[PATCH 1 of 2] manifest: allow specifying the revlog filename

Durham Goode durham at fb.com
Fri Feb 24 22:44:01 UTC 2017


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1487973639 28800
#      Fri Feb 24 14:00:39 2017 -0800
# Node ID ed987b24e755a4c61c006f7d98a4ff370229faad
# Parent  f01df5d2fe493376a67569756a9bc2ddffa5cd81
manifest: allow specifying the revlog filename

Previously we had hardcoded the manifest filename to be 00manifest.i. In our
external treemanifest extension, we want to allow writing a treemanifest side by
side with a flat manifest, so we need to be able to store the root revisions at
a different location (in our extension we use 00manifesttree.i).

This patches moves the revlog name to a parameter so we can adjust it.

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1132,7 +1132,8 @@ class manifestrevlog(revlog.revlog):
     '''A revlog that stores manifest texts. This is responsible for caching the
     full-text manifest contents.
     '''
-    def __init__(self, opener, dir='', dirlogcache=None):
+    def __init__(self, opener, dir='', dirlogcache=None,
+                 indexfile='00manifest.i'):
         # During normal operations, we expect to deal with not more than four
         # revs at a time (such as during commit --amend). When rebasing large
         # stacks of commits, the number can go up, hence the config knob below.
@@ -1150,12 +1151,11 @@ class manifestrevlog(revlog.revlog):
 
         self._fulltextcache = util.lrucachedict(cachesize)
 
-        indexfile = "00manifest.i"
         if dir:
             assert self._treeondisk, 'opts is %r' % opts
             if not dir.endswith('/'):
                 dir = dir + '/'
-            indexfile = "meta/" + dir + "00manifest.i"
+            indexfile = "meta/" + dir + indexfile
         self._dir = dir
         # The dirlogcache is kept on the root manifest log
         if dir:


More information about the Mercurial-devel mailing list