Patch by Gerrit Holl:
authorGuido van Rossum <guido@python.org>
Mon, 14 Feb 2000 21:41:50 +0000 (21:41 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 14 Feb 2000 21:41:50 +0000 (21:41 +0000)
    * In logmerge.py: added '-r' flag to show the oldest checkin
      first instead of the newest, and getopt.getopt was used
      wrong.

Tools/scripts/logmerge.py

index c26df30690cb631b44453356f297276090a4ca07..a09fd46f13830d09d0f15c6524d5c59621b7ce59 100755 (executable)
@@ -32,10 +32,13 @@ sep2 = '-'*28 + '\n'                    # revision separator
 def main():
     """Main program"""
     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:
         if o == '-t':
             truncate_last = 1
+        elif o == '-r':
+            reverse = 1
     database = []
     while 1:
         chunk = read_chunk(sys.stdin)
@@ -46,7 +49,8 @@ def main():
             del records[-1]
         database[len(database):] = records
     database.sort()
-    database.reverse()
+    if not reverse:
+        database.reverse()
     format_output(database)
 
 def read_chunk(fp):