Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commit.py @ 45662:64a4b85c4a00
salvaged: record salvaged in ChangingFiles at commit time
The new code is a simple but effective way to detect this information. We might
be able to move it inside the various conditionnal above, but I want to focus
on simplicity until we have a full working stack.
It is worth noting that if we record the information in the ChangingFiles
object, it is not persisted yet. This will comes with later changesets.
Differential Revision: https://phab.mercurial-scm.org/D9120
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 14 Sep 2020 23:47:42 +0200 |
parents | 094a91a183f1 |
children | 61454026fa04 |
comparison
equal
deleted
inserted
replaced
45661:ebc14a2ad23d | 45662:64a4b85c4a00 |
---|---|
137 files.update_touched(origfiles) | 137 files.update_touched(origfiles) |
138 | 138 |
139 if writechangesetcopy: | 139 if writechangesetcopy: |
140 files.update_copies_from_p1(ctx.p1copies()) | 140 files.update_copies_from_p1(ctx.p1copies()) |
141 files.update_copies_from_p2(ctx.p2copies()) | 141 files.update_copies_from_p2(ctx.p2copies()) |
142 | |
143 copy_sd = ctx.repo().filecopiesmode == b'changeset-sidedata' | |
144 if copy_sd and len(ctx.parents()) > 1: | |
145 # XXX this `mergestate.read` could be duplicated with a the merge state | |
146 # reading in _process_files So we could refactor further to reuse it in | |
147 # some cases. | |
148 ms = mergestate.mergestate.read(repo) | |
149 if ms.active(): | |
150 for fname in sorted(ms._stateextras.keys()): | |
151 might_removed = ms.extras(fname).get(b'merge-removal-candidate') | |
152 if might_removed == b'yes': | |
153 if fname in ctx: | |
154 files.mark_salvaged(fname) | |
142 | 155 |
143 return mn, files | 156 return mn, files |
144 | 157 |
145 | 158 |
146 def _process_files(tr, ctx, error=False): | 159 def _process_files(tr, ctx, error=False): |