changeset 45198:559ebfb5a58e stable

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 23 Jul 2020 16:30:30 +0200
parents 5ff77aaba1e4
children 1476ec96965f
files tests/test-obsolete-check-push.t
diffstat 1 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 ../..