diff -r a54113fcc8c9 -r a2a6755a3def mercurial/commands.py --- a/mercurial/commands.py Mon Mar 26 23:02:50 2018 -0400 +++ b/mercurial/commands.py Tue Mar 27 20:21:30 2018 +0530 @@ -2590,8 +2590,11 @@ skip[fn] = True if copy: skip[copy] = True - del matches[rev] del revfiles[rev] + # We will keep the matches dict for the duration of the window + # clear the matches dict once the window is over + if not revfiles: + matches.clear() fm.end() return not found