next: bail out early in `hg next --evolve` if dirty wdir stable
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 03 Jun 2018 02:26:19 +0530
branchstable
changeset 3779 084038b98cd7
parent 3778 1bf0d353f999
child 3780 9da11755d615
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.
hgext3rd/evolve/__init__.py
tests/test-prev-next.t
--- 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]