Comments
Patch
@@ -1466,16 +1466,20 @@ class revlog(object):
textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]),
cachedelta[1])
else:
textlen = len(text)
# should we try to build a delta?
if prev != nullrev:
tested = set()
+ # This condition is true most of the time when processing
+ # changegroup data into a generaldelta repo. The only time it
+ # isn't true is if this is the first revision in a delta chain
+ # or if ``format.generaldelta=true`` disabled ``lazydeltabase``.
if cachedelta and self._generaldelta and self._lazydeltabase:
# Assume what we received from the server is a good choice
# build delta will reuse the cache
candidatedelta = builddelta(cachedelta[0])
tested.add(cachedelta[0])
if self._isgooddelta(candidatedelta, textlen):
delta = candidatedelta
if delta is None and self._generaldelta: