Patchwork [evolve-ext-V2] evolve: duplicate evolution summary entries (issue5014)

login
register
mail settings
Submitter Laurent Charignon
Date Jan. 4, 2016, 4:40 p.m.
Message ID <172c86b95e80eb8d9656.1451925610@lcharignon-mbp.local>
Download mbox | patch
Permalink /patch/12508/
State Accepted
Delegated to: Pierre-Yves David
Headers show

Comments

Laurent Charignon - Jan. 4, 2016, 4:40 p.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1451925598 28800
#      Mon Jan 04 08:39:58 2016 -0800
# Node ID 172c86b95e80eb8d9656f64a98ba27cfc18085be
# Parent  526253198860fdbdcae01380ae97727195039f44
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.
Pierre-Yves David - Jan. 17, 2016, 6:38 p.m.
On 01/04/2016 08:40 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon@fb.com>
> # Date 1451925598 28800
> #      Mon Jan 04 08:39:58 2016 -0800
> # Node ID 172c86b95e80eb8d9656f64a98ba27cfc18085be
> # Parent  526253198860fdbdcae01380ae97727195039f44
> 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.

Applied to main, dropping the test changes.

That test changes highlighted an (already fixed) issue with the 
pluralization in core (core gave using pluralization)

Thanks,

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -765,12 +765,17 @@  def summaryhook(ui, repo):
         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):
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -390,7 +390,7 @@  Test rollback support
   commit: 1 deleted, 2 unknown (clean)
   update: 2 new changesets, 2 branch heads (merge)
   phases: 4 draft
-  unstable: 1 changesets
+  unstable: 1 changeset
   $ qlog
   6
   - 909a0fb57e5d
@@ -664,7 +664,7 @@  Check divergence detection (note: multip
   commit: (clean)
   update: (2|9|11) new changesets, (3|9|10) branch heads \(merge\) (re)
   phases: 3 draft
-  bumped: 1 changesets
+  bumped: 1 changeset
   $ hg debugobsolete `getid a7a6f2b5d8a5` `getid 50f11e5e3a63`
   $ hg log -r 'divergent()'
   changeset:   12:6db5e282cb91