evolve: fix the code flow pattern of solving obswdir par and troubled revs
authorSushil khanchi <sushilkhanchi97@gmail.com>
Sun, 16 Jun 2019 23:39:55 +0530
changeset 4695 4c9f9dac8977
parent 4694 b6a7d2594ff3
child 4696 7ac40b4ea24c
evolve: fix the code flow pattern of solving obswdir par and troubled revs Now we will go to _handlenotrouble() (which prints messages about no revs to solve) only when there is no troubled revs and working dir parent is not obsolete. This change also saves us from an issue which was about looking into the revset (smartset contains troubled revs to solve) when a rev from the revset gets hidden. This happens in the case when our wdir parent is obsolete. After resolving obswdir parent we were looking into the revset to check if there is any troubled revs to solve but we should have performed this check before performing the obswdir resolution. Changes in test file reflect this fixed behaviour.
CHANGELOG
hgext3rd/evolve/evolvecmd.py
tests/test-evolve-topic.t
--- a/CHANGELOG	Sun Jun 09 12:07:08 2019 +0530
+++ b/CHANGELOG	Sun Jun 16 23:39:55 2019 +0530
@@ -6,6 +6,7 @@
 
   * evolve: use the same wording as core in case of unresolved conflict
   * evolve: minor output message improvements
+  * evolve: improve `hg evolve --all` behavior when "." is obsolete
 
 9.0.0 -- 2019-06-06
 -------------------
--- a/hgext3rd/evolve/evolvecmd.py	Sun Jun 09 12:07:08 2019 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Sun Jun 16 23:39:55 2019 +0530
@@ -1678,20 +1678,20 @@
     else:
         cmdutil.bailifchanged(repo)
 
+        obswdir = repo['.'].obsolete()
         revs = _selectrevs(repo, allopt, revopt, anyopt, targetcat)
 
-        hadobswdp = False
-        if repo['.'].obsolete():
-            hadobswdp = True
+        if not (revs or obswdir):
+            return _handlenotrouble(ui, repo, allopt, revopt, anyopt, targetcat)
+        obswdironly = not revs and obswdir
+
+        if obswdir:
             result = solveobswdp(ui, repo, opts)
             if result != 0 or result is True:
                 # return as solving obswdp wasn't successful
                 return result
-
-        if not revs:
-            if hadobswdp:
-                return 0
-            return _handlenotrouble(ui, repo, allopt, revopt, anyopt, targetcat)
+        if obswdironly:
+            return 0
 
         # Progress handling
         seen = 1
--- a/tests/test-evolve-topic.t	Sun Jun 09 12:07:08 2019 +0530
+++ b/tests/test-evolve-topic.t	Sun Jun 16 23:39:55 2019 +0530
@@ -458,5 +458,3 @@
   switching to topic bar
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   working directory is now at 2c295936ac04
-  abort: filtered revision '3'!
-  [255]