Patchwork [3,of,5,STABLE,REGRESSION,V2] push: another test for checks preventing pushing orphaness to a server

login
register
mail settings
Submitter Pierre-Yves David
Date July 24, 2020, 1:03 p.m.
Message ID <89ef8e19853e11c10665.1595595781@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/46865/
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 1595514389 -7200
#      Thu Jul 23 16:26:29 2020 +0200
# Branch stable
# Node ID 89ef8e19853e11c106653add49bd33dda246be3c
# Parent  ac128543063466eae7d6c9c8859154360580879a
# EXP-Topic push-obscheck
# Available At https://foss.heptapod.net/octobus/mercurial-devel/
#              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r 89ef8e19853e
push: another test for checks preventing pushing orphaness to a server

In this one, orphan was create with and amend instead of a prune.

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
@@ -121,3 +121,61 @@  Pushing the result is prevented with a m
   [255]
 
   $ cd ../..
+
+
+Orphan from superseding
+-----------------------
+
+Setup
+
+  $ cp -R base check-superseded
+  $ cd check-superseded/client
+  $ hg up 'desc("commit_A0_")'
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch other
+  marked working directory as branch other
+  $ hg commit --amend -m commit_A1_
+  1 new orphan changesets
+  $ hg log -G
+  @  changeset:   4:df9b82a99e21
+  |  branch:      other
+  |  tag:         tip
+  |  parent:      0:1e4be0697311
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     commit_A1_
+  |
+  | o  changeset:   3:16affbe0f986
+  |/   branch:      unrelated
+  |    parent:      0:1e4be0697311
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     unrelated
+  |
+  | *  changeset:   2:c09d8ab29fda
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  instability: orphan
+  | |  summary:     commit_B0_
+  | |
+  | x  changeset:   1:37624bf21024
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    obsolete:    rewritten using amend as 4:df9b82a99e21
+  |    summary:     commit_A0_
+  |
+  o  changeset:   0:1e4be0697311
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     root
+  
+
+Pushing the result is prevented with a message
+
+  $ hg push --new-branch
+  pushing to $TESTTMP/check-superseded/server
+  searching for changes
+  abort: push includes orphan changeset: c09d8ab29fda!
+  [255]
+
+  $ cd ../..