next: improve the message for dirty working copy with --evolve
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 10 Nov 2018 16:05:34 +0100
changeset 4240 323b3dac5bba
parent 4239 7e274734cc2c
child 4241 df22f010cf24
next: improve the message for dirty working copy with --evolve This will be important soon when --evolve will be the default.
hgext3rd/evolve/__init__.py
tests/test-prev-next.t
--- a/hgext3rd/evolve/__init__.py	Sat Nov 10 16:01:31 2018 +0100
+++ b/hgext3rd/evolve/__init__.py	Sat Nov 10 16:05:34 2018 +0100
@@ -1130,7 +1130,8 @@
 
         # check for dirty wdir if --evolve is passed
         if opts['evolve']:
-            cmdutil.bailifchanged(repo)
+            hint = _('use `hg amend`, `hg revert` or `hg shelve`')
+            cmdutil.bailifchanged(repo, hint=hint)
 
         children = [ctx for ctx in wparents[0].children() if not ctx.obsolete()]
         topic = _getcurrenttopic(repo)
--- a/tests/test-prev-next.t	Sat Nov 10 16:01:31 2018 +0100
+++ b/tests/test-prev-next.t	Sat Nov 10 16:05:34 2018 +0100
@@ -375,6 +375,7 @@
 
   $ hg next --evolve
   abort: uncommitted changes
+  (use `hg amend`, `hg revert` or `hg shelve`)
   [255]
 
   $ cd ..