From 55c42219e10be5cc08cf0f35e770a45a3bff4d09 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Fri, 11 May 2012 11:29:24 +0300 Subject: [PATCH] pq-rpm: add new --pq-branch option 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 --- gbp/config.py | 3 +++ gbp/scripts/pq_rpm.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gbp/config.py b/gbp/config.py index 50568a3..ca64b62 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -581,6 +581,7 @@ class GbpOptionParserRpm(GbpOptionParser): 'cleaner' : '', 'packaging-dir' : '', 'packaging-tag' : 'packaging/%(version)s', + 'pq-branch' : 'development/%(branch)s', 'spec-file' : 'auto', } ) @@ -590,6 +591,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'", } ) diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py index e1fda71..267357b 100755 --- a/gbp/scripts/pq_rpm.py +++ b/gbp/scripts/pq_rpm.py @@ -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") -- 2.7.4