Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commit.py @ 45350:dcbad0f17d76
commitctx: move ChangingFiles creation directly inside `_process_files`
As announced, we move it there. We focus on the signature change first, we will
update the code afterward.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 25 Jul 2020 16:34:02 +0200 |
parents | e52031f5e046 |
children | a852e5058e69 |
comparison
equal
deleted
inserted
replaced
45349:e52031f5e046 | 45350:dcbad0f17d76 |
---|---|
127 elif not ctx.files(): | 127 elif not ctx.files(): |
128 repo.ui.debug(b'reusing manifest from p1 (no file change)\n') | 128 repo.ui.debug(b'reusing manifest from p1 (no file change)\n') |
129 mn = p1.manifestnode() | 129 mn = p1.manifestnode() |
130 files = metadata.ChangingFiles() | 130 files = metadata.ChangingFiles() |
131 else: | 131 else: |
132 mn, touched, added, removed = _process_files(tr, ctx, error=error) | 132 mn, files = _process_files(tr, ctx, error=error) |
133 files = metadata.ChangingFiles() | |
134 files.update_touched(touched) | |
135 if added: | |
136 files.update_added(added) | |
137 if removed: | |
138 files.update_removed(removed) | |
139 | 133 |
140 if origctx and origctx.manifestnode() == mn: | 134 if origctx and origctx.manifestnode() == mn: |
141 origfiles = origctx.files() | 135 origfiles = origctx.files() |
142 assert files.touched.issubset(origfiles) | 136 assert files.touched.issubset(origfiles) |
143 files.update_touched(origfiles) | 137 files.update_touched(origfiles) |
209 touched.extend(removed) | 203 touched.extend(removed) |
210 | 204 |
211 files = touched | 205 files = touched |
212 mn = _commit_manifest(tr, linkrev, ctx, mctx, m, files, added, drop) | 206 mn = _commit_manifest(tr, linkrev, ctx, mctx, m, files, added, drop) |
213 | 207 |
214 return mn, files, filesadded, removed | 208 files = metadata.ChangingFiles( |
209 touched=files, added=filesadded, removed=removed | |
210 ) | |
211 | |
212 return mn, files | |
215 | 213 |
216 | 214 |
217 def _filecommit( | 215 def _filecommit( |
218 repo, fctx, manifest1, manifest2, linkrev, tr, includecopymeta, | 216 repo, fctx, manifest1, manifest2, linkrev, tr, includecopymeta, |
219 ): | 217 ): |