diff hgext/obsolete.py @ 479:b63da0fb8ee5

obsolete: add obsolete data to summary.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 23 Aug 2012 12:23:34 +0200
parents 1f8f8dd75d18
children cd1d5b7308be
line wrap: on
line diff
--- 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                                   ###
 #####################################################################