Comments
Patch
@@ -983,6 +983,9 @@ coreconfigitem('storage', 'revlog.optimi
default=True,
alias=[('format', 'aggressivemergedeltas')],
)
+coreconfigitem('storage', 'revlog.reuse-external-delta-parent',
+ default=None,
+)
coreconfigitem('server', 'bookmarks-pushkey-compat',
default=True,
)
@@ -1843,6 +1843,28 @@ category impact performance and reposito
Turning this option off can result in large increase of repository size for
repository with many merges.
+``revlog.reuse-external-delta-parent``
+ Control the order in which delta parents are considered when adding new
+ revisions from an external source.
+ (typically: apply bundle from `hg pull` or `hg push`).
+
+ New revisions are usually provided as a delta against other revisions. By
+ default, Mercurial will try to reuse this delta first, therefore using the
+ same "delta parent" as the source. Directly using delta's from the source
+ reduces CPU usage and usually speeds up operation. However, in some case,
+ the source might have sub-optimal delta bases and forcing their reevaluation
+ is useful. For example, pushes from an old client could have sub-optimal
+ delta's parent that the server want to optimize. (lack of general delta, bad
+ parents, choice, lack of sparse-revlog, etc).
+
+ This option is enabled by default. Turning it off will ensure bad delta
+ parent choices from older client do not propagate to this repository, at
+ the cost of a small increase in CPU consumption.
+
+ Note: this option only control the order in which delta parents are
+ considered. Even when disabled, the existing delta from the source will be
+ reused if the same delta parent is selected.
+
``server``
----------
@@ -752,7 +752,12 @@ def resolverevlogstorevfsoptions(ui, req
b'revlog.optimize-delta-parent-choice')
options[b'deltabothparents'] = deltabothparents
- options[b'lazydeltabase'] = not scmutil.gddeltaconfig(ui)
+
+ lazydeltabase = ui.configbool(b'storage',
+ b'revlog.reuse-external-delta-parent')
+ if lazydeltabase is None:
+ lazydeltabase = not scmutil.gddeltaconfig(ui)
+ options[b'lazydeltabase'] = lazydeltabase
chainspan = ui.configbytes(b'experimental', b'maxdeltachainspan')
if 0 <= chainspan:
@@ -339,7 +339,7 @@ test maxdeltachainspan
52 5 1 -1 base 369 640 369 0.57656 369 0 0.00000
53 6 1 -1 base 0 0 0 0.00000 0 0 0.00000
54 7 1 -1 base 369 640 369 0.57656 369 0 0.00000
- $ hg clone --pull source-repo --config experimental.maxdeltachainspan=0 noconst-chain --config format.generaldelta=yes
+ $ hg clone --pull source-repo --config experimental.maxdeltachainspan=0 noconst-chain --config format.usegeneraldelta=yes --config storage.revlog.reuse-external-delta-parent=no
requesting all changes
adding changesets
adding manifests
@@ -40,8 +40,7 @@ repeatedly while some of it changes rare
> maxchainlen = 15
> [storage]
> revlog.optimize-delta-parent-choice = yes
- > [format]
- > generaldelta = yes
+ > revlog.reuse-external-delta-parent = no
> EOF
$ hg init sparse-repo
$ cd sparse-repo