Add debughash and debugindex commands

This commit is contained in:
mpm@selenic.com 2005-05-04 22:45:52 -08:00
parent de51831199
commit b9dbea8b13

14
hg
View File

@ -211,6 +211,20 @@ elif cmd == "dumpmanifest":
for f in files:
print hg.hex(m[f]), f
elif cmd == "debughash":
f = repo.file(args[0])
print f.encodepath(args[0])
elif cmd == "debugindex":
r = hg.revlog(open, args[0], "")
print " rev offset length base linkrev"+\
" p1 p2 nodeid"
for i in range(r.count()):
e = r.index[i]
print "% 6d % 9d % 7d % 5d % 7d %s.. %s.. %s.." % (
i, e[0], e[1], e[2], e[3],
hg.hex(e[4][:5]), hg.hex(e[5][:5]), hg.hex(e[6][:5]))
elif cmd == "merge":
if args:
other = hg.repository(ui, args[0])