narrow: remove support for old match modules
authorAugie Fackler <augie@google.com>
Mon, 29 Jan 2018 18:08:56 -0500
changeset 36080 9dc28d8ea61e
parent 36079 a2a6e724d61a
child 36081 48c12b440b4a
narrow: remove support for old match modules Differential Revision: https://phab.mercurial-scm.org/D1975
hgext/narrow/__init__.py
--- a/hgext/narrow/__init__.py	Mon Jan 29 16:19:33 2018 -0500
+++ b/hgext/narrow/__init__.py	Mon Jan 29 18:08:56 2018 -0500
@@ -24,7 +24,6 @@
     hg,
     localrepo,
     registrar,
-    util,
     verify as verifymod,
 )
 
@@ -85,15 +84,6 @@
         narrowpatch.setup(repo)
         narrowwirepeer.reposetup(repo)
 
-def _narrowvalidpath(orig, repo, path):
-    matcher = getattr(repo, 'narrowmatch', None)
-    if matcher is None:
-        return orig(repo, path)
-    matcher = matcher()
-    if matcher.visitdir(path) or matcher(path):
-        return orig(repo, path)
-    return False
-
 def _verifierinit(orig, self, repo, matcher=None):
     # The verifier's matcher argument was desgined for narrowhg, so it should
     # be None from core. If another extension passes a matcher (unlikely),
@@ -103,9 +93,6 @@
     orig(self, repo, matcher)
 
 def extsetup(ui):
-    if util.safehasattr(verifymod, '_validpath'):
-        extensions.wrapfunction(verifymod, '_validpath', _narrowvalidpath)
-    else:
-        extensions.wrapfunction(verifymod.verifier, '__init__', _verifierinit)
+    extensions.wrapfunction(verifymod.verifier, '__init__', _verifierinit)
     extensions.wrapfunction(hg, 'postshare', narrowrepo.wrappostshare)
     extensions.wrapfunction(hg, 'copystore', narrowrepo.unsharenarrowspec)