Add debughash and debugindex commands
authormpm@selenic.com
Wed, 04 May 2005 22:45:52 -0800
changeset 24 57a1eef79415
parent 23 018fb8d9ea8d
child 25 daa724b27300
Add debughash and debugindex commands
hg
--- a/hg	Wed May 04 17:27:08 2005 -0800
+++ b/hg	Wed May 04 22:45:52 2005 -0800
@@ -211,6 +211,20 @@
     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])