match: resolve 'set:' patterns first in _buildmatch()
authorYuya Nishihara <yuya@tcha.org>
Sun, 10 Jun 2018 15:52:27 +0900
changeset 38579 ec0cee4c1fff
parent 38578 2d487b9cac07
child 38580 9f9ffe5f687c
match: resolve 'set:' patterns first in _buildmatch() This just makes the next patch less complicated. The order of 'set:' and 'subinclude:' expansion doesn't matter.
mercurial/match.py
--- a/mercurial/match.py	Sun Jun 10 15:47:58 2018 +0900
+++ b/mercurial/match.py	Sun Jun 10 15:52:27 2018 +0900
@@ -828,6 +828,10 @@
     globsuffix is appended to the regexp of globs.'''
     matchfuncs = []
 
+    fset, kindpats = _expandsets(kindpats, ctx, listsubrepos)
+    if fset:
+        matchfuncs.append(fset.__contains__)
+
     subincludes, kindpats = _expandsubinclude(kindpats, root)
     if subincludes:
         submatchers = {}
@@ -844,10 +848,6 @@
             return False
         matchfuncs.append(matchsubinclude)
 
-    fset, kindpats = _expandsets(kindpats, ctx, listsubrepos)
-    if fset:
-        matchfuncs.append(fset.__contains__)
-
     regex = ''
     if kindpats:
         regex, mf = _buildregexmatch(kindpats, globsuffix)