mercurial/filemerge.py
changeset 49956 2282d8ac0fa9
parent 49845 e0c0545e2e55
child 50920 c642c03969ff
equal deleted inserted replaced
49954:a11237723332 49956:2282d8ac0fa9
   476 
   476 
   477 def _merge(repo, local, other, base, mode):
   477 def _merge(repo, local, other, base, mode):
   478     """
   478     """
   479     Uses the internal non-interactive simple merge algorithm for merging
   479     Uses the internal non-interactive simple merge algorithm for merging
   480     files. It will fail if there are any conflicts and leave markers in
   480     files. It will fail if there are any conflicts and leave markers in
   481     the partially merged file. Markers will have two sections, one for each side
   481     the partially merged file. Markers will have two sections, one for each
   482     of merge, unless mode equals 'union' which suppresses the markers."""
   482     side of merge, unless mode equals 'union' or 'union-other-first' which
       
   483     suppresses the markers."""
   483     ui = repo.ui
   484     ui = repo.ui
   484 
   485 
   485     try:
   486     try:
   486         _verifytext(local, ui)
   487         _verifytext(local, ui)
   487         _verifytext(base, ui)
   488         _verifytext(base, ui)
   508     precheck=_mergecheck,
   509     precheck=_mergecheck,
   509 )
   510 )
   510 def _iunion(repo, mynode, local, other, base, toolconf, backup):
   511 def _iunion(repo, mynode, local, other, base, toolconf, backup):
   511     """
   512     """
   512     Uses the internal non-interactive simple merge algorithm for merging
   513     Uses the internal non-interactive simple merge algorithm for merging
   513     files. It will use both left and right sides for conflict regions.
   514     files. It will use both local and other sides for conflict regions by
       
   515     adding local on top of other.
   514     No markers are inserted."""
   516     No markers are inserted."""
   515     return _merge(repo, local, other, base, b'union')
   517     return _merge(repo, local, other, base, b'union')
       
   518 
       
   519 
       
   520 @internaltool(
       
   521     b'union-other-first',
       
   522     fullmerge,
       
   523     _(
       
   524         b"warning: conflicts while merging %s! "
       
   525         b"(edit, then use 'hg resolve --mark')\n"
       
   526     ),
       
   527     precheck=_mergecheck,
       
   528 )
       
   529 def _iunion_other_first(repo, mynode, local, other, base, toolconf, backup):
       
   530     """
       
   531     Like :union, but add other on top of local."""
       
   532     return _merge(repo, local, other, base, b'union-other-first')
   516 
   533 
   517 
   534 
   518 @internaltool(
   535 @internaltool(
   519     b'merge',
   536     b'merge',
   520     fullmerge,
   537     fullmerge,