[Request] [+ ] D8703: commitctx: compute files added from _filecommit returns

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


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

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(



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200708/e19a53a0/attachment.html>


More information about the Mercurial-patches mailing list