summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-09-04 16:01:17 +0300
committerGuido Günther <agx@sigxcpu.org>2013-10-31 19:17:21 +0100
commit99c69951436746f219a15edf1b86c751d1dc2434 (patch)
tree6a17318ff27427fa5976186bb23f1b18c36fbc1c
parent34e85f7fe5417caea9d536a0b065f76df9b80507 (diff)
downloadgit-buildpackage-99c69951436746f219a15edf1b86c751d1dc2434.tar.gz
git-buildpackage-99c69951436746f219a15edf1b86c751d1dc2434.tar.bz2
git-buildpackage-99c69951436746f219a15edf1b86c751d1dc2434.zip
pq: support 'Topic' patch-export command
Topic can be defined with either 'Gbp: Topic <topic>' or 'Gbp-Pq: Topic <topic>' in the commit message. This is to replace the "gbp-pq-topic: <topic>" command. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--gbp/scripts/common/pq.py3
-rwxr-xr-xgbp/scripts/pq.py7
2 files changed, 5 insertions, 5 deletions
diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py
index 7f0c0c9b..8e41d4ae 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 1a15f10a..8682d855 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<topic>\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'])