evolve: make sure user can recover from conflict (issue6053) stable
authorSushil khanchi <sushilkhanchi97@gmail.com>
Mon, 04 Mar 2019 03:16:51 +0530
branchstable
changeset 4420 6a20e0e9b957
parent 4419 1fdecdfd0df9
child 4421 a56caab87e37
evolve: make sure user can recover from conflict (issue6053) we make sure while continuing interrupted evolve it reach to right code This patch fix the issue6053 which is about falling evolve into unrecoverable state and this is how it call fall into it: If after some rewrite operations we reach to a point where resparent for two content divergent csets is obsolete and we hit a conflict in relocation, so now if you run `hg evolve --continue` after resolving the conflict: code execution would check if wdir parent is obsolete and run solveobswdp() rather than going to continueevolve() part and there we will hit by a "abort: outstanding uncommitted merge" And same for `--abort` or `--stop` flags. Changes in tests reflect the fixed behaviour.
hgext3rd/evolve/evolvecmd.py
tests/test-evolve-content-divergence.t
--- a/hgext3rd/evolve/evolvecmd.py	Mon Mar 04 02:55:38 2019 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Mon Mar 04 03:16:51 2019 +0530
@@ -1473,12 +1473,13 @@
         return
 
     targetcat = 'orphan'
+    has_some_opts = bool(revopt or anyopt or allopt or contopt or stopopt or abortopt)
     if 1 < len(specifiedcategories):
         msg = _('cannot specify more than one trouble category to solve (yet)')
         raise error.Abort(msg)
     elif len(specifiedcategories) == 1:
         targetcat = specifiedcategories[0]
-    elif repo['.'].obsolete() and not(revopt or anyopt or allopt):
+    elif repo['.'].obsolete() and not has_some_opts:
         # if no args and parent is obsolete, update to successors
         return solveobswdp(ui, repo, opts)
 
--- a/tests/test-evolve-content-divergence.t	Mon Mar 04 02:55:38 2019 +0530
+++ b/tests/test-evolve-content-divergence.t	Mon Mar 04 03:16:51 2019 +0530
@@ -929,8 +929,8 @@
       () [default] draft
 
 
-Test which demonstrate that evolve can fall into unrecoverable state (issue6053):
----------------------------------------------------------------------------------
+Test to make sure that evolve don't fall into unrecoverable state (issue6053):
+------------------------------------------------------------------------------
   $ cd ..
   $ hg init localside
   $ cd localside
@@ -1016,17 +1016,13 @@
   continue: hg evolve --continue
 
   $ hg evolve --continue
-  update:[2] added c
-  abort: outstanding uncommitted merge
-  [255]
+  evolving 6:de4ea3103326 "updated e"
+  updating to "local" side of the conflict: ff6f7cd76a7c
+  merging "other" content-divergent changeset 'e504bd82de7e'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  working directory is now at 83b1664a580f
 
-  $ hg evolve --abort
-  update:[2] added c
-  abort: outstanding uncommitted merge
-  [255]
-
-  $ hg ci -m "merge commit"
-  abort: evolve in progress
-  (use 'hg evolve --continue' or 'hg evolve --abort' to abort)
-  [255]
-
+  $ hg glog -l1
+  @  8:83b1664a580f updated e
+  |   () [default] draft
+  ~