Debian Codegraph @

tests/test-single-head-obsolescence-named-branch-A3.t

raw
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 superseding of a branch interleaved with another
14
15 .. old-state:
16 ..
17 .. * 2 changesets on branch default
18 .. * 2 changesets on branch Z interleaved with the other
19 ..
20 .. new-state:
21 ..
22 .. * 2 changesets on branch Z at the same location
23 .. * 2 changesets on branch default superseding 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 #testcases bm-v2 bm-v3
42 #if bm-v3
43 $ cat <<EOF >> $HGRCPATH
44 > [experimental]
45 > branch-cache-v3=yes
46 > EOF
47 #else
48 $ cat <<EOF >> $HGRCPATH
49 > [experimental]
50 > branch-cache-v3=no
51 > EOF
52 #endif
53
54 $ . $TESTDIR/testlib/push-checkheads-util.sh
55
56 $ cat >> $HGRCPATH << EOF
57 > [command-templates]
58 > log = "{node|short} [{branch}] ({phase}): {desc}\n"
59 > EOF
60
61 Test setup
62 ----------
63
64 $ mkdir A3
65 $ cd A3
66 $ setuprepos single-head
67 creating basic server and client repo
68 updating to branch default
69 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 $ cd client
71 $ hg branch Z
72 marked working directory as branch Z
73 (branches are permanent and global, did you want a bookmark?)
74 $ mkcommit B0
75 $ hg branch default --force
76 marked working directory as branch default
77 $ mkcommit C0
78 created new head
79 $ hg branch Z --force
80 marked working directory as branch Z
81 $ mkcommit D0
82 created new head
83 $ hg push --new-branch
84 pushing to $TESTTMP/A3/server
85 searching for changes
86 adding changesets
87 adding manifests
88 adding file changes
89 added 3 changesets with 3 changes to 3 files
90 $ hg up 0
91 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
92 $ mkcommit A1
93 created new head
94 $ mkcommit C1
95 $ hg debugobsolete `getid "desc(A0)"` `getid "desc(A1)"`
96 1 new obsolescence markers
97 obsoleted 1 changesets
98 3 new orphan changesets
99 $ hg debugobsolete `getid "desc(C0)"` `getid "desc(C1)"`
100 1 new obsolescence markers
101 obsoleted 1 changesets
102 $ hg heads
103 0c76bc104656 [default] (draft): C1
104 78578c4306ce [Z] (draft): D0
105 $ hg log -G --hidden
106 @ 0c76bc104656 [default] (draft): C1
107 |
108 o f6082bc4ffef [default] (draft): A1
109 |
110 | * 78578c4306ce [Z] (draft): D0
111 | |
112 | x afc55ba2ce61 [default] (draft): C0
113 | |
114 | * 93e5c1321ece [Z] (draft): B0
115 | |
116 | x 8aaa48160adc [default] (draft): A0
117 |/
118 o 1e4be0697311 [default] (public): root
119
120
121 Actual testing
122 --------------
123
124 $ hg push -r 'desc("C1")'
125 pushing to $TESTTMP/A3/server
126 searching for changes
127 adding changesets
128 adding manifests
129 adding file changes
130 added 2 changesets with 2 changes to 2 files (+1 heads)
131 2 new obsolescence markers
132 obsoleted 2 changesets
133 2 new orphan changesets