D8704: commitctx: more filesremoved assignment closer to removed computation

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Jul 8 08:38:42 UTC 2020


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8704

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3177,6 +3177,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:
@@ -3207,9 +3210,6 @@
                         drop,
                         match=self.narrowmatch(),
                     )
-
-                    if writechangesetcopy:
-                        filesremoved = removed
                 else:
                     self.ui.debug(
                         b'reusing manifest from p1 (listed files '



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list