changeset 3784:838fc71ddb9c stable

next-prev: replace the error hint to mention about `--merge` flag
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 03 Jun 2018 03:21:25 +0530
parents 313484606461
children adee98706508
files hgext3rd/evolve/__init__.py tests/test-prev-next.t
diffstat 2 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Sun Jun 03 03:13:47 2018 +0530
+++ b/hgext3rd/evolve/__init__.py	Sun Jun 03 03:21:25 2018 +0530
@@ -973,7 +973,12 @@
             repo.ui.write(_('hg bookmark %s -r %s;\n')
                           % (bookmark, target))
     else:
-        ret = hg.updatetotally(repo.ui, repo, target.node(), None)
+        try:
+            ret = hg.updatetotally(repo.ui, repo, target.node(), None)
+        except error.Abort as exc:
+            # replace the hint to mention about --merge option
+            exc.hint = _('do you want --merge?')
+            raise
         if not ret:
             tr = lock = None
             try:
@@ -1208,7 +1213,13 @@
         if shouldmove:
             ui.write(_('hg bookmark %s -r %s;\n') % (bm, children))
     else:
-        ret = hg.updatetotally(ui, repo, children.node(), None)
+        try:
+            ret = hg.updatetotally(ui, repo, children.node(), None)
+        except error.Abort as exc:
+            # replace the hint to mention about --merge option
+            exc.hint = _('do you want --merge?')
+            raise
+
         if not ret:
             lock = tr = None
             try:
--- a/tests/test-prev-next.t	Sun Jun 03 03:13:47 2018 +0530
+++ b/tests/test-prev-next.t	Sun Jun 03 03:21:25 2018 +0530
@@ -425,7 +425,7 @@
   $ echo bar > bar
   $ hg prev
   abort: conflicting changes
-  (commit or update --clean to discard changes)
+  (do you want --merge?)
   [255]
 
   $ echo hi > bar
@@ -437,5 +437,5 @@
 
   $ hg next
   abort: conflicting changes
-  (commit or update --clean to discard changes)
+  (do you want --merge?)
   [255]