aboutsummaryrefslogtreecommitdiff
path: root/scripts/maint/format_changelog.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-05-27 09:26:08 -0400
committerNick Mathewson <nickm@torproject.org>2016-05-27 09:26:49 -0400
commit3934e78bb94a73e9528bd33aa3b2fb952ff810db (patch)
tree892519728ce324e0a596e7c8008a6b9a83d4979c /scripts/maint/format_changelog.py
parenta93b6bbf17f8940a2b5cb9faad2ee054c85297c1 (diff)
downloadtor-3934e78bb94a73e9528bd33aa3b2fb952ff810db.tar.gz
tor-3934e78bb94a73e9528bd33aa3b2fb952ff810db.zip
Make format_changelog.py add links to bugs
Diffstat (limited to 'scripts/maint/format_changelog.py')
-rwxr-xr-xscripts/maint/format_changelog.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/maint/format_changelog.py b/scripts/maint/format_changelog.py
index 5e4c8cac9a..6b588702a7 100755
--- a/scripts/maint/format_changelog.py
+++ b/scripts/maint/format_changelog.py
@@ -398,16 +398,24 @@ class ChangeLog(object):
self.dumpEndOfSections()
self.dumpEndOfChangelog()
+# Let's turn bugs to html.
+BUG_PAT = re.compile('(bug|ticket|feature)\s+(\d{4,5})', re.I)
+def bug_html(m):
+ return "%s <a href='https://trac.torproject.org/projects/tor/ticket/%s'>%s</a>" % (m.group(1), m.group(2), m.group(2))
+
class HTMLChangeLog(ChangeLog):
def __init__(self, *args, **kwargs):
ChangeLog.__init__(self, *args, **kwargs)
def htmlText(self, graf):
+ output = []
for line in graf:
line = line.rstrip().replace("&","&amp;")
line = line.rstrip().replace("<","&lt;").replace(">","&gt;")
- sys.stdout.write(line.strip())
- sys.stdout.write(" ")
+ output.append(line.strip())
+ output = " ".join(output)
+ output = BUG_PAT.sub(bug_html, output)
+ sys.stdout.write(output)
def htmlPar(self, graf):
sys.stdout.write("<p>")