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:
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'])