##// END OF EJS Templates
debugindex: respect --debug flag to show full nodeids
Kyle Lippincott -
r23547:21446f4d default
parent child Browse files
Show More
@@ -2173,13 +2173,24 b' def debugindex(ui, repo, file_=None, **o'
2173 else:
2173 else:
2174 basehdr = ' base'
2174 basehdr = ' base'
2175
2175
2176 if ui.debugflag:
2177 shortfn = hex
2178 else:
2179 shortfn = short
2180
2181 # There might not be anything in r, so have a sane default
2182 idlen = 12
2183 for i in r:
2184 idlen = len(shortfn(r.node(i)))
2185 break
2186
2176 if format == 0:
2187 if format == 0:
2177 ui.write(" rev offset length " + basehdr + " linkrev"
2188 ui.write(" rev offset length " + basehdr + " linkrev"
2178 " nodeid p1 p2\n")
2189 " %s %s p2\n" % ("nodeid".ljust(idlen), "p1".ljust(idlen)))
2179 elif format == 1:
2190 elif format == 1:
2180 ui.write(" rev flag offset length"
2191 ui.write(" rev flag offset length"
2181 " size " + basehdr + " link p1 p2"
2192 " size " + basehdr + " link p1 p2"
2182 " nodeid\n")
2193 " %s\n" % "nodeid".rjust(idlen))
2183
2194
2184 for i in r:
2195 for i in r:
2185 node = r.node(i)
2196 node = r.node(i)
@@ -2194,12 +2205,12 b' def debugindex(ui, repo, file_=None, **o'
2194 pp = [nullid, nullid]
2205 pp = [nullid, nullid]
2195 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % (
2206 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % (
2196 i, r.start(i), r.length(i), base, r.linkrev(i),
2207 i, r.start(i), r.length(i), base, r.linkrev(i),
2197 short(node), short(pp[0]), short(pp[1])))
2208 shortfn(node), shortfn(pp[0]), shortfn(pp[1])))
2198 elif format == 1:
2209 elif format == 1:
2199 pr = r.parentrevs(i)
2210 pr = r.parentrevs(i)
2200 ui.write("% 6d %04x % 8d % 8d % 8d % 6d % 6d % 6d % 6d %s\n" % (
2211 ui.write("% 6d %04x % 8d % 8d % 8d % 6d % 6d % 6d % 6d %s\n" % (
2201 i, r.flags(i), r.start(i), r.length(i), r.rawsize(i),
2212 i, r.flags(i), r.start(i), r.length(i), r.rawsize(i),
2202 base, r.linkrev(i), pr[0], pr[1], short(node)))
2213 base, r.linkrev(i), pr[0], pr[1], shortfn(node)))
2203
2214
2204 @command('debugindexdot', [], _('FILE'), optionalrepo=True)
2215 @command('debugindexdot', [], _('FILE'), optionalrepo=True)
2205 def debugindexdot(ui, repo, file_):
2216 def debugindexdot(ui, repo, file_):
@@ -24,6 +24,21 b''
24 full revision size (min/max/avg) : 44 / 44 / 44
24 full revision size (min/max/avg) : 44 / 44 / 44
25 delta size (min/max/avg) : 0 / 0 / 0
25 delta size (min/max/avg) : 0 / 0 / 0
26
26
27 Test debugindex, with and without the --debug flag
28 $ hg debugindex a
29 rev offset length .... linkrev nodeid p1 p2 (re)
30 0 0 3 .... 0 b789fdd96dc2 000000000000 000000000000 (re)
31 $ hg --debug debugindex a
32 rev offset length .... linkrev nodeid p1 p2 (re)
33 0 0 3 .... 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 (re)
34 $ hg debugindex -f 1 a
35 rev flag offset length size .... link p1 p2 nodeid (re)
36 0 0000 0 3 2 .... 0 -1 -1 b789fdd96dc2 (re)
37 $ hg --debug debugindex -f 1 a
38 rev flag offset length size .... link p1 p2 nodeid (re)
39 0 0000 0 3 2 .... 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (re)
40
41
27 Test max chain len
42 Test max chain len
28 $ cat >> $HGRCPATH << EOF
43 $ cat >> $HGRCPATH << EOF
29 > [format]
44 > [format]
General Comments 0
You need to be logged in to leave comments. Login now