hgext/rebase.py
changeset 13856 0995eee8ffe4
parent 13778 46c3043253fb
child 13875 ff3c683eb8ff
equal deleted inserted replaced
13855:3c43dd85d3d1 13856:0995eee8ffe4
   112             if detachf:
   112             if detachf:
   113                 raise util.Abort(_('cannot use detach with continue or abort'))
   113                 raise util.Abort(_('cannot use detach with continue or abort'))
   114             if srcf or basef or destf:
   114             if srcf or basef or destf:
   115                 raise util.Abort(
   115                 raise util.Abort(
   116                     _('abort and continue do not allow specifying revisions'))
   116                     _('abort and continue do not allow specifying revisions'))
       
   117             if opts.get('tool', False):
       
   118                 ui.warn(_('tool option will be ignored\n'))
   117 
   119 
   118             (originalwd, target, state, skipped, collapsef, keepf,
   120             (originalwd, target, state, skipped, collapsef, keepf,
   119                                 keepbranchesf, external) = restorestatus(repo)
   121                                 keepbranchesf, external) = restorestatus(repo)
   120             if abortf:
   122             if abortf:
   121                 return abort(repo, originalwd, target, state)
   123                 return abort(repo, originalwd, target, state)
   165                 p1, p2 = defineparents(repo, rev, target, state,
   167                 p1, p2 = defineparents(repo, rev, target, state,
   166                                                         targetancestors)
   168                                                         targetancestors)
   167                 if len(repo.parents()) == 2:
   169                 if len(repo.parents()) == 2:
   168                     repo.ui.debug('resuming interrupted rebase\n')
   170                     repo.ui.debug('resuming interrupted rebase\n')
   169                 else:
   171                 else:
   170                     stats = rebasenode(repo, rev, p1, p2, state)
   172                     try:
   171                     if stats and stats[3] > 0:
   173                         ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
   172                         raise util.Abort(_('unresolved conflicts (see hg '
   174                         stats = rebasenode(repo, rev, p1, p2, state)
   173                                     'resolve, then hg rebase --continue)'))
   175                         if stats and stats[3] > 0:
       
   176                             raise util.Abort(_('unresolved conflicts (see hg '
       
   177                                         'resolve, then hg rebase --continue)'))
       
   178                     finally:
       
   179                         ui.setconfig('ui', 'forcemerge', '')
   174                 updatedirstate(repo, rev, target, p2)
   180                 updatedirstate(repo, rev, target, p2)
   175                 if not collapsef:
   181                 if not collapsef:
   176                     newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn)
   182                     newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn)
   177                 else:
   183                 else:
   178                     # Skip commit if we are collapsing
   184                     # Skip commit if we are collapsing
   590          _('read collapse commit message from file'), _('FILE')),
   596          _('read collapse commit message from file'), _('FILE')),
   591         ('', 'keep', False, _('keep original changesets')),
   597         ('', 'keep', False, _('keep original changesets')),
   592         ('', 'keepbranches', False, _('keep original branch names')),
   598         ('', 'keepbranches', False, _('keep original branch names')),
   593         ('', 'detach', False, _('force detaching of source from its original '
   599         ('', 'detach', False, _('force detaching of source from its original '
   594                                 'branch')),
   600                                 'branch')),
       
   601         ('t', 'tool', '', _('specify merge tool')),
   595         ('c', 'continue', False, _('continue an interrupted rebase')),
   602         ('c', 'continue', False, _('continue an interrupted rebase')),
   596         ('a', 'abort', False, _('abort an interrupted rebase'))] +
   603         ('a', 'abort', False, _('abort an interrupted rebase'))] +
   597          templateopts,
   604          templateopts,
   598         _('hg rebase [-s REV | -b REV] [-d REV] [options]\n'
   605         _('hg rebase [-s REV | -b REV] [-d REV] [options]\n'
   599           'hg rebase {-a|-c}'))
   606           'hg rebase {-a|-c}'))