Show More
@@ -2653,22 +2653,13 b' def debugrevlog(ui, repo, file_=None, **' | |||||
2653 | " rawsize totalsize compression heads chainlen\n") |
|
2653 | " rawsize totalsize compression heads chainlen\n") | |
2654 | ts = 0 |
|
2654 | ts = 0 | |
2655 | heads = set() |
|
2655 | heads = set() | |
2656 | rindex = r.index |
|
|||
2657 |
|
||||
2658 | def chainbaseandlen(rev): |
|
|||
2659 | clen = 0 |
|
|||
2660 | base = rindex[rev][3] |
|
|||
2661 | while base != rev: |
|
|||
2662 | clen += 1 |
|
|||
2663 | rev = base |
|
|||
2664 | base = rindex[rev][3] |
|
|||
2665 | return base, clen |
|
|||
2666 |
|
2656 | |||
2667 | for rev in xrange(numrevs): |
|
2657 | for rev in xrange(numrevs): | |
2668 | dbase = r.deltaparent(rev) |
|
2658 | dbase = r.deltaparent(rev) | |
2669 | if dbase == -1: |
|
2659 | if dbase == -1: | |
2670 | dbase = rev |
|
2660 | dbase = rev | |
2671 |
cbase |
|
2661 | cbase = r.chainbase(rev) | |
|
2662 | clen = r.chainlen(rev) | |||
2672 | p1, p2 = r.parentrevs(rev) |
|
2663 | p1, p2 = r.parentrevs(rev) | |
2673 | rs = r.rawsize(rev) |
|
2664 | rs = r.rawsize(rev) | |
2674 | ts = ts + rs |
|
2665 | ts = ts + rs |
@@ -350,6 +350,20 b' class revlog(object):' | |||||
350 | rev = base |
|
350 | rev = base | |
351 | base = index[rev][3] |
|
351 | base = index[rev][3] | |
352 | return base |
|
352 | return base | |
|
353 | def chainlen(self, rev): | |||
|
354 | index = self.index | |||
|
355 | generaldelta = self._generaldelta | |||
|
356 | iterrev = rev | |||
|
357 | e = index[iterrev] | |||
|
358 | clen = 0 | |||
|
359 | while iterrev != e[3]: | |||
|
360 | clen += 1 | |||
|
361 | if generaldelta: | |||
|
362 | iterrev = e[3] | |||
|
363 | else: | |||
|
364 | iterrev -= 1 | |||
|
365 | e = index[iterrev] | |||
|
366 | return clen | |||
353 | def flags(self, rev): |
|
367 | def flags(self, rev): | |
354 | return self.index[rev][0] & 0xFFFF |
|
368 | return self.index[rev][0] & 0xFFFF | |
355 | def rawsize(self, rev): |
|
369 | def rawsize(self, rev): |
General Comments 0
You need to be logged in to leave comments.
Login now