357 ) |
357 ) |
358 |
358 |
359 elif fparent1 == nullid: |
359 elif fparent1 == nullid: |
360 fparent1, fparent2 = fparent2, nullid |
360 fparent1, fparent2 = fparent2, nullid |
361 elif fparent2 != nullid: |
361 elif fparent2 != nullid: |
|
362 if ms.active() and ms.extras(fname).get(b'filenode-source') == b'other': |
|
363 fparent1, fparent2 = fparent2, nullid |
362 # is one parent an ancestor of the other? |
364 # is one parent an ancestor of the other? |
363 fparentancestors = flog.commonancestorsheads(fparent1, fparent2) |
365 else: |
364 if fparent1 in fparentancestors: |
366 fparentancestors = flog.commonancestorsheads(fparent1, fparent2) |
365 fparent1, fparent2 = fparent2, nullid |
367 if fparent1 in fparentancestors: |
366 elif fparent2 in fparentancestors: |
|
367 fparent2 = nullid |
|
368 elif not fparentancestors: |
|
369 # TODO: this whole if-else might be simplified much more |
|
370 if ( |
|
371 ms.active() |
|
372 and ms.extras(fname).get(b'filenode-source') == b'other' |
|
373 ): |
|
374 fparent1, fparent2 = fparent2, nullid |
368 fparent1, fparent2 = fparent2, nullid |
|
369 elif fparent2 in fparentancestors: |
|
370 fparent2 = nullid |
375 |
371 |
376 force_new_node = False |
372 force_new_node = False |
377 # The file might have been deleted by merge code and user explicitly choose |
373 # The file might have been deleted by merge code and user explicitly choose |
378 # to revert the file and keep it. The other case can be where there is |
374 # to revert the file and keep it. The other case can be where there is |
379 # change-delete or delete-change conflict and user explicitly choose to keep |
375 # change-delete or delete-change conflict and user explicitly choose to keep |