Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 24956:48583a1e44f3
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.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 05 May 2015 08:40:59 -0700 |
parents | a02d293a1079 |
children | 7df090c9c9fe |
comparison
equal
deleted
inserted
replaced
24955:1df233bcb7f6 | 24956:48583a1e44f3 |
---|---|
190 def changegroupsubset(self, bases, heads, source): | 190 def changegroupsubset(self, bases, heads, source): |
191 return changegroup.changegroupsubset(self._repo, bases, heads, source) | 191 return changegroup.changegroupsubset(self._repo, bases, heads, source) |
192 | 192 |
193 class localrepository(object): | 193 class localrepository(object): |
194 | 194 |
195 supportedformats = set(('revlogv1', 'generaldelta', 'manifestv2')) | 195 supportedformats = set(('revlogv1', 'generaldelta', 'treemanifest', |
196 'manifestv2')) | |
196 _basesupported = supportedformats | set(('store', 'fncache', 'shared', | 197 _basesupported = supportedformats | set(('store', 'fncache', 'shared', |
197 'dotencode')) | 198 'dotencode')) |
198 openerreqs = set(('revlogv1', 'generaldelta', 'manifestv2')) | 199 openerreqs = set(('revlogv1', 'generaldelta', 'treemanifest', 'manifestv2')) |
199 filtername = None | 200 filtername = None |
200 | 201 |
201 # a list of (ui, featureset) functions. | 202 # a list of (ui, featureset) functions. |
202 # only functions defined in module of enabled extensions are invoked | 203 # only functions defined in module of enabled extensions are invoked |
203 featuresetupfuncs = set() | 204 featuresetupfuncs = set() |
257 '\0\0\0\2' # represents revlogv2 | 258 '\0\0\0\2' # represents revlogv2 |
258 ' dummy changelog to prevent using the old repo layout' | 259 ' dummy changelog to prevent using the old repo layout' |
259 ) | 260 ) |
260 if self.ui.configbool('format', 'generaldelta', False): | 261 if self.ui.configbool('format', 'generaldelta', False): |
261 self.requirements.add("generaldelta") | 262 self.requirements.add("generaldelta") |
263 if self.ui.configbool('experimental', 'treemanifest', False): | |
264 self.requirements.add("treemanifest") | |
262 if self.ui.configbool('experimental', 'manifestv2', False): | 265 if self.ui.configbool('experimental', 'manifestv2', False): |
263 self.requirements.add("manifestv2") | 266 self.requirements.add("manifestv2") |
264 else: | 267 else: |
265 raise error.RepoError(_("repository %s not found") % path) | 268 raise error.RepoError(_("repository %s not found") % path) |
266 elif create: | 269 elif create: |
346 if maxchainlen is not None: | 349 if maxchainlen is not None: |
347 self.svfs.options['maxchainlen'] = maxchainlen | 350 self.svfs.options['maxchainlen'] = maxchainlen |
348 manifestcachesize = self.ui.configint('format', 'manifestcachesize') | 351 manifestcachesize = self.ui.configint('format', 'manifestcachesize') |
349 if manifestcachesize is not None: | 352 if manifestcachesize is not None: |
350 self.svfs.options['manifestcachesize'] = manifestcachesize | 353 self.svfs.options['manifestcachesize'] = manifestcachesize |
351 usetreemanifest = self.ui.configbool('experimental', 'treemanifest') | |
352 if usetreemanifest is not None: | |
353 self.svfs.options['usetreemanifest'] = usetreemanifest | |
354 | 354 |
355 def _writerequirements(self): | 355 def _writerequirements(self): |
356 scmutil.writerequires(self.vfs, self.requirements) | 356 scmutil.writerequires(self.vfs, self.requirements) |
357 | 357 |
358 def _checknested(self, path): | 358 def _checknested(self, path): |