[PATCH 1 of 5 evolve-ext] evolve: don't use python sets on top of revset for evolve --rev

Laurent Charignon lcharignon at fb.com
Wed May 13 17:04:19 UTC 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1431532991 25200
#      Wed May 13 09:03:11 2015 -0700
# Node ID 08577d19560731490ddf3446ebe785ce3219b52a
# Parent  5e82d78f5872c9503d7b6691c594a13794a9b4a4
evolve: don't use python sets on top of revset for evolve --rev

In --rev we were wrapping the revsets in python sets.
This is wrong as the use python sets force the wrapper revision set to be
computed earlier than it has to and have no order guarantee.
Removing this wrapping changes a test because the ordering does not appear to
be the same but the end result is the same.

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -1303,20 +1303,16 @@
         return graftcmd(ui, repo, old_obsolete=True, **{'continue': True})
     # Rev specified on the commands line
     if revopt:
-        revs = set(repo.revs(revopt))
-        troubled = set(repo.revs('troubled()'))
+        revs = repo.revs(revopt)
+        troubled = repo.revs('troubled()')
         _revs = revs & troubled
         if not _revs:
             ui.write_err("No troubled changes in the specified revset")
         else:
-            # For the progress bar to show
-            count = len(_revs)
             for rev in _revs:
-                progresscb()
                 _solveone(ui, repo, repo[rev], dryrunopt, confirmopt, 
                         progresscb)
                 seen += 1
-            progresscb()
             _cleanup(ui, repo, startnode, showprogress)
             return
     nexttrouble = _picknexttroubled(ui, repo, anyopt or allopt)
diff --git a/tests/test-evolve.t b/tests/test-evolve.t
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -1002,15 +1002,15 @@
   o  0	: a0 - test
   
   $ hg evolve --rev "14::"
+  move:[15] add gg
+  atop:[18] a3
   move:[16] add gh
   atop:[18] a3
-  move:[15] add gg
-  atop:[18] a3
-  working directory is now at 10ffdd7e3cc9
+  working directory is now at db3d894869b0
   $ hg glog
-  @  20	: add gg - test
+  @  20	: add gh - test
   |
-  | o  19	: add gh - test
+  | o  19	: add gg - test
   |/
   o  18	: a3 - test
   |


More information about the Mercurial-devel mailing list