comparison mercurial/commands.py @ 5311:599f3a690d8f

debugindex: more robust for damaged indexes
author Matt Mackall <mpm@selenic.com>
date Fri, 21 Sep 2007 17:13:38 -0500
parents ba3dc7883968
children 24de027551c1
comparison
equal deleted inserted replaced
5310:ba3dc7883968 5311:599f3a690d8f
801 r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_) 801 r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
802 ui.write(" rev offset length base linkrev" + 802 ui.write(" rev offset length base linkrev" +
803 " nodeid p1 p2\n") 803 " nodeid p1 p2\n")
804 for i in xrange(r.count()): 804 for i in xrange(r.count()):
805 node = r.node(i) 805 node = r.node(i)
806 pp = r.parents(node) 806 try:
807 pp = r.parents(node)
808 except:
809 pp = [nullid, nullid]
807 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % ( 810 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % (
808 i, r.start(i), r.length(i), r.base(i), r.linkrev(node), 811 i, r.start(i), r.length(i), r.base(i), r.linkrev(node),
809 short(node), short(pp[0]), short(pp[1]))) 812 short(node), short(pp[0]), short(pp[1])))
810 813
811 def debugindexdot(ui, file_): 814 def debugindexdot(ui, file_):