Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commit.py @ 45264:39f4ec4039a8
commitctx: move a special case about files earlier
Same logic as a changeset a bit earlier, the `writefilecopymeta` section is more
a post processing details so we move the conditional about `files` value closer
to the rest of the code computing `files` value.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 23 Jul 2020 23:40:59 +0200 |
parents | 0c468fef09b3 |
children | bd7515273fd6 |
comparison
equal
deleted
inserted
replaced
45263:0c468fef09b3 | 45264:39f4ec4039a8 |
---|---|
87 mn, files, added, removed = _process_files(tr, ctx, error=error) | 87 mn, files, added, removed = _process_files(tr, ctx, error=error) |
88 if writechangesetcopy: | 88 if writechangesetcopy: |
89 filesremoved = removed | 89 filesremoved = removed |
90 filesadded = added | 90 filesadded = added |
91 | 91 |
92 if origctx and origctx.manifestnode() == mn: | |
93 files = origctx.files() | |
94 | |
92 if not writefilecopymeta: | 95 if not writefilecopymeta: |
93 # If writing only to changeset extras, use None to indicate that | 96 # If writing only to changeset extras, use None to indicate that |
94 # no entry should be written. If writing to both, write an empty | 97 # no entry should be written. If writing to both, write an empty |
95 # entry to prevent the reader from falling back to reading | 98 # entry to prevent the reader from falling back to reading |
96 # filelogs. | 99 # filelogs. |
97 p1copies = p1copies or None | 100 p1copies = p1copies or None |
98 p2copies = p2copies or None | 101 p2copies = p2copies or None |
99 filesadded = filesadded or None | 102 filesadded = filesadded or None |
100 filesremoved = filesremoved or None | 103 filesremoved = filesremoved or None |
101 | |
102 if origctx and origctx.manifestnode() == mn: | |
103 files = origctx.files() | |
104 | 104 |
105 # update changelog | 105 # update changelog |
106 repo.ui.note(_(b"committing changelog\n")) | 106 repo.ui.note(_(b"committing changelog\n")) |
107 repo.changelog.delayupdate(tr) | 107 repo.changelog.delayupdate(tr) |
108 n = repo.changelog.add( | 108 n = repo.changelog.add( |