diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1831,7 +1831,7 @@ else: self.revs.discard(value) ctx = change(value) - matches = filter(match, ctx.files()) + matches = [f for f in ctx.files() if match(f)] if matches: fncache[value] = matches self.set.add(value) diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -685,8 +685,8 @@ # the base and present in the source. # Presence in the base is important to exclude added files, presence in the # source is important to exclude removed files. - missingfiles = filter(lambda f: f not in m1 and f in base and f in c2, - changedfiles) + filt = lambda f: f not in m1 and f in base and f in c2 + missingfiles = [f for f in changedfiles if filt(f)] if missingfiles: basenametofilename = collections.defaultdict(list)