summaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/pq.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-01-29 10:51:29 +0100
committerGuido Günther <agx@sigxcpu.org>2015-01-29 10:57:39 +0100
commitddb0dd2878d83d41566434af630214ea8aa90afc (patch)
treebfc7a8efe714a6367f070c5143e512324e9c5674 /gbp/scripts/pq.py
parent1d6c4c702bd8b5576d17217140d3eaf7c6d7ef29 (diff)
Revert "pq: deprecate the usage of 'gbp-pq-topic:'"
"Gbp-Pq: Topic <topic>" leaves the marker in the exorted patch so we shouldn't use it by default. This reverts commit 7ce15d2434ee42aa5a1afce3d03069c5efb2db1b.
Diffstat (limited to 'gbp/scripts/pq.py')
-rwxr-xr-xgbp/scripts/pq.py28
1 files changed, 3 insertions, 25 deletions
diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py
index 543907b6..c32a36f4 100755
--- a/gbp/scripts/pq.py
+++ b/gbp/scripts/pq.py
@@ -41,27 +41,6 @@ PATCH_DIR = "debian/patches/"
SERIES_FILE = os.path.join(PATCH_DIR,"series")
-def parse_old_style_topic(commit_info):
- """Parse 'gbp-pq-topic:' line(s) from commit info"""
-
- commit = commit_info['id']
- topic_regex = 'gbp-pq-topic:\s*(?P<topic>\S.*)'
- mangled_body = ''
- topic = ''
- # Parse and filter commit message body
- for line in commit_info['body'].splitlines():
- match = re.match(topic_regex, line, flags=re.I)
- if match:
- topic = match.group('topic')
- gbp.log.debug("Topic %s found for %s" % (topic, commit))
- gbp.log.warn("Deprecated 'gbp-pq-topic: <topic>' in %s, please "
- "use 'Gbp[-Pq]: Topic <topic>' instead" % commit)
- continue
- mangled_body += line + '\n'
- commit_info['body'] = mangled_body
- return topic
-
-
def generate_patches(repo, start, end, outdir, options):
"""
Generate patch files from git
@@ -74,16 +53,15 @@ def generate_patches(repo, start, end, outdir, options):
# Generate patches
rev_list = reversed(repo.get_commits(start, end))
+ topic_regex = 'gbp-pq-topic:\s*(?P<topic>\S.*)'
for commit in rev_list:
info = repo.get_commit_info(commit)
- topic = parse_old_style_topic(info)
cmds = parse_gbp_commands(info, 'gbp', ('ignore'), ('topic'))
cmds.update(parse_gbp_commands(info, 'gbp-pq', ('ignore'), ('topic')))
if not 'ignore' in cmds:
- if 'topic' in cmds:
- topic = cmds['topic']
+ topic = cmds['topic'] if 'topic' in cmds else ''
format_patch(outdir, repo, info, patches, options.patch_numbers,
- topic=topic)
+ topic_regex=topic_regex, topic=topic)
else:
gbp.log.info('Ignoring commit %s' % info['id'])