Patchwork D3046: narrow: move manifestlog overrides to core

login
register
mail settings
Submitter phabricator
Date April 5, 2018, 6:03 p.m.
Message ID <3494306d7ae329eb833a19f04f71c8bc@localhost.localdomain>
Download mbox | patch
Permalink /patch/30398/
State Not Applicable
Headers show

Comments

phabricator - April 5, 2018, 6:03 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGac42e39b1b77: narrow: move manifestlog overrides to core (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3046?vs=7577&id=7745

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

AFFECTED FILES
  hgext/narrow/narrowrepo.py
  hgext/narrow/narrowrevlog.py
  mercurial/manifest.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1303,6 +1303,9 @@ 
         if node in self._dirmancache.get(dir, ()):
             return self._dirmancache[dir][node]
 
+        if not self._narrowmatch.always():
+            if not self._narrowmatch.visitdir(dir[:-1] or '.'):
+                return excludeddirmanifestctx(dir, node)
         if dir:
             if self._revlog._treeondisk:
                 if verify:
diff --git a/hgext/narrow/narrowrevlog.py b/hgext/narrow/narrowrevlog.py
--- a/hgext/narrow/narrowrevlog.py
+++ b/hgext/narrow/narrowrevlog.py
@@ -8,7 +8,6 @@ 
 from __future__ import absolute_import
 
 from mercurial import (
-   manifest,
    revlog,
    util,
 )
@@ -30,14 +29,6 @@ 
     # load time.
     pass
 
-def makenarrowmanifestlog(mfl, repo):
-    class narrowmanifestlog(mfl.__class__):
-        def get(self, dir, node, verify=True):
-            if not repo.narrowmatch().visitdir(dir[:-1] or '.'):
-                return manifest.excludeddirmanifestctx(dir, node)
-            return super(narrowmanifestlog, self).get(dir, node, verify=verify)
-    mfl.__class__ = narrowmanifestlog
-
 def makenarrowfilelog(fl, narrowmatch):
     class narrowfilelog(fl.__class__):
         def renamed(self, node):
diff --git a/hgext/narrow/narrowrepo.py b/hgext/narrow/narrowrepo.py
--- a/hgext/narrow/narrowrepo.py
+++ b/hgext/narrow/narrowrepo.py
@@ -50,12 +50,6 @@ 
 
     class narrowrepository(repo.__class__):
 
-        @cacheprop('00manifest.i')
-        def manifestlog(self):
-            mfl = super(narrowrepository, self).manifestlog
-            narrowrevlog.makenarrowmanifestlog(mfl, self)
-            return mfl
-
         def file(self, f):
             fl = super(narrowrepository, self).file(f)
             narrowrevlog.makenarrowfilelog(fl, self.narrowmatch())