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>
Tue, 7 Jan 2014 14:21:28 +0000 (16:21 +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 81d396b712a2074a4849b377df66aef1f94e0ae0..4eb9f9c642743447c214cb8bcf969f544a0bb193 100644 (file)
@@ -537,6 +537,7 @@ class GbpOptionParserRpm(GbpOptionParser):
                        'cleaner'                : '',
                        'packaging-dir'          : '',
                        'packaging-tag'          : 'packaging/%(version)s',
+                       'pq-branch'              : 'development/%(branch)s',
                        'spec-file'              : 'auto',
                      } )
 
@@ -546,6 +547,8 @@ class GbpOptionParserRpm(GbpOptionParser):
                         "subdir where packaging files are stored, default is '%(packaging-dir)s'",
                    '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 '%(spec-file)s'",
                  } )
index 3522fb53f26998295b2039dd0549b58eaf9a3340..24009b3e0d4d8402db7a889fd04de373438aee40 100755 (executable)
@@ -278,7 +278,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])
 
 
@@ -317,6 +317,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")