Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 5156:49554ba98951
debugstate: print symlinks as 'lnk', not '777'
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu, 09 Aug 2007 20:03:34 -0700 |
parents | 13d23d66a6cd |
children | de7c772751b4 |
comparison
equal
deleted
inserted
replaced
5155:13d23d66a6cd | 5156:49554ba98951 |
---|---|
757 finally: | 757 finally: |
758 del wlock | 758 del wlock |
759 | 759 |
760 def debugstate(ui, repo): | 760 def debugstate(ui, repo): |
761 """show the contents of the current dirstate""" | 761 """show the contents of the current dirstate""" |
762 dc = repo.dirstate._map | 762 k = repo.dirstate._map.items() |
763 k = dc.keys() | |
764 k.sort() | 763 k.sort() |
765 for file_ in k: | 764 for file_, ent in k: |
766 if dc[file_][3] == -1: | 765 if ent[3] == -1: |
767 # Pad or slice to locale representation | 766 # Pad or slice to locale representation |
768 locale_len = len(time.strftime("%x %X", time.localtime(0))) | 767 locale_len = len(time.strftime("%x %X", time.localtime(0))) |
769 timestr = 'unset' | 768 timestr = 'unset' |
770 timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr)) | 769 timestr = timestr[:locale_len] + ' '*(locale_len - len(timestr)) |
771 else: | 770 else: |
772 timestr = time.strftime("%x %X", time.localtime(dc[file_][3])) | 771 timestr = time.strftime("%x %X", time.localtime(ent[3])) |
773 ui.write("%c %3o %10d %s %s\n" | 772 if ent[1] & 020000: |
774 % (dc[file_][0], dc[file_][1] & 0777, dc[file_][2], | 773 mode = 'lnk' |
775 timestr, file_)) | 774 else: |
775 mode = '%3o' % (ent[1] & 0777) | |
776 ui.write("%c %s %10d %s %s\n" % (ent[0], mode, ent[2], timestr, file_)) | |
776 for f in repo.dirstate.copies(): | 777 for f in repo.dirstate.copies(): |
777 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f)) | 778 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f)) |
778 | 779 |
779 def debugdata(ui, file_, rev): | 780 def debugdata(ui, file_, rev): |
780 """dump the contents of a data file revision""" | 781 """dump the contents of a data file revision""" |