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