##// END OF EJS Templates
delta-find: simply code that is now never invoqued without general delta...
marmoute -
r51333:8038493e stable
parent child Browse files
Show More
@@ -725,9 +725,7 b' def _candidategroups('
725 group = []
725 group = []
726 for rev in temptative:
726 for rev in temptative:
727 # skip over empty delta (no need to include them in a chain)
727 # skip over empty delta (no need to include them in a chain)
728 while revlog._generaldelta and not (
728 while not (rev == nullrev or rev in tested or deltalength(rev)):
729 rev == nullrev or rev in tested or deltalength(rev)
730 ):
731 tested.add(rev)
729 tested.add(rev)
732 rev = deltaparent(rev)
730 rev = deltaparent(rev)
733 # no need to try a delta against nullrev, this will be done as a
731 # no need to try a delta against nullrev, this will be done as a
@@ -910,27 +908,27 b' def _rawgroups(revlog, p1, p2, cachedelt'
910
908
911 The group order aims at providing fast or small candidates first.
909 The group order aims at providing fast or small candidates first.
912 """
910 """
913 gdelta = revlog._generaldelta
911 # Why search for delta base if we cannot use a delta base ?
914 # gate sparse behind general-delta because of issue6056
912 assert revlog._generaldelta
915 sparse = gdelta and revlog._sparserevlog
913 # also see issue6056
914 sparse = revlog._sparserevlog
916 curr = len(revlog)
915 curr = len(revlog)
917 prev = curr - 1
916 prev = curr - 1
918 deltachain = lambda rev: revlog._deltachain(rev)[0]
917 deltachain = lambda rev: revlog._deltachain(rev)[0]
919
918
920 if gdelta:
919 # exclude already lazy tested base if any
921 # exclude already lazy tested base if any
920 parents = [p for p in (p1, p2) if p != nullrev]
922 parents = [p for p in (p1, p2) if p != nullrev]
923
921
924 if not revlog._deltabothparents and len(parents) == 2:
922 if not revlog._deltabothparents and len(parents) == 2:
925 parents.sort()
923 parents.sort()
926 # To minimize the chance of having to build a fulltext,
924 # To minimize the chance of having to build a fulltext,
927 # pick first whichever parent is closest to us (max rev)
925 # pick first whichever parent is closest to us (max rev)
928 yield (parents[1],)
926 yield (parents[1],)
929 # then the other one (min rev) if the first did not fit
927 # then the other one (min rev) if the first did not fit
930 yield (parents[0],)
928 yield (parents[0],)
931 elif len(parents) > 0:
929 elif len(parents) > 0:
932 # Test all parents (1 or 2), and keep the best candidate
930 # Test all parents (1 or 2), and keep the best candidate
933 yield parents
931 yield parents
934
932
935 if sparse and parents:
933 if sparse and parents:
936 if snapshot_cache is None:
934 if snapshot_cache is None:
General Comments 0
You need to be logged in to leave comments. Login now