changeset 3779:084038b98cd7 stable

next: bail out early in `hg next --evolve` if dirty wdir This patch adds logic to bail out early when --evolve is passed with next command and the working directory is dirty. This will help us in preventing the message saying `do you want --merge` which is useless and misleading when `--evolve` is passed.
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 03 Jun 2018 02:26:19 +0530
parents 1bf0d353f999
children 9da11755d615
files hgext3rd/evolve/__init__.py tests/test-prev-next.t
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Sun Jun 03 02:24:28 2018 +0530
+++ b/hgext3rd/evolve/__init__.py	Sun Jun 03 02:26:19 2018 +0530
@@ -1103,6 +1103,11 @@
         wparents = wkctx.parents()
         if len(wparents) != 1:
             raise error.Abort(_('merge in progress'))
+
+        # check for dirty wdir if --evolve is passed
+        if opts['evolve']:
+            cmdutil.bailifchanged(repo)
+
         if not opts['merge']:
             try:
                 cmdutil.bailifchanged(repo)
--- a/tests/test-prev-next.t	Sun Jun 03 02:24:28 2018 +0530
+++ b/tests/test-prev-next.t	Sun Jun 03 02:26:19 2018 +0530
@@ -375,5 +375,4 @@
 
   $ hg next --evolve
   abort: uncommitted changes
-  (do you want --merge?)
   [255]