comparison mercurial/manifest.py @ 24526:cd50f3717639

manifestv2: add (unused) config option With tree manifests, hashes will change anyway, so now is a good time to also take up the old plans of a new manifest format. While there should be little or no reason to use tree manifests with the current manifest format (v1) once the new format (v2) is supported, we'll try to keep the two dimensions (flat/tree and v1/v2) separate. In preparation for adding a the new format, let's add configuration for it and propagate that configuration to the manifest revlog subclass. The new configuration ("experimental.manifestv2") says in what format to write the manifest data. We may later add other configuration to choose how to hash it, either keeping the v1 hash for BC or hashing the v2 content. See http://mercurial.selenic.com/wiki/ManifestV2Plan for more details.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 27 Mar 2015 16:19:44 -0700
parents e118f74d246f
children 8aead3bc5ff8
comparison
equal deleted inserted replaced
24525:e118f74d246f 24526:cd50f3717639
595 # During normal operations, we expect to deal with not more than four 595 # During normal operations, we expect to deal with not more than four
596 # revs at a time (such as during commit --amend). When rebasing large 596 # revs at a time (such as during commit --amend). When rebasing large
597 # stacks of commits, the number can go up, hence the config knob below. 597 # stacks of commits, the number can go up, hence the config knob below.
598 cachesize = 4 598 cachesize = 4
599 usetreemanifest = False 599 usetreemanifest = False
600 usemanifestv2 = False
600 opts = getattr(opener, 'options', None) 601 opts = getattr(opener, 'options', None)
601 if opts is not None: 602 if opts is not None:
602 cachesize = opts.get('manifestcachesize', cachesize) 603 cachesize = opts.get('manifestcachesize', cachesize)
603 usetreemanifest = opts.get('usetreemanifest', usetreemanifest) 604 usetreemanifest = opts.get('usetreemanifest', usetreemanifest)
605 usemanifestv2 = opts.get('usemanifestv2', usemanifestv2)
604 self._mancache = util.lrucachedict(cachesize) 606 self._mancache = util.lrucachedict(cachesize)
605 revlog.revlog.__init__(self, opener, "00manifest.i") 607 revlog.revlog.__init__(self, opener, "00manifest.i")
606 self._usetreemanifest = usetreemanifest 608 self._usetreemanifest = usetreemanifest
609 self._usemanifestv2 = usemanifestv2
607 610
608 def _newmanifest(self, data=''): 611 def _newmanifest(self, data=''):
609 if self._usetreemanifest: 612 if self._usetreemanifest:
610 return treemanifest('', data) 613 return treemanifest('', data)
611 return manifestdict(data) 614 return manifestdict(data)