diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2610,8 +2610,9 @@ skip[fn] = True if copy: skip[copy] = True - del matches[rev] del revfiles[rev] + if not revfiles: + matches.clear() fm.end() return not found