# HG changeset patch # User Yuya Nishihara # Date 2018-06-10 06:52:27 # Node ID ec0cee4c1fff356c903bc03bed169eeb9fca5317 # Parent 2d487b9cac0729d5911af6ff02bed86cca3e29ad 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. diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -828,6 +828,10 @@ def _buildmatch(ctx, kindpats, globsuffi 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 @@ def _buildmatch(ctx, kindpats, globsuffi 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)