# HG changeset patch
# User Pierre-Yves David <pierre-yves.da...@octobus.net>
# Date 1595514555 -7200
#      Thu Jul 23 16:29:15 2020 +0200
# Branch stable
# Node ID 099d3b7cfef487b42c408c54345cdccb5cf9be98
# Parent  89ef8e19853e11c106653add49bd33dda246be3c
# EXP-Topic push-obscheck
# Available At https://foss.heptapod.net/octobus/mercurial-devel/
#              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r 
099d3b7cfef4
push: test for checks preventing publishing obsolete changeset

This introduce a simple example, more are coming. See inline documentation
for details.

diff --git a/tests/test-obsolete-check-push.t b/tests/test-obsolete-check-push.t
--- a/tests/test-obsolete-check-push.t
+++ b/tests/test-obsolete-check-push.t
@@ -179,3 +179,31 @@ Pushing the result is prevented with a m
   [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 ../..

_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to