match: simplify nevermatcher
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 01 Jun 2017 08:31:21 -0700
changeset 32650 783394c0c978
parent 32649 7a209737f01c
child 32652 9929af2b09b4
match: simplify nevermatcher Most of it does the same as its superclass, so it can simply be removed. It also seems to make more sense for it to use relative paths, as we do for everything except alwaysmatcher, although nevermatcher.uipath() will probably never get called anyway, so it won't matter.
mercurial/match.py
--- a/mercurial/match.py	Sat Jun 03 00:25:24 2017 +0900
+++ b/mercurial/match.py	Thu Jun 01 08:31:21 2017 -0700
@@ -153,8 +153,7 @@
                                listsubrepos=listsubrepos, badfn=badfn)
     else:
         # It's a little strange that no patterns means to match everything.
-        # Consider changing this to match nothing (probably adding a
-        # "nevermatcher").
+        # Consider changing this to match nothing (probably using nevermatcher).
         m = alwaysmatcher(root, cwd, badfn)
 
     if include:
@@ -345,18 +344,8 @@
 class nevermatcher(basematcher):
     '''Matches nothing.'''
 
-    def __init__(self, root, cwd, badfn=None, relativeuipath=False):
-        super(nevermatcher, self).__init__(root, cwd, badfn,
-                                           relativeuipath=relativeuipath)
-
-    def always(self):
-        return False
-
-    def matchfn(self, f):
-        return False
-
-    def visitdir(self, dir):
-        return False
+    def __init__(self, root, cwd, badfn=None):
+        super(nevermatcher, self).__init__(root, cwd, badfn)
 
     def __repr__(self):
         return '<nevermatcher>'