Patchwork [3,of,3] aggressivemergedelta: document rename and move to `revlog` section

login
register
mail settings
Submitter Boris Feld
Date July 19, 2018, 9:08 a.m.
Message ID <960c31460aedc813e939.1531991316@FB-lair>
Download mbox | patch
Permalink /patch/32909/
State Accepted
Headers show

Comments

Boris Feld - July 19, 2018, 9:08 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1531989329 -7200
#      Thu Jul 19 10:35:29 2018 +0200
# Node ID 960c31460aedc813e939066843f0b592073c6112
# Parent  fdfde2e7c10f72e2f5b3afee86cb16c5ce14cd78
# EXP-Topic aggressivemergedeltas
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 960c31460aed
aggressivemergedelta: document rename and move to `revlog` section

The config does not follow our naming guideline and "Aggressive" is probably a
word to keep away from users.

The option does not truly fit in the `format` section. It can be turned on and
off for existing repository without much consequence regarding compatibility.

A new `revlog` option is created to control behavior related to revlog writing
and reading. We can see multiple other config options that could be migrated
there.

* format.maxchainlen
* experimental.mmapindexthreshold
* experimental.sparse-read.density-threshold (in an updated form)
* experimental.sparse-read.min-gap-size (in an updated form)

In addition, we can foresee at least a couple of sparse-revlog related option
coming too (to reduce delta chain length and increase snapshot reuse)

These two extra options might fit there too. Unless we want to create a
section dedicated to caches and performance.

* format.chunkcachesize
* format.manifestcachesize

For now, we only migrate `optimize-delta-parent-choice` since it is getting
out of experimental. It is too close to the release to move the other one. In
addition, we still lack proper the prioritization of alias that would help
renaming them without bad consequence for users.

(Not fully happy about the `revlog` name but could not find better).
Yuya Nishihara - July 19, 2018, 1:09 p.m.
On Thu, 19 Jul 2018 11:08:36 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1531989329 -7200
> #      Thu Jul 19 10:35:29 2018 +0200
> # Node ID 960c31460aedc813e939066843f0b592073c6112
> # Parent  fdfde2e7c10f72e2f5b3afee86cb16c5ce14cd78
> # EXP-Topic aggressivemergedeltas
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 960c31460aed
> aggressivemergedelta: document rename and move to `revlog` section

Fixed typos and queued, thanks.

> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -669,8 +669,8 @@ class localrepository(object):
>          if manifestcachesize is not None:
>              self.svfs.options['manifestcachesize'] = manifestcachesize
>          # experimental config: format.aggressivemergedeltas

Removed this comment in flight since it's no longer experimental.

> -        deltabothparents = self.ui.configbool('format',
> -                                              'aggressivemergedeltas')
> +        deltabothparents = self.ui.configbool('revlog',
> +                                              'optimize-delta-parent-choice')

Patch

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -634,9 +634,6 @@  coreconfigitem('extdata', '.*',
     default=None,
     generic=True,
 )
-coreconfigitem('format', 'aggressivemergedeltas',
-    default=True,
-)
 coreconfigitem('format', 'chunkcachesize',
     default=None,
 )
@@ -927,6 +924,10 @@  coreconfigitem('progress', 'width',
 coreconfigitem('push', 'pushvars.server',
     default=False,
 )
+coreconfigitem('revlog', 'optimize-delta-parent-choice',
+    default=True,
+    # formely an experimental option: format.aggressivemergedeltas
+)
 coreconfigitem('server', 'bookmarks-pushkey-compat',
     default=True,
 )
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -1773,6 +1773,20 @@  have a definite end point.
 
 Alias definitions for revsets. See :hg:`help revsets` for details.
 
+``revlog``
+----------
+
+Control the strategy mercurial use internally to store history. Option in this
+category impact performance and repository size.
+
+``optimize-delta-parent-choice``
+    When storing a merge revision, both parents will be equaly considered as a
+    possible delta base. This result in better delta selection and improved
+    revlog compression. This option is enabled by default.
+
+    Turning this option off can result if large increase of repository size for
+    repository with many merge.
+
 ``server``
 ----------
 
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -669,8 +669,8 @@  class localrepository(object):
         if manifestcachesize is not None:
             self.svfs.options['manifestcachesize'] = manifestcachesize
         # experimental config: format.aggressivemergedeltas
-        deltabothparents = self.ui.configbool('format',
-                                              'aggressivemergedeltas')
+        deltabothparents = self.ui.configbool('revlog',
+                                              'optimize-delta-parent-choice')
         self.svfs.options['deltabothparents'] = deltabothparents
         self.svfs.options['lazydeltabase'] = not scmutil.gddeltaconfig(self.ui)
         chainspan = self.ui.configbytes('experimental', 'maxdeltachainspan')
diff --git a/tests/test-generaldelta.t b/tests/test-generaldelta.t
--- a/tests/test-generaldelta.t
+++ b/tests/test-generaldelta.t
@@ -118,7 +118,7 @@  delta coming from the server base delta 
         2       1        2        0      p1         57        135        161   1.19259       218        57    0.35404
         3       1        2        0      p1         57        135        161   1.19259       275       114    0.70807
 
-Test format.aggressivemergedeltas
+Test revlog.optimize-delta-parent-choice
 
   $ hg init --config format.generaldelta=1 aggressive
   $ cd aggressive
@@ -146,7 +146,7 @@  Test format.aggressivemergedeltas
 - Verify aggressive merge uses p2 (commit 0) as delta parent
   $ hg up -q -C 1
   $ hg merge -q 0
-  $ hg commit -q -m merge --config format.aggressivemergedeltas=True
+  $ hg commit -q -m merge --config revlog.optimize-delta-parent-choice=yes
   $ hg debugdeltachain -m
       rev  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
         0       1        1       -1    base         59        215         59   0.27442        59         0    0.00000