evolve: duplicate evolution summary entries (issue5014)
authorLaurent Charignon <lcharignon@fb.com>
Mon, 04 Jan 2016 08:39:58 -0800
changeset 1580 b915e0d54db0
parent 1579 4f83b2d2d20d
child 1581 54f75dc48887
evolve: duplicate evolution summary entries (issue5014) Since we added summary entries for trouble changesets in core we don't need to display it anymore in evolve for the version of hg with the change. Tested with 3.6.1 and 3.6.2.
hgext/evolve.py
--- a/hgext/evolve.py	Sun Jan 03 16:47:57 2016 +0100
+++ b/hgext/evolve.py	Mon Jan 04 08:39:58 2016 -0800
@@ -765,12 +765,17 @@
         else:
             ui.note(s)
 
-    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)
+    # util.versiontuple was introduced in 3.6.2
+    if not util.safehasattr(util, 'versiontuple'):
+        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)
+    else:
+        # In 3.6.2, summary in core gained this feature, no need to display it
+        pass
 
 @eh.extsetup
 def obssummarysetup(ui):