Patchwork [4,of,5,STABLE,REGRESSION] push: test for checks preventing publishing obsolete changeset

login
register
mail settings
Submitter Pierre-Yves David
Date July 23, 2020, 3:40 p.m.
Message ID <b1ba2cd7af5a87e5b900.1595518847@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/46847/
State Superseded
Headers show

Comments

Pierre-Yves David - July 23, 2020, 3:40 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1595514555 -7200
#      Thu Jul 23 16:29:15 2020 +0200
# Branch stable
# Node ID b1ba2cd7af5a87e5b9006d042c9401e12a4cb9ef
# Parent  c7a435ee409a9d8c03ed6a8da36e2333c611636a
# EXP-Topic push-obscheck
# Available At https://foss.heptapod.net/octobus/mercurial-devel/
#              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r b1ba2cd7af5a
push: test for checks preventing publishing obsolete changeset

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

Patch

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
@@ -180,3 +180,31 @@  Pushing the result if 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 'desc("commit_")'
+  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 somethign prevent 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 ../..