Mercurial > public > mercurial-scm > hg-stable
diff mercurial/copies.py @ 6646:9eb274d773d9
copies: teach copies about dirstate.copies
When we're using copies() to find changes between the working directory and
its first parent for diff/status/etc., use dirstate.copies() directly.
This avoids doing a full statwalk for simple diffs (issue1090) and
removes a special case from the status command.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 03 Jun 2008 15:41:09 -0500 |
parents | a42d8d3e6ea9 |
children | fb42030d79d6 |
line wrap: on
line diff
--- a/mercurial/copies.py Tue Jun 03 09:34:14 2008 +0200 +++ b/mercurial/copies.py Tue Jun 03 15:41:09 2008 -0500 @@ -109,6 +109,10 @@ if not c1 or not c2 or c1 == c2: return {}, {} + # avoid silly behavior for parent -> working dir + if c2.node() == None and c1.node() == repo.dirstate.parents()[0]: + return repo.dirstate.copies(), {} + limit = _findlimit(repo, c1.rev(), c2.rev()) m1 = c1.manifest() m2 = c2.manifest()