hgext/obsolete.py
changeset 479 b63da0fb8ee5
parent 473 1f8f8dd75d18
child 480 cd1d5b7308be
--- a/hgext/obsolete.py	Thu Aug 23 12:23:00 2012 +0200
+++ b/hgext/obsolete.py	Thu Aug 23 12:23:34 2012 +0200
@@ -927,6 +927,27 @@
             return result
     repo.__class__ = stabilizerrepo
 
+@eh.wrapcommand("summary")
+def obssummary(orig, ui, repo, *args, **kwargs):
+    ret = orig(ui, repo, *args, **kwargs)
+    nbunstable = len(getobscache(repo, 'unstable'))
+    nblatecomer = len(getobscache(repo, 'latecomer'))
+    nbconflicting = len(getobscache(repo, 'unstable'))
+    if nbunstable:
+        ui.write('unstable: %i changesets\n' % nbunstable)
+    else:
+        ui.note('unstable: 0 changesets\n')
+    if nblatecomer:
+        ui.write('latecomer: %i changesets\n' % nblatecomer)
+    else:
+        ui.note('latecomer: 0 changesets\n')
+    if nbconflicting:
+        ui.write('conflicting: %i changesets\n' % nbconflicting)
+    else:
+        ui.note('conflicting: 0 changesets\n')
+    return ret
+
+
 #####################################################################
 ### Core Other extension compat                                   ###
 #####################################################################