changeset 47059:7a90fddb13b0

rewriteutil: point to help about instability when rewriting creates orphan This replicates the message from the evolve extension. Differential Revision: https://phab.mercurial-scm.org/D10517
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 11 Feb 2021 15:11:10 -0800
parents da4e6d7a8fdd
children c4dbbaecaad3
files mercurial/rewriteutil.py tests/test-amend.t tests/test-branch-change.t tests/test-fix.t tests/test-rebase-collapse.t tests/test-rebase-scenario-global.t tests/test-split.t tests/test-unamend.t
diffstat 8 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/rewriteutil.py	Tue Apr 27 14:59:45 2021 -0700
+++ b/mercurial/rewriteutil.py	Thu Feb 11 15:11:10 2021 -0800
@@ -54,7 +54,10 @@
 
     newunstable = disallowednewunstable(repo, revs)
     if newunstable:
-        raise error.InputError(_(b"cannot %s changeset with children") % action)
+        hint = _(b"see 'hg help evolution.instability'")
+        raise error.InputError(
+            _(b"cannot %s changeset with children") % action, hint=hint
+        )
 
 
 def disallowednewunstable(repo, revs):
--- a/tests/test-amend.t	Tue Apr 27 14:59:45 2021 -0700
+++ b/tests/test-amend.t	Thu Feb 11 15:11:10 2021 -0800
@@ -197,6 +197,7 @@
   $ echo 2 >> B
   $ hg amend
   abort: cannot amend changeset with children
+  (see 'hg help evolution.instability')
   [10]
 
 #if obsstore-on
--- a/tests/test-branch-change.t	Tue Apr 27 14:59:45 2021 -0700
+++ b/tests/test-branch-change.t	Thu Feb 11 15:11:10 2021 -0800
@@ -58,6 +58,7 @@
 
   $ hg branch -r 1::3 foo
   abort: cannot change branch of changeset with children
+  (see 'hg help evolution.instability')
   [10]
 
 Change with dirty working directory
@@ -129,6 +130,7 @@
 
   $ hg branch -r 2 stable
   abort: cannot change branch of changeset with children
+  (see 'hg help evolution.instability')
   [10]
 
 Enabling the allowunstable config and trying to change branch on a branch head
--- a/tests/test-fix.t	Tue Apr 27 14:59:45 2021 -0700
+++ b/tests/test-fix.t	Thu Feb 11 15:11:10 2021 -0800
@@ -1173,6 +1173,7 @@
   $ hg commit -m "second"
   $ hg --config experimental.evolution.allowunstable=False fix -r '.^'
   abort: cannot fix changeset with children
+  (see 'hg help evolution.instability')
   [10]
   $ hg fix -r '.^'
   1 new orphan changesets
--- a/tests/test-rebase-collapse.t	Tue Apr 27 14:59:45 2021 -0700
+++ b/tests/test-rebase-collapse.t	Thu Feb 11 15:11:10 2021 -0800
@@ -550,7 +550,7 @@
   
   $ hg rebase --collapse -r 1 -d 0
   abort: cannot rebase changeset with children
-  (use --keep to keep original changesets)
+  (see 'hg help evolution.instability')
   [10]
 
 Test collapsing in place
--- a/tests/test-rebase-scenario-global.t	Tue Apr 27 14:59:45 2021 -0700
+++ b/tests/test-rebase-scenario-global.t	Thu Feb 11 15:11:10 2021 -0800
@@ -453,7 +453,7 @@
   $ cd ah1
   $ hg rebase -r '2::8' -d 1
   abort: cannot rebase changeset with children
-  (use --keep to keep original changesets)
+  (see 'hg help evolution.instability')
   [10]
   $ hg rebase -r '2::8' -d 1 -k
   rebasing 2:c9e50f6cdc55 "C"
@@ -499,7 +499,7 @@
   $ cd ah2
   $ hg rebase -r '3::8' -d 1
   abort: cannot rebase changeset with children
-  (use --keep to keep original changesets)
+  (see 'hg help evolution.instability')
   [10]
   $ hg rebase -r '3::8' -d 1 --keep
   rebasing 3:ffd453c31098 "D"
@@ -542,7 +542,7 @@
   $ cd ah3
   $ hg rebase -r '3::7' -d 1
   abort: cannot rebase changeset with children
-  (use --keep to keep original changesets)
+  (see 'hg help evolution.instability')
   [10]
   $ hg rebase -r '3::7' -d 1 --keep
   rebasing 3:ffd453c31098 "D"
@@ -582,7 +582,7 @@
   $ cd ah4
   $ hg rebase -r '3::(7+5)' -d 1
   abort: cannot rebase changeset with children
-  (use --keep to keep original changesets)
+  (see 'hg help evolution.instability')
   [10]
   $ hg rebase -r '3::(7+5)' -d 1 --keep
   rebasing 3:ffd453c31098 "D"
--- a/tests/test-split.t	Tue Apr 27 14:59:45 2021 -0700
+++ b/tests/test-split.t	Thu Feb 11 15:11:10 2021 -0800
@@ -467,6 +467,7 @@
 #if obsstore-off
   $ runsplit -r 1 --no-rebase
   abort: cannot split changeset with children
+  (see 'hg help evolution.instability')
   [10]
 #else
   $ runsplit -r 1 --no-rebase >/dev/null
@@ -518,6 +519,7 @@
   $ rm .hg/localtags
   $ hg split $B --config experimental.evolution=createmarkers
   abort: cannot split changeset with children
+  (see 'hg help evolution.instability')
   [10]
   $ cat > $TESTTMP/messages <<EOF
   > Split B
--- a/tests/test-unamend.t	Tue Apr 27 14:59:45 2021 -0700
+++ b/tests/test-unamend.t	Thu Feb 11 15:11:10 2021 -0800
@@ -284,6 +284,7 @@
 
   $ hg --config experimental.evolution=createmarkers unamend
   abort: cannot unamend changeset with children
+  (see 'hg help evolution.instability')
   [10]
 
   $ hg unamend