patch: remove useless copy, cleanup stable
authorPatrick Mezard <pmezard@gmail.com>
Sun, 14 Feb 2010 17:53:23 +0100
branchstable
changeset 10467 16c68fd720ab
parent 10466 d1f209bb9564
child 10468 2250fc372d34
patch: remove useless copy, cleanup
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' %