Patchwork [1,of,2] treemanifest: set requires at repo creation time, ignore config after

login
register
mail settings
Submitter Martin von Zweigbergk
Date May 5, 2015, 4:32 p.m.
Message ID <0493459ea08d7b8db87b.1430843574@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/8895/
State Accepted
Headers show

Comments

Martin von Zweigbergk - May 5, 2015, 4:32 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1430840459 25200
#      Tue May 05 08:40:59 2015 -0700
# Node ID 0493459ea08d7b8db87bb28d1deb0e85f084b10c
# Parent  e5b507efb36e2b9ad8edb1a38459d26c934d74dd
treemanifest: set requires at repo creation time, ignore config after

The very next changeset will start writing one revlog per directory
when tree manifests are enabled. That is backwards incompatible, so it
requires .hg/requires to be updated. Just like with generaldelta, we
want to update .hg/requires only when the repo is created. Updating
..hg/requires is bad for repos on shared disk. Instead, those who do
want to upgrade a repo to using treemanifest (or manifestv2, etc) can
run

  hg clone --config experimental.treemanifest repo clone


which will create a new repo with the requirement set. Unlike the case
of e.g. generaldelta, it will not rewrite the changesets, since tree
manifests hash differently.
Matt Mackall - May 7, 2015, 6:58 p.m.
On Tue, 2015-05-05 at 09:32 -0700, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1430840459 25200
> #      Tue May 05 08:40:59 2015 -0700
> # Node ID 0493459ea08d7b8db87bb28d1deb0e85f084b10c
> # Parent  e5b507efb36e2b9ad8edb1a38459d26c934d74dd
> treemanifest: set requires at repo creation time, ignore config after

I've queued this first one for default, thanks.

Patch

diff -r e5b507efb36e -r 0493459ea08d mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon May 04 13:15:15 2015 -0500
+++ b/mercurial/localrepo.py	Tue May 05 08:40:59 2015 -0700
@@ -192,10 +192,11 @@ 
 
 class localrepository(object):
 
-    supportedformats = set(('revlogv1', 'generaldelta', 'manifestv2'))
+    supportedformats = set(('revlogv1', 'generaldelta', 'treemanifest',
+                            'manifestv2'))
     _basesupported = supportedformats | set(('store', 'fncache', 'shared',
                                              'dotencode'))
-    openerreqs = set(('revlogv1', 'generaldelta', 'manifestv2'))
+    openerreqs = set(('revlogv1', 'generaldelta', 'treemanifest', 'manifestv2'))
     filtername = None
 
     # a list of (ui, featureset) functions.
@@ -259,6 +260,8 @@ 
                     )
                 if self.ui.configbool('format', 'generaldelta', False):
                     self.requirements.add("generaldelta")
+                if self.ui.configbool('experimental', 'treemanifest', False):
+                    self.requirements.add("treemanifest")
                 if self.ui.configbool('experimental', 'manifestv2', False):
                     self.requirements.add("manifestv2")
             else:
@@ -348,9 +351,6 @@ 
         manifestcachesize = self.ui.configint('format', 'manifestcachesize')
         if manifestcachesize is not None:
             self.svfs.options['manifestcachesize'] = manifestcachesize
-        usetreemanifest = self.ui.configbool('experimental', 'treemanifest')
-        if usetreemanifest is not None:
-            self.svfs.options['usetreemanifest'] = usetreemanifest
 
     def _writerequirements(self):
         reqfile = self.vfs("requires", "w")
diff -r e5b507efb36e -r 0493459ea08d mercurial/manifest.py
--- a/mercurial/manifest.py	Mon May 04 13:15:15 2015 -0500
+++ b/mercurial/manifest.py	Tue May 05 08:40:59 2015 -0700
@@ -760,7 +760,7 @@ 
         opts = getattr(opener, 'options', None)
         if opts is not None:
             cachesize = opts.get('manifestcachesize', cachesize)
-            usetreemanifest = opts.get('usetreemanifest', usetreemanifest)
+            usetreemanifest = opts.get('treemanifest', usetreemanifest)
             usemanifestv2 = opts.get('manifestv2', usemanifestv2)
         self._mancache = util.lrucachedict(cachesize)
         revlog.revlog.__init__(self, opener, "00manifest.i")