changeset 38582:6467286b829c

match: remove ctx argument from code path down to _buildmatch() 'ctx' was there only for filesets.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 12 Jun 2018 22:01:59 +0900
parents 9f9ffe5f687c
children 7f4bf8110150
files mercurial/match.py
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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 = []