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.
--- 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)