mercurial/filemerge.py
changeset 48577 62682662346c
parent 48576 1a84758b4fca
child 48578 77e24ee8994b
equal deleted inserted replaced
48576:1a84758b4fca 48577:62682662346c
   397         return filectx.changectx()[filectx.path()]
   397         return filectx.changectx()[filectx.path()]
   398     else:
   398     else:
   399         return filectx
   399         return filectx
   400 
   400 
   401 
   401 
   402 def _premerge(repo, fcd, fco, fca, toolconf, backup, labels=None):
   402 def _premerge(repo, fcd, fco, fca, toolconf, backup, labels):
   403     tool, toolpath, binary, symlink, scriptfn = toolconf
   403     tool, toolpath, binary, symlink, scriptfn = toolconf
   404     if symlink or fcd.isabsent() or fco.isabsent():
   404     if symlink or fcd.isabsent() or fco.isabsent():
   405         return 1
   405         return 1
   406 
   406 
   407     ui = repo.ui
   407     ui = repo.ui
   419                 _(b"%s.premerge not valid ('%s' is neither boolean nor %s)")
   419                 _(b"%s.premerge not valid ('%s' is neither boolean nor %s)")
   420                 % (tool, premerge, _valid)
   420                 % (tool, premerge, _valid)
   421             )
   421             )
   422 
   422 
   423     if premerge:
   423     if premerge:
   424         if not labels:
       
   425             labels = _defaultconflictlabels
       
   426         if len(labels) < 3:
   424         if len(labels) < 3:
   427             labels.append(b'base')
   425             labels.append(b'base')
   428         mode = b'merge'
   426         mode = b'merge'
   429         if premerge == b'keep-mergediff':
   427         if premerge == b'keep-mergediff':
   430             mode = b'mergediff'
   428             mode = b'mergediff'