changeset 45237:39f4ec4039a8

commitctx: move a special case about files earlier Same logic as a changeset a bit earlier, the `writefilecopymeta` section is more a post processing details so we move the conditional about `files` value closer to the rest of the code computing `files` value.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 23 Jul 2020 23:40:59 +0200
parents 0c468fef09b3
children bd7515273fd6
files mercurial/commit.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commit.py	Thu Jul 23 18:25:45 2020 +0200
+++ b/mercurial/commit.py	Thu Jul 23 23:40:59 2020 +0200
@@ -89,6 +89,9 @@
                 filesremoved = removed
                 filesadded = added
 
+        if origctx and origctx.manifestnode() == mn:
+            files = origctx.files()
+
         if not writefilecopymeta:
             # If writing only to changeset extras, use None to indicate that
             # no entry should be written. If writing to both, write an empty
@@ -99,9 +102,6 @@
             filesadded = filesadded or None
             filesremoved = filesremoved or None
 
-        if origctx and origctx.manifestnode() == mn:
-            files = origctx.files()
-
         # update changelog
         repo.ui.note(_(b"committing changelog\n"))
         repo.changelog.delayupdate(tr)