match: redefine always and never in terms of match and exact
authorMatt Mackall <mpm@selenic.com>
Sun, 24 May 2009 02:56:14 -0500
changeset 8585 bbcd0da50e96
parent 8584 0f06e72abfdc
child 8586 347fe1ac4f21
match: redefine always and never in terms of match and exact
mercurial/match.py
--- a/mercurial/match.py	Sun May 24 02:56:14 2009 -0500
+++ b/mercurial/match.py	Sun May 24 02:56:14 2009 -0500
@@ -35,18 +35,6 @@
     def anypats(self):
         return self._anypats
 
-class always(_match):
-    def __init__(self, root, cwd):
-        _match.__init__(self, root, cwd, [], lambda f: True, False)
-
-class never(_match):
-    def __init__(self, root, cwd):
-        _match.__init__(self, root, cwd, [], lambda f: False, False)
-
-class exact(_match):
-    def __init__(self, root, cwd, files):
-        _match.__init__(self, root, cwd, files, self.exact, False)
-
 class match(_match):
     def __init__(self, root, cwd, patterns, include=[], exclude=[],
                  default='glob'):
@@ -108,6 +96,18 @@
 
         _match.__init__(self, root, cwd, roots, m, anypats)
 
+class exact(_match):
+    def __init__(self, root, cwd, files):
+        _match.__init__(self, root, cwd, files, self.exact, False)
+
+class always(match):
+    def __init__(self, root, cwd):
+        match.__init__(self, root, cwd, [])
+
+class never(exact):
+    def __init__(self, root, cwd):
+        exact.__init__(self, root, cwd, [])
+
 def patkind(pat):
     return _patsplit(pat, None)[0]