# HG changeset patch # User Martin von Zweigbergk # Date 1543904543 28800 # Node ID 3913223417ea0598a1237797b94d5d49f175d783 # Parent 2eeef8e577acf695c7e741f2981fcedd6e7fe138 manifest: accept narrowmatch into constructor instead of getting from repo The manifest should ideally not know at all about the repo, so this is just a little step towards cleaning that up. Differential Revision: https://phab.mercurial-scm.org/D5469 diff -r 2eeef8e577ac -r 3913223417ea mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py Sat Dec 22 00:05:39 2018 -0500 +++ b/mercurial/bundlerepo.py Mon Dec 03 22:22:23 2018 -0800 @@ -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 diff -r 2eeef8e577ac -r 3913223417ea mercurial/localrepo.py --- a/mercurial/localrepo.py Sat Dec 22 00:05:39 2018 -0500 +++ b/mercurial/localrepo.py Mon Dec 03 22:22:23 2018 -0800 @@ -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 -r 2eeef8e577ac -r 3913223417ea mercurial/manifest.py --- a/mercurial/manifest.py Sat Dec 22 00:05:39 2018 -0500 +++ b/mercurial/manifest.py Mon Dec 03 22:22:23 2018 -0800 @@ -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 -r 2eeef8e577ac -r 3913223417ea mercurial/statichttprepo.py --- a/mercurial/statichttprepo.py Sat Dec 22 00:05:39 2018 -0500 +++ b/mercurial/statichttprepo.py Mon Dec 03 22:22:23 2018 -0800 @@ -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 -r 2eeef8e577ac -r 3913223417ea mercurial/unionrepo.py --- a/mercurial/unionrepo.py Sat Dec 22 00:05:39 2018 -0500 +++ b/mercurial/unionrepo.py Mon Dec 03 22:22:23 2018 -0800 @@ -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 -r 2eeef8e577ac -r 3913223417ea tests/test-check-interfaces.py --- a/tests/test-check-interfaces.py Sat Dec 22 00:05:39 2018 -0500 +++ b/tests/test-check-interfaces.py Mon Dec 03 22:22:23 2018 -0800 @@ -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)