comparison tests/test-stack-branch.t @ 6401:716912541759 mercurial-5.0

test-compat: merge mercurial-5.1 into mercurial-5.0
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 07 Feb 2023 10:51:10 +0400
parents 60daa7887c49
children 90f867d5be22
comparison
equal deleted inserted replaced
6355:4cf673319dfc 6401:716912541759
10 > evolution=createmarkers,exchange,allowunstable 10 > evolution=createmarkers,exchange,allowunstable
11 > EOF 11 > EOF
12 12
13 $ hg init main 13 $ hg init main
14 $ cd main 14 $ cd main
15 $ hg branch other 15 $ hg branch double//slash
16 marked working directory as branch other 16 marked working directory as branch double//slash
17 (branches are permanent and global, did you want a bookmark?) 17 (branches are permanent and global, did you want a bookmark?)
18 $ echo aaa > aaa 18 $ echo aaa > aaa
19 $ hg add aaa 19 $ hg add aaa
20 $ hg commit -m c_a 20 $ hg commit -m c_a
21 $ echo aaa > bbb 21 $ echo aaa > bbb
22 $ hg add bbb 22 $ hg add bbb
23 $ hg commit -m c_b 23 $ hg commit -m c_b
24 $ hg branch foo 24 $ hg branch foo//bar
25 marked working directory as branch foo 25 marked working directory as branch foo//bar
26 $ echo aaa > ccc 26 $ echo aaa > ccc
27 $ hg add ccc 27 $ hg add ccc
28 $ hg commit -m c_c 28 $ hg commit -m c_c
29 $ echo aaa > ddd 29 $ echo aaa > ddd
30 $ hg add ddd 30 $ hg add ddd
34 $ hg commit -m c_e 34 $ hg commit -m c_e
35 $ echo aaa > fff 35 $ echo aaa > fff
36 $ hg add fff 36 $ hg add fff
37 $ hg commit -m c_f 37 $ hg commit -m c_f
38 $ hg log -G 38 $ hg log -G
39 @ 5 foo {} draft c_f 39 @ 5 foo//bar {} draft c_f
40 | 40 |
41 o 4 foo {} draft c_e 41 o 4 foo//bar {} draft c_e
42 | 42 |
43 o 3 foo {} draft c_d 43 o 3 foo//bar {} draft c_d
44 | 44 |
45 o 2 foo {} draft c_c 45 o 2 foo//bar {} draft c_c
46 | 46 |
47 o 1 other {} draft c_b 47 o 1 double//slash {} draft c_b
48 | 48 |
49 o 0 other {} draft c_a 49 o 0 double//slash {} draft c_a
50 50
51 51
52 Check that topic without any parent does not crash --list 52 Commit extras have branch name without formatting
53 -------------------------------------------------
54
55 $ hg log -r 1 -T '{rev}: {join(extras, " ")}\n'
56 1: branch=double//slash
57 $ hg log -r 5 -T '{rev}: {join(extras, " ")}\n'
58 5: branch=foo//bar
59
60 Check that branch without any parent does not crash stack
53 --------------------------------------------------------- 61 ---------------------------------------------------------
54 62
55 $ hg up other 63 $ hg up double//slash//
56 0 files updated, 0 files merged, 4 files removed, 0 files unresolved 64 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
57 $ hg stack 65 $ hg stack
58 ### target: other (branch) 66 ### target: double//slash (branch)
59 s2@ c_b (current) 67 s2@ c_b (current)
60 s1: c_a 68 s1: c_a
61 $ hg phase --public 'branch("other")' 69 $ hg phase --public 'branch("double//slash//")'
62 $ hg up foo 70 $ hg up foo//bar//
63 4 files updated, 0 files merged, 0 files removed, 0 files unresolved 71 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 72
65 Simple test 73 Simple test
66 ----------- 74 -----------
67 75
68 'hg stack' list all changeset in the topic 76 'hg stack' lists all changeset on the branch
69 77
70 $ hg branch 78 $ hg branch
71 foo 79 foo//bar
72 $ hg stack 80 $ hg stack
73 ### target: foo (branch) 81 ### target: foo//bar (branch)
74 s4@ c_f (current) 82 s4@ c_f (current)
75 s3: c_e 83 s3: c_e
76 s2: c_d 84 s2: c_d
77 s1: c_c 85 s1: c_c
78 s0^ c_b (base) 86 s0^ c_b (base)
79 $ hg stack -v 87 $ hg stack -v
80 ### target: foo (branch) 88 ### target: foo//bar (branch)
81 s4(913c298d8b0a)@ c_f (current) 89 s4(18b3ff044de9)@ c_f (current)
82 s3(4f2a69f6d380): c_e 90 s3(b1913e064ca1): c_e
83 s2(f61adbacd17a): c_d 91 s2(8fad7e98adf6): c_d
84 s1(3e9313bc4b71): c_c 92 s1(da14ac95d156): c_c
85 s0(4a04f1104a27)^ c_b (base) 93 s0(2450a061c0f0)^ c_b (base)
86 94
87 Test "t#" reference 95 Test "s#" reference
88 ------------------- 96 -------------------
89 97
90 $ hg up s2 98 $ hg up s2
91 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 99 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
92 $ hg up foo 100 $ hg up foo//bar//
93 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 101 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 $ hg up s42 102 $ hg up s42
95 abort: cannot resolve "s42": branch "foo" has only 4 non-public changesets 103 abort: cannot resolve "s42": branch "foo//bar//" has only 4 non-public changesets
96 [255] 104 [255]
97 $ hg up s2 105 $ hg up s2
98 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 106 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
99 $ hg summary 107 $ hg summary
100 parent: 3:f61adbacd17a 108 parent: 3:8fad7e98adf6
101 c_d 109 c_d
102 branch: foo 110 branch: foo//bar//
103 commit: (clean) 111 commit: (clean)
104 update: 2 new changesets (update) 112 update: 2 new changesets (update)
105 phases: 4 draft 113 phases: 4 draft
106 114
107 Case with some of the branch unstable 115 Case with some of the branch unstable
109 117
110 $ echo bbb > ddd 118 $ echo bbb > ddd
111 $ hg commit --amend 119 $ hg commit --amend
112 2 new orphan changesets 120 2 new orphan changesets
113 $ hg log -G 121 $ hg log -G
114 @ 6 foo {} draft c_d 122 @ 6 foo//bar {} draft c_d
115 | 123 |
116 | * 5 foo {} draft c_f 124 | * 5 foo//bar {} draft c_f
117 | | 125 | |
118 | * 4 foo {} draft c_e 126 | * 4 foo//bar {} draft c_e
119 | | 127 | |
120 | x 3 foo {} draft c_d 128 | x 3 foo//bar {} draft c_d
121 |/ 129 |/
122 o 2 foo {} draft c_c 130 o 2 foo//bar {} draft c_c
123 | 131 |
124 o 1 other {} public c_b 132 o 1 double//slash {} public c_b
125 | 133 |
126 o 0 other {} public c_a 134 o 0 double//slash {} public c_a
127 135
128 $ hg stack 136 $ hg stack
129 ### target: foo (branch) 137 ### target: foo//bar (branch)
130 s4$ c_f (orphan) 138 s4$ c_f (orphan)
131 s3$ c_e (orphan) 139 s3$ c_e (orphan)
132 s2@ c_d (current) 140 s2@ c_d (current)
133 s1: c_c 141 s1: c_c
134 s0^ c_b (base) 142 s0^ c_b (base)
135 $ hg up s3 143 $ hg up s3
136 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 144 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 $ hg stack 145 $ hg stack
138 ### target: foo (branch) 146 ### target: foo//bar (branch)
139 s4$ c_f (orphan) 147 s4$ c_f (orphan)
140 s3@ c_e (current orphan) 148 s3@ c_e (current orphan)
141 s2: c_d 149 s2: c_d
142 s1: c_c 150 s1: c_c
143 s0^ c_b (base) 151 s0^ c_b (base)
145 1 files updated, 0 files merged, 1 files removed, 0 files unresolved 153 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
146 154
147 Also test the revset: 155 Also test the revset:
148 156
149 $ hg log -r 'stack()' 157 $ hg log -r 'stack()'
150 2 foo {} draft c_c 158 2 foo//bar {} draft c_c
151 6 foo {} draft c_d 159 6 foo//bar {} draft c_d
152 4 foo {} draft c_e 160 4 foo//bar {} draft c_e
153 5 foo {} draft c_f 161 5 foo//bar {} draft c_f
154 162
155 Case with multiple heads on the topic 163 Case with multiple heads on the branch
156 ------------------------------------- 164 --------------------------------------
157 165
158 Make things linear again 166 Make things linear again
159 167
160 $ hg rebase -s 'desc(c_e)' -d 'desc(c_d) - obsolete()' 168 $ hg rebase -s 'desc(c_e)' -d 'desc(c_d) - obsolete()'
161 rebasing 4:4f2a69f6d380 "c_e" 169 rebasing 4:b1913e064ca1 "c_e"
162 rebasing 5:913c298d8b0a "c_f" 170 rebasing 5:18b3ff044de9 "c_f"
163 $ hg log -G 171 $ hg log -G
164 o 8 foo {} draft c_f 172 o 8 foo//bar {} draft c_f
165 | 173 |
166 o 7 foo {} draft c_e 174 o 7 foo//bar {} draft c_e
167 | 175 |
168 @ 6 foo {} draft c_d 176 @ 6 foo//bar {} draft c_d
169 | 177 |
170 o 2 foo {} draft c_c 178 o 2 foo//bar {} draft c_c
171 | 179 |
172 o 1 other {} public c_b 180 o 1 double//slash {} public c_b
173 | 181 |
174 o 0 other {} public c_a 182 o 0 double//slash {} public c_a
175 183
176 184
177 Create the second branch 185 Create the second head
178 186
179 $ hg up 'desc(c_d)' 187 $ hg up 'desc(c_d)'
180 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 $ echo aaa > ggg 189 $ echo aaa > ggg
182 $ hg add ggg 190 $ hg add ggg
185 (consider using topic for lightweight branches. See 'hg help topic') 193 (consider using topic for lightweight branches. See 'hg help topic')
186 $ echo aaa > hhh 194 $ echo aaa > hhh
187 $ hg add hhh 195 $ hg add hhh
188 $ hg commit -m c_h 196 $ hg commit -m c_h
189 $ hg log -G 197 $ hg log -G
190 @ 10 foo {} draft c_h 198 @ 10 foo//bar {} draft c_h
191 | 199 |
192 o 9 foo {} draft c_g 200 o 9 foo//bar {} draft c_g
193 | 201 |
194 | o 8 foo {} draft c_f 202 | o 8 foo//bar {} draft c_f
195 | | 203 | |
196 | o 7 foo {} draft c_e 204 | o 7 foo//bar {} draft c_e
197 |/ 205 |/
198 o 6 foo {} draft c_d 206 o 6 foo//bar {} draft c_d
199 | 207 |
200 o 2 foo {} draft c_c 208 o 2 foo//bar {} draft c_c
201 | 209 |
202 o 1 other {} public c_b 210 o 1 double//slash {} public c_b
203 | 211 |
204 o 0 other {} public c_a 212 o 0 double//slash {} public c_a
205 213
206 214
207 Test output 215 Test output
208 216
209 $ hg stack 217 $ hg stack
210 ### target: foo (branch) (2 heads) 218 ### target: foo//bar (branch) (2 heads)
211 s6@ c_h (current) 219 s6@ c_h (current)
212 s5: c_g 220 s5: c_g
213 s2^ c_d (base) 221 s2^ c_d (base)
214 s4: c_f 222 s4: c_f
215 s3: c_e 223 s3: c_e
216 s2: c_d 224 s2: c_d
217 s1: c_c 225 s1: c_c
218 s0^ c_b (base) 226 s0^ c_b (base)
219 227
220 Case with multiple heads on the topic with instability involved 228 Case with multiple heads on the branch with instability involved
221 --------------------------------------------------------------- 229 ----------------------------------------------------------------
222 230
223 We amend the message to make sure the display base pick the right changeset 231 We amend the message to make sure the display base pick the right changeset
224 232
225 $ hg up 'desc(c_d)' 233 $ hg up 'desc(c_d)'
226 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 234 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
227 $ echo ccc > ddd 235 $ echo ccc > ddd
228 $ hg commit --amend -m 'c_D' 236 $ hg commit --amend -m 'c_D'
229 4 new orphan changesets 237 4 new orphan changesets
230 $ hg rebase -d . -s 'desc(c_g)' 238 $ hg rebase -d . -s 'desc(c_g)'
231 rebasing 9:2ebb6e48ab8a "c_g" 239 rebasing 9:8c1819a4441f "c_g"
232 rebasing 10:634f38e27a1d "c_h" 240 rebasing 10:e255b784f0e9 "c_h"
233 $ hg log -G 241 $ hg log -G
234 o 13 foo {} draft c_h 242 o 13 foo//bar {} draft c_h
235 | 243 |
236 o 12 foo {} draft c_g 244 o 12 foo//bar {} draft c_g
237 | 245 |
238 @ 11 foo {} draft c_D 246 @ 11 foo//bar {} draft c_D
239 | 247 |
240 | * 8 foo {} draft c_f 248 | * 8 foo//bar {} draft c_f
241 | | 249 | |
242 | * 7 foo {} draft c_e 250 | * 7 foo//bar {} draft c_e
243 | | 251 | |
244 | x 6 foo {} draft c_d 252 | x 6 foo//bar {} draft c_d
245 |/ 253 |/
246 o 2 foo {} draft c_c 254 o 2 foo//bar {} draft c_c
247 | 255 |
248 o 1 other {} public c_b 256 o 1 double//slash {} public c_b
249 | 257 |
250 o 0 other {} public c_a 258 o 0 double//slash {} public c_a
251 259
252 260
253 $ hg stack 261 $ hg stack
254 ### target: foo (branch) (2 heads) 262 ### target: foo//bar (branch) (2 heads)
255 s6: c_h 263 s6: c_h
256 s5: c_g 264 s5: c_g
257 s2^ c_D (base current) 265 s2^ c_D (base current)
258 s4$ c_f (orphan) 266 s4$ c_f (orphan)
259 s3$ c_e (orphan) 267 s3$ c_e (orphan)
260 s2@ c_D (current) 268 s2@ c_D (current)
261 s1: c_c 269 s1: c_c
262 s0^ c_b (base) 270 s0^ c_b (base)
263 271
264 Check that stack doesn't show draft changesets on a branch 272 Check that stack doesn't show public changesets on a branch
265 ---------------------------------------------------------- 273 -----------------------------------------------------------
266 274
267 $ hg log --graph 275 $ hg log --graph
268 o 13 foo {} draft c_h 276 o 13 foo//bar {} draft c_h
269 | 277 |
270 o 12 foo {} draft c_g 278 o 12 foo//bar {} draft c_g
271 | 279 |
272 @ 11 foo {} draft c_D 280 @ 11 foo//bar {} draft c_D
273 | 281 |
274 | * 8 foo {} draft c_f 282 | * 8 foo//bar {} draft c_f
275 | | 283 | |
276 | * 7 foo {} draft c_e 284 | * 7 foo//bar {} draft c_e
277 | | 285 | |
278 | x 6 foo {} draft c_d 286 | x 6 foo//bar {} draft c_d
279 |/ 287 |/
280 o 2 foo {} draft c_c 288 o 2 foo//bar {} draft c_c
281 | 289 |
282 o 1 other {} public c_b 290 o 1 double//slash {} public c_b
283 | 291 |
284 o 0 other {} public c_a 292 o 0 double//slash {} public c_a
285 293
286 294
287 $ hg stack 295 $ hg stack
288 ### target: foo (branch) (2 heads) 296 ### target: foo//bar (branch) (2 heads)
289 s6: c_h 297 s6: c_h
290 s5: c_g 298 s5: c_g
291 s2^ c_D (base current) 299 s2^ c_D (base current)
292 s4$ c_f (orphan) 300 s4$ c_f (orphan)
293 s3$ c_e (orphan) 301 s3$ c_e (orphan)
294 s2@ c_D (current) 302 s2@ c_D (current)
295 s1: c_c 303 s1: c_c
296 s0^ c_b (base) 304 s0^ c_b (base)
297 $ hg phase --public s1 305 $ hg phase --public s1
298 $ hg stack 306 $ hg stack
299 ### target: foo (branch) (2 heads) 307 ### target: foo//bar (branch) (2 heads)
300 s5: c_h 308 s5: c_h
301 s4: c_g 309 s4: c_g
302 s1^ c_D (base current) 310 s1^ c_D (base current)
303 s3$ c_f (orphan) 311 s3$ c_f (orphan)
304 s2$ c_e (orphan) 312 s2$ c_e (orphan)
305 s1@ c_D (current) 313 s1@ c_D (current)
306 s0^ c_c (base) 314 s0^ c_c (base)
307 315
308 Check that stack doesn't show changeset with a topic 316 Check that stack doesn't show changesets with a topic
309 ---------------------------------------------------- 317 -----------------------------------------------------
310 318
311 $ hg topic --rev s4::s5 sometopic 319 $ hg topic --rev s4::s5 sometopic
312 changed topic on 2 changesets to "sometopic" 320 changed topic on 2 changesets to "sometopic"
313 $ hg stack 321 $ hg stack
314 ### target: foo (branch) 322 ### target: foo//bar (branch)
315 s3$ c_f (orphan) 323 s3$ c_f (orphan)
316 s2$ c_e (orphan) 324 s2$ c_e (orphan)
317 s1@ c_D (current) 325 s1@ c_D (current)
318 s0^ c_c (base) 326 s0^ c_c (base)