Patchwork D8703: commitctx: compute files added from _filecommit returns

login
register
mail settings
Submitter phabricator
Date July 8, 2020, 8:38 a.m.
Message ID <differential-rev-PHID-DREV-t2vuwx5bdwv5xe23ns6x-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46659/
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
  When possible, lets avoid recomputing the same information again.
  
  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/D8703

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
@@ -3133,6 +3133,7 @@ 
 
                 # check in files
                 added = []
+                filesadded = []
                 changed = []
                 removed = list(ctx.removed())
                 linkrev = len(self)
@@ -3151,6 +3152,8 @@ 
                             )
                             if is_touched:
                                 changed.append(f)
+                                if writechangesetcopy and is_touched == 'added':
+                                    filesadded.append(f)
                             m.setflag(f, fctx.flags())
                     except OSError:
                         self.ui.warn(
@@ -3206,9 +3209,6 @@ 
                     )
 
                     if writechangesetcopy:
-                        filesadded = [
-                            f for f in changed if not (f in m1 or f in m2)
-                        ]
                         filesremoved = removed
                 else:
                     self.ui.debug(