Mercurial > evolve
comparison tests/test-checkheads-partial-C1.t @ 2249:0ecb9fba6364
checkheads: handle partial obsolescence
We now properly detects situations were only parts of the remote branch is
obsoleted. To do so, we process children in the branch recursively to see if
they will be obsolete.
The current code has some trouble when the remote branch in unknown locally, or
when the prune happened on a successors that is not relevant to the push. These
case will be handled later.
The processing code is becoming more and more complex, a lighter approach would
be to check for the obsolescence markers that are relevant to the pushed set,
but I prefer to stick with the current approach until more test cases are
written.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Wed, 29 Mar 2017 15:48:27 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2248:c2817eac11e5 | 2249:0ecb9fba6364 |
---|---|
1 ==================================== | |
2 Testing head checking code: Case C-1 | |
3 ==================================== | |
4 | |
5 Mercurial checks for the introduction of multiple heads on push. Evolution | |
6 comes into play to detect if existing heads on the server are being replaced by | |
7 some of the new heads we push. | |
8 | |
9 This test file is part of a series of tests checking this behavior. | |
10 | |
11 Category C: checking case were the branch is only partially obsoleted. | |
12 TestCase 1: 2 changeset branch, only the head is rewritten | |
13 | |
14 .. old-state: | |
15 .. | |
16 .. * 2 changeset branch | |
17 .. | |
18 .. new-state: | |
19 .. | |
20 .. * 1 new changesets branches superceeding only the head of the old one | |
21 .. * base of the old branch is still alive | |
22 .. | |
23 .. expected-result: | |
24 .. | |
25 .. * push denied | |
26 .. | |
27 .. graph-summary: | |
28 .. | |
29 .. B ø⇠◔ B' | |
30 .. | | | |
31 .. A ○ | | |
32 .. |/ | |
33 .. ○ | |
34 | |
35 $ . $TESTDIR/testlib/checkheads-util.sh | |
36 | |
37 Test setup | |
38 ---------- | |
39 | |
40 $ setuprepos | |
41 creating basic server and client repo | |
42 updating to branch default | |
43 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
44 $ cd server | |
45 $ mkcommit B0 | |
46 $ cd ../client | |
47 $ hg pull | |
48 pulling from $TESTTMP/server | |
49 searching for changes | |
50 adding changesets | |
51 adding manifests | |
52 adding file changes | |
53 added 1 changesets with 1 changes to 1 files | |
54 (run 'hg update' to get a working copy) | |
55 $ hg up 0 | |
56 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
57 $ mkcommit B1 | |
58 created new head | |
59 $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` | |
60 $ hg log -G --hidden | |
61 @ 25c56d33e4c4 (draft): B1 | |
62 | | |
63 | x d73caddc5533 (draft): B0 | |
64 | | | |
65 | o 8aaa48160adc (draft): A0 | |
66 |/ | |
67 o 1e4be0697311 (public): root | |
68 | |
69 | |
70 | |
71 Actual testing | |
72 -------------- | |
73 | |
74 $ hg push | |
75 pushing to $TESTTMP/server | |
76 searching for changes | |
77 abort: push creates new remote head 25c56d33e4c4! | |
78 (merge or see 'hg help push' for details about pushing new heads) | |
79 [255] |