* In logmerge.py: added '-r' flag to show the oldest checkin
first instead of the newest, and getopt.getopt was used
wrong.
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)
del records[-1]
database[len(database):] = records
database.sort()
- database.reverse()
+ if not reverse:
+ database.reverse()
format_output(database)
def read_chunk(fp):