[PATCH 04 of 10] manifest: delete unused dirlog and _newmanifest functions
Durham Goode
durham at fb.com
Wed Nov 9 19:31:18 UTC 2016
# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1478682487 28800
# Wed Nov 09 01:08:07 2016 -0800
# Node ID 9b070d4fce7896d247e9ad98c3088c5b25f3ce18
# Parent 34c7fe4045dd6826261988d2cbd843a78572d5db
manifest: delete unused dirlog and _newmanifest functions
As part of migrating all manifest functionality out of manifest.manifest, let's
migrate a couple spots off of manifest.dirlog() to use the revlog specific
accessor. Then we can delete manifest.dirlog() and other unused functions.
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -555,7 +555,7 @@ def openrevlog(repo, cmd, file_, opts):
if 'treemanifest' not in repo.requirements:
raise error.Abort(_("--dir can only be used on repos with "
"treemanifest enabled"))
- dirlog = repo.manifest.dirlog(dir)
+ dirlog = repo.manifestlog._revlog.dirlog(dir)
if len(dirlog):
r = dirlog
elif mf:
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1581,19 +1581,3 @@ class manifest(manifestrevlog):
self._mancache = util.lrucachedict(cachesize)
self._treeinmem = usetreemanifest
super(manifest, self).__init__(opener, dir=dir, dirlogcache=dirlogcache)
-
- def _newmanifest(self, data=''):
- if self._treeinmem:
- return treemanifest(self._dir, data)
- return manifestdict(data)
-
- def dirlog(self, dir):
- """This overrides the base revlog implementation to allow construction
- 'manifest' types instead of manifestrevlog types. This is only needed
- until we migrate off the 'manifest' type."""
- if dir:
- assert self._treeondisk
- if dir not in self._dirlogcache:
- self._dirlogcache[dir] = manifest(self.opener, dir,
- self._dirlogcache)
- return self._dirlogcache[dir]
diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -174,7 +174,7 @@ def strip(ui, repo, nodelist, backup=Tru
if (unencoded.startswith('meta/') and
unencoded.endswith('00manifest.i')):
dir = unencoded[5:-12]
- repo.manifest.dirlog(dir).strip(striprev, tr)
+ repo.manifestlog._revlog.dirlog(dir).strip(striprev, tr)
for fn in files:
repo.file(fn).strip(striprev, tr)
tr.endgroup()
More information about the Mercurial-devel
mailing list