diff -r ff72bd52d56a -r 9d2b2df2c2ba mercurial/match.py --- a/mercurial/match.py Fri Mar 06 10:52:44 2020 +0100 +++ b/mercurial/match.py Fri Mar 06 13:27:41 2020 -0500 @@ -772,7 +772,7 @@ candidates = self._fileset | self._dirs - {b''} if dir != b'': d = dir + b'/' - candidates = set(c[len(d) :] for c in candidates if c.startswith(d)) + candidates = {c[len(d) :] for c in candidates if c.startswith(d)} # self._dirs includes all of the directories, recursively, so if # we're attempting to match foo/bar/baz.txt, it'll have '', 'foo', # 'foo/bar' in it. Thus we can safely ignore a candidate that has a