hgext/rebase.py
changeset 19214 0250047a365e
parent 19059 53eadcb814fd
child 19398 f7bcc2e56279
equal deleted inserted replaced
19213:f324a9b8d4bf 19214:0250047a365e
   777     else:
   777     else:
   778         if opts.get('tool'):
   778         if opts.get('tool'):
   779             raise util.Abort(_('--tool can only be used with --rebase'))
   779             raise util.Abort(_('--tool can only be used with --rebase'))
   780         orig(ui, repo, *args, **opts)
   780         orig(ui, repo, *args, **opts)
   781 
   781 
       
   782 def summaryhook(ui, repo):
       
   783     if not os.path.exists(repo.join('rebasestate')):
       
   784         return
       
   785     state = restorestatus(repo)[2]
       
   786     numrebased = len([i for i in state.itervalues() if i != -1])
       
   787     # i18n: column positioning for "hg summary"
       
   788     ui.write(_('rebase: %s, %s (rebase --continue)\n') %
       
   789              (ui.label(_('%d rebased'), 'rebase.rebased') % numrebased,
       
   790               ui.label(_('%d remaining'), 'rebase.remaining') %
       
   791               (len(state) - numrebased)))
       
   792 
   782 def uisetup(ui):
   793 def uisetup(ui):
   783     'Replace pull with a decorator to provide --rebase option'
   794     'Replace pull with a decorator to provide --rebase option'
   784     entry = extensions.wrapcommand(commands.table, 'pull', pullrebase)
   795     entry = extensions.wrapcommand(commands.table, 'pull', pullrebase)
   785     entry[1].append(('', 'rebase', None,
   796     entry[1].append(('', 'rebase', None,
   786                      _("rebase working directory to branch head")))
   797                      _("rebase working directory to branch head")))
   787     entry[1].append(('t', 'tool', '',
   798     entry[1].append(('t', 'tool', '',
   788                      _("specify merge tool for rebase")))
   799                      _("specify merge tool for rebase")))
       
   800     cmdutil.summaryhooks.add('rebase', summaryhook)