D5469: manifest: accept narrowmatch into constructor instead of getting from repo

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Dec 20 18:12:28 UTC 2018


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The manifest should ideally not know at all about the repo, so this is
  just a little step towards cleaning that up.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5469

AFFECTED FILES
  mercurial/bundlerepo.py
  mercurial/localrepo.py
  mercurial/manifest.py
  mercurial/statichttprepo.py
  mercurial/unionrepo.py
  tests/test-check-interfaces.py

CHANGE DETAILS

diff --git a/tests/test-check-interfaces.py b/tests/test-check-interfaces.py
--- a/tests/test-check-interfaces.py
+++ b/tests/test-check-interfaces.py
@@ -182,7 +182,8 @@
     checkzobject(fl, allowextra=True)
 
     # Conforms to imanifestlog.
-    ml = manifest.manifestlog(vfs, repo, manifest.manifestrevlog(repo.svfs))
+    ml = manifest.manifestlog(vfs, repo, manifest.manifestrevlog(repo.svfs),
+                              repo.narrowmatch())
     checkzobject(ml)
     checkzobject(repo.manifestlog)
 
diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
--- a/mercurial/unionrepo.py
+++ b/mercurial/unionrepo.py
@@ -212,7 +212,8 @@
     def manifestlog(self):
         rootstore = unionmanifest(self.svfs, self.repo2.svfs,
                                   self.unfiltered()._clrev)
-        return manifest.manifestlog(self.svfs, self, rootstore)
+        return manifest.manifestlog(self.svfs, self, rootstore,
+                                    self.narrowmatch())
 
     def _clrev(self, rev2):
         """map from repo2 changelog rev to temporary rev in self.changelog"""
diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -187,7 +187,8 @@
         self.requirements = requirements
 
         rootmanifest = manifest.manifestrevlog(self.svfs)
-        self.manifestlog = manifest.manifestlog(self.svfs, self, rootmanifest)
+        self.manifestlog = manifest.manifestlog(self.svfs, self, rootmanifest,
+                                                self.narrowmatch())
         self.changelog = changelog.changelog(self.svfs)
         self._tags = None
         self.nodetagscache = None
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1636,7 +1636,7 @@
     of the list of files in the given commit. Consumers of the output of this
     class do not care about the implementation details of the actual manifests
     they receive (i.e. tree or flat or lazily loaded, etc)."""
-    def __init__(self, opener, repo, rootstore):
+    def __init__(self, opener, repo, rootstore, narrowmatch):
         usetreemanifest = False
         cachesize = 4
 
@@ -1649,7 +1649,7 @@
 
         self._rootstore = rootstore
         self._rootstore._setupmanifestcachehooks(repo)
-        self._narrowmatch = repo.narrowmatch()
+        self._narrowmatch = narrowmatch
 
         # A cache of the manifestctx or treemanifestctx for each directory
         self._dirmancache = {}
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1190,7 +1190,8 @@
     @storecache('00manifest.i')
     def manifestlog(self):
         rootstore = manifest.manifestrevlog(self.svfs)
-        return manifest.manifestlog(self.svfs, self, rootstore)
+        return manifest.manifestlog(self.svfs, self, rootstore,
+                                    self.narrowmatch())
 
     @repofilecache('dirstate')
     def dirstate(self):
diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -374,7 +374,8 @@
         rootstore = bundlemanifest(self.svfs, self._cgunpacker, linkmapper)
         self.filestart = self._cgunpacker.tell()
 
-        return manifest.manifestlog(self.svfs, self, rootstore)
+        return manifest.manifestlog(self.svfs, self, rootstore,
+                                    self.narrowmatch())
 
     def _consumemanifest(self):
         """Consumes the manifest portion of the bundle, setting filestart so the



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list