changeset 45232:4eb6466e6889

commitctx: no longer use the `writecopiesto` variable in the function The `writefilecopymeta` variable already carry the same information, so we can use `writefilecopymeta` in the one conditional where `writecopiesto` was used.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 23 Jul 2020 21:03:30 +0200
parents f0d4d1343cb4
children ada51c1b6916
files mercurial/commit.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commit.py	Thu Jul 23 14:58:21 2020 +0200
+++ b/mercurial/commit.py	Thu Jul 23 21:03:30 2020 +0200
@@ -47,7 +47,6 @@
     if repo.filecopiesmode == b'changeset-sidedata':
         writechangesetcopy = True
         writefilecopymeta = True
-        writecopiesto = None
     else:
         writecopiesto = repo.ui.config(b'experimental', b'copies.write-to')
         writefilecopymeta = writecopiesto != b'changeset-only'
@@ -134,7 +133,7 @@
             files = touched
             mn = _commit_manifest(tr, linkrev, ctx, mctx, files, added, drop)
 
-        if writecopiesto == b'changeset-only':
+        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
             # entry to prevent the reader from falling back to reading