Commit d9628783 authored by Guido van Rossum's avatar Guido van Rossum

Patch by Gerrit Holl:

    * In logmerge.py: added '-r' flag to show the oldest checkin
      first instead of the newest, and getopt.getopt was used
      wrong.
parent 126960b7
...@@ -32,10 +32,13 @@ sep2 = '-'*28 + '\n' # revision separator ...@@ -32,10 +32,13 @@ sep2 = '-'*28 + '\n' # revision separator
def main(): def main():
"""Main program""" """Main program"""
truncate_last = 0 truncate_last = 0
opts, args = getopt.getopt(sys.argv[1:], "-t") reverse = 0
opts, args = getopt.getopt(sys.argv[1:], "tr")
for o, a in opts: for o, a in opts:
if o == '-t': if o == '-t':
truncate_last = 1 truncate_last = 1
elif o == '-r':
reverse = 1
database = [] database = []
while 1: while 1:
chunk = read_chunk(sys.stdin) chunk = read_chunk(sys.stdin)
...@@ -46,7 +49,8 @@ def main(): ...@@ -46,7 +49,8 @@ def main():
del records[-1] del records[-1]
database[len(database):] = records database[len(database):] = records
database.sort() database.sort()
database.reverse() if not reverse:
database.reverse()
format_output(database) format_output(database)
def read_chunk(fp): def read_chunk(fp):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment