Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jarl
tor
Commits
8727eb9e
Commit
8727eb9e
authored
11 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
format_changelog.py now formats the first section, in-place.
parent
b54669bc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+0
-1
0 additions, 1 deletion
ChangeLog
contrib/format_changelog.py
+21
-1
21 additions, 1 deletion
contrib/format_changelog.py
with
21 additions
and
2 deletions
ChangeLog
+
0
−
1
View file @
8727eb9e
...
...
@@ -267,7 +267,6 @@ Changes in version 0.2.5.4-alpha - 2014-04-??
Resolves ticket 11070.
Changes in version 0.2.5.3-alpha - 2014-03-22
Tor 0.2.5.3-alpha includes all the fixes from 0.2.4.21. It contains
two new anti-DoS features for Tor relays, resolves a bug that kept
...
...
This diff is collapsed.
Click to expand it.
contrib/format_changelog.py
+
21
−
1
View file @
8727eb9e
...
...
@@ -9,6 +9,7 @@
# To run it, pipe a section of the changelog (starting with "Changes
# in Tor 0.x.y.z-alpha" through the script.)
import
os
import
re
import
sys
import
textwrap
...
...
@@ -19,6 +20,7 @@ TP_BLANK = 2
TP_SECHEAD
=
3
TP_ITEMFIRST
=
4
TP_ITEMBODY
=
5
TP_END
=
6
def
head_parser
(
line
):
if
re
.
match
(
r
'
^[A-Z]
'
,
line
):
...
...
@@ -39,6 +41,8 @@ def body_parser(line):
return
TP_ITEMBODY
elif
re
.
match
(
r
'
^\s*$
'
,
line
):
return
TP_BLANK
elif
re
.
match
(
r
'
^Changes in
'
,
line
):
return
TP_END
else
:
print
"
Weird line %r
"
%
line
...
...
@@ -129,13 +133,29 @@ class ChangeLog(object):
CL
=
ChangeLog
()
parser
=
head_parser
sys
.
stdin
=
open
(
'
ChangeLog
'
,
'
r
'
)
for
line
in
sys
.
stdin
:
line
=
line
.
rstrip
()
tp
=
parser
(
line
)
CL
.
addLine
(
tp
,
line
)
if
tp
==
TP_SECHEAD
:
parser
=
body_parser
elif
tp
==
TP_END
:
nextline
=
line
break
CL
.
addLine
(
tp
,
line
)
CL
.
lint
()
sys
.
stdout
=
open
(
'
ChangeLog.new
'
,
'
w
'
)
CL
.
dump
()
print
nextline
for
line
in
sys
.
stdin
:
sys
.
stdout
.
write
(
line
)
os
.
rename
(
'
ChangeLog.new
'
,
'
ChangeLog
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment