match: remove ctx argument from code path down to _buildmatch()
authorYuya Nishihara <yuya@tcha.org>
Tue, 12 Jun 2018 22:01:59 +0900
changeset 38581 6467286b829c
parent 38580 9f9ffe5f687c
child 38582 7f4bf8110150
match: remove ctx argument from code path down to _buildmatch() 'ctx' was there only for filesets.
mercurial/match.py
--- a/mercurial/match.py	Sun Jun 10 16:08:58 2018 +0900
+++ b/mercurial/match.py	Tue Jun 12 22:01:59 2018 +0900
@@ -100,7 +100,7 @@
     fset, kindpats = _expandsets(kindpats, ctx, listsubrepos)
     matchers = []
     if kindpats:
-        m = matchercls(root, cwd, kindpats, ctx=ctx, listsubrepos=listsubrepos,
+        m = matchercls(root, cwd, kindpats, listsubrepos=listsubrepos,
                        badfn=badfn)
         matchers.append(m)
     if fset:
@@ -410,13 +410,12 @@
 
 class patternmatcher(basematcher):
 
-    def __init__(self, root, cwd, kindpats, ctx=None, listsubrepos=False,
-                 badfn=None):
+    def __init__(self, root, cwd, kindpats, listsubrepos=False, badfn=None):
         super(patternmatcher, self).__init__(root, cwd, badfn)
 
         self._files = _explicitfiles(kindpats)
         self._prefix = _prefix(kindpats)
-        self._pats, self.matchfn = _buildmatch(ctx, kindpats, '$', listsubrepos,
+        self._pats, self.matchfn = _buildmatch(kindpats, '$', listsubrepos,
                                                root)
 
     @propertycache
@@ -441,11 +440,10 @@
 
 class includematcher(basematcher):
 
-    def __init__(self, root, cwd, kindpats, ctx=None, listsubrepos=False,
-                 badfn=None):
+    def __init__(self, root, cwd, kindpats, listsubrepos=False, badfn=None):
         super(includematcher, self).__init__(root, cwd, badfn)
 
-        self._pats, self.matchfn = _buildmatch(ctx, kindpats, '(?:/|$)',
+        self._pats, self.matchfn = _buildmatch(kindpats, '(?:/|$)',
                                                listsubrepos, root)
         self._prefix = _prefix(kindpats)
         roots, dirs = _rootsanddirs(kindpats)
@@ -842,7 +840,7 @@
         return _globre(pat) + globsuffix
     raise error.ProgrammingError('not a regex pattern: %s:%s' % (kind, pat))
 
-def _buildmatch(ctx, kindpats, globsuffix, listsubrepos, root):
+def _buildmatch(kindpats, globsuffix, listsubrepos, root):
     '''Return regexp string and a matcher function for kindpats.
     globsuffix is appended to the regexp of globs.'''
     matchfuncs = []