From 99c69951436746f219a15edf1b86c751d1dc2434 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Wed, 4 Sep 2013 16:01:17 +0300 Subject: [PATCH] pq: support 'Topic' patch-export command Topic can be defined with either 'Gbp: Topic ' or 'Gbp-Pq: Topic ' in the commit message. This is to replace the "gbp-pq-topic: " command. Signed-off-by: Markus Lehtonen --- gbp/scripts/common/pq.py | 3 +-- gbp/scripts/pq.py | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py index 7f0c0c9..8e41d4a 100644 --- a/gbp/scripts/common/pq.py +++ b/gbp/scripts/common/pq.py @@ -155,12 +155,11 @@ def write_patch_file(filename, commit_info, diff): def format_patch(outdir, repo, commit_info, series, numbered=True, - topic_regex=None, path_exclude_regex=None): + topic_regex=None, path_exclude_regex=None, topic=''): """Create patch of a single commit""" commit = commit_info['id'] # Parse and filter commit message body - topic = "" mangled_body = "" for line in commit_info['body'].splitlines(): if topic_regex: diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py index 1a15f10..8682d85 100755 --- a/gbp/scripts/pq.py +++ b/gbp/scripts/pq.py @@ -54,11 +54,12 @@ def generate_patches(repo, start, end, outdir, options): topic_regex = 'gbp-pq-topic:\s*(?P\S.*)' for commit in rev_list: info = repo.get_commit_info(commit) - cmds = parse_gbp_commands(info, 'gbp', ('ignore'), None) - cmds.update(parse_gbp_commands(info, 'gbp-pq', ('ignore'), None)) + cmds = parse_gbp_commands(info, 'gbp', ('ignore'), ('topic')) + cmds.update(parse_gbp_commands(info, 'gbp-pq', ('ignore'), ('topic'))) if not 'ignore' in cmds: + topic = cmds['topic'] if 'topic' in cmds else '' format_patch(outdir, repo, info, patches, options.patch_numbers, - topic_regex=topic_regex) + topic_regex=topic_regex, topic=topic) else: gbp.log.info('Ignoring commit %s' % info['id']) -- 2.7.4