##// END OF EJS Templates
deltas: at a `target_rev` parameter to finddeltainfo...
marmoute -
r48249:93f4e183 default
parent child Browse files
Show More
@@ -1033,8 +1033,7 b' class deltacomputer(object):'
1033 1033 snapshotdepth,
1034 1034 )
1035 1035
1036 def _fullsnapshotinfo(self, fh, revinfo):
1037 curr = len(self.revlog)
1036 def _fullsnapshotinfo(self, fh, revinfo, curr):
1038 1037 rawtext = self.buildtext(revinfo, fh)
1039 1038 data = self.revlog.compress(rawtext)
1040 1039 compresseddeltalen = deltalen = dist = len(data[1]) + len(data[0])
@@ -1053,7 +1052,7 b' class deltacomputer(object):'
1053 1052 snapshotdepth,
1054 1053 )
1055 1054
1056 def finddeltainfo(self, revinfo, fh, excluded_bases=None):
1055 def finddeltainfo(self, revinfo, fh, excluded_bases=None, target_rev=None):
1057 1056 """Find an acceptable delta against a candidate revision
1058 1057
1059 1058 revinfo: information about the revision (instance of _revisioninfo)
@@ -1070,8 +1069,11 b' class deltacomputer(object):'
1070 1069 a delta base. Use this to recompute delta suitable in censor or strip
1071 1070 context.
1072 1071 """
1072 if target_rev is None:
1073 curr = len(self.revlog)
1074
1073 1075 if not revinfo.textlen:
1074 return self._fullsnapshotinfo(fh, revinfo)
1076 return self._fullsnapshotinfo(fh, revinfo, target_rev)
1075 1077
1076 1078 if excluded_bases is None:
1077 1079 excluded_bases = set()
@@ -1080,7 +1082,7 b' class deltacomputer(object):'
1080 1082 # not calling candelta since only one revision needs test, also to
1081 1083 # avoid overhead fetching flags again.
1082 1084 if revinfo.flags & REVIDX_RAWTEXT_CHANGING_FLAGS:
1083 return self._fullsnapshotinfo(fh, revinfo)
1085 return self._fullsnapshotinfo(fh, revinfo, target_rev)
1084 1086
1085 1087 cachedelta = revinfo.cachedelta
1086 1088 p1 = revinfo.p1
@@ -1102,6 +1104,8 b' class deltacomputer(object):'
1102 1104 for candidaterev in candidaterevs:
1103 1105 if candidaterev in excluded_bases:
1104 1106 continue
1107 if candidaterev >= target_rev:
1108 continue
1105 1109 candidatedelta = self._builddeltainfo(revinfo, candidaterev, fh)
1106 1110 if candidatedelta is not None:
1107 1111 if isgooddeltainfo(self.revlog, candidatedelta, revinfo):
@@ -1114,7 +1118,7 b' class deltacomputer(object):'
1114 1118 candidaterevs = next(groups)
1115 1119
1116 1120 if deltainfo is None:
1117 deltainfo = self._fullsnapshotinfo(fh, revinfo)
1121 deltainfo = self._fullsnapshotinfo(fh, revinfo, target_rev)
1118 1122 return deltainfo
1119 1123
1120 1124
General Comments 0
You need to be logged in to leave comments. Login now