changeset 788:e973dd5bf583

evolve: register a summary hook instead of wrapping the summary command
author Simon Heimberg <simohe@besonet.ch>
date Fri, 07 Feb 2014 09:36:42 +0100
parents a9277d11db47
children 0d2bb0282e78
files hgext/evolve.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/evolve.py	Wed Jan 22 14:30:45 2014 -0800
+++ b/hgext/evolve.py	Fri Feb 07 09:36:42 2014 +0100
@@ -621,8 +621,7 @@
             return result
     repo.__class__ = evolvingrepo
 
-@eh.wrapcommand("summary")
-def obssummary(orig, ui, repo, *args, **kwargs):
+def summaryhook(ui, repo):
     def write(fmt, count):
         s = fmt % count
         if count:
@@ -630,14 +629,16 @@
         else:
             ui.note(s)
 
-    ret = orig(ui, repo, *args, **kwargs)
     nbunstable = len(getrevs(repo, 'unstable'))
     nbbumped = len(getrevs(repo, 'bumped'))
     nbdivergent = len(getrevs(repo, 'divergent'))
     write('unstable: %i changesets\n', nbunstable)
     write('bumped: %i changesets\n', nbbumped)
     write('divergent: %i changesets\n', nbdivergent)
-    return ret
+
+@eh.extsetup
+def obssummarysetup(ui):
+    cmdutil.summaryhooks.add('evolve', summaryhook)
 
 
 #####################################################################