# HG changeset patch # User Pierre-Yves David # Date 1594113388 -7200 # Node ID 6979a20ff004b0f95c62b79359ffbfab75073505 # Parent e64c35dfc6cb948f1caafe262453699dab22a530 commitctx: more filesremoved assignment closer to removed computation A small change that makes the code flow clearer. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. We start with easy and small cleanup. Differential Revision: https://phab.mercurial-scm.org/D8704 diff -r e64c35dfc6cb -r 6979a20ff004 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Jul 06 20:03:30 2020 +0200 +++ b/mercurial/localrepo.py Tue Jul 07 11:16:28 2020 +0200 @@ -3164,6 +3164,9 @@ rf = metadata.get_removal_filter(ctx, (p1, p2, m1, m2)) removed = [f for f in removed if not rf(f)] + if writechangesetcopy: + filesremoved = removed + files = changed + removed md = None if not files: @@ -3194,9 +3197,6 @@ drop, match=self.narrowmatch(), ) - - if writechangesetcopy: - filesremoved = removed else: self.ui.debug( b'reusing manifest from p1 (listed files '