pq-rpm: add new --pq-branch option
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 11 May 2012 08:29:24 +0000 (11:29 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 14 Nov 2014 12:22:11 +0000 (14:22 +0200)
Adds a new command line option '--pq-branch' to set the name of
patch-queue branches. Changes the defaults pq-branch name for rpm tools
to 'development/%(branch)s' (instead of the old
'patch-queue/%(branch)s').

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/config.py
gbp/scripts/pq_rpm.py

index c0421d0..c785315 100644 (file)
@@ -596,6 +596,7 @@ class GbpOptionParserRpm(GbpOptionParser):
             'packaging-branch'          : 'master',
             'packaging-dir'             : '',
             'packaging-tag'             : 'packaging/%(version)s',
+            'pq-branch'                 : 'development/%(branch)s',
             'spec-file'                 : 'auto',
                     })
 
@@ -616,6 +617,9 @@ class GbpOptionParserRpm(GbpOptionParser):
             'packaging-tag':
                 "Format string for packaging tags, RPM counterpart of the "
                 "'debian-tag' option, default is '%(packaging-tag)s'",
+            'pq-branch':
+                "format string for the patch-queue branch name, default is "
+                "'%(pq-branch)s'",
             'spec-file':
                 "Spec file to use, 'auto' makes gbp to guess, other values "
                 "make the packaging-dir option to be ignored, default is "
index e1fda71..267357b 100755 (executable)
@@ -279,7 +279,7 @@ def rebase_pq(repo, branch, options):
     if not upstream_commit:
         raise GbpError, ("Couldn't find upstream version %s. Don't know on what base to import." % spec.version)
 
-    switch_to_pq_branch(repo, branch)
+    switch_to_pq_branch(repo, branch, options)
     GitCommand("rebase")([upstream_commit])
 
 
@@ -323,6 +323,10 @@ def main(argv):
     parser.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
     parser.add_config_file_option(option_name="spec-file", dest="spec_file")
     parser.add_config_file_option(option_name="packaging-dir", dest="packaging_dir")
+    parser.add_config_file_option(option_name="packaging-branch",
+                                  dest="packaging_branch",
+                                  help="Branch the packaging is being maintained on. Only relevant if a invariable/single pq-branch is defined, in which case this is used as the 'base' branch. Default is '%(packaging-branch)s'")
+    parser.add_config_file_option(option_name="pq-branch", dest="pq_branch")
     parser.add_option("--export-rev", action="store", dest="export_rev", default="",
                       help="Export patches from treeish object TREEISH instead "
                            "of head of patch-queue branch", metavar="TREEISH")