aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido G√ľnther <agx@sigxcpu.org>2015-10-30 15:28:57 +0100
committerGuido G√ľnther <agx@sigxcpu.org>2015-10-30 15:28:57 +0100
commitc8eb65eada8db3946174403889369ccbdd64ea8d (patch)
treefe2c909fb560aa3a9214312fb0ddf09835319045
parent16c078b6250a5e2818b46eeb641bacc7f102e63e (diff)
Support multiple commit IDs separated by comma
-rw-r--r--htmlchangelog.py11
1 files 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+\*\s+\[)" # as generated by git-dch
- +r"(?P<commitid>[a-fA-F0-9]{7,40})"
+ +r"(?P<commitids>[a-fA-F0-9,]{7,40})"
+r"(?P<e>\]:?\s+.*)"),
re.compile(r"(?P<s>\s+-\s+)" # drm-snapshot uses this
- +r"(?P<commitid>[a-fA-F0-9]{7,40})"
+ +r"(?P<commitids>[a-fA-F0-9]{7,40})"
+r"(?P<e>\.\.\.\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 = '<a href="%s">%s</a>' % (self.vcsbrowser.commit(commitid), commitid)
- line = m.group("s") + link + m.group("e")
+ links = []
+ for commitid in m.group('commitids').split(','):
+ links.append('<a href="%s">%s</a>' % (self.vcsbrowser.commit(commitid), commitid))
+ line = m.group("s") + ",".join(links) + m.group("e")
break
body.append(line)
return "\n".join(body)