From c8eb65eada8db3946174403889369ccbdd64ea8d Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 30 Oct 2015 15:28:57 +0100 Subject: Support multiple commit IDs separated by comma --- htmlchangelog.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htmlchangelog.py b/htmlchangelog.py index 432f251..9dddcff 100644 --- a/htmlchangelog.py +++ b/htmlchangelog.py @@ -9,10 +9,10 @@ _TEMPLATEDIR='templates/' class HTMLChangelogFilter(object): commit_id_res = [ re.compile(r"(?P\s+\*\s+\[)" # as generated by git-dch - +r"(?P[a-fA-F0-9]{7,40})" + +r"(?P[a-fA-F0-9,]{7,40})" +r"(?P\]:?\s+.*)"), re.compile(r"(?P\s+-\s+)" # drm-snapshot uses this - +r"(?P[a-fA-F0-9]{7,40})" + +r"(?P[a-fA-F0-9]{7,40})" +r"(?P\.\.\.\s+.*)"), ] @@ -26,9 +26,10 @@ class HTMLChangelogFilter(object): for regex in self.commit_id_res: m = regex.match(line) if m: - commitid = m.group('commitid') - link = '%s' % (self.vcsbrowser.commit(commitid), commitid) - line = m.group("s") + link + m.group("e") + links = [] + for commitid in m.group('commitids').split(','): + links.append('%s' % (self.vcsbrowser.commit(commitid), commitid)) + line = m.group("s") + ",".join(links) + m.group("e") break body.append(line) return "\n".join(body) -- cgit v1.2.3