comparison tests/test-push-checkheads-superceed-A5.t @ 31978:c9b4bcad327e

obsolescence: add test for the "branch replacement" logic during push, case A5 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:24:57 +0200
parents
children 53b3a1968aa6
comparison
equal deleted inserted replaced
31977:e4bd71627903 31978:c9b4bcad327e
1 ====================================
2 Testing head checking code: Case A-5
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 5: New changeset as parent of the successor
13
14 .. old-state:
15 ..
16 .. * 1-changeset branch
17 ..
18 .. new-state:
19 ..
20 .. * 2rchangeset branch, head is a successor, but other is new
21 ..
22 .. expected-result:
23 ..
24 .. * push allowed
25 ..
26 .. graph-summary:
27 ..
28 .. A ø⇠◔ A'
29 .. | |
30 .. | ◔ B
31 .. |/
32 .. ●
33
34 $ . $TESTDIR/testlib/push-checkheads-util.sh
35
36 Test setup
37 ----------
38
39 $ mkdir A5
40 $ cd A5
41 $ setuprepos
42 creating basic server and client repo
43 updating to branch default
44 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 $ cd client
46 $ hg up 0
47 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
48 $ mkcommit B0
49 created new head
50 $ mkcommit A1
51 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
52 $ hg log -G --hidden
53 @ ba93660aff8d (draft): A1
54 |
55 o 74ff5441d343 (draft): B0
56 |
57 | x 8aaa48160adc (draft): A0
58 |/
59 o 1e4be0697311 (public): root
60
61
62 Actual testing
63 --------------
64
65 $ hg push
66 pushing to $TESTTMP/A5/server (glob)
67 searching for changes
68 adding changesets
69 adding manifests
70 adding file changes
71 added 2 changesets with 2 changes to 2 files (+1 heads)
72 1 new obsolescence markers
73
74 $ cd ../..
75