# HG changeset patch # User Martin von Zweigbergk # Date 2015-05-05 15:40:59 # Node ID 48583a1e44f37a8a4a76693459f0e97e4efbb2cc # Parent 1df233bcb7f6447849b543c377eade6092f5732f 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. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -192,10 +192,11 @@ class locallegacypeer(localpeer): 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 @@ class localrepository(object): ) 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 @@ class localrepository(object): 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): scmutil.writerequires(self.vfs, self.requirements) diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -760,7 +760,7 @@ class manifest(revlog.revlog): 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")