# HG changeset patch # User Martin von Zweigbergk # Date 1573860969 28800 # Node ID 95d2eab0a7b9684408955b884a23302ed5979f5e # Parent f965b1027fb0153054663927d17029e7a3643cbf dirstate: include explicit matches in match.traversedir calls The caller should not have to register to get both explicit and non-explicit matches. Differential Revision: https://phab.mercurial-scm.org/D7439 diff -r f965b1027fb0 -r 95d2eab0a7b9 mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Nov 15 14:47:31 2019 -0800 +++ b/mercurial/dirstate.py Fri Nov 15 15:36:09 2019 -0800 @@ -939,6 +939,11 @@ # step 1: find all explicit files results, work, dirsnotfound = self._walkexplicit(match, subrepos) + if matchtdir: + for d in work: + matchtdir(d[0]) + for d in dirsnotfound: + matchtdir(d) skipstep3 = skipstep3 and not (work or dirsnotfound) work = [d for d in work if not dirignore(d[0])] diff -r f965b1027fb0 -r 95d2eab0a7b9 mercurial/merge.py --- a/mercurial/merge.py Fri Nov 15 14:47:31 2019 -0800 +++ b/mercurial/merge.py Fri Nov 15 15:36:09 2019 -0800 @@ -2676,7 +2676,6 @@ # There's no API to copy a matcher. So mutate the passed matcher and # restore it when we're done. - oldexplicitdir = matcher.explicitdir oldtraversedir = matcher.traversedir res = [] @@ -2684,7 +2683,7 @@ try: if removeemptydirs: directories = [] - matcher.explicitdir = matcher.traversedir = directories.append + matcher.traversedir = directories.append status = repo.status(match=matcher, ignored=ignored, unknown=True) @@ -2706,5 +2705,4 @@ return res finally: - matcher.explicitdir = oldexplicitdir matcher.traversedir = oldtraversedir