mercurial/copies.py
changeset 46184 cb8b2ee89a5d
parent 46183 ee63c1173c1b
child 46302 599d247af600
--- a/mercurial/copies.py	Mon Dec 14 02:03:36 2020 +0100
+++ b/mercurial/copies.py	Tue Dec 15 00:29:29 2020 +0100
@@ -383,9 +383,11 @@
 
                 if copies is None:
                     # this is a root
-                    copies = {}
-
-                newcopies = copies
+                    newcopies = copies = {}
+                elif remaining_children:
+                    newcopies = copies.copy()
+                else:
+                    newcopies = copies
                 # chain the data in the edge with the existing data
                 if changes is not None:
                     childcopies = {}
@@ -403,8 +405,6 @@
                             newcopies[dest] = (current_rev, source)
                         assert newcopies is not copies
                     if changes.removed:
-                        if newcopies is copies:
-                            newcopies = copies.copy()
                         for f in changes.removed:
                             if f in newcopies:
                                 if newcopies is copies:
@@ -417,9 +417,6 @@
                 # that child). See comment below for details.
                 if current_copies is None:
                     current_copies = newcopies
-                elif current_copies is newcopies:
-                    # nothing to merge:
-                    pass
                 else:
                     # we are the second parent to work on c, we need to merge our
                     # work with the other.