push: test for checks preventing publishing obsolete changeset
The main difference from the previous test is how the changeset was obsoleted.
In this case it is an amend so publishing the orphan would also create phase
divergence. This must not go unnoticed.
--- a/tests/test-obsolete-check-push.t Thu Jul 23 16:29:15 2020 +0200
+++ b/tests/test-obsolete-check-push.t Thu Jul 23 16:30:30 2020 +0200
@@ -207,3 +207,30 @@
[255]
$ cd ../..
+
+Orphan from superseding
+-----------------------
+
+Make sure the only difference is phase:
+
+ $ cd check-superseded/client
+ $ hg push --force --rev 'not desc("unrelated")'
+ pushing to $TESTTMP/check-superseded/server
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 0 changes to 0 files (+1 heads)
+ 1 new obsolescence markers
+ obsoleted 1 changesets
+ 1 new orphan changesets
+
+Check something prevents a silent publication of the obsolete changeset
+
+ $ hg push --publish --new-branch
+ pushing to $TESTTMP/check-superseded/server
+ searching for changes
+ abort: push includes orphan changeset: c09d8ab29fda!
+ [255]
+
+ $ cd ../..