diff mercurial/localrepo.py @ 24571:919f8ce040be

manifestv2: set requires at repo creation time While it should be safe to switch to the new manifest format on an existing repo, let's keep it simple for now and make the configuration have any effect only at repo creation time. If the configuration is enabled then (at repo creation), we add an entry to requires and read that instead of the configuration from then on.
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 31 Mar 2015 22:45:45 -0700
parents cd50f3717639
children c79b1e690110
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Mar 31 15:06:55 2015 -0700
+++ b/mercurial/localrepo.py	Tue Mar 31 22:45:45 2015 -0700
@@ -174,10 +174,10 @@
 
 class localrepository(object):
 
-    supportedformats = set(('revlogv1', 'generaldelta'))
+    supportedformats = set(('revlogv1', 'generaldelta', 'manifestv2'))
     _basesupported = supportedformats | set(('store', 'fncache', 'shared',
                                              'dotencode'))
-    openerreqs = set(('revlogv1', 'generaldelta'))
+    openerreqs = set(('revlogv1', 'generaldelta', 'manifestv2'))
     requirements = ['revlogv1']
     filtername = None
 
@@ -241,6 +241,8 @@
                     )
                 if self.ui.configbool('format', 'generaldelta', False):
                     requirements.append("generaldelta")
+                if self.ui.configbool('experimental', 'manifestv2', False):
+                    requirements.append("manifestv2")
                 requirements = set(requirements)
             else:
                 raise error.RepoError(_("repository %s not found") % path)
@@ -334,9 +336,6 @@
         usetreemanifest = self.ui.configbool('experimental', 'treemanifest')
         if usetreemanifest is not None:
             self.svfs.options['usetreemanifest'] = usetreemanifest
-        usemanifestv2 = self.ui.configbool('experimental', 'manifestv2')
-        if usemanifestv2 is not None:
-            self.svfs.options['usemanifestv2'] = usemanifestv2
 
     def _writerequirements(self):
         reqfile = self.vfs("requires", "w")