commitctx: rename "changed" to touched
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 06 Jul 2020 22:35:34 +0200
changeset 45195 025ee25b5b23
parent 45194 6979a20ff004
child 45196 c068e355cd71
commitctx: rename "changed" to touched The variable contains content that are both added and modified. "changed" could be confused with "modified" only, so we pick a less ambiguous naming that will help with more unification. For example, it would make sense to shove the "removed" item in there since this is how the variable is used. 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/D8706
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Tue Jul 07 11:16:28 2020 +0200
+++ b/mercurial/localrepo.py	Mon Jul 06 22:35:34 2020 +0200
@@ -3121,8 +3121,8 @@
                 # check in files
                 added = []
                 filesadded = []
-                changed = []
                 removed = list(ctx.removed())
+                touched = []
                 linkrev = len(self)
                 self.ui.note(_(b"committing files:\n"))
                 uipathfn = scmutil.getuipathfn(self)
@@ -3138,7 +3138,7 @@
                                 fctx, m1, m2, linkrev, trp, writefilecopymeta,
                             )
                             if is_touched:
-                                changed.append(f)
+                                touched.append(f)
                                 if writechangesetcopy and is_touched == 'added':
                                     filesadded.append(f)
                             m.setflag(f, fctx.flags())
@@ -3167,7 +3167,7 @@
                 if writechangesetcopy:
                     filesremoved = removed
 
-                files = changed + removed
+                files = touched + removed
                 md = None
                 if not files:
                     # if no "files" actually changed in terms of the changelog,