annotate tests/test-push-checkheads-pruned-B8.t @ 5917:94aed9c7ce69 stable

next: refactor two if blocks into an if-elif block We already checked the value of `needevolve and opts['evolve']` in the first if block above. In the first one it need to be True, in the second it needs to be False for the statements to execute. Since not(a or b) = not a and not b, we can join the second if block to the first one with an elif while dropping the explicit check. For me, this works better, because we're doing the same thing in both of these blocks (checking if working copy is dirty or not).
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 15 May 2021 20:40:19 +0800
parents a8ff17479fb8
children f3e39a354378 144d10e74757
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
1 ====================================
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
2 Testing head checking code: Case B-2
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
3 ====================================
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
4
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
5 Mercurial checks for the introduction of new heads on push. Evolution comes
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
6 into play to detect if existing branches on the server are being replaced by
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
7 some of the new one we push.
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
8
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
9 This case is part of a series of tests checking this behavior.
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
10
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
11 Category B: simple case involving pruned changesets
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
12 TestCase 2: multi-changeset branch, head is pruned, rest is superceeded, through other
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
13
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
14 .. old-state:
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
15 ..
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
16 .. * 2 changeset branch
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
17 ..
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
18 .. new-state:
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
19 ..
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
20 .. * old head is rewritten then pruned
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
21 .. * 1 new branch succeeding to the other changeset in the old branch (through another obsolete branch)
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
22 ..
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
23 .. expected-result:
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
24 ..
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
25 .. * push allowed
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
26 ..
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
27 .. graph-summary:
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
28 ..
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
29 .. B ø⇠⊗ B'
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
30 .. | | A'
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
31 .. A ø⇠ø⇠◔ A''
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
32 .. |/ /
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
33 .. | /
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
34 .. |/
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
35 .. ●
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
36
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
37 $ . $TESTDIR/testlib/push-checkheads-util.sh
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
38
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
39 Test setup
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
40 ----------
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
41
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
42 $ mkdir B8
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
43 $ cd B8
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
44 $ setuprepos
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
45 creating basic server and client repo
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
46 updating to branch default
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
47 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
48 $ cd server
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
49 $ mkcommit B0
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
50 $ cd ../client
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
51 $ hg pull
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
52 pulling from $TESTTMP/B8/server (glob)
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
53 searching for changes
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
54 adding changesets
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
55 adding manifests
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
56 adding file changes
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
57 added 1 changesets with 1 changes to 1 files
4181
ab3581bc0637 branching: preserve the expected output on default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4165
diff changeset
58 new changesets d73caddc5533 (1 drafts)
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
59 (run 'hg update' to get a working copy)
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
60 $ hg up 0
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
61 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
62 $ mkcommit A1
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
63 created new head
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
64 $ mkcommit B1
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
65 $ hg up 0
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
66 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
67 $ mkcommit A2
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
68 created new head
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
69 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
4871
a8ff17479fb8 branching: preserve test change on stable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4860
diff changeset
70 1 new obsolescence markers
2754
21f06d932231 test: update test output to match b11e8c67fb0f
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2710
diff changeset
71 obsoleted 1 changesets
3431
2e703ed1c713 evolve: update output for wider reporting of troubled changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 3075
diff changeset
72 1 new orphan changesets
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
73 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
4871
a8ff17479fb8 branching: preserve test change on stable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4860
diff changeset
74 1 new obsolescence markers
2754
21f06d932231 test: update test output to match b11e8c67fb0f
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2710
diff changeset
75 obsoleted 1 changesets
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
76 $ hg debugobsolete --record-parents `getid "desc(B1)"`
4871
a8ff17479fb8 branching: preserve test change on stable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4860
diff changeset
77 1 new obsolescence markers
2754
21f06d932231 test: update test output to match b11e8c67fb0f
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2710
diff changeset
78 obsoleted 1 changesets
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
79 $ hg debugobsolete `getid "desc(A1)" ` `getid "desc(A2)"`
4871
a8ff17479fb8 branching: preserve test change on stable
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4860
diff changeset
80 1 new obsolescence markers
2754
21f06d932231 test: update test output to match b11e8c67fb0f
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2710
diff changeset
81 obsoleted 1 changesets
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
82 $ hg log -G --hidden
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
83 @ c1f8d089020f (draft): A2
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
84 |
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
85 | x 262c8c798096 (draft): B1
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
86 | |
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
87 | x f6082bc4ffef (draft): A1
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
88 |/
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
89 | x d73caddc5533 (draft): B0
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
90 | |
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
91 | x 8aaa48160adc (draft): A0
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
92 |/
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
93 o 1e4be0697311 (public): root
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
94
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
95
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
96 Actual testing
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
97 --------------
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
98
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
99 $ hg push
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
100 pushing to $TESTTMP/B8/server (glob)
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
101 searching for changes
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
102 adding changesets
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
103 adding manifests
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
104 adding file changes
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
105 added 1 changesets with 1 changes to 1 files (+1 heads)
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
106 4 new obsolescence markers
2710
e22de367fc74 compat: adapt to change in 53b3a1968aa6-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2277
diff changeset
107 obsoleted 2 changesets
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
108
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
109 $ cd ../..