# HG changeset patch # User Patrick Mezard # Date 1266166403 -3600 # Node ID 16c68fd720ab64982eaf91e912313b56c57a42de # Parent d1f209bb95646b1f72b75555c8edbd71dba50477 patch: remove useless copy, cleanup diff -r d1f209bb9564 -r 16c68fd720ab mercurial/patch.py --- a/mercurial/patch.py Thu Feb 11 11:22:57 2010 -0200 +++ b/mercurial/patch.py Sun Feb 14 17:53:23 2010 +0100 @@ -1435,7 +1435,6 @@ copy = {} if opts.git or opts.upgrade: copy = copies.copies(repo, ctx1, ctx2, repo[nullid])[0] - copy = copy.copy() difffn = lambda opts, losedata: trydiff(repo, revs, ctx1, ctx2, modified, added, removed, copy, getfilectx, opts, losedata) @@ -1517,9 +1516,10 @@ elif f in removed: if opts.git: # have we already reported a copy above? - if f in copy and copy[f] in added and copyto[copy[f]] == f: - dodiff = False - elif f in copyto and copyto[f] in added and copy[copyto[f]] == f: + if ((f in copy and copy[f] in added + and copyto[copy[f]] == f) or + (f in copyto and copyto[f] in added + and copy[copyto[f]] == f)): dodiff = False else: header.append('deleted file mode %s\n' %