# HG changeset patch # User Brendan Cully # Date 1155920744 25200 # Node ID 0843bd53dcff1c74e76522a587dee1a10e47eac4 # Parent af71034aac9096a927bb8ca84ee76d9e25bd2bfd Fix bug #345. The last hit for a file might have been before the last window, so we can't clear copies. To reduce the load, we only store real copy entries instead of storing hashes for every revision. diff -r af71034aac90 -r 0843bd53dcff mercurial/commands.py --- a/mercurial/commands.py Wed Aug 16 11:03:45 2006 -0700 +++ b/mercurial/commands.py Fri Aug 18 10:05:44 2006 -0700 @@ -1526,7 +1526,6 @@ if st == 'window': incrementing = rev matches.clear() - copies.clear() elif st == 'add': change = repo.changelog.read(repo.lookup(str(rev))) mf = repo.manifest.read(change[0]) @@ -1535,20 +1534,19 @@ if fn in skip: continue fstate.setdefault(fn, {}) - copies.setdefault(rev, {}) try: grepbody(fn, rev, getfile(fn).read(mf[fn])) if follow: copied = getfile(fn).renamed(mf[fn]) if copied: - copies[rev][fn] = copied[0] + copies.setdefault(rev, {})[fn] = copied[0] except KeyError: pass elif st == 'iter': states = matches[rev].items() states.sort() for fn, m in states: - copy = copies[rev].get(fn) + copy = copies.get(rev, {}).get(fn) if fn in skip: if copy: skip[copy] = True @@ -1571,7 +1569,7 @@ for fn, state in fstate: if fn in skip: continue - if fn not in copies[prev[fn]]: + if fn not in copies.get(prev[fn], {}): display(fn, rev, {}, state) return (count == 0 and 1) or 0