##// END OF EJS Templates
debugrevlog: add chainlen column to --dump output
Sune Foldager -
r22311:5038dee5 default
parent child Browse files
Show More
@@ -2536,24 +2536,36 b' def debugrevlog(ui, repo, file_=None, **'
2536 2536 if opts.get("dump"):
2537 2537 numrevs = len(r)
2538 2538 ui.write("# rev p1rev p2rev start end deltastart base p1 p2"
2539 " rawsize totalsize compression heads\n")
2539 " rawsize totalsize compression heads chainlen\n")
2540 2540 ts = 0
2541 2541 heads = set()
2542 rindex = r.index
2543
2544 def chainbaseandlen(rev):
2545 clen = 0
2546 base = rindex[rev][3]
2547 while base != rev:
2548 clen += 1
2549 rev = base
2550 base = rindex[rev][3]
2551 return base, clen
2552
2542 2553 for rev in xrange(numrevs):
2543 2554 dbase = r.deltaparent(rev)
2544 2555 if dbase == -1:
2545 2556 dbase = rev
2546 cbase = r.chainbase(rev)
2557 cbase, clen = chainbaseandlen(rev)
2547 2558 p1, p2 = r.parentrevs(rev)
2548 2559 rs = r.rawsize(rev)
2549 2560 ts = ts + rs
2550 2561 heads -= set(r.parentrevs(rev))
2551 2562 heads.add(rev)
2552 ui.write("%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d %11d %5d\n" %
2563 ui.write("%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d "
2564 "%11d %5d %8d\n" %
2553 2565 (rev, p1, p2, r.start(rev), r.end(rev),
2554 2566 r.start(dbase), r.start(cbase),
2555 2567 r.start(p1), r.start(p2),
2556 rs, ts, ts / r.end(rev), len(heads)))
2568 rs, ts, ts / r.end(rev), len(heads), clen))
2557 2569 return 0
2558 2570
2559 2571 v = r.version
@@ -88,11 +88,11 b' Killing a single changeset with replacem'
88 88 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
89 89 2:245bde4270cd add original_c
90 90 $ hg debugrevlog -cd
91 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads
92 0 -1 -1 0 59 0 0 0 0 58 58 0 1
93 1 0 -1 59 118 59 59 0 0 58 116 0 1
94 2 1 -1 118 204 59 59 59 0 76 192 0 1
95 3 1 -1 204 271 204 204 59 0 66 258 0 2
91 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
92 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0
93 1 0 -1 59 118 59 59 0 0 58 116 0 1 0
94 2 1 -1 118 204 59 59 59 0 76 192 0 1 1
95 3 1 -1 204 271 204 204 59 0 66 258 0 2 0
96 96 $ hg debugobsolete
97 97 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:44 1970 -0000) {'user': 'test'}
98 98
General Comments 0
You need to be logged in to leave comments. Login now