Mercurial > hg-stable
changeset 45229:e64c35dfc6cb
commitctx: compute files added from _filecommit returns
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.
Differential Revision: https://phab.mercurial-scm.org/D8703
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 06 Jul 2020 20:03:30 +0200 |
parents | 509f5b6c0b7e |
children | 6979a20ff004 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Mon Jul 06 19:35:53 2020 +0200 +++ b/mercurial/localrepo.py Mon Jul 06 20:03:30 2020 +0200 @@ -3120,6 +3120,7 @@ # check in files added = [] + filesadded = [] changed = [] removed = list(ctx.removed()) linkrev = len(self) @@ -3138,6 +3139,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( @@ -3193,9 +3196,6 @@ ) if writechangesetcopy: - filesadded = [ - f for f in changed if not (f in m1 or f in m2) - ] filesremoved = removed else: self.ui.debug(