# HG changeset patch # User Pierre-Yves David # Date 1500831928 -7200 # Node ID d17d193c41450596dbbcb2e774d28ea0fab84713 # Parent 3e9c3119410a135d7be91a2a7949eed92fb96243 precheck: update the orphan message to something me generic This will help to reuse it for other commands. diff -r 3e9c3119410a -r d17d193c4145 hgext3rd/evolve/rewriteutil.py --- 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) diff -r 3e9c3119410a -r d17d193c4145 tests/test-fold.t --- 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] diff -r 3e9c3119410a -r d17d193c4145 tests/test-metaedit.t --- 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