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.
--- 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]