precheck: update the orphan message to something me generic
This will help to reuse it for other commands.
--- a/hgext3rd/evolve/rewriteutil.py Sun Jul 23 19:53:51 2017 +0200
+++ b/hgext3rd/evolve/rewriteutil.py Sun Jul 23 19:45:28 2017 +0200
@@ -68,7 +68,8 @@
raise error.Abort(msg, hint=hint)
newunstable = disallowednewunstable(repo, revs)
if newunstable:
- msg = _("cannot fold chain not ending with a head or with branching")
+ msg = _("%s will orphan %i descendants")
+ msg %= (action, len(newunstable))
hint = _("see 'hg help evolution.instability'")
raise error.Abort(msg, hint=hint)
--- a/tests/test-fold.t Sun Jul 23 19:53:51 2017 +0200
+++ b/tests/test-fold.t Sun Jul 23 19:45:28 2017 +0200
@@ -163,11 +163,11 @@
> evolution = createmarkers, allnewcommands
> EOF
$ hg fold --from 'desc("r4")'
- abort: cannot fold chain not ending with a head or with branching
+ abort: fold will orphan 1 descendants
(see 'hg help evolution.instability')
[255]
$ hg fold --from 'desc("r3")::desc("r11")'
- abort: cannot fold chain not ending with a head or with branching
+ abort: fold will orphan 1 descendants
(see 'hg help evolution.instability')
[255]
--- a/tests/test-metaedit.t Sun Jul 23 19:53:51 2017 +0200
+++ b/tests/test-metaedit.t Sun Jul 23 19:45:28 2017 +0200
@@ -118,7 +118,7 @@
(587528abfffe will become unstable and new unstable changes are not allowed)
[255]
$ hg metaedit 'desc(A)::desc(B)' --fold --config 'experimental.evolution=createmarkers, allnewcommands'
- abort: cannot fold chain not ending with a head or with branching
+ abort: fold will orphan 4 descendants
(see 'hg help evolution.instability')
[255]
$ hg metaedit --user foobar