##// END OF EJS Templates
revlog: preserve `_lazydelta` attribute in `revlog.clone`...
marmoute -
r42023:afd37ed7 default
parent child Browse files
Show More
@@ -2396,21 +2396,25 b' class revlog(object):'
2396 if getattr(destrevlog, 'filteredrevs', None):
2396 if getattr(destrevlog, 'filteredrevs', None):
2397 raise ValueError(_('destination revlog has filtered revisions'))
2397 raise ValueError(_('destination revlog has filtered revisions'))
2398
2398
2399 # lazydeltabase controls whether to reuse a cached delta, if possible.
2399 # lazydelta and lazydeltabase controls whether to reuse a cached delta,
2400 # if possible.
2401 oldlazydelta = destrevlog._lazydelta
2400 oldlazydeltabase = destrevlog._lazydeltabase
2402 oldlazydeltabase = destrevlog._lazydeltabase
2401 oldamd = destrevlog._deltabothparents
2403 oldamd = destrevlog._deltabothparents
2402
2404
2403 try:
2405 try:
2404 if deltareuse == self.DELTAREUSEALWAYS:
2406 if deltareuse == self.DELTAREUSEALWAYS:
2405 destrevlog._lazydeltabase = True
2407 destrevlog._lazydeltabase = True
2408 destrevlog._lazydelta = True
2406 elif deltareuse == self.DELTAREUSESAMEREVS:
2409 elif deltareuse == self.DELTAREUSESAMEREVS:
2407 destrevlog._lazydeltabase = False
2410 destrevlog._lazydeltabase = False
2411 destrevlog._lazydelta = True
2412 elif deltareuse == self.DELTAREUSENEVER:
2413 destrevlog._lazydeltabase = False
2414 destrevlog._lazydelta = False
2408
2415
2409 destrevlog._deltabothparents = forcedeltabothparents or oldamd
2416 destrevlog._deltabothparents = forcedeltabothparents or oldamd
2410
2417
2411 populatecachedelta = deltareuse in (self.DELTAREUSEALWAYS,
2412 self.DELTAREUSESAMEREVS)
2413
2414 deltacomputer = deltautil.deltacomputer(destrevlog)
2418 deltacomputer = deltautil.deltacomputer(destrevlog)
2415 index = self.index
2419 index = self.index
2416 for rev in self:
2420 for rev in self:
@@ -2428,7 +2432,7 b' class revlog(object):'
2428 # the revlog chunk is a delta.
2432 # the revlog chunk is a delta.
2429 cachedelta = None
2433 cachedelta = None
2430 rawtext = None
2434 rawtext = None
2431 if populatecachedelta:
2435 if destrevlog._lazydelta:
2432 dp = self.deltaparent(rev)
2436 dp = self.deltaparent(rev)
2433 if dp != nullrev:
2437 if dp != nullrev:
2434 cachedelta = (dp, bytes(self._chunk(rev)))
2438 cachedelta = (dp, bytes(self._chunk(rev)))
@@ -2460,6 +2464,7 b' class revlog(object):'
2460 if addrevisioncb:
2464 if addrevisioncb:
2461 addrevisioncb(self, rev, node)
2465 addrevisioncb(self, rev, node)
2462 finally:
2466 finally:
2467 destrevlog._lazydelta = oldlazydelta
2463 destrevlog._lazydeltabase = oldlazydeltabase
2468 destrevlog._lazydeltabase = oldlazydeltabase
2464 destrevlog._deltabothparents = oldamd
2469 destrevlog._deltabothparents = oldamd
2465
2470
General Comments 0
You need to be logged in to leave comments. Login now