Patchwork D8706: commitctx: rename "changed" to touched

login
register
mail settings
Submitter phabricator
Date July 8, 2020, 8:38 a.m.
Message ID <differential-rev-PHID-DREV-oahaowznuwtvhirfqfai-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46663/
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
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8706

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
@@ -3134,8 +3134,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)
@@ -3151,7 +3151,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())
@@ -3180,7 +3180,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,