Patchwork D10517: rewriteutil: point to help about instability when rewriting creates orphan

login
register
mail settings
Submitter phabricator
Date April 28, 2021, 3:08 p.m.
Message ID <differential-rev-PHID-DREV-pvowrr7efcahenvebdnv-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48837/
State Superseded
Headers show

Comments

phabricator - April 28, 2021, 3:08 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
pulkit accepted this revision.
This revision is now accepted and ready to land.

REVISION SUMMARY
  This replicates the message from the evolve extension.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10517

AFFECTED 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

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-unamend.t b/tests/test-unamend.t
--- a/tests/test-unamend.t
+++ b/tests/test-unamend.t
@@ -284,6 +284,7 @@ 
 
   $ hg --config experimental.evolution=createmarkers unamend
   abort: cannot unamend changeset with children
+  (see 'hg help evolution.instability')
   [10]
 
   $ hg unamend
diff --git a/tests/test-split.t b/tests/test-split.t
--- a/tests/test-split.t
+++ b/tests/test-split.t
@@ -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
diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t
--- a/tests/test-rebase-scenario-global.t
+++ b/tests/test-rebase-scenario-global.t
@@ -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"
diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t
--- a/tests/test-rebase-collapse.t
+++ b/tests/test-rebase-collapse.t
@@ -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
diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -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
diff --git a/tests/test-branch-change.t b/tests/test-branch-change.t
--- a/tests/test-branch-change.t
+++ b/tests/test-branch-change.t
@@ -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
diff --git a/tests/test-amend.t b/tests/test-amend.t
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -197,6 +197,7 @@ 
   $ echo 2 >> B
   $ hg amend
   abort: cannot amend changeset with children
+  (see 'hg help evolution.instability')
   [10]
 
 #if obsstore-on
diff --git a/mercurial/rewriteutil.py b/mercurial/rewriteutil.py
--- a/mercurial/rewriteutil.py
+++ b/mercurial/rewriteutil.py
@@ -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):