comparison tests/test-single-head-obsolescence-named-branch-A3.t @ 5227:b20d04641c0f stable

head-checking: ignore obsolete section when checking for single heads This overwrite the core code that enforce single heads to ignore obsolete section. That way older obsolete version of a branch no longer prevent the new version to be pushed.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 11 Mar 2020 23:56:11 +0100
parents
children f560d23639e1
comparison
equal deleted inserted replaced
5226:1e0516ee4cb9 5227:b20d04641c0f
1 =========================================
2 Testing single head enforcement: Case A-3
3 =========================================
4
5 A repository is set to only accept a single head per name (typically named
6 branch). However, obsolete changesets can make this enforcement more
7 complicated, because they can be kept visible by other changeset on other
8 branch.
9
10 This case is part of a series of tests checking this behavior.
11
12 Category A: Involving obsolescence
13 TestCase 3: Full superceedig of a branch interleaved with another
14
15 .. old-state:
16 ..
17 .. * 2 changeset changeset on branch default
18 .. * 2 changeset changeset on branch Z interleaved with the other
19 ..
20 .. new-state:
21 ..
22 .. * 2 changeset changeset on branch Z at the same location
23 .. * 2 changeset changeset on branch default superceeding the other ones
24 ..
25 .. expected-result:
26 ..
27 .. * only one head detected
28 ..
29 .. graph-summary:
30 ..
31 .. D ● (branch Z)
32 .. |
33 .. C ø⇠◔ C'
34 .. | |
35 .. B ● | (branch Z)
36 .. | |
37 .. A ø⇠◔ A'
38 .. |/
39 .. ●
40
41 $ . $TESTDIR/testlib/topic_setup.sh
42 $ . $TESTDIR/testlib/push-checkheads-util.sh
43
44 Test setup
45 ----------
46
47 $ mkdir A3
48 $ cd A3
49 $ setuprepos single-head
50 creating basic server and client repo
51 updating to branch default
52 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 $ cd client
54 $ hg branch Z
55 marked working directory as branch Z
56 (branches are permanent and global, did you want a bookmark?)
57 $ mkcommit B0
58 $ hg branch default --force
59 marked working directory as branch default
60 $ mkcommit C0
61 created new head
62 (consider using topic for lightweight branches. See 'hg help topic')
63 $ hg branch Z --force
64 marked working directory as branch Z
65 $ mkcommit D0
66 created new head
67 (consider using topic for lightweight branches. See 'hg help topic')
68 $ hg push --new-branch
69 pushing to $TESTTMP/A3/server
70 searching for changes
71 adding changesets
72 adding manifests
73 adding file changes
74 added 3 changesets with 3 changes to 3 files
75 $ hg up 0
76 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
77 $ mkcommit A1
78 created new head
79 (consider using topic for lightweight branches. See 'hg help topic')
80 $ mkcommit C1
81 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
82 1 new obsolescence markers
83 obsoleted 1 changesets
84 3 new orphan changesets
85 $ hg debugobsolete `getid "desc(C0)" ` `getid "desc(C1)"`
86 1 new obsolescence markers
87 obsoleted 1 changesets
88 $ hg log -G --hidden
89 @ 0c76bc104656 [default] (draft): C1
90 |
91 o f6082bc4ffef [default] (draft): A1
92 |
93 | * 78578c4306ce [Z] (draft): D0
94 | |
95 | x afc55ba2ce61 [default] (draft): C0
96 | |
97 | * 93e5c1321ece [Z] (draft): B0
98 | |
99 | x 8aaa48160adc [default] (draft): A0
100 |/
101 o 1e4be0697311 [default] (public): root
102
103
104 Actual testing
105 --------------
106
107 (force push to make sure we get the changeset on the remote)
108
109 $ hg push -r 'desc("C1")' --force
110 pushing to $TESTTMP/A3/server
111 searching for changes
112 adding changesets
113 adding manifests
114 adding file changes
115 added 2 changesets with 2 changes to 2 files (+1 heads)
116 2 new obsolescence markers
117 obsoleted 2 changesets
118 2 new orphan changesets