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

login
register
mail settings
Submitter Pierre-Yves David
Date July 24, 2020, 1:03 p.m.
Message ID <e741ef8d1b76060f6c49.1595595783@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/46866/
State New
Headers show

Comments

Pierre-Yves David - July 24, 2020, 1:03 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1595514630 -7200
#      Thu Jul 23 16:30:30 2020 +0200
# Branch stable
# Node ID e741ef8d1b76060f6c49fbef0082efe19246cde7
# Parent  099d3b7cfef487b42c408c54345cdccb5cf9be98
# EXP-Topic push-obscheck
# Available At https://foss.heptapod.net/octobus/mercurial-devel/
#              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r e741ef8d1b76
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.

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
@@ -207,3 +207,30 @@  Check something prevents a silent public
   [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 ../..