changeset 1689:60752ed8d2d4

prune: suggest --biject in error "hint" When use specify multiple changesets to prune and as successors, we should point them to the right options to confirm there intend.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 02 May 2016 18:40:21 +0200
parents 031682c1faa2
children 52cda77949f5
files hgext/evolve.py tests/test-prune.t
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/evolve.py	Mon May 02 18:24:36 2016 +0200
+++ b/hgext/evolve.py	Mon May 02 18:40:21 2016 +0200
@@ -2518,7 +2518,9 @@
         sucs = tuple(repo[n] for n in sucs)
         if not biject and len(sucs) > 1 and len(precs) > 1:
             msg = "Can't use multiple successors for multiple precursors"
-            raise error.Abort(msg)
+            hint = _("use --biject to mark a series as a replacement"
+                     " for another")
+            raise error.Abort(msg, hint=hint)
         elif biject and len(sucs) != len(precs):
             msg = "Can't use %d successors for %d precursors" \
                 % (len(sucs), len(precs))
--- a/tests/test-prune.t	Mon May 02 18:24:36 2016 +0200
+++ b/tests/test-prune.t	Mon May 02 18:40:21 2016 +0200
@@ -194,6 +194,7 @@
 
   $ hg prune 'desc("add cc")' 'desc("add bb")' -s 'desc("add nD")' -s 'desc("add nC")'
   abort: Can't use multiple successors for multiple precursors
+  (use --biject to mark a series as a replacement for another)
   [255]
   $ hg debugobsolete
   9d206ffc875e1bc304590549be293be36821e66c 0 {47d2a3944de8b013de3be9578e8e344ea2e6c097} (Sat Dec 15 00:00:00 1979 +0000) {'user': 'blah'}