changeset 23549:609ecde2778f

match: make 'always' and 'exact' functions, not classes There is no reason for classes 'always' and 'exact' not to be just functions that return instances the plain 'match' class.
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 01 Nov 2014 22:56:49 -0700
parents 141baca16059
children 7fa2189c1e87
files mercurial/match.py
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/match.py	Sat Dec 13 14:31:55 2014 -0800
+++ b/mercurial/match.py	Sat Nov 01 22:56:49 2014 -0700
@@ -156,13 +156,11 @@
         - optimization might be possible and necessary.'''
         return self._always
 
-class exact(match):
-    def __init__(self, root, cwd, files):
-        match.__init__(self, root, cwd, files, exact=True)
+def exact(root, cwd, files):
+    return match(root, cwd, files, exact=True)
 
-class always(match):
-    def __init__(self, root, cwd):
-        match.__init__(self, root, cwd, [])
+def always(root, cwd):
+    return match(root, cwd, [])
 
 class narrowmatcher(match):
     """Adapt a matcher to work on a subdirectory only.