Show More
@@ -1,990 +1,1000 b'' | |||
|
1 | 1 | $ hg init repo |
|
2 | 2 | $ cd repo |
|
3 | 3 | |
|
4 | 4 | no bookmarks |
|
5 | 5 | |
|
6 | 6 | $ hg bookmarks |
|
7 | 7 | no bookmarks set |
|
8 | 8 | |
|
9 | 9 | $ hg bookmarks -Tjson |
|
10 | 10 | [ |
|
11 | 11 | ] |
|
12 | 12 | |
|
13 | 13 | bookmark rev -1 |
|
14 | 14 | |
|
15 | 15 | $ hg bookmark X |
|
16 | 16 | |
|
17 | 17 | list bookmarks |
|
18 | 18 | |
|
19 | 19 | $ hg bookmarks |
|
20 | 20 | * X -1:000000000000 |
|
21 | 21 | |
|
22 | 22 | list bookmarks with color |
|
23 | 23 | |
|
24 | 24 | $ hg --config extensions.color= --config color.mode=ansi \ |
|
25 | 25 | > bookmarks --color=always |
|
26 | 26 | \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc) |
|
27 | 27 | |
|
28 | 28 | $ echo a > a |
|
29 | 29 | $ hg add a |
|
30 | 30 | $ hg commit -m 0 |
|
31 | 31 | |
|
32 | 32 | bookmark X moved to rev 0 |
|
33 | 33 | |
|
34 | 34 | $ hg bookmarks |
|
35 | 35 | * X 0:f7b1eb17ad24 |
|
36 | 36 | |
|
37 | 37 | look up bookmark |
|
38 | 38 | |
|
39 | 39 | $ hg log -r X |
|
40 | 40 | changeset: 0:f7b1eb17ad24 |
|
41 | 41 | bookmark: X |
|
42 | 42 | tag: tip |
|
43 | 43 | user: test |
|
44 | 44 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | 45 | summary: 0 |
|
46 | 46 | |
|
47 | 47 | |
|
48 | 48 | second bookmark for rev 0, command should work even with ui.strict on |
|
49 | 49 | |
|
50 | 50 | $ hg --config ui.strict=1 bookmark X2 |
|
51 | 51 | |
|
52 | 52 | bookmark rev -1 again |
|
53 | 53 | |
|
54 | 54 | $ hg bookmark -r null Y |
|
55 | 55 | |
|
56 | 56 | list bookmarks |
|
57 | 57 | |
|
58 | 58 | $ hg bookmarks |
|
59 | 59 | X 0:f7b1eb17ad24 |
|
60 | 60 | * X2 0:f7b1eb17ad24 |
|
61 | 61 | Y -1:000000000000 |
|
62 | 62 | |
|
63 | 63 | $ echo b > b |
|
64 | 64 | $ hg add b |
|
65 | 65 | $ hg commit -m 1 |
|
66 | 66 | |
|
67 | 67 | $ hg bookmarks -Tjson |
|
68 | 68 | [ |
|
69 | 69 | { |
|
70 | 70 | "active": false, |
|
71 | 71 | "bookmark": "X", |
|
72 | 72 | "node": "f7b1eb17ad24730a1651fccd46c43826d1bbc2ac", |
|
73 | 73 | "rev": 0 |
|
74 | 74 | }, |
|
75 | 75 | { |
|
76 | 76 | "active": true, |
|
77 | 77 | "bookmark": "X2", |
|
78 | 78 | "node": "925d80f479bb026b0fb3deb27503780b13f74123", |
|
79 | 79 | "rev": 1 |
|
80 | 80 | }, |
|
81 | 81 | { |
|
82 | 82 | "active": false, |
|
83 | 83 | "bookmark": "Y", |
|
84 | 84 | "node": "0000000000000000000000000000000000000000", |
|
85 | 85 | "rev": -1 |
|
86 | 86 | } |
|
87 | 87 | ] |
|
88 | 88 | |
|
89 | 89 | bookmarks revset |
|
90 | 90 | |
|
91 | 91 | $ hg log -r 'bookmark()' |
|
92 | 92 | changeset: 0:f7b1eb17ad24 |
|
93 | 93 | bookmark: X |
|
94 | 94 | user: test |
|
95 | 95 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
96 | 96 | summary: 0 |
|
97 | 97 | |
|
98 | 98 | changeset: 1:925d80f479bb |
|
99 | 99 | bookmark: X2 |
|
100 | 100 | tag: tip |
|
101 | 101 | user: test |
|
102 | 102 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
103 | 103 | summary: 1 |
|
104 | 104 | |
|
105 | 105 | $ hg log -r 'bookmark(Y)' |
|
106 | 106 | $ hg log -r 'bookmark(X2)' |
|
107 | 107 | changeset: 1:925d80f479bb |
|
108 | 108 | bookmark: X2 |
|
109 | 109 | tag: tip |
|
110 | 110 | user: test |
|
111 | 111 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
112 | 112 | summary: 1 |
|
113 | 113 | |
|
114 | 114 | $ hg log -r 'bookmark("re:X")' |
|
115 | 115 | changeset: 0:f7b1eb17ad24 |
|
116 | 116 | bookmark: X |
|
117 | 117 | user: test |
|
118 | 118 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
119 | 119 | summary: 0 |
|
120 | 120 | |
|
121 | 121 | changeset: 1:925d80f479bb |
|
122 | 122 | bookmark: X2 |
|
123 | 123 | tag: tip |
|
124 | 124 | user: test |
|
125 | 125 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
126 | 126 | summary: 1 |
|
127 | 127 | |
|
128 | 128 | $ hg log -r 'bookmark("literal:X")' |
|
129 | 129 | changeset: 0:f7b1eb17ad24 |
|
130 | 130 | bookmark: X |
|
131 | 131 | user: test |
|
132 | 132 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
133 | 133 | summary: 0 |
|
134 | 134 | |
|
135 | 135 | |
|
136 | 136 | $ hg log -r 'bookmark(unknown)' |
|
137 | 137 | abort: bookmark 'unknown' does not exist! |
|
138 | 138 | [255] |
|
139 | 139 | $ hg log -r 'bookmark("literal:unknown")' |
|
140 | 140 | abort: bookmark 'unknown' does not exist! |
|
141 | 141 | [255] |
|
142 | 142 | $ hg log -r 'bookmark("re:unknown")' |
|
143 | 143 | abort: no bookmarks exist that match 'unknown'! |
|
144 | 144 | [255] |
|
145 | 145 | $ hg log -r 'present(bookmark("literal:unknown"))' |
|
146 | 146 | $ hg log -r 'present(bookmark("re:unknown"))' |
|
147 | 147 | |
|
148 | 148 | $ hg help revsets | grep 'bookmark(' |
|
149 | 149 | "bookmark([name])" |
|
150 | 150 | |
|
151 | 151 | bookmarks X and X2 moved to rev 1, Y at rev -1 |
|
152 | 152 | |
|
153 | 153 | $ hg bookmarks |
|
154 | 154 | X 0:f7b1eb17ad24 |
|
155 | 155 | * X2 1:925d80f479bb |
|
156 | 156 | Y -1:000000000000 |
|
157 | 157 | |
|
158 | 158 | bookmark rev 0 again |
|
159 | 159 | |
|
160 | 160 | $ hg bookmark -r 0 Z |
|
161 | 161 | |
|
162 | 162 | $ hg update X |
|
163 | 163 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
164 | 164 | (activating bookmark X) |
|
165 | 165 | $ echo c > c |
|
166 | 166 | $ hg add c |
|
167 | 167 | $ hg commit -m 2 |
|
168 | 168 | created new head |
|
169 | 169 | |
|
170 | 170 | bookmarks X moved to rev 2, Y at rev -1, Z at rev 0 |
|
171 | 171 | |
|
172 | 172 | $ hg bookmarks |
|
173 | 173 | * X 2:db815d6d32e6 |
|
174 | 174 | X2 1:925d80f479bb |
|
175 | 175 | Y -1:000000000000 |
|
176 | 176 | Z 0:f7b1eb17ad24 |
|
177 | 177 | |
|
178 | 178 | rename nonexistent bookmark |
|
179 | 179 | |
|
180 | 180 | $ hg bookmark -m A B |
|
181 | 181 | abort: bookmark 'A' does not exist |
|
182 | 182 | [255] |
|
183 | 183 | |
|
184 | 184 | rename to existent bookmark |
|
185 | 185 | |
|
186 | 186 | $ hg bookmark -m X Y |
|
187 | 187 | abort: bookmark 'Y' already exists (use -f to force) |
|
188 | 188 | [255] |
|
189 | 189 | |
|
190 | 190 | force rename to existent bookmark |
|
191 | 191 | |
|
192 | 192 | $ hg bookmark -f -m X Y |
|
193 | 193 | |
|
194 | 194 | list bookmarks |
|
195 | 195 | |
|
196 | 196 | $ hg bookmark |
|
197 | 197 | X2 1:925d80f479bb |
|
198 | 198 | * Y 2:db815d6d32e6 |
|
199 | 199 | Z 0:f7b1eb17ad24 |
|
200 | 200 | |
|
201 | 201 | bookmarks from a revset |
|
202 | 202 | $ hg bookmark -r '.^1' REVSET |
|
203 | 203 | $ hg bookmark -r ':tip' TIP |
|
204 | 204 | $ hg up -q TIP |
|
205 | 205 | $ hg bookmarks |
|
206 | 206 | REVSET 0:f7b1eb17ad24 |
|
207 | 207 | * TIP 2:db815d6d32e6 |
|
208 | 208 | X2 1:925d80f479bb |
|
209 | 209 | Y 2:db815d6d32e6 |
|
210 | 210 | Z 0:f7b1eb17ad24 |
|
211 | 211 | |
|
212 | 212 | $ hg bookmark -d REVSET |
|
213 | 213 | $ hg bookmark -d TIP |
|
214 | 214 | |
|
215 | 215 | rename without new name or multiple names |
|
216 | 216 | |
|
217 | 217 | $ hg bookmark -m Y |
|
218 | 218 | abort: new bookmark name required |
|
219 | 219 | [255] |
|
220 | 220 | $ hg bookmark -m Y Y2 Y3 |
|
221 | 221 | abort: only one new bookmark name allowed |
|
222 | 222 | [255] |
|
223 | 223 | |
|
224 | 224 | delete without name |
|
225 | 225 | |
|
226 | 226 | $ hg bookmark -d |
|
227 | 227 | abort: bookmark name required |
|
228 | 228 | [255] |
|
229 | 229 | |
|
230 | 230 | delete nonexistent bookmark |
|
231 | 231 | |
|
232 | 232 | $ hg bookmark -d A |
|
233 | 233 | abort: bookmark 'A' does not exist |
|
234 | 234 | [255] |
|
235 | 235 | |
|
236 | 236 | bookmark name with spaces should be stripped |
|
237 | 237 | |
|
238 | 238 | $ hg bookmark ' x y ' |
|
239 | 239 | |
|
240 | 240 | list bookmarks |
|
241 | 241 | |
|
242 | 242 | $ hg bookmarks |
|
243 | 243 | X2 1:925d80f479bb |
|
244 | 244 | Y 2:db815d6d32e6 |
|
245 | 245 | Z 0:f7b1eb17ad24 |
|
246 | 246 | * x y 2:db815d6d32e6 |
|
247 | 247 | |
|
248 | 248 | look up stripped bookmark name |
|
249 | 249 | |
|
250 | 250 | $ hg log -r '"x y"' |
|
251 | 251 | changeset: 2:db815d6d32e6 |
|
252 | 252 | bookmark: Y |
|
253 | 253 | bookmark: x y |
|
254 | 254 | tag: tip |
|
255 | 255 | parent: 0:f7b1eb17ad24 |
|
256 | 256 | user: test |
|
257 | 257 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
258 | 258 | summary: 2 |
|
259 | 259 | |
|
260 | 260 | |
|
261 | 261 | reject bookmark name with newline |
|
262 | 262 | |
|
263 | 263 | $ hg bookmark ' |
|
264 | 264 | > ' |
|
265 | 265 | abort: bookmark names cannot consist entirely of whitespace |
|
266 | 266 | [255] |
|
267 | 267 | |
|
268 | 268 | $ hg bookmark -m Z ' |
|
269 | 269 | > ' |
|
270 | 270 | abort: bookmark names cannot consist entirely of whitespace |
|
271 | 271 | [255] |
|
272 | 272 | |
|
273 | 273 | bookmark with reserved name |
|
274 | 274 | |
|
275 | 275 | $ hg bookmark tip |
|
276 | 276 | abort: the name 'tip' is reserved |
|
277 | 277 | [255] |
|
278 | 278 | |
|
279 | 279 | $ hg bookmark . |
|
280 | 280 | abort: the name '.' is reserved |
|
281 | 281 | [255] |
|
282 | 282 | |
|
283 | 283 | $ hg bookmark null |
|
284 | 284 | abort: the name 'null' is reserved |
|
285 | 285 | [255] |
|
286 | 286 | |
|
287 | 287 | |
|
288 | 288 | bookmark with existing name |
|
289 | 289 | |
|
290 | 290 | $ hg bookmark X2 |
|
291 | 291 | abort: bookmark 'X2' already exists (use -f to force) |
|
292 | 292 | [255] |
|
293 | 293 | |
|
294 | 294 | $ hg bookmark -m Y Z |
|
295 | 295 | abort: bookmark 'Z' already exists (use -f to force) |
|
296 | 296 | [255] |
|
297 | 297 | |
|
298 | 298 | bookmark with name of branch |
|
299 | 299 | |
|
300 | 300 | $ hg bookmark default |
|
301 | 301 | abort: a bookmark cannot have the name of an existing branch |
|
302 | 302 | [255] |
|
303 | 303 | |
|
304 | 304 | $ hg bookmark -m Y default |
|
305 | 305 | abort: a bookmark cannot have the name of an existing branch |
|
306 | 306 | [255] |
|
307 | 307 | |
|
308 | 308 | bookmark with integer name |
|
309 | 309 | |
|
310 | 310 | $ hg bookmark 10 |
|
311 | 311 | abort: cannot use an integer as a name |
|
312 | 312 | [255] |
|
313 | 313 | |
|
314 | 314 | bookmark with a name that matches a node id |
|
315 | 315 | $ hg bookmark 925d80f479bb db815d6d32e6 |
|
316 | 316 | bookmark 925d80f479bb matches a changeset hash |
|
317 | 317 | (did you leave a -r out of an 'hg bookmark' command?) |
|
318 | 318 | bookmark db815d6d32e6 matches a changeset hash |
|
319 | 319 | (did you leave a -r out of an 'hg bookmark' command?) |
|
320 | 320 | $ hg bookmark -d 925d80f479bb |
|
321 | 321 | $ hg bookmark -d db815d6d32e6 |
|
322 | 322 | |
|
323 | 323 | $ cd .. |
|
324 | 324 | |
|
325 | 325 | bookmark with a name that matches an ambiguous node id |
|
326 | 326 | |
|
327 | 327 | $ hg init ambiguous |
|
328 | 328 | $ cd ambiguous |
|
329 | 329 | $ echo 0 > a |
|
330 | 330 | $ hg ci -qAm 0 |
|
331 | 331 | $ for i in 1057 2857 4025; do |
|
332 | 332 | > hg up -q 0 |
|
333 | 333 | > echo $i > a |
|
334 | 334 | > hg ci -qm $i |
|
335 | 335 | > done |
|
336 | 336 | $ hg up -q null |
|
337 | 337 | $ hg log -r0: -T '{rev}:{node}\n' |
|
338 | 338 | 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a |
|
339 | 339 | 1:c56256a09cd28e5764f32e8e2810d0f01e2e357a |
|
340 | 340 | 2:c5623987d205cd6d9d8389bfc40fff9dbb670b48 |
|
341 | 341 | 3:c562ddd9c94164376c20b86b0b4991636a3bf84f |
|
342 | 342 | |
|
343 | 343 | $ hg bookmark -r0 c562 |
|
344 | 344 | $ hg bookmarks |
|
345 | 345 | c562 0:b4e73ffab476 |
|
346 | 346 | |
|
347 | 347 | $ cd .. |
|
348 | 348 | |
|
349 | 349 | incompatible options |
|
350 | 350 | |
|
351 | 351 | $ cd repo |
|
352 | 352 | |
|
353 | 353 | $ hg bookmark -m Y -d Z |
|
354 | 354 | abort: --delete and --rename are incompatible |
|
355 | 355 | [255] |
|
356 | 356 | |
|
357 | 357 | $ hg bookmark -r 1 -d Z |
|
358 | 358 | abort: --rev is incompatible with --delete |
|
359 | 359 | [255] |
|
360 | 360 | |
|
361 | 361 | $ hg bookmark -r 1 -m Z Y |
|
362 | 362 | abort: --rev is incompatible with --rename |
|
363 | 363 | [255] |
|
364 | 364 | |
|
365 | 365 | force bookmark with existing name |
|
366 | 366 | |
|
367 | 367 | $ hg bookmark -f X2 |
|
368 | 368 | |
|
369 | 369 | force bookmark back to where it was, should deactivate it |
|
370 | 370 | |
|
371 | 371 | $ hg bookmark -fr1 X2 |
|
372 | 372 | $ hg bookmarks |
|
373 | 373 | X2 1:925d80f479bb |
|
374 | 374 | Y 2:db815d6d32e6 |
|
375 | 375 | Z 0:f7b1eb17ad24 |
|
376 | 376 | x y 2:db815d6d32e6 |
|
377 | 377 | |
|
378 | 378 | forward bookmark to descendant without --force |
|
379 | 379 | |
|
380 | 380 | $ hg bookmark Z |
|
381 | 381 | moving bookmark 'Z' forward from f7b1eb17ad24 |
|
382 | 382 | |
|
383 | 383 | list bookmarks |
|
384 | 384 | |
|
385 | 385 | $ hg bookmark |
|
386 | 386 | X2 1:925d80f479bb |
|
387 | 387 | Y 2:db815d6d32e6 |
|
388 | 388 | * Z 2:db815d6d32e6 |
|
389 | 389 | x y 2:db815d6d32e6 |
|
390 | 390 | |
|
391 | 391 | revision but no bookmark name |
|
392 | 392 | |
|
393 | 393 | $ hg bookmark -r . |
|
394 | 394 | abort: bookmark name required |
|
395 | 395 | [255] |
|
396 | 396 | |
|
397 | 397 | bookmark name with whitespace only |
|
398 | 398 | |
|
399 | 399 | $ hg bookmark ' ' |
|
400 | 400 | abort: bookmark names cannot consist entirely of whitespace |
|
401 | 401 | [255] |
|
402 | 402 | |
|
403 | 403 | $ hg bookmark -m Y ' ' |
|
404 | 404 | abort: bookmark names cannot consist entirely of whitespace |
|
405 | 405 | [255] |
|
406 | 406 | |
|
407 | 407 | invalid bookmark |
|
408 | 408 | |
|
409 | 409 | $ hg bookmark 'foo:bar' |
|
410 | 410 | abort: ':' cannot be used in a name |
|
411 | 411 | [255] |
|
412 | 412 | |
|
413 | 413 | $ hg bookmark 'foo |
|
414 | 414 | > bar' |
|
415 | 415 | abort: '\n' cannot be used in a name |
|
416 | 416 | [255] |
|
417 | 417 | |
|
418 | 418 | the bookmark extension should be ignored now that it is part of core |
|
419 | 419 | |
|
420 | 420 | $ echo "[extensions]" >> $HGRCPATH |
|
421 | 421 | $ echo "bookmarks=" >> $HGRCPATH |
|
422 | 422 | $ hg bookmarks |
|
423 | 423 | X2 1:925d80f479bb |
|
424 | 424 | Y 2:db815d6d32e6 |
|
425 | 425 | * Z 2:db815d6d32e6 |
|
426 | 426 | x y 2:db815d6d32e6 |
|
427 | 427 | |
|
428 | 428 | test summary |
|
429 | 429 | |
|
430 | 430 | $ hg summary |
|
431 | 431 | parent: 2:db815d6d32e6 tip |
|
432 | 432 | 2 |
|
433 | 433 | branch: default |
|
434 | 434 | bookmarks: *Z Y x y |
|
435 | 435 | commit: (clean) |
|
436 | 436 | update: 1 new changesets, 2 branch heads (merge) |
|
437 | 437 | phases: 3 draft |
|
438 | 438 | |
|
439 | 439 | test id |
|
440 | 440 | |
|
441 | 441 | $ hg id |
|
442 | 442 | db815d6d32e6 tip Y/Z/x y |
|
443 | 443 | |
|
444 | 444 | test rollback |
|
445 | 445 | |
|
446 | 446 | $ echo foo > f1 |
|
447 | 447 | $ hg bookmark tmp-rollback |
|
448 | 448 | $ hg ci -Amr |
|
449 | 449 | adding f1 |
|
450 | 450 | $ hg bookmarks |
|
451 | 451 | X2 1:925d80f479bb |
|
452 | 452 | Y 2:db815d6d32e6 |
|
453 | 453 | Z 2:db815d6d32e6 |
|
454 | 454 | * tmp-rollback 3:2bf5cfec5864 |
|
455 | 455 | x y 2:db815d6d32e6 |
|
456 | 456 | $ hg rollback |
|
457 | 457 | repository tip rolled back to revision 2 (undo commit) |
|
458 | 458 | working directory now based on revision 2 |
|
459 | 459 | $ hg bookmarks |
|
460 | 460 | X2 1:925d80f479bb |
|
461 | 461 | Y 2:db815d6d32e6 |
|
462 | 462 | Z 2:db815d6d32e6 |
|
463 | 463 | * tmp-rollback 2:db815d6d32e6 |
|
464 | 464 | x y 2:db815d6d32e6 |
|
465 | 465 | $ hg bookmark -f Z -r 1 |
|
466 | 466 | $ hg rollback |
|
467 | 467 | repository tip rolled back to revision 2 (undo bookmark) |
|
468 | 468 | $ hg bookmarks |
|
469 | 469 | X2 1:925d80f479bb |
|
470 | 470 | Y 2:db815d6d32e6 |
|
471 | 471 | Z 2:db815d6d32e6 |
|
472 | 472 | * tmp-rollback 2:db815d6d32e6 |
|
473 | 473 | x y 2:db815d6d32e6 |
|
474 | 474 | $ hg bookmark -d tmp-rollback |
|
475 | 475 | |
|
476 | 476 | activate bookmark on working dir parent without --force |
|
477 | 477 | |
|
478 | 478 | $ hg bookmark --inactive Z |
|
479 | 479 | $ hg bookmark Z |
|
480 | 480 | |
|
481 | 481 | test clone |
|
482 | 482 | |
|
483 | 483 | $ hg bookmark -r 2 -i @ |
|
484 | 484 | $ hg bookmark -r 2 -i a@ |
|
485 | 485 | $ hg bookmarks |
|
486 | 486 | @ 2:db815d6d32e6 |
|
487 | 487 | X2 1:925d80f479bb |
|
488 | 488 | Y 2:db815d6d32e6 |
|
489 | 489 | * Z 2:db815d6d32e6 |
|
490 | 490 | a@ 2:db815d6d32e6 |
|
491 | 491 | x y 2:db815d6d32e6 |
|
492 | 492 | $ hg clone . cloned-bookmarks |
|
493 | 493 | updating to bookmark @ |
|
494 | 494 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
495 | 495 | $ hg -R cloned-bookmarks bookmarks |
|
496 | 496 | * @ 2:db815d6d32e6 |
|
497 | 497 | X2 1:925d80f479bb |
|
498 | 498 | Y 2:db815d6d32e6 |
|
499 | 499 | Z 2:db815d6d32e6 |
|
500 | 500 | a@ 2:db815d6d32e6 |
|
501 | 501 | x y 2:db815d6d32e6 |
|
502 | 502 | |
|
503 | 503 | test clone with pull protocol |
|
504 | 504 | |
|
505 | 505 | $ hg clone --pull . cloned-bookmarks-pull |
|
506 | 506 | requesting all changes |
|
507 | 507 | adding changesets |
|
508 | 508 | adding manifests |
|
509 | 509 | adding file changes |
|
510 | 510 | added 3 changesets with 3 changes to 3 files (+1 heads) |
|
511 | 511 | updating to bookmark @ |
|
512 | 512 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
513 | 513 | $ hg -R cloned-bookmarks-pull bookmarks |
|
514 | 514 | * @ 2:db815d6d32e6 |
|
515 | 515 | X2 1:925d80f479bb |
|
516 | 516 | Y 2:db815d6d32e6 |
|
517 | 517 | Z 2:db815d6d32e6 |
|
518 | 518 | a@ 2:db815d6d32e6 |
|
519 | 519 | x y 2:db815d6d32e6 |
|
520 | 520 | |
|
521 | 521 | delete multiple bookmarks at once |
|
522 | 522 | |
|
523 | 523 | $ hg bookmark -d @ a@ |
|
524 | 524 | |
|
525 | 525 | test clone with a bookmark named "default" (issue3677) |
|
526 | 526 | |
|
527 | 527 | $ hg bookmark -r 1 -f -i default |
|
528 | 528 | $ hg clone . cloned-bookmark-default |
|
529 | 529 | updating to branch default |
|
530 | 530 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
531 | 531 | $ hg -R cloned-bookmark-default bookmarks |
|
532 | 532 | X2 1:925d80f479bb |
|
533 | 533 | Y 2:db815d6d32e6 |
|
534 | 534 | Z 2:db815d6d32e6 |
|
535 | 535 | default 1:925d80f479bb |
|
536 | 536 | x y 2:db815d6d32e6 |
|
537 | 537 | $ hg -R cloned-bookmark-default parents -q |
|
538 | 538 | 2:db815d6d32e6 |
|
539 | 539 | $ hg bookmark -d default |
|
540 | 540 | |
|
541 | 541 | test clone with a specific revision |
|
542 | 542 | |
|
543 | 543 | $ hg clone -r 925d80 . cloned-bookmarks-rev |
|
544 | 544 | adding changesets |
|
545 | 545 | adding manifests |
|
546 | 546 | adding file changes |
|
547 | 547 | added 2 changesets with 2 changes to 2 files |
|
548 | 548 | updating to branch default |
|
549 | 549 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
550 | 550 | $ hg -R cloned-bookmarks-rev bookmarks |
|
551 | 551 | X2 1:925d80f479bb |
|
552 | 552 | |
|
553 | 553 | test clone with update to a bookmark |
|
554 | 554 | |
|
555 | 555 | $ hg clone -u Z . ../cloned-bookmarks-update |
|
556 | 556 | updating to branch default |
|
557 | 557 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
558 | 558 | $ hg -R ../cloned-bookmarks-update bookmarks |
|
559 | 559 | X2 1:925d80f479bb |
|
560 | 560 | Y 2:db815d6d32e6 |
|
561 | 561 | * Z 2:db815d6d32e6 |
|
562 | 562 | x y 2:db815d6d32e6 |
|
563 | 563 | |
|
564 | 564 | create bundle with two heads |
|
565 | 565 | |
|
566 | 566 | $ hg clone . tobundle |
|
567 | 567 | updating to branch default |
|
568 | 568 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
569 | 569 | $ echo x > tobundle/x |
|
570 | 570 | $ hg -R tobundle add tobundle/x |
|
571 | 571 | $ hg -R tobundle commit -m'x' |
|
572 | 572 | $ hg -R tobundle update -r -2 |
|
573 | 573 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
574 | 574 | $ echo y > tobundle/y |
|
575 | 575 | $ hg -R tobundle branch test |
|
576 | 576 | marked working directory as branch test |
|
577 | 577 | (branches are permanent and global, did you want a bookmark?) |
|
578 | 578 | $ hg -R tobundle add tobundle/y |
|
579 | 579 | $ hg -R tobundle commit -m'y' |
|
580 | 580 | $ hg -R tobundle bundle tobundle.hg |
|
581 | 581 | searching for changes |
|
582 | 582 | 2 changesets found |
|
583 | 583 | $ hg unbundle tobundle.hg |
|
584 | 584 | adding changesets |
|
585 | 585 | adding manifests |
|
586 | 586 | adding file changes |
|
587 | 587 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
588 | 588 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
589 | 589 | |
|
590 | 590 | update to active bookmark if it's not the parent |
|
591 | 591 | |
|
592 | (it is known issue that fsmonitor can't handle nested repositories. In | |
|
593 | this test scenario, cloned-bookmark-default and tobundle exist in the | |
|
594 | working directory of current repository) | |
|
595 | ||
|
592 | 596 | $ hg summary |
|
593 | 597 | parent: 2:db815d6d32e6 |
|
594 | 598 | 2 |
|
595 | 599 | branch: default |
|
596 | 600 | bookmarks: *Z Y x y |
|
597 | commit: 1 added, 1 unknown (new branch head) | |
|
601 | commit: 1 added, 1 unknown (new branch head) (no-fsmonitor !) | |
|
602 | commit: 1 added, * unknown (new branch head) (glob) (fsmonitor !) | |
|
598 | 603 | update: 2 new changesets (update) |
|
599 | 604 | phases: 5 draft |
|
600 | 605 | $ hg update |
|
601 | 606 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
602 | 607 | updating bookmark Z |
|
603 | 608 | $ hg bookmarks |
|
604 | 609 | X2 1:925d80f479bb |
|
605 | 610 | Y 2:db815d6d32e6 |
|
606 | 611 | * Z 3:125c9a1d6df6 |
|
607 | 612 | x y 2:db815d6d32e6 |
|
608 | 613 | |
|
609 | 614 | pull --update works the same as pull && update |
|
610 | 615 | |
|
611 | 616 | $ hg bookmark -r3 Y |
|
612 | 617 |
|
|
613 | 618 | $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update |
|
614 | 619 | $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update-with-divergence |
|
615 | 620 | |
|
616 | 621 | (manual version) |
|
617 | 622 | |
|
618 | 623 | $ hg -R ../cloned-bookmarks-manual-update update Y |
|
619 | 624 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
620 | 625 | (activating bookmark Y) |
|
621 | 626 | $ hg -R ../cloned-bookmarks-manual-update pull . |
|
622 | 627 | pulling from . |
|
623 | 628 | searching for changes |
|
624 | 629 | adding changesets |
|
625 | 630 | adding manifests |
|
626 | 631 | adding file changes |
|
627 | 632 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
628 | 633 | updating bookmark Y |
|
629 | 634 | updating bookmark Z |
|
630 | 635 |
(run ' |
|
631 | 636 | |
|
632 | 637 | (# tests strange but with --date crashing when bookmark have to move) |
|
633 | 638 | |
|
634 | 639 | $ hg -R ../cloned-bookmarks-manual-update update -d 1986 |
|
635 | 640 | abort: revision matching date not found |
|
636 | 641 | [255] |
|
637 | 642 | $ hg -R ../cloned-bookmarks-manual-update update |
|
638 | 643 | updating to active bookmark Y |
|
639 | 644 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
640 | 645 | |
|
641 | 646 | (all in one version) |
|
642 | 647 | |
|
643 | 648 | $ hg -R ../cloned-bookmarks-update update Y |
|
644 | 649 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
645 | 650 | (activating bookmark Y) |
|
646 | 651 | $ hg -R ../cloned-bookmarks-update pull --update . |
|
647 | 652 | pulling from . |
|
648 | 653 | searching for changes |
|
649 | 654 | adding changesets |
|
650 | 655 | adding manifests |
|
651 | 656 | adding file changes |
|
652 | 657 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
653 | 658 | updating bookmark Y |
|
654 | 659 | updating bookmark Z |
|
655 | 660 | updating to active bookmark Y |
|
656 | 661 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
657 | 662 | |
|
658 | 663 | We warn about divergent during bare update to the active bookmark |
|
659 | 664 | |
|
660 | 665 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence update Y |
|
661 | 666 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
662 | 667 | (activating bookmark Y) |
|
663 | 668 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks -r X2 Y@1 |
|
664 | 669 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks |
|
665 | 670 | X2 1:925d80f479bb |
|
666 | 671 | * Y 2:db815d6d32e6 |
|
667 | 672 | Y@1 1:925d80f479bb |
|
668 | 673 | Z 2:db815d6d32e6 |
|
669 | 674 | x y 2:db815d6d32e6 |
|
670 | 675 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence pull |
|
671 | 676 | pulling from $TESTTMP/repo (glob) |
|
672 | 677 | searching for changes |
|
673 | 678 | adding changesets |
|
674 | 679 | adding manifests |
|
675 | 680 | adding file changes |
|
676 | 681 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
677 | 682 | updating bookmark Y |
|
678 | 683 | updating bookmark Z |
|
679 | 684 |
(run ' |
|
680 | 685 | $ hg -R ../cloned-bookmarks-manual-update-with-divergence update |
|
681 | 686 | updating to active bookmark Y |
|
682 | 687 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
683 | 688 | 1 other divergent bookmarks for "Y" |
|
684 | 689 | |
|
685 | 690 | test wrongly formated bookmark |
|
686 | 691 | |
|
687 | 692 |
$ echo |
|
688 | 693 | $ hg bookmarks |
|
689 | 694 | X2 1:925d80f479bb |
|
690 | 695 | Y 3:125c9a1d6df6 |
|
691 | 696 | * Z 3:125c9a1d6df6 |
|
692 | 697 | x y 2:db815d6d32e6 |
|
693 | 698 |
|
|
694 | 699 | $ hg bookmarks |
|
695 | 700 |
malformed line in .hg/bookmarks: " |
|
696 | 701 | X2 1:925d80f479bb |
|
697 | 702 | Y 3:125c9a1d6df6 |
|
698 | 703 | * Z 3:125c9a1d6df6 |
|
699 | 704 | x y 2:db815d6d32e6 |
|
700 | 705 | |
|
701 | 706 | test missing revisions |
|
702 | 707 | |
|
703 | 708 | $ echo "925d80f479b925d80f479bc925d80f479bccabab z" > .hg/bookmarks |
|
704 | 709 | $ hg book |
|
705 | 710 | no bookmarks set |
|
706 | 711 | |
|
707 | 712 | test stripping a non-checked-out but bookmarked revision |
|
708 | 713 | |
|
709 | 714 | $ hg log --graph |
|
710 | 715 | o changeset: 4:9ba5f110a0b3 |
|
711 | 716 | | branch: test |
|
712 | 717 | | tag: tip |
|
713 | 718 | | parent: 2:db815d6d32e6 |
|
714 | 719 | | user: test |
|
715 | 720 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
716 | 721 | | summary: y |
|
717 | 722 | | |
|
718 | 723 | | @ changeset: 3:125c9a1d6df6 |
|
719 | 724 | |/ user: test |
|
720 | 725 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
721 | 726 | | summary: x |
|
722 | 727 | | |
|
723 | 728 | o changeset: 2:db815d6d32e6 |
|
724 | 729 | | parent: 0:f7b1eb17ad24 |
|
725 | 730 | | user: test |
|
726 | 731 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
727 | 732 | | summary: 2 |
|
728 | 733 | | |
|
729 | 734 | | o changeset: 1:925d80f479bb |
|
730 | 735 | |/ user: test |
|
731 | 736 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
732 | 737 | | summary: 1 |
|
733 | 738 | | |
|
734 | 739 | o changeset: 0:f7b1eb17ad24 |
|
735 | 740 | user: test |
|
736 | 741 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
737 | 742 | summary: 0 |
|
738 | 743 | |
|
739 | 744 | $ hg book should-end-on-two |
|
740 | 745 | $ hg co --clean 4 |
|
741 | 746 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
742 | 747 | (leaving bookmark should-end-on-two) |
|
743 | 748 | $ hg book four |
|
744 | 749 | $ hg --config extensions.mq= strip 3 |
|
745 | 750 | saved backup bundle to * (glob) |
|
746 | 751 |
|
|
747 | 752 | tipmost surviving ancestor of the stripped revision. |
|
748 | 753 | $ hg log --graph |
|
749 | 754 | @ changeset: 3:9ba5f110a0b3 |
|
750 | 755 | | branch: test |
|
751 | 756 | | bookmark: four |
|
752 | 757 | | tag: tip |
|
753 | 758 | | user: test |
|
754 | 759 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
755 | 760 | | summary: y |
|
756 | 761 | | |
|
757 | 762 | o changeset: 2:db815d6d32e6 |
|
758 | 763 | | bookmark: should-end-on-two |
|
759 | 764 | | parent: 0:f7b1eb17ad24 |
|
760 | 765 | | user: test |
|
761 | 766 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
762 | 767 | | summary: 2 |
|
763 | 768 | | |
|
764 | 769 | | o changeset: 1:925d80f479bb |
|
765 | 770 | |/ user: test |
|
766 | 771 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
767 | 772 | | summary: 1 |
|
768 | 773 | | |
|
769 | 774 | o changeset: 0:f7b1eb17ad24 |
|
770 | 775 | user: test |
|
771 | 776 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
772 | 777 | summary: 0 |
|
773 | 778 |
|
|
774 | 779 | |
|
775 | 780 |
|
|
776 | 781 | |
|
782 | (it is known issue that fsmonitor can't handle nested repositories. In | |
|
783 | this test scenario, cloned-bookmark-default and tobundle exist in the | |
|
784 | working directory of current repository) | |
|
785 | ||
|
777 | 786 | $ hg bookmarks |
|
778 | 787 | * four 3:9ba5f110a0b3 |
|
779 | 788 | should-end-on-two 2:db815d6d32e6 |
|
780 | 789 | $ hg up four |
|
781 | 790 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
782 | 791 | $ hg up |
|
783 | 792 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
784 | 793 | $ hg sum |
|
785 | 794 | parent: 3:9ba5f110a0b3 tip |
|
786 | 795 | y |
|
787 | 796 | branch: test |
|
788 | 797 | bookmarks: *four |
|
789 | commit: 2 unknown (clean) | |
|
798 | commit: 2 unknown (clean) (no-fsmonitor !) | |
|
799 | commit: * unknown (clean) (glob) (fsmonitor !) | |
|
790 | 800 | update: (current) |
|
791 | 801 | phases: 4 draft |
|
792 | 802 | |
|
793 | 803 | test clearing divergent bookmarks of linear ancestors |
|
794 | 804 | |
|
795 | 805 | $ hg bookmark Z -r 0 |
|
796 | 806 | $ hg bookmark Z@1 -r 1 |
|
797 | 807 | $ hg bookmark Z@2 -r 2 |
|
798 | 808 | $ hg bookmark Z@3 -r 3 |
|
799 | 809 | $ hg book |
|
800 | 810 | Z 0:f7b1eb17ad24 |
|
801 | 811 | Z@1 1:925d80f479bb |
|
802 | 812 | Z@2 2:db815d6d32e6 |
|
803 | 813 | Z@3 3:9ba5f110a0b3 |
|
804 | 814 | * four 3:9ba5f110a0b3 |
|
805 | 815 | should-end-on-two 2:db815d6d32e6 |
|
806 | 816 | $ hg bookmark Z |
|
807 | 817 | moving bookmark 'Z' forward from f7b1eb17ad24 |
|
808 | 818 | $ hg book |
|
809 | 819 | * Z 3:9ba5f110a0b3 |
|
810 | 820 | Z@1 1:925d80f479bb |
|
811 | 821 | four 3:9ba5f110a0b3 |
|
812 | 822 | should-end-on-two 2:db815d6d32e6 |
|
813 | 823 | |
|
814 | 824 | test clearing only a single divergent bookmark across branches |
|
815 | 825 | |
|
816 | 826 | $ hg book foo -r 1 |
|
817 | 827 | $ hg book foo@1 -r 0 |
|
818 | 828 | $ hg book foo@2 -r 2 |
|
819 | 829 | $ hg book foo@3 -r 3 |
|
820 | 830 | $ hg book foo -r foo@3 |
|
821 | 831 | $ hg book |
|
822 | 832 | * Z 3:9ba5f110a0b3 |
|
823 | 833 | Z@1 1:925d80f479bb |
|
824 | 834 | foo 3:9ba5f110a0b3 |
|
825 | 835 | foo@1 0:f7b1eb17ad24 |
|
826 | 836 | foo@2 2:db815d6d32e6 |
|
827 | 837 | four 3:9ba5f110a0b3 |
|
828 | 838 | should-end-on-two 2:db815d6d32e6 |
|
829 | 839 | |
|
830 | 840 | pull --update works the same as pull && update (case #2) |
|
831 | 841 | |
|
832 | 842 | It is assumed that "hg pull" itself doesn't update current active |
|
833 | 843 | bookmark ('Y' in tests below). |
|
834 | 844 | |
|
835 | 845 | $ hg pull -q ../cloned-bookmarks-update |
|
836 | 846 | divergent bookmark Z stored as Z@2 |
|
837 | 847 | |
|
838 | 848 | (pulling revision on another named branch with --update updates |
|
839 | 849 | neither the working directory nor current active bookmark: "no-op" |
|
840 | 850 | case) |
|
841 | 851 | |
|
842 | 852 | $ echo yy >> y |
|
843 | 853 | $ hg commit -m yy |
|
844 | 854 | |
|
845 | 855 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' |
|
846 | 856 | * Y 3:125c9a1d6df6 |
|
847 | 857 | $ hg -R ../cloned-bookmarks-update pull . --update |
|
848 | 858 | pulling from . |
|
849 | 859 | searching for changes |
|
850 | 860 | adding changesets |
|
851 | 861 | adding manifests |
|
852 | 862 | adding file changes |
|
853 | 863 | added 1 changesets with 1 changes to 1 files |
|
854 | 864 | divergent bookmark Z stored as Z@default |
|
855 | 865 | adding remote bookmark foo |
|
856 | 866 | adding remote bookmark four |
|
857 | 867 | adding remote bookmark should-end-on-two |
|
858 | 868 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
859 | 869 | $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n" |
|
860 | 870 | 3:125c9a1d6df6 |
|
861 | 871 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' |
|
862 | 872 | * Y 3:125c9a1d6df6 |
|
863 | 873 | |
|
864 | 874 | (pulling revision on current named/topological branch with --update |
|
865 | 875 | updates the working directory and current active bookmark) |
|
866 | 876 | |
|
867 | 877 | $ hg update -C -q 125c9a1d6df6 |
|
868 | 878 | $ echo xx >> x |
|
869 | 879 | $ hg commit -m xx |
|
870 | 880 | |
|
871 | 881 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' |
|
872 | 882 | * Y 3:125c9a1d6df6 |
|
873 | 883 | $ hg -R ../cloned-bookmarks-update pull . --update |
|
874 | 884 | pulling from . |
|
875 | 885 | searching for changes |
|
876 | 886 | adding changesets |
|
877 | 887 | adding manifests |
|
878 | 888 | adding file changes |
|
879 | 889 | added 1 changesets with 1 changes to 1 files |
|
880 | 890 | divergent bookmark Z stored as Z@default |
|
881 | 891 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
882 | 892 | updating bookmark Y |
|
883 | 893 | $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n" |
|
884 | 894 | 6:81dcce76aa0b |
|
885 | 895 | $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y ' |
|
886 | 896 | * Y 6:81dcce76aa0b |
|
887 | 897 | |
|
888 | 898 | $ cd .. |
|
889 | 899 | |
|
890 | 900 | ensure changelog is written before bookmarks |
|
891 | 901 | $ hg init orderrepo |
|
892 | 902 | $ cd orderrepo |
|
893 | 903 | $ touch a |
|
894 | 904 | $ hg commit -Aqm one |
|
895 | 905 | $ hg book mybook |
|
896 | 906 | $ echo a > a |
|
897 | 907 | |
|
898 | 908 | $ cat > $TESTTMP/pausefinalize.py <<EOF |
|
899 | 909 | > from mercurial import extensions, localrepo |
|
900 | 910 | > import os, time |
|
901 | 911 | > def transaction(orig, self, desc, report=None): |
|
902 | 912 | > tr = orig(self, desc, report) |
|
903 | 913 | > def sleep(*args, **kwargs): |
|
904 | 914 | > retry = 20 |
|
905 | 915 | > while retry > 0 and not os.path.exists("$TESTTMP/unpause"): |
|
906 | 916 | > retry -= 1 |
|
907 | 917 | > time.sleep(0.5) |
|
908 | 918 | > if os.path.exists("$TESTTMP/unpause"): |
|
909 | 919 | > os.remove("$TESTTMP/unpause") |
|
910 | 920 | > # It is important that this finalizer start with 'a', so it runs before |
|
911 | 921 | > # the changelog finalizer appends to the changelog. |
|
912 | 922 | > tr.addfinalize('a-sleep', sleep) |
|
913 | 923 | > return tr |
|
914 | 924 | > |
|
915 | 925 | > def extsetup(ui): |
|
916 | 926 | > # This extension inserts an artifical pause during the transaction |
|
917 | 927 | > # finalizer, so we can run commands mid-transaction-close. |
|
918 | 928 | > extensions.wrapfunction(localrepo.localrepository, 'transaction', |
|
919 | 929 | > transaction) |
|
920 | 930 | > EOF |
|
921 | 931 | $ hg commit -qm two --config extensions.pausefinalize=$TESTTMP/pausefinalize.py & |
|
922 | 932 | $ sleep 2 |
|
923 | 933 | $ hg log -r . |
|
924 | 934 | changeset: 0:867bc5792c8c |
|
925 | 935 | bookmark: mybook |
|
926 | 936 | tag: tip |
|
927 | 937 | user: test |
|
928 | 938 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
929 | 939 | summary: one |
|
930 | 940 | |
|
931 | 941 | $ hg bookmarks |
|
932 | 942 | * mybook 0:867bc5792c8c |
|
933 | 943 | $ touch $TESTTMP/unpause |
|
934 | 944 | |
|
935 | 945 | $ cd .. |
|
936 | 946 | |
|
937 | 947 | check whether HG_PENDING makes pending changes only in related |
|
938 | 948 | repositories visible to an external hook. |
|
939 | 949 | |
|
940 | 950 | (emulate a transaction running concurrently by copied |
|
941 | 951 | .hg/bookmarks.pending in subsequent test) |
|
942 | 952 | |
|
943 | 953 | $ cat > $TESTTMP/savepending.sh <<EOF |
|
944 | 954 | > cp .hg/bookmarks.pending .hg/bookmarks.pending.saved |
|
945 | 955 | > exit 1 # to avoid adding new bookmark for subsequent tests |
|
946 | 956 | > EOF |
|
947 | 957 | |
|
948 | 958 | $ hg init unrelated |
|
949 | 959 | $ cd unrelated |
|
950 | 960 | $ echo a > a |
|
951 | 961 | $ hg add a |
|
952 | 962 | $ hg commit -m '#0' |
|
953 | 963 | $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" bookmarks INVISIBLE |
|
954 | 964 | transaction abort! |
|
955 | 965 | rollback completed |
|
956 | 966 | abort: pretxnclose hook exited with status 1 |
|
957 | 967 | [255] |
|
958 | 968 | $ cp .hg/bookmarks.pending.saved .hg/bookmarks.pending |
|
959 | 969 | |
|
960 | 970 | (check visible bookmarks while transaction running in repo) |
|
961 | 971 | |
|
962 | 972 | $ cat > $TESTTMP/checkpending.sh <<EOF |
|
963 | 973 | > echo "@repo" |
|
964 | 974 | > hg -R "$TESTTMP/repo" bookmarks |
|
965 | 975 | > echo "@unrelated" |
|
966 | 976 | > hg -R "$TESTTMP/unrelated" bookmarks |
|
967 | 977 | > exit 1 # to avoid adding new bookmark for subsequent tests |
|
968 | 978 | > EOF |
|
969 | 979 | |
|
970 | 980 | $ cd ../repo |
|
971 | 981 | $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" bookmarks NEW |
|
972 | 982 | @repo |
|
973 | 983 | * NEW 6:81dcce76aa0b |
|
974 | 984 | X2 1:925d80f479bb |
|
975 | 985 | Y 4:125c9a1d6df6 |
|
976 | 986 | Z 5:5fb12f0f2d51 |
|
977 | 987 | Z@1 1:925d80f479bb |
|
978 | 988 | Z@2 4:125c9a1d6df6 |
|
979 | 989 | foo 3:9ba5f110a0b3 |
|
980 | 990 | foo@1 0:f7b1eb17ad24 |
|
981 | 991 | foo@2 2:db815d6d32e6 |
|
982 | 992 | four 3:9ba5f110a0b3 |
|
983 | 993 | should-end-on-two 2:db815d6d32e6 |
|
984 | 994 | x y 2:db815d6d32e6 |
|
985 | 995 | @unrelated |
|
986 | 996 | no bookmarks set |
|
987 | 997 | transaction abort! |
|
988 | 998 | rollback completed |
|
989 | 999 | abort: pretxnclose hook exited with status 1 |
|
990 | 1000 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now