Mercurial > evolve
annotate tests/test-push-checkheads-mixed-branch-topic-G1.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 | c6a84c6a26b8 |
children | 35e769c9604f fc60328270ac |
rev | line source |
---|---|
5224
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
1 ==================================== |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
2 Testing head checking code: Case E-1 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
3 ==================================== |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
4 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
5 Mercurial checks for the introduction of new heads on push. Evolution comes |
5a46f156c9b7
head-checking: add test variants with topics
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 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
7 some of the new one we push. |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
8 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
9 This case is part of a series of tests checking this behavior. |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
10 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
11 Category F: case involving changeset on multiple topic |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
12 TestCase 1: moving a branch to another location |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
13 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
14 .. old-state: |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
15 .. |
5225
c6a84c6a26b8
head-checking: add test variant mixing branch and topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5224
diff
changeset
|
16 .. * 1-changeset on branch default |
5224
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
17 .. * 1-changeset on topic Z (above Y) |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
18 .. |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
19 .. new-state: |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
20 .. |
5225
c6a84c6a26b8
head-checking: add test variant mixing branch and topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5224
diff
changeset
|
21 .. * 1-changeset on branch default |
5224
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
22 .. * 1-changeset on topic Z (rebased away from A0) |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
23 .. |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
24 .. expected-result: |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
25 .. |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
26 .. * push allowed |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
27 .. |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
28 .. graph-summary: |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
29 .. |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
30 .. B ø⇠◔ B' topic Z |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
31 .. | | |
5225
c6a84c6a26b8
head-checking: add test variant mixing branch and topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5224
diff
changeset
|
32 .. A ◔ | branch default |
5224
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
33 .. |/ |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
34 .. ● |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
35 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
36 $ . $TESTDIR/testlib/topic_setup.sh |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
37 $ . $TESTDIR/testlib/push-checkheads-util.sh |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
38 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
39 Test setup |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
40 ---------- |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
41 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
42 $ mkdir E1 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
43 $ cd E1 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
44 $ setuprepos |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
45 creating basic server and client repo |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
46 updating to branch default |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
47 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
48 $ cd client |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
49 $ hg topic Z |
5225
c6a84c6a26b8
head-checking: add test variant mixing branch and topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5224
diff
changeset
|
50 marked working directory as topic: Z |
5224
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
51 $ mkcommit B0 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
52 active topic 'Z' grew its first changeset |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
53 (see 'hg help topics' for more information) |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
54 $ hg push |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
55 pushing to $TESTTMP/E1/server |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
56 searching for changes |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
57 adding changesets |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
58 adding manifests |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
59 adding file changes |
5225
c6a84c6a26b8
head-checking: add test variant mixing branch and topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5224
diff
changeset
|
60 added 1 changesets with 1 changes to 1 files |
5224
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
61 $ hg up 0 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
62 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
63 $ hg topic Z |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
64 marked working directory as topic: Z |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
65 $ mkcommit B1 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
66 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
67 1 new obsolescence markers |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
68 obsoleted 1 changesets |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
69 $ hg log -G --hidden |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
70 @ 845eeb768064 (draft)[Z]: B1 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
71 | |
5225
c6a84c6a26b8
head-checking: add test variant mixing branch and topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5224
diff
changeset
|
72 | x 35d2f30a8ba4 (draft)[Z]: B0 |
5224
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
73 | | |
5225
c6a84c6a26b8
head-checking: add test variant mixing branch and topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
5224
diff
changeset
|
74 | o 8aaa48160adc (draft): A0 |
5224
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
75 |/ |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
76 o 1e4be0697311 (public): root |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
77 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
78 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
79 Actual testing |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
80 -------------- |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
81 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
82 $ hg push |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
83 pushing to $TESTTMP/E1/server |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
84 searching for changes |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
85 adding changesets |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
86 adding manifests |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
87 adding file changes |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
88 added 1 changesets with 1 changes to 1 files (+1 heads) |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
89 1 new obsolescence markers |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
90 obsoleted 1 changesets |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
91 |
5a46f156c9b7
head-checking: add test variants with topics
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
92 $ cd ../.. |