changeset 6223:4298ae0b966d stable

evolve: don't update wdir when --dry-run is given (issue6669) What _cleanup() should've been called, perhaps, is _update(). Because it updates working copy to either headnode or a successor of startnode. And yes, it performs an update even when shouldupdate is False. So when --dry-run is given, we should simply avoid calling _cleanup().
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 09 Apr 2022 20:49:43 +0300
parents 9571d40061c8
children 17ffdea0edbb
files CHANGELOG hgext3rd/evolve/evolvecmd.py tests/test-fixup.t
diffstat 3 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG	Thu Apr 07 16:03:29 2022 +0200
+++ b/CHANGELOG	Sat Apr 09 20:49:43 2022 +0300
@@ -4,6 +4,7 @@
 10.5.1 - in progress
 --------------------
 
+  * evolve: avoid updating working copy when --dry-run is given (issue6669)
   * fixup: work correctly with bookmarks
 
 10.5.0 -- 2022-02-23
--- a/hgext3rd/evolve/evolvecmd.py	Thu Apr 07 16:03:29 2022 +0200
+++ b/hgext3rd/evolve/evolvecmd.py	Sat Apr 09 20:49:43 2022 +0300
@@ -1768,7 +1768,8 @@
         if showprogress:
             progress.complete()
 
-    _cleanup(ui, repo, startnode, shouldupdate, headnode)
+    if not dryrunopt:
+        _cleanup(ui, repo, startnode, shouldupdate, headnode)
 
 def _solveonerev(ui, repo, rev, evolvestate, activetopic, dryrunopt, confirmopt,
                  progresscb, targetcat):
--- a/tests/test-fixup.t	Thu Apr 07 16:03:29 2022 +0200
+++ b/tests/test-fixup.t	Sat Apr 09 20:49:43 2022 +0300
@@ -96,6 +96,17 @@
   o  0:e63c23eaa88a foo
       () draft
 
+using --dry-run should only print actions (issue6669)
+
+  $ hg evolve --dry-run
+  update:[5] bar
+
+  $ hg evolve --dry-run --any
+  update:[5] bar
+  move:[2] baz
+  atop:[5] bar
+  hg rebase -r a425495a8e64 -d 2eec5320cfc7
+
   $ hg evolve
   update:[5] bar
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved