Patchwork D8704: commitctx: more filesremoved assignment closer to removed computation

login
register
mail settings
Submitter phabricator
Date July 8, 2020, 8:38 a.m.
Message ID <differential-rev-PHID-DREV-ltimnheptlthdfmilnk6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46661/
State Superseded
Headers show

Comments

phabricator - July 8, 2020, 8:38 a.m.
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




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

Patch

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 '