Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 40855:64051af15596
upgrade: clarify "aggressivemergedelta" handling
We rename "aggressivemergedelta" argument to "forceaggressivemergedelta". The
previous argument naming could infer an absolute control on the behavior.
However, the code show we respect the config option if set.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 13 Jul 2018 11:45:15 +0200 |
parents | 8947f49daaa8 |
children | cbc3cbd9ff93 |
comparison
equal
deleted
inserted
replaced
40854:5887973febc7 | 40855:64051af15596 |
---|---|
2285 DELTAREUSEFULLADD = 'fulladd' | 2285 DELTAREUSEFULLADD = 'fulladd' |
2286 | 2286 |
2287 DELTAREUSEALL = {'always', 'samerevs', 'never', 'fulladd'} | 2287 DELTAREUSEALL = {'always', 'samerevs', 'never', 'fulladd'} |
2288 | 2288 |
2289 def clone(self, tr, destrevlog, addrevisioncb=None, | 2289 def clone(self, tr, destrevlog, addrevisioncb=None, |
2290 deltareuse=DELTAREUSESAMEREVS, deltabothparents=None): | 2290 deltareuse=DELTAREUSESAMEREVS, forcedeltabothparents=None): |
2291 """Copy this revlog to another, possibly with format changes. | 2291 """Copy this revlog to another, possibly with format changes. |
2292 | 2292 |
2293 The destination revlog will contain the same revisions and nodes. | 2293 The destination revlog will contain the same revisions and nodes. |
2294 However, it may not be bit-for-bit identical due to e.g. delta encoding | 2294 However, it may not be bit-for-bit identical due to e.g. delta encoding |
2295 differences. | 2295 differences. |
2319 delta could choose a better revision, it will do so. This means if you | 2319 delta could choose a better revision, it will do so. This means if you |
2320 are converting a non-generaldelta revlog to a generaldelta revlog, | 2320 are converting a non-generaldelta revlog to a generaldelta revlog, |
2321 deltas will be recomputed if the delta's parent isn't a parent of the | 2321 deltas will be recomputed if the delta's parent isn't a parent of the |
2322 revision. | 2322 revision. |
2323 | 2323 |
2324 In addition to the delta policy, the ``deltabothparents`` argument | 2324 In addition to the delta policy, the ``forcedeltabothparents`` |
2325 controls whether to compute deltas against both parents for merges. | 2325 argument controls whether to force compute deltas against both parents |
2326 By default, the current default is used. | 2326 for merges. By default, the current default is used. |
2327 """ | 2327 """ |
2328 if deltareuse not in self.DELTAREUSEALL: | 2328 if deltareuse not in self.DELTAREUSEALL: |
2329 raise ValueError(_('value for deltareuse invalid: %s') % deltareuse) | 2329 raise ValueError(_('value for deltareuse invalid: %s') % deltareuse) |
2330 | 2330 |
2331 if len(destrevlog): | 2331 if len(destrevlog): |
2344 if deltareuse == self.DELTAREUSEALWAYS: | 2344 if deltareuse == self.DELTAREUSEALWAYS: |
2345 destrevlog._lazydeltabase = True | 2345 destrevlog._lazydeltabase = True |
2346 elif deltareuse == self.DELTAREUSESAMEREVS: | 2346 elif deltareuse == self.DELTAREUSESAMEREVS: |
2347 destrevlog._lazydeltabase = False | 2347 destrevlog._lazydeltabase = False |
2348 | 2348 |
2349 destrevlog._deltabothparents = deltabothparents or oldamd | 2349 destrevlog._deltabothparents = forcedeltabothparents or oldamd |
2350 | 2350 |
2351 populatecachedelta = deltareuse in (self.DELTAREUSEALWAYS, | 2351 populatecachedelta = deltareuse in (self.DELTAREUSEALWAYS, |
2352 self.DELTAREUSESAMEREVS) | 2352 self.DELTAREUSESAMEREVS) |
2353 | 2353 |
2354 deltacomputer = deltautil.deltacomputer(destrevlog) | 2354 deltacomputer = deltautil.deltacomputer(destrevlog) |