mercurial/filemerge.py
changeset 34049 6330df9d6393
parent 34036 fe04c018eaac
child 34076 cd38b83bfb23
equal deleted inserted replaced
34048:0e0ac8f09048 34049:6330df9d6393
   339         if premerge == 'keep-merge3':
   339         if premerge == 'keep-merge3':
   340             if not labels:
   340             if not labels:
   341                 labels = _defaultconflictlabels
   341                 labels = _defaultconflictlabels
   342             if len(labels) < 3:
   342             if len(labels) < 3:
   343                 labels.append('base')
   343                 labels.append('base')
   344         r = simplemerge.simplemerge(ui, fcd, fca, fco,
   344         r = simplemerge.simplemerge(ui, fcd, fca, fco, quiet=True, label=labels)
   345                                     quiet=True, label=labels, repo=repo)
       
   346         if not r:
   345         if not r:
   347             ui.debug(" premerge successful\n")
   346             ui.debug(" premerge successful\n")
   348             return 0
   347             return 0
   349         if premerge not in validkeep:
   348         if premerge not in validkeep:
   350             # restore from backup and try again
   349             # restore from backup and try again
   369     files. It will fail if there are any conflicts and leave markers in
   368     files. It will fail if there are any conflicts and leave markers in
   370     the partially merged file. Markers will have two sections, one for each side
   369     the partially merged file. Markers will have two sections, one for each side
   371     of merge, unless mode equals 'union' which suppresses the markers."""
   370     of merge, unless mode equals 'union' which suppresses the markers."""
   372     ui = repo.ui
   371     ui = repo.ui
   373 
   372 
   374     r = simplemerge.simplemerge(ui, fcd, fca, fco,
   373     r = simplemerge.simplemerge(ui, fcd, fca, fco, label=labels, mode=mode)
   375                                 label=labels, mode=mode, repo=repo)
       
   376     return True, r, False
   374     return True, r, False
   377 
   375 
   378 @internaltool('union', fullmerge,
   376 @internaltool('union', fullmerge,
   379               _("warning: conflicts while merging %s! "
   377               _("warning: conflicts while merging %s! "
   380                 "(edit, then use 'hg resolve --mark')\n"),
   378                 "(edit, then use 'hg resolve --mark')\n"),
   421     """
   419     """
   422     Generic driver for _imergelocal and _imergeother
   420     Generic driver for _imergelocal and _imergeother
   423     """
   421     """
   424     assert localorother is not None
   422     assert localorother is not None
   425     tool, toolpath, binary, symlink = toolconf
   423     tool, toolpath, binary, symlink = toolconf
   426     r = simplemerge.simplemerge(repo.ui, fcd, fca, fco,
   424     r = simplemerge.simplemerge(repo.ui, fcd, fca, fco, label=labels,
   427                                 label=labels, localorother=localorother,
   425                                 localorother=localorother)
   428                                 repo=repo)
       
   429     return True, r
   426     return True, r
   430 
   427 
   431 @internaltool('merge-local', mergeonly, precheck=_mergecheck)
   428 @internaltool('merge-local', mergeonly, precheck=_mergecheck)
   432 def _imergelocal(*args, **kwargs):
   429 def _imergelocal(*args, **kwargs):
   433     """
   430     """