# HG changeset patch # User Bryan O'Sullivan # Date 1368555798 25200 # Node ID f184fe1e2ac5cd57f59be624a3d1576b2d11f5f7 # Parent 0250047a365e7419026dca811cd3a8f1aafd56ad summary: add a histedit hook diff -r 0250047a365e -r f184fe1e2ac5 hgext/color.py --- a/hgext/color.py Tue May 14 11:23:17 2013 -0700 +++ b/hgext/color.py Tue May 14 11:23:18 2013 -0700 @@ -63,6 +63,8 @@ rebase.rebased = blue rebase.remaining = red bold + histedit.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 @@ -251,6 +253,7 @@ 'diff.trailingwhitespace': 'bold red_background', 'diffstat.deleted': 'red', 'diffstat.inserted': 'green', + 'histedit.remaining': 'red bold', 'ui.prompt': 'yellow', 'log.changeset': 'yellow', 'rebase.rebased': 'blue', diff -r 0250047a365e -r f184fe1e2ac5 hgext/histedit.py --- a/hgext/histedit.py Tue May 14 11:23:17 2013 -0700 +++ b/hgext/histedit.py Tue May 14 11:23:18 2013 -0700 @@ -856,3 +856,16 @@ repair.strip(ui, repo, c) finally: lockmod.release(lock) + +def summaryhook(ui, repo): + if not os.path.exists(repo.join('histedit-state')): + return + (parentctxnode, rules, keep, topmost, replacements) = readstate(repo) + if rules: + # i18n: column positioning for "hg summary" + ui.write(_('hist: %s (histedit --continue)\n') % + (ui.label(_('%d remaining'), 'histedit.remaining') % + len(rules))) + +def extsetup(ui): + cmdutil.summaryhooks.add('histedit', summaryhook) diff -r 0250047a365e -r f184fe1e2ac5 tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t Tue May 14 11:23:17 2013 -0700 +++ b/tests/test-histedit-edit.t Tue May 14 11:23:18 2013 -0700 @@ -159,6 +159,7 @@ branch: default commit: 1 added (new branch head) update: 1 new changesets (update) + hist: 1 remaining (histedit --continue) $ HGEDITOR='true' hg histedit --continue 0 files updated, 0 files merged, 0 files removed, 0 files unresolved