Patchwork [06,of,11] commitctx: move `writechangesetcopy` business at the end a code section

login
register
mail settings
Submitter Pierre-Yves David
Date July 24, 2020, 2:38 p.m.
Message ID <4eeff7ebf46eb591767c.1595601511@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/46873/
State Accepted
Headers show

Comments

Pierre-Yves David - July 24, 2020, 2:38 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1595537909 -7200
#      Thu Jul 23 22:58:29 2020 +0200
# Node ID 4eeff7ebf46eb591767ca79fbceb447b2d3ca17d
# Parent  87553bac39d2fec8dd7b23b44152ec89bcb2f74d
# EXP-Topic commitctx-cleanup-2
# Available At https://foss.heptapod.net/octobus/mercurial-devel/
#              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r 4eeff7ebf46e
commitctx: move `writechangesetcopy` business at the end a code section

This code is to handle a specific subcase so we move it a the end. This allow to gather the rest of the "core" code closer to the related logic.

Patch

diff --git a/mercurial/commit.py b/mercurial/commit.py
--- a/mercurial/commit.py
+++ b/mercurial/commit.py
@@ -138,12 +138,12 @@  def commitctx(repo, ctx, error=False, or
 
             touched.extend(removed)
 
+            files = touched
+            mn = _commit_manifest(tr, linkrev, ctx, mctx, files, added, drop)
+
             if writechangesetcopy:
                 filesremoved = removed
 
-            files = touched
-            mn = _commit_manifest(tr, linkrev, ctx, mctx, files, added, drop)
-
         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