# HG changeset patch # User Patrick Mezard # Date 1187189020 -7200 # Node ID de7c772751b456c4e6f42ab20f113ff06e9a0ef4 # Parent 4dfe4c21dd64adc2ed941eae0d7016108bb76ac8# Parent ee702e7f181f743ae7b2131a36004876a19a0c07 Merge with crew-stable diff -r 4dfe4c21dd64 -r de7c772751b4 mercurial/commands.py --- a/mercurial/commands.py Tue Aug 14 21:36:08 2007 +0200 +++ b/mercurial/commands.py Wed Aug 15 16:43:40 2007 +0200 @@ -1188,9 +1188,9 @@ 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: diff -r 4dfe4c21dd64 -r de7c772751b4 tests/test-grep --- a/tests/test-grep Tue Aug 14 21:36:08 2007 +0200 +++ b/tests/test-grep Wed Aug 15 16:43:40 2007 +0200 @@ -52,3 +52,17 @@ hg ci -m 3 -d '0 0' hg grep orange hg grep --all orange + +# Got a traceback when using grep on a single +# revision with renamed files. +cd .. +echo % issue 685 +hg init issue685 +cd issue685 +echo octarine > color +hg ci -Amcolor +hg rename color colour +Hg ci -Am rename +hg grep octarine +# Used to crash here +hg grep -r 1 octarine diff -r 4dfe4c21dd64 -r de7c772751b4 tests/test-grep.out --- a/tests/test-grep.out Tue Aug 14 21:36:08 2007 +0200 +++ b/tests/test-grep.out Wed Aug 15 16:43:40 2007 +0200 @@ -32,3 +32,8 @@ color:3:+:orange color:2:-:orange color:1:+:orange +% issue 685 +adding color +color:0:octarine +colour:1:octarine +colour:1:octarine