aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-10-19 11:47:16 -0400
committerNick Mathewson <nickm@torproject.org>2014-10-19 11:47:16 -0400
commit1405fbcc5862388b859d975ff7b8f95350d46240 (patch)
treecf0f7b346357af3984bb58c010fc165063e697cd /scripts
parentfc5cab44724e8328e2186f22114625388f1c8f0d (diff)
downloadtor-1405fbcc5862388b859d975ff7b8f95350d46240.tar.gz
tor-1405fbcc5862388b859d975ff7b8f95350d46240.zip
format_changelog.py: learn about the ReleaseNotes format
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maint/format_changelog.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/maint/format_changelog.py b/scripts/maint/format_changelog.py
index f67e89b602..32a3d74e31 100755
--- a/scripts/maint/format_changelog.py
+++ b/scripts/maint/format_changelog.py
@@ -156,10 +156,13 @@ TP_SECHEAD = 3
TP_ITEMFIRST = 4
TP_ITEMBODY = 5
TP_END = 6
+TP_PREHEAD = 7
def head_parser(line):
- if re.match(r'^[A-Z]', line):
+ if re.match(r'^Changes in', line):
return TP_MAINHEAD
+ elif re.match(r'^[A-Za-z]', line):
+ return TP_PREHEAD
elif re.match(r'^ o ', line):
return TP_SECHEAD
elif re.match(r'^\s*$', line):
@@ -178,11 +181,14 @@ def body_parser(line):
return TP_BLANK
elif re.match(r'^Changes in', line):
return TP_END
+ elif re.match(r'^\s+\S', line):
+ return TP_HEADTEXT
else:
print "Weird line %r"%line
class ChangeLog(object):
def __init__(self):
+ self.prehead = []
self.mainhead = None
self.headtext = []
self.curgraf = None
@@ -197,6 +203,9 @@ class ChangeLog(object):
assert not self.mainhead
self.mainhead = line
+ elif tp == TP_PREHEAD:
+ self.prehead.append(line)
+
elif tp == TP_HEADTEXT:
if self.curgraf is None:
self.curgraf = []
@@ -250,6 +259,9 @@ class ChangeLog(object):
subsequent_indent=" "*indent2))
def dump(self):
+ if self.prehead:
+ self.dumpGraf(self.prehead, 0)
+ print
print self.mainhead
for par in self.headtext:
self.dumpGraf(par, 2)