aboutsummaryrefslogtreecommitdiff
path: root/scripts/maint/format_changelog.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-06-16 15:00:10 -0400
committerNick Mathewson <nickm@torproject.org>2014-06-16 15:00:35 -0400
commit205084631257751b655c5bf33a1f290e2741bf27 (patch)
tree2064abd0e920e7920423f45dc0bd631d2ed6bf5c /scripts/maint/format_changelog.py
parent2f4fcfc8d14bfae233b1485fd171cc48d6d79fdb (diff)
downloadtor-205084631257751b655c5bf33a1f290e2741bf27.tar
tor-205084631257751b655c5bf33a1f290e2741bf27.tar.gz
Bring remaining 0.2.5.5-alpha entries into changelog
Diffstat (limited to 'scripts/maint/format_changelog.py')
-rwxr-xr-xscripts/maint/format_changelog.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/maint/format_changelog.py b/scripts/maint/format_changelog.py
index 86f5c5039..f67e89b60 100755
--- a/scripts/maint/format_changelog.py
+++ b/scripts/maint/format_changelog.py
@@ -270,7 +270,16 @@ class ChangeLog(object):
CL = ChangeLog()
parser = head_parser
-sys.stdin = open('ChangeLog', 'r')
+if len(sys.argv) == 1:
+ fname = 'ChangeLog'
+else:
+ fname = sys.argv[1]
+
+fname_new = fname+".new"
+
+sys.stdin = open(fname, 'r')
+
+nextline = None
for line in sys.stdin:
line = line.rstrip()
@@ -286,13 +295,14 @@ for line in sys.stdin:
CL.lint()
-sys.stdout = open('ChangeLog.new', 'w')
+sys.stdout = open(fname_new, 'w')
CL.dump()
-print nextline
+if nextline is not None:
+ print nextline
for line in sys.stdin:
sys.stdout.write(line)
-os.rename('ChangeLog.new', 'ChangeLog')
+os.rename(fname_new, fname)