330 ms.active() |
330 ms.active() |
331 and ms.extras(fname).get(b'filenode-source') == b'other' |
331 and ms.extras(fname).get(b'filenode-source') == b'other' |
332 ): |
332 ): |
333 fparent1, fparent2 = fparent2, nullid |
333 fparent1, fparent2 = fparent2, nullid |
334 |
334 |
|
335 force_new_node = False |
|
336 # The file might have been deleted by merge code and user explicitly choose |
|
337 # to revert the file and keep it. The other case can be where there is |
|
338 # change-delete or delete-change conflict and user explicitly choose to keep |
|
339 # the file. The goal is to create a new filenode for users explicit choices |
|
340 if ( |
|
341 repo.ui.configbool(b'experimental', b'merge-track-salvaged') |
|
342 and ms.active() |
|
343 and ms.extras(fname).get(b'merge-removal-candidate') == b'yes' |
|
344 ): |
|
345 force_new_node = True |
335 # is the file changed? |
346 # is the file changed? |
336 text = fctx.data() |
347 text = fctx.data() |
337 if fparent2 != nullid or meta or flog.cmp(fparent1, text): |
348 if fparent2 != nullid or meta or flog.cmp(fparent1, text) or force_new_node: |
338 if touched is None: # do not overwrite added |
349 if touched is None: # do not overwrite added |
339 touched = 'modified' |
350 touched = 'modified' |
340 fnode = flog.add(text, meta, tr, linkrev, fparent1, fparent2) |
351 fnode = flog.add(text, meta, tr, linkrev, fparent1, fparent2) |
341 # are just the flags changed during merge? |
352 # are just the flags changed during merge? |
342 elif fname in manifest1 and manifest1.flags(fname) != fctx.flags(): |
353 elif fname in manifest1 and manifest1.flags(fname) != fctx.flags(): |