# HG changeset patch # User Alexis S. L. Carvalho # Date 1188352961 10800 # Node ID 15a108ad7adb0be221234177e544bdf196848309 # Parent 0fc16031bb458ae3f02ec947cfba3b8361961dcb Avoid a working dir walk while trying to detect copies for diff --git diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1169,8 +1169,9 @@ def diff(repo, node1=None, node2=None, f if crev is None: crev = repo.changelog.count() orig = f + files = (f,) while crev > startrev: - if f in c.files(): + if f in files: try: src = getfilectx(f, c).renamed() except revlog.LookupError: @@ -1180,6 +1181,7 @@ def diff(repo, node1=None, node2=None, f crev = c.parents()[0].rev() # try to reuse c = getctx(crev) + files = c.files() if f not in man: return None if f == orig: