##// END OF EJS Templates
debug-revlog: details about non-ancestors delta-bases...
marmoute -
r50556:511106bc default
parent child Browse files
Show More
@@ -302,13 +302,19 b' def debug_revlog(ui, revlog):'
302 302 numsemi = 0
303 303 # snapshot count per depth
304 304 numsnapdepth = collections.defaultdict(lambda: 0)
305 # number of snapshots with a non-ancestor delta
306 numsnapdepth_nad = collections.defaultdict(lambda: 0)
305 307 # delta against previous revision
306 308 numprev = 0
309 # delta against prev, where prev is a non-ancestor
310 numprev_nad = 0
307 311 # delta against first or second parent (not prev)
308 312 nump1 = 0
309 313 nump2 = 0
310 314 # delta against neither prev nor parents
311 315 numother = 0
316 # delta against other that is a non-ancestor
317 numother_nad = 0
312 318 # delta against prev that are also first or second parent
313 319 # (details of `numprev`)
314 320 nump1prev = 0
@@ -358,6 +364,9 b' def debug_revlog(ui, revlog):'
358 364 addsize(size, fullsize)
359 365 addsize(size, snapsizedepth[0])
360 366 else:
367 nad = (
368 delta != p1 and delta != p2 and not r.isancestorrev(delta, rev)
369 )
361 370 chainlengths.append(chainlengths[delta] + 1)
362 371 baseaddr = chainbases[delta]
363 372 revaddr = r.start(rev)
@@ -371,6 +380,8 b' def debug_revlog(ui, revlog):'
371 380 numsemi += 1
372 381 depth = r.snapshotdepth(rev)
373 382 numsnapdepth[depth] += 1
383 if nad:
384 numsnapdepth_nad[depth] += 1
374 385 addsize(size, snapsizedepth[depth])
375 386 else:
376 387 addsize(size, deltasize)
@@ -380,12 +391,15 b' def debug_revlog(ui, revlog):'
380 391 nump1prev += 1
381 392 elif delta == p2:
382 393 nump2prev += 1
394 elif nad:
395 numprev_nad += 1
383 396 elif delta == p1:
384 397 nump1 += 1
385 398 elif delta == p2:
386 399 nump2 += 1
387 400 elif delta != nodemod.nullrev:
388 401 numother += 1
402 numother_nad += 1
389 403
390 404 # Obtain data on the raw chunks in the revlog.
391 405 if util.safehasattr(r, '_getsegmentforrevs'):
@@ -410,7 +424,8 b' def debug_revlog(ui, revlog):'
410 424 size[0] = 0
411 425
412 426 numdeltas = numrevs - numfull - numempty - numsemi
413 numoprev = numprev - nump1prev - nump2prev
427 numoprev = numprev - nump1prev - nump2prev - numprev_nad
428 num_other_ancestors = numother - numother_nad
414 429 totalrawsize = datasize[2]
415 430 datasize[2] /= numrevs
416 431 fulltotal = fullsize[2]
@@ -477,10 +492,17 b' def debug_revlog(ui, revlog):'
477 492 b' snapshot : ' + fmt % pcfmt(numfull + numsemi, numrevs)
478 493 )
479 494 for depth in sorted(numsnapdepth):
480 ui.write(
481 (b' lvl-%-3d : ' % depth)
482 + fmt % pcfmt(numsnapdepth[depth], numrevs)
483 )
495 base = b' lvl-%-3d : ' % depth
496 count = fmt % pcfmt(numsnapdepth[depth], numrevs)
497 pieces = [base, count]
498 if numsnapdepth_nad[depth]:
499 pieces[-1] = count = count[:-1] # drop the final '\n'
500 more = b' non-ancestor-bases: '
501 anc_count = fmt
502 anc_count %= pcfmt(numsnapdepth_nad[depth], numsnapdepth[depth])
503 pieces.append(more)
504 pieces.append(anc_count)
505 ui.write(b''.join(pieces))
484 506 ui.writenoi18n(b' deltas : ' + fmt % pcfmt(numdeltas, numrevs))
485 507 ui.writenoi18n(b'revision size : ' + fmt2 % totalsize)
486 508 ui.writenoi18n(
@@ -561,7 +583,10 b' def debug_revlog(ui, revlog):'
561 583 b' where prev = p2 : ' + fmt2 % pcfmt(nump2prev, numprev)
562 584 )
563 585 ui.writenoi18n(
564 b' other : ' + fmt2 % pcfmt(numoprev, numprev)
586 b' other-ancestor : ' + fmt2 % pcfmt(numoprev, numprev)
587 )
588 ui.writenoi18n(
589 b' unrelated : ' + fmt2 % pcfmt(numoprev, numprev)
565 590 )
566 591 if gdelta:
567 592 ui.writenoi18n(
@@ -571,5 +596,10 b' def debug_revlog(ui, revlog):'
571 596 b'deltas against p2 : ' + fmt % pcfmt(nump2, numdeltas)
572 597 )
573 598 ui.writenoi18n(
574 b'deltas against other : ' + fmt % pcfmt(numother, numdeltas)
599 b'deltas against ancs : '
600 + fmt % pcfmt(num_other_ancestors, numdeltas)
575 601 )
602 ui.writenoi18n(
603 b'deltas against other : '
604 + fmt % pcfmt(numother_nad, numdeltas)
605 )
@@ -105,11 +105,11 b' repeatedly while some of it changes rare'
105 105 delta : 0 (100.00%)
106 106 snapshot : 383 ( 7.66%)
107 107 lvl-0 : 3 ( 0.06%)
108 lvl-1 : 18 ( 0.36%)
109 lvl-2 : 62 ( 1.24%)
110 lvl-3 : 108 ( 2.16%)
111 lvl-4 : 191 ( 3.82%)
112 lvl-5 : 1 ( 0.02%)
108 lvl-1 : 18 ( 0.36%) non-ancestor-bases: 9 (50.00%)
109 lvl-2 : 62 ( 1.24%) non-ancestor-bases: 58 (93.55%)
110 lvl-3 : 108 ( 2.16%) non-ancestor-bases: 108 (100.00%)
111 lvl-4 : 191 ( 3.82%) non-ancestor-bases: 180 (94.24%)
112 lvl-5 : 1 ( 0.02%) non-ancestor-bases: 1 (100.00%)
113 113 deltas : 4618 (92.34%)
114 114 revision size : 58616973
115 115 snapshot : 9247844 (15.78%)
@@ -144,9 +144,11 b' repeatedly while some of it changes rare'
144 144 deltas against prev : 3906 (84.58%)
145 145 where prev = p1 : 3906 (100.00%)
146 146 where prev = p2 : 0 ( 0.00%)
147 other : 0 ( 0.00%)
147 other-ancestor : 0 ( 0.00%)
148 unrelated : 0 ( 0.00%)
148 149 deltas against p1 : 649 (14.05%)
149 150 deltas against p2 : 63 ( 1.36%)
151 deltas against ancs : 0 ( 0.00%)
150 152 deltas against other : 0 ( 0.00%)
151 153
152 154
General Comments 0
You need to be logged in to leave comments. Login now