mercurial/patch.py
changeset 27902 51b6ce257e0a
parent 27901 29c8e35d3283
child 28341 8286f551b7ee
--- a/mercurial/patch.py	Thu Jan 14 10:14:24 2016 -0800
+++ b/mercurial/patch.py	Thu Jan 14 10:22:55 2016 -0800
@@ -2273,6 +2273,11 @@
     modified = sorted(modifiedset)
     added = sorted(addedset)
     removed = sorted(removedset)
+    for dst, src in copy.items():
+        if src not in ctx1:
+            # Files merged in during a merge and then copied/renamed are
+            # reported as copies. We want to show them in the diff as additions.
+            del copy[dst]
 
     def difffn(opts, losedata):
         return trydiff(repo, revs, ctx1, ctx2, modified, added, removed,