D4824: narrow: move support for `hg verify` into core

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Mon Oct 1 13:15:33 EDT 2018


martinvonz updated this revision to Diff 11535.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4824?vs=11532&id=11535

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

AFFECTED FILES
  hgext/narrow/__init__.py
  mercurial/verify.py

CHANGE DETAILS

diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -19,7 +19,6 @@
     error,
     pycompat,
     revlog,
-    scmutil,
     util,
 )
 
@@ -35,12 +34,10 @@
     return f
 
 class verifier(object):
-    # The match argument is always None in hg core, but e.g. the narrowhg
-    # extension will pass in a matcher here.
-    def __init__(self, repo, match=None):
+    def __init__(self, repo):
         self.repo = repo.unfiltered()
         self.ui = repo.ui
-        self.match = match or scmutil.matchall(repo)
+        self.match = repo.narrowmatch()
         self.badrevs = set()
         self.errors = 0
         self.warnings = 0
diff --git a/hgext/narrow/__init__.py b/hgext/narrow/__init__.py
--- a/hgext/narrow/__init__.py
+++ b/hgext/narrow/__init__.py
@@ -15,11 +15,9 @@
 testedwith = 'ships-with-hg-core'
 
 from mercurial import (
-    extensions,
     localrepo,
     registrar,
     repository,
-    verify as verifymod,
 )
 
 from . import (
@@ -70,15 +68,5 @@
         narrowpatch.setup(repo)
         narrowwirepeer.reposetup(repo)
 
-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),
-    # we'll have to fail until matchers can be composed more easily.
-    assert matcher is None
-    orig(self, repo, repo.narrowmatch())
-
-def extsetup(ui):
-    extensions.wrapfunction(verifymod.verifier, '__init__', _verifierinit)
-
 templatekeyword = narrowtemplates.templatekeyword
 revsetpredicate = narrowtemplates.revsetpredicate



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


More information about the Mercurial-devel mailing list