changeset 45197:5ff77aaba1e4 stable

push: test for checks preventing publishing obsolete changeset This introduce a simple example, more are coming. See inline documentation for details.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 23 Jul 2020 16:29:15 +0200
parents fc751824ae97
children 559ebfb5a58e
files tests/test-obsolete-check-push.t
diffstat 1 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-obsolete-check-push.t	Thu Jul 23 16:26:29 2020 +0200
+++ b/tests/test-obsolete-check-push.t	Thu Jul 23 16:29:15 2020 +0200
@@ -179,3 +179,31 @@
   [255]
 
   $ cd ../..
+
+Tests that user get warned if it is about to publish obsolete/unstable content
+------------------------------------------------------------------------------
+
+Orphan from pruning
+-------------------
+
+Make sure the only difference is phase:
+
+  $ cd check-pruned/client
+  $ hg push --force --rev 'not desc("unrelated")'
+  pushing to $TESTTMP/check-pruned/server
+  searching for changes
+  no changes found
+  1 new obsolescence markers
+  obsoleted 1 changesets
+  1 new orphan changesets
+  [1]
+
+Check something prevents a silent publication of the obsolete changeset
+
+  $ hg push --publish --new-branch
+  pushing to $TESTTMP/check-pruned/server
+  searching for changes
+  abort: push includes orphan changeset: c09d8ab29fda!
+  [255]
+
+  $ cd ../..