Skip to content
Snippets Groups Projects
Commit 0250047a365e authored by Bryan O'Sullivan's avatar Bryan O'Sullivan
Browse files

summary: indicate if a rebase is underway

parent f324a9b8d4bf
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
tags.normal = green tags.normal = green
tags.local = black bold tags.local = black bold
rebase.rebased = blue
rebase.remaining = red bold
The available effects in terminfo mode are 'blink', 'bold', 'dim', The available effects in terminfo mode are 'blink', 'bold', 'dim',
'inverse', 'invisible', 'italic', 'standout', and 'underline'; in 'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and
...@@ -250,6 +253,8 @@ ...@@ -250,6 +253,8 @@
'diffstat.inserted': 'green', 'diffstat.inserted': 'green',
'ui.prompt': 'yellow', 'ui.prompt': 'yellow',
'log.changeset': 'yellow', 'log.changeset': 'yellow',
'rebase.rebased': 'blue',
'rebase.remaining': 'red bold',
'resolve.resolved': 'green bold', 'resolve.resolved': 'green bold',
'resolve.unresolved': 'red bold', 'resolve.unresolved': 'red bold',
'status.added': 'green bold', 'status.added': 'green bold',
......
...@@ -779,6 +779,17 @@ ...@@ -779,6 +779,17 @@
raise util.Abort(_('--tool can only be used with --rebase')) raise util.Abort(_('--tool can only be used with --rebase'))
orig(ui, repo, *args, **opts) 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): def uisetup(ui):
'Replace pull with a decorator to provide --rebase option' 'Replace pull with a decorator to provide --rebase option'
entry = extensions.wrapcommand(commands.table, 'pull', pullrebase) entry = extensions.wrapcommand(commands.table, 'pull', pullrebase)
...@@ -786,3 +797,4 @@ ...@@ -786,3 +797,4 @@
_("rebase working directory to branch head"))) _("rebase working directory to branch head")))
entry[1].append(('t', 'tool', '', entry[1].append(('t', 'tool', '',
_("specify merge tool for rebase"))) _("specify merge tool for rebase")))
cmdutil.summaryhooks.add('rebase', summaryhook)
...@@ -427,6 +427,7 @@ ...@@ -427,6 +427,7 @@
branch: default branch: default
commit: 1 modified, 1 unresolved (merge) commit: 1 modified, 1 unresolved (merge)
update: (current) update: (current)
rebase: 0 rebased, 1 remaining (rebase --continue)
$ hg resolve -l $ hg resolve -l
U c2 U c2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment