diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1188,9 +1188,9 @@ def grep(ui, repo, pattern, *pats, **opt for fn in fns: if fn in skip: continue - fstate.setdefault(fn, {}) try: grepbody(fn, rev, getfile(fn).read(mf[fn])) + fstate.setdefault(fn, []) if follow: copied = getfile(fn).renamed(mf[fn]) if copied: