mercurial/commit.py
changeset 45326 99614011892b
parent 45324 6c56277317c2
child 45327 6de4c5647db3
--- a/mercurial/commit.py	Sat Jul 25 16:02:26 2020 +0200
+++ b/mercurial/commit.py	Sat Jul 25 16:07:38 2020 +0200
@@ -115,10 +115,6 @@
 
     writechangesetcopy, writefilecopymeta = _write_copy_meta(repo)
 
-    p1copies, p2copies = None, None
-    if writechangesetcopy:
-        p1copies = ctx.p1copies()
-        p2copies = ctx.p2copies()
     filesadded, filesremoved = None, None
     if ctx.manifestnode():
         # reuse an existing manifest revision
@@ -144,10 +140,9 @@
     files = metadata.ChangingFiles()
     if touched:
         files.update_touched(touched)
-    if p1copies:
-        files.update_copies_from_p1(p1copies)
-    if p2copies:
-        files.update_copies_from_p2(p2copies)
+    if writechangesetcopy:
+        files.update_copies_from_p1(ctx.p1copies())
+        files.update_copies_from_p2(ctx.p2copies())
     if filesadded:
         files.update_added(filesadded)
     if filesremoved: