comparison mercurial/commands.py @ 4053:994fec0ee900

mtime can be -1 after a merge and cause tracebacks on win32. Output "unset" instead.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 30 Jan 2007 00:26:19 +0100
parents 31047b6f7ec1
children e37786b29bed
comparison
equal deleted inserted replaced
4052:a8a8ecf909db 4053:994fec0ee900
773 repo.dirstate.read() 773 repo.dirstate.read()
774 dc = repo.dirstate.map 774 dc = repo.dirstate.map
775 keys = dc.keys() 775 keys = dc.keys()
776 keys.sort() 776 keys.sort()
777 for file_ in keys: 777 for file_ in keys:
778 if dc[file_][3] == -1:
779 # Pad or slice to locale representation
780 locale_len = len(time.strftime("%x %X", time.localtime(0)))
781 timestr = 'unset'
782 timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr))
783 else:
784 timestr = time.strftime("%x %X", time.localtime(dc[file_][3]))
778 ui.write("%c %3o %10d %s %s\n" 785 ui.write("%c %3o %10d %s %s\n"
779 % (dc[file_][0], dc[file_][1] & 0777, dc[file_][2], 786 % (dc[file_][0], dc[file_][1] & 0777, dc[file_][2],
780 time.strftime("%x %X", 787 timestr, file_))
781 time.localtime(dc[file_][3])), file_))
782 for f in repo.dirstate.copies(): 788 for f in repo.dirstate.copies():
783 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f)) 789 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
784 790
785 def debugdata(ui, file_, rev): 791 def debugdata(ui, file_, rev):
786 """dump the contents of an data file revision""" 792 """dump the contents of an data file revision"""