##// END OF EJS Templates
revlog: compute snapshot depth on delta info...
Boris Feld -
r39190:e0da43e2 default
parent child Browse files
Show More
@@ -606,6 +606,7 b' class _deltainfo(object):'
606 chainbase = attr.ib()
606 chainbase = attr.ib()
607 chainlen = attr.ib()
607 chainlen = attr.ib()
608 compresseddeltalen = attr.ib()
608 compresseddeltalen = attr.ib()
609 snapshotdepth = attr.ib()
609
610
610 class _deltacomputer(object):
611 class _deltacomputer(object):
611 def __init__(self, revlog):
612 def __init__(self, revlog):
@@ -736,8 +737,21 b' class _deltacomputer(object):'
736 chainlen, compresseddeltalen = revlog._chaininfo(base)
737 chainlen, compresseddeltalen = revlog._chaininfo(base)
737 chainlen += 1
738 chainlen += 1
738 compresseddeltalen += deltalen
739 compresseddeltalen += deltalen
740
741 revlog = self.revlog
742 snapshotdepth = None
743 if deltabase == nullrev:
744 snapshotdepth = 0
745 elif revlog._sparserevlog and revlog.issnapshot(deltabase):
746 # A delta chain should always be one full snapshot,
747 # zero or more semi-snapshots, and zero or more deltas
748 p1, p2 = revlog.rev(revinfo.p1), revlog.rev(revinfo.p2)
749 if deltabase not in (p1, p2) and revlog.issnapshot(deltabase):
750 snapshotdepth = len(revlog._deltachain(deltabase)[0])
751
739 return _deltainfo(dist, deltalen, (header, data), deltabase,
752 return _deltainfo(dist, deltalen, (header, data), deltabase,
740 chainbase, chainlen, compresseddeltalen)
753 chainbase, chainlen, compresseddeltalen,
754 snapshotdepth)
741
755
742 def finddeltainfo(self, revinfo, fh):
756 def finddeltainfo(self, revinfo, fh):
743 """Find an acceptable delta against a candidate revision
757 """Find an acceptable delta against a candidate revision
General Comments 0
You need to be logged in to leave comments. Login now