diff --git a/hgext/color.py b/hgext/color.py --- a/hgext/color.py +++ b/hgext/color.py @@ -60,6 +60,9 @@ Default effects may be overridden from y tags.normal = green tags.local = black bold + rebase.rebased = blue + rebase.remaining = red bold + The available effects in terminfo mode are 'blink', 'bold', 'dim', 'inverse', 'invisible', 'italic', 'standout', and 'underline'; in ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and @@ -250,6 +253,8 @@ except ImportError: 'diffstat.inserted': 'green', 'ui.prompt': 'yellow', 'log.changeset': 'yellow', + 'rebase.rebased': 'blue', + 'rebase.remaining': 'red bold', 'resolve.resolved': 'green bold', 'resolve.unresolved': 'red bold', 'status.added': 'green bold', diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -779,6 +779,17 @@ def pullrebase(orig, ui, repo, *args, ** raise util.Abort(_('--tool can only be used with --rebase')) orig(ui, repo, *args, **opts) +def summaryhook(ui, repo): + if not os.path.exists(repo.join('rebasestate')): + return + state = restorestatus(repo)[2] + numrebased = len([i for i in state.itervalues() if i != -1]) + # i18n: column positioning for "hg summary" + ui.write(_('rebase: %s, %s (rebase --continue)\n') % + (ui.label(_('%d rebased'), 'rebase.rebased') % numrebased, + ui.label(_('%d remaining'), 'rebase.remaining') % + (len(state) - numrebased))) + def uisetup(ui): 'Replace pull with a decorator to provide --rebase option' entry = extensions.wrapcommand(commands.table, 'pull', pullrebase) @@ -786,3 +797,4 @@ def uisetup(ui): _("rebase working directory to branch head"))) entry[1].append(('t', 'tool', '', _("specify merge tool for rebase"))) + cmdutil.summaryhooks.add('rebase', summaryhook) diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t --- a/tests/test-rebase-parameters.t +++ b/tests/test-rebase-parameters.t @@ -427,6 +427,7 @@ Test --tool parameter: branch: default commit: 1 modified, 1 unresolved (merge) update: (current) + rebase: 0 rebased, 1 remaining (rebase --continue) $ hg resolve -l U c2