annotate tests/test-push-checkheads-multibranches-E3.t @ 6216:ce46b853d10e

prune: add a test to demonstrate a bug Test shows that pruning without any successor warns about creating divergence which is not possible and is a false warning. For the knowledge, this pattern of pruning (without any successor) an already pruned cset is sometime used to keep successors locally but vanish them at server side.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Fri, 23 Jul 2021 00:48:50 +0530
parents f0d46ffbf1bb
children 73cb6cafc930 fc60328270ac ebc2dea354a2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5223
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
1 ====================================
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
2 Testing head checking code: Case E-3
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
3 ====================================
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
4
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
5 Mercurial checks for the introduction of new heads on push. Evolution comes
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
6 into play to detect if existing branches on the server are being replaced by
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
7 some of the new one we push.
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
8
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
9 This case is part of a series of tests checking this behavior.
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
10
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
11 Category E: case involving changeset on multiple branch
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
12 TestCase 8: moving only part of the interleaved branch away, creating 2 heads
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
13
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
14 .. old-state:
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
15 ..
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
16 .. * 2-changeset on branch default
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
17 .. * 1-changeset on branch Z (between the two other)
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
18 ..
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
19 .. new-state:
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
20 ..
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
21 .. * 2-changeset on branch default, on untouched, the other moved
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
22 .. * 1-changeset on branch Z (at the same location)
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
23 ..
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
24 .. expected-result:
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
25 ..
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
26 .. * push rejected
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
27 ..
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
28 .. graph-summary:
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
29 ..
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
30 .. C ø⇠◔ C'
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
31 .. | |
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
32 .. B ◔ |
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
33 .. | |
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
34 .. A ◔ |
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
35 .. |/
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
36 .. ●
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
37
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
38 $ . $TESTDIR/testlib/topic_setup.sh
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
39 $ . $TESTDIR/testlib/push-checkheads-util.sh
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
40
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
41 Test setup
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
42 ----------
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
43
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
44 $ mkdir E1
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
45 $ cd E1
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
46 $ setuprepos
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
47 creating basic server and client repo
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
48 updating to branch default
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
49 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
50 $ cd client
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
51 $ hg branch Z
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
52 marked working directory as branch Z
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
53 (branches are permanent and global, did you want a bookmark?)
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
54 $ mkcommit B0
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
55 $ hg branch default --force
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
56 marked working directory as branch default
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
57 $ mkcommit C0
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
58 created new head
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
59 (consider using topic for lightweight branches. See 'hg help topic')
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
60 $ hg push --new-branch
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
61 pushing to $TESTTMP/E1/server
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
62 searching for changes
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
63 adding changesets
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
64 adding manifests
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
65 adding file changes
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
66 added 2 changesets with 2 changes to 2 files
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
67 $ hg up 0
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
68 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
69 $ mkcommit C1
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
70 created new head
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
71 (consider using topic for lightweight branches. See 'hg help topic')
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
72 $ hg debugobsolete `getid "desc(C0)" ` `getid "desc(C1)"`
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
73 1 new obsolescence markers
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
74 obsoleted 1 changesets
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
75 $ hg log -G --hidden
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
76 @ dc44c53142f0 (draft): C1
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
77 |
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
78 | x afc55ba2ce61 (draft): C0
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
79 | |
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
80 | o 93e5c1321ece (draft): B0
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
81 | |
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
82 | o 8aaa48160adc (draft): A0
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
83 |/
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
84 o 1e4be0697311 (public): root
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
85
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
86
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
87 Actual testing
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
88 --------------
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
89
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
90 $ hg push -r 'desc("C1")'
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
91 pushing to $TESTTMP/E1/server
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
92 searching for changes
5672
12c53d7122a7 tests: remove trailing "!" from abort messages
Anton Shestakov <av6@dwimlabs.net>
parents: 5223
diff changeset
93 abort: push creates new remote head dc44c53142f0
5223
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
94 (merge or see 'hg help push' for details about pushing new heads)
5682
f0d46ffbf1bb tests: update exit code in case of push failing because it'd create new heads
Anton Shestakov <av6@dwimlabs.net>
parents: 5672
diff changeset
95 [20]
5223
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
96
11c359b4071d head-checking: backport fix from 7d5455b988ec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
97 $ cd ../..