Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 45231:025ee25b5b23
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
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 06 Jul 2020 22:35:34 +0200 |
parents | 6979a20ff004 |
children | c068e355cd71 |
comparison
equal
deleted
inserted
replaced
45230:6979a20ff004 | 45231:025ee25b5b23 |
---|---|
3119 m2 = m2ctx.read() | 3119 m2 = m2ctx.read() |
3120 | 3120 |
3121 # check in files | 3121 # check in files |
3122 added = [] | 3122 added = [] |
3123 filesadded = [] | 3123 filesadded = [] |
3124 changed = [] | |
3125 removed = list(ctx.removed()) | 3124 removed = list(ctx.removed()) |
3125 touched = [] | |
3126 linkrev = len(self) | 3126 linkrev = len(self) |
3127 self.ui.note(_(b"committing files:\n")) | 3127 self.ui.note(_(b"committing files:\n")) |
3128 uipathfn = scmutil.getuipathfn(self) | 3128 uipathfn = scmutil.getuipathfn(self) |
3129 for f in sorted(ctx.modified() + ctx.added()): | 3129 for f in sorted(ctx.modified() + ctx.added()): |
3130 self.ui.note(uipathfn(f) + b"\n") | 3130 self.ui.note(uipathfn(f) + b"\n") |
3136 added.append(f) | 3136 added.append(f) |
3137 m[f], is_touched = self._filecommit( | 3137 m[f], is_touched = self._filecommit( |
3138 fctx, m1, m2, linkrev, trp, writefilecopymeta, | 3138 fctx, m1, m2, linkrev, trp, writefilecopymeta, |
3139 ) | 3139 ) |
3140 if is_touched: | 3140 if is_touched: |
3141 changed.append(f) | 3141 touched.append(f) |
3142 if writechangesetcopy and is_touched == 'added': | 3142 if writechangesetcopy and is_touched == 'added': |
3143 filesadded.append(f) | 3143 filesadded.append(f) |
3144 m.setflag(f, fctx.flags()) | 3144 m.setflag(f, fctx.flags()) |
3145 except OSError: | 3145 except OSError: |
3146 self.ui.warn( | 3146 self.ui.warn( |
3165 removed = [f for f in removed if not rf(f)] | 3165 removed = [f for f in removed if not rf(f)] |
3166 | 3166 |
3167 if writechangesetcopy: | 3167 if writechangesetcopy: |
3168 filesremoved = removed | 3168 filesremoved = removed |
3169 | 3169 |
3170 files = changed + removed | 3170 files = touched + removed |
3171 md = None | 3171 md = None |
3172 if not files: | 3172 if not files: |
3173 # if no "files" actually changed in terms of the changelog, | 3173 # if no "files" actually changed in terms of the changelog, |
3174 # try hard to detect unmodified manifest entry so that the | 3174 # try hard to detect unmodified manifest entry so that the |
3175 # exact same commit can be reproduced later on convert. | 3175 # exact same commit can be reproduced later on convert. |