Mercurial > hg
comparison tests/test-push-checkheads-superceed-A8.t @ 31981:259f4e02533b
obsolescence: add test for the "branch replacement" logic during push, case A8
Mercurial checks for the introduction of new heads on push. Evolution comes
into play to detect if existing branches on the server are being replaced by
some of the new one we push.
The current code for this logic is very basic (eg: issue4354) and was poorly
tested. We have a better implementation coming in the evolve extension fixing
these issues and with more serious tests coverage. In the process of upstreaming
this improved logic, we start with adding the test case that are already passing
with the current implementation. Once they are all in, we'll upstream the better
implementation and the extra test cases.
See inline documentation for details about the test case added in this
changeset.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 13 Apr 2017 16:25:44 +0200 |
parents | |
children | 53b3a1968aa6 |
comparison
equal
deleted
inserted
replaced
31980:276390e0ccfc | 31981:259f4e02533b |
---|---|
1 ==================================== | |
2 Testing head checking code: Case A-8 | |
3 ==================================== | |
4 | |
5 Mercurial checks for the introduction of new heads on push. Evolution comes | |
6 into play to detect if existing branches on the server are being replaced by | |
7 some of the new one we push. | |
8 | |
9 This case is part of a series of tests checking this behavior. | |
10 | |
11 Category A: simple case involving a branch being superceeded by another. | |
12 TestCase 8: single-changeset branch indirect rewrite | |
13 | |
14 .. old-state: | |
15 .. | |
16 .. * 1-changeset branch | |
17 .. | |
18 .. new-state: | |
19 .. | |
20 .. * 1-changeset branch succeeding to A, through another unpushed changesets | |
21 .. | |
22 .. expected-result: | |
23 .. | |
24 .. * push allowed | |
25 .. | |
26 .. graph-summary: | |
27 .. | |
28 .. A' | |
29 .. A ø⇠ø⇠◔ A'' | |
30 .. |/ / | |
31 .. | / | |
32 .. |/ | |
33 .. ● | |
34 | |
35 $ . $TESTDIR/testlib/push-checkheads-util.sh | |
36 | |
37 Test setup | |
38 ---------- | |
39 | |
40 $ mkdir A8 | |
41 $ cd A8 | |
42 $ setuprepos | |
43 creating basic server and client repo | |
44 updating to branch default | |
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
46 $ cd client | |
47 $ hg up 0 | |
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
49 $ mkcommit A1 | |
50 created new head | |
51 $ hg up 0 | |
52 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
53 $ mkcommit A2 | |
54 created new head | |
55 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` | |
56 $ hg debugobsolete `getid "desc(A1)" ` `getid "desc(A2)"` | |
57 $ hg log -G --hidden | |
58 @ c1f8d089020f (draft): A2 | |
59 | | |
60 | x f6082bc4ffef (draft): A1 | |
61 |/ | |
62 | x 8aaa48160adc (draft): A0 | |
63 |/ | |
64 o 1e4be0697311 (public): root | |
65 | |
66 | |
67 Actual testing | |
68 -------------- | |
69 | |
70 $ hg push | |
71 pushing to $TESTTMP/A8/server (glob) | |
72 searching for changes | |
73 adding changesets | |
74 adding manifests | |
75 adding file changes | |
76 added 1 changesets with 1 changes to 1 files (+1 heads) | |
77 2 new obsolescence markers | |
78 | |
79 $ cd ../.. |