From fbcab811f1736b9286b50ade99d4dba3f9dd40fc Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Fri, 6 Sep 2013 14:23:03 +0300 Subject: [PATCH] common/pq: support more flexible pq-branch naming Now any string fields (e.g. '%(version)s') can be used in the pq-branch format strings - in addition to the '%(branch)s' supported before. Signed-off-by: Markus Lehtonen Conflicts: gbp/scripts/common/pq.py --- gbp/scripts/common/pq.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py index c2bc629..1686884 100644 --- a/gbp/scripts/common/pq.py +++ b/gbp/scripts/common/pq.py @@ -121,7 +121,7 @@ def pq_branch_name(branch, options, extra_keys=None): return pq_format_str % format_fields if not is_pq_branch(branch, options): - return pq_format_str % dict(branch=branch) + return pq_format_str % format_fields def pq_branch_base(pq_branch, options): """ @@ -337,11 +337,7 @@ def get_maintainer_from_control(repo): return GitModifier() -<<<<<<< HEAD def switch_to_pq_branch(repo, branch, options, name_keys=None): -======= -def switch_to_pq_branch(repo, branch, options): ->>>>>>> 3ba82da... gbp-pq: readiness to configure the pq branch name """ Switch to patch-queue branch if not already there, create it if it doesn't exist yet @@ -349,11 +345,7 @@ def switch_to_pq_branch(repo, branch, options): if is_pq_branch(branch, options): return -<<<<<<< HEAD pq_branch = pq_branch_name(branch, options, name_keys) -======= - pq_branch = pq_branch_name(branch, options) ->>>>>>> 3ba82da... gbp-pq: readiness to configure the pq branch name if not repo.has_branch(pq_branch): try: repo.create_branch(pq_branch) @@ -396,20 +388,12 @@ def apply_and_commit_patch(repo, patch, fallback_author, topic=None): repo.update_ref('HEAD', commit, msg="gbp-pq import %s" % patch.path) -<<<<<<< HEAD def drop_pq(repo, branch, options, name_keys=None): -======= -def drop_pq(repo, branch, options): ->>>>>>> 3ba82da... gbp-pq: readiness to configure the pq branch name if is_pq_branch(branch, options): gbp.log.err("On a patch-queue branch, can't drop it.") raise GbpError else: -<<<<<<< HEAD pq_branch = pq_branch_name(branch, options, name_keys) -======= - pq_branch = pq_branch_name(branch, options) ->>>>>>> 3ba82da... gbp-pq: readiness to configure the pq branch name if repo.has_branch(pq_branch): repo.delete_branch(pq_branch) -- 2.7.4