# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1594067734 -7200
#      Mon Jul 06 22:35:34 2020 +0200
# Node ID 025ee25b5b2302013013232b7708b2965bc862f7
# Parent  6979a20ff004b0f95c62b79359ffbfab75073505
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

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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,