changeset 3845:5c964ebe4d4b

evolve: always order the revs to be evolved The current code only order the revs if we are resolving orphans and not in other case. The ordering is important when we pass --all and tackle multiple occurence of the same instability. Let's order the revs for each instability. There are enough test coverage of phase-divergence and content-divergence that I feel confident doing it because none of the test changed. The change in test-evolve-content-divergent.t demonstrates the indeed ordering helped.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 12 Jun 2018 23:20:54 +0530
parents 48fbccfd1dff
children f9dad99a90d5
files hgext3rd/evolve/evolvecmd.py tests/test-evolve-content-divergence.t
diffstat 2 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Tue Jun 12 21:13:02 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Tue Jun 12 23:20:54 2018 +0530
@@ -1452,8 +1452,7 @@
         # For the progress bar to show
         count = len(revs)
         # Order the revisions
-        if targetcat == 'orphan':
-            revs = _orderrevs(repo, revs)
+        revs = _orderrevs(repo, revs)
 
         # cbor does not know how to serialize sets, using list for skippedrevs
         stateopts = {'category': targetcat, 'replacements': {},
--- a/tests/test-evolve-content-divergence.t	Tue Jun 12 21:13:02 2018 +0530
+++ b/tests/test-evolve-content-divergence.t	Tue Jun 12 23:20:54 2018 +0530
@@ -868,14 +868,6 @@
 
 XXX: we are not resolving divergence in the correct order here
   $ hg evolve --all --content-divergent
-  skipping c72d2885eb51: have a different parent than 513e3267034e (not handled yet)
-  | c72d2885eb51, 513e3267034e are not based on the same changeset.
-  | With the current state of its implementation, 
-  | evolve does not work in that case.
-  | rebase one of them next to the other and run 
-  | this command again.
-  | - either: hg rebase --dest 'p1(c72d2885eb51)' -r 513e3267034e
-  | - or:     hg rebase --dest 'p1(513e3267034e)' -r c72d2885eb51
   merge:[5] watbar to a
   with: [9] watbar to a
   base: [1] added a
@@ -910,6 +902,14 @@
   | this command again.
   | - either: hg rebase --dest 'p1(3ce4be6d8e5e)' -r accb7a2b6ae9
   | - or:     hg rebase --dest 'p1(accb7a2b6ae9)' -r 3ce4be6d8e5e
+  skipping c72d2885eb51: have a different parent than 513e3267034e (not handled yet)
+  | c72d2885eb51, 513e3267034e are not based on the same changeset.
+  | With the current state of its implementation, 
+  | evolve does not work in that case.
+  | rebase one of them next to the other and run 
+  | this command again.
+  | - either: hg rebase --dest 'p1(c72d2885eb51)' -r 513e3267034e
+  | - or:     hg rebase --dest 'p1(513e3267034e)' -r c72d2885eb51
   working directory is now at df46e196f3c4
 
   $ hg glog