obsolete: add obsolete data to summary.
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 23 Aug 2012 12:23:34 +0200
changeset 479 b63da0fb8ee5
parent 478 13ccb68b728d
child 480 cd1d5b7308be
obsolete: add obsolete data to summary.
README
hgext/obsolete.py
tests/test-obsolete.t
--- a/README	Thu Aug 23 12:23:00 2012 +0200
+++ b/README	Thu Aug 23 12:23:34 2012 +0200
@@ -51,6 +51,7 @@
 - stabilize get a --continue switch
 - merge and update ignore extinct changeset in most case.
 - new "troubled()" revset
+- summary now reports troubles changesets
 
 - rebase refuse to work on public changeset again
 - rebase explicitly state that there is nothing to rebase because everything is
--- 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                                   ###
 #####################################################################
--- a/tests/test-obsolete.t	Thu Aug 23 12:23:00 2012 +0200
+++ b/tests/test-obsolete.t	Thu Aug 23 12:23:34 2012 +0200
@@ -375,6 +375,8 @@
   branch: default
   commit: 1 deleted, 2 unknown (clean)
   update: 4 new changesets, 4 branch heads (merge)
+  unstable: 1 changesets
+  conflicting: 1 changesets
   $ qlog
   6
   - 909a0fb57e5d
@@ -631,6 +633,7 @@
   branch: default
   commit: (clean)
   update: 9 new changesets, 9 branch heads (merge)
+  latecomer: 1 changesets
   $ hg debugobsolete `getid a7a6f2b5d8a5` `getid 50f11e5e3a63`
   $ hg log -r 'conflicting()'
   changeset:   14:50f11e5e3a63