Show More
@@ -1050,7 +1050,7 b' class deltacomputer(object):' | |||||
1050 | snapshotdepth, |
|
1050 | snapshotdepth, | |
1051 | ) |
|
1051 | ) | |
1052 |
|
1052 | |||
1053 | def finddeltainfo(self, revinfo, fh): |
|
1053 | def finddeltainfo(self, revinfo, fh, excluded_bases=None): | |
1054 | """Find an acceptable delta against a candidate revision |
|
1054 | """Find an acceptable delta against a candidate revision | |
1055 |
|
1055 | |||
1056 | revinfo: information about the revision (instance of _revisioninfo) |
|
1056 | revinfo: information about the revision (instance of _revisioninfo) | |
@@ -1062,10 +1062,17 b' class deltacomputer(object):' | |||||
1062 |
|
1062 | |||
1063 | If no suitable deltabase is found, we return delta info for a full |
|
1063 | If no suitable deltabase is found, we return delta info for a full | |
1064 | snapshot. |
|
1064 | snapshot. | |
|
1065 | ||||
|
1066 | `excluded_bases` is an optional set of revision that cannot be used as | |||
|
1067 | a delta base. Use this to recompute delta suitable in censor or strip | |||
|
1068 | context. | |||
1065 | """ |
|
1069 | """ | |
1066 | if not revinfo.textlen: |
|
1070 | if not revinfo.textlen: | |
1067 | return self._fullsnapshotinfo(fh, revinfo) |
|
1071 | return self._fullsnapshotinfo(fh, revinfo) | |
1068 |
|
1072 | |||
|
1073 | if excluded_bases is None: | |||
|
1074 | excluded_bases = set() | |||
|
1075 | ||||
1069 | # no delta for flag processor revision (see "candelta" for why) |
|
1076 | # no delta for flag processor revision (see "candelta" for why) | |
1070 | # not calling candelta since only one revision needs test, also to |
|
1077 | # not calling candelta since only one revision needs test, also to | |
1071 | # avoid overhead fetching flags again. |
|
1078 | # avoid overhead fetching flags again. | |
@@ -1090,6 +1097,8 b' class deltacomputer(object):' | |||||
1090 | # challenge it against refined candidates |
|
1097 | # challenge it against refined candidates | |
1091 | nominateddeltas.append(deltainfo) |
|
1098 | nominateddeltas.append(deltainfo) | |
1092 | for candidaterev in candidaterevs: |
|
1099 | for candidaterev in candidaterevs: | |
|
1100 | if candidaterev in excluded_bases: | |||
|
1101 | continue | |||
1093 | candidatedelta = self._builddeltainfo(revinfo, candidaterev, fh) |
|
1102 | candidatedelta = self._builddeltainfo(revinfo, candidaterev, fh) | |
1094 | if candidatedelta is not None: |
|
1103 | if candidatedelta is not None: | |
1095 | if isgooddeltainfo(self.revlog, candidatedelta, revinfo): |
|
1104 | if isgooddeltainfo(self.revlog, candidatedelta, revinfo): |
General Comments 0
You need to be logged in to leave comments.
Login now