comparison mercurial/commit.py @ 48746:18e69f224e4b

narrow: add support for merging add and remove outside of the tracked set This extend f1eb77dceb36 to test and support the remaining action. Or, at least, the simple incarnation of them. Differential Revision: https://phab.mercurial-scm.org/D12181
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 03 Feb 2022 18:14:25 +0100
parents f1eb77dceb36
children 6000f5b25c9b
comparison
equal deleted inserted replaced
48745:94e36b230990 48746:18e69f224e4b
209 all_files.sort() 209 all_files.sort()
210 for f in all_files: 210 for f in all_files:
211 repo.ui.note(uipathfn(f) + b"\n") 211 repo.ui.note(uipathfn(f) + b"\n")
212 if f in narrow_files: 212 if f in narrow_files:
213 narrow_action = narrow_files.get(f) 213 narrow_action = narrow_files.get(f)
214 if narrow_action == mergestate.CHANGE_MODIFIED: 214 if narrow_action == mergestate.CHANGE_REMOVED:
215 files.mark_removed(f)
216 removed.append(f)
217 elif narrow_action == mergestate.CHANGE_ADDED:
218 files.mark_added(f)
219 added.append(f)
220 m[f] = m2[f]
221 flags = m2ctx.find(f)[1] or b''
222 m.setflag(f, flags)
223 elif narrow_action == mergestate.CHANGE_MODIFIED:
215 files.mark_touched(f) 224 files.mark_touched(f)
216 added.append(f) 225 added.append(f)
217 m[f] = m2[f] 226 m[f] = m2[f]
218 flags = m2ctx.find(f)[1] or b'' 227 flags = m2ctx.find(f)[1] or b''
219 m.setflag(f, flags) 228 m.setflag(f, flags)