##// END OF EJS Templates
bookmarks: fix test broken by 0bba1ff2ac7b...
Kevin Bullock -
r18774:b616c9b8 default
parent child Browse files
Show More
@@ -1,579 +1,579 b''
1 1 $ hg init
2 2
3 3 no bookmarks
4 4
5 5 $ hg bookmarks
6 6 no bookmarks set
7 7
8 8 bookmark rev -1
9 9
10 10 $ hg bookmark X
11 11
12 12 list bookmarks
13 13
14 14 $ hg bookmarks
15 15 * X -1:000000000000
16 16
17 17 list bookmarks with color
18 18
19 19 $ hg --config extensions.color= --config color.mode=ansi \
20 20 > bookmarks --color=always
21 21 \x1b[0;32m * X -1:000000000000\x1b[0m (esc)
22 22
23 23 $ echo a > a
24 24 $ hg add a
25 25 $ hg commit -m 0
26 26
27 27 bookmark X moved to rev 0
28 28
29 29 $ hg bookmarks
30 30 * X 0:f7b1eb17ad24
31 31
32 32 look up bookmark
33 33
34 34 $ hg log -r X
35 35 changeset: 0:f7b1eb17ad24
36 36 bookmark: X
37 37 tag: tip
38 38 user: test
39 39 date: Thu Jan 01 00:00:00 1970 +0000
40 40 summary: 0
41 41
42 42
43 43 second bookmark for rev 0, command should work even with ui.strict on
44 44
45 45 $ hg --config ui.strict=1 bookmark X2
46 46
47 47 bookmark rev -1 again
48 48
49 49 $ hg bookmark -r null Y
50 50
51 51 list bookmarks
52 52
53 53 $ hg bookmarks
54 54 X 0:f7b1eb17ad24
55 55 * X2 0:f7b1eb17ad24
56 56 Y -1:000000000000
57 57
58 58 $ echo b > b
59 59 $ hg add b
60 60 $ hg commit -m 1
61 61
62 62 bookmarks revset
63 63
64 64 $ hg log -r 'bookmark()'
65 65 changeset: 0:f7b1eb17ad24
66 66 bookmark: X
67 67 user: test
68 68 date: Thu Jan 01 00:00:00 1970 +0000
69 69 summary: 0
70 70
71 71 changeset: 1:925d80f479bb
72 72 bookmark: X2
73 73 tag: tip
74 74 user: test
75 75 date: Thu Jan 01 00:00:00 1970 +0000
76 76 summary: 1
77 77
78 78 $ hg log -r 'bookmark(Y)'
79 79 $ hg log -r 'bookmark(X2)'
80 80 changeset: 1:925d80f479bb
81 81 bookmark: X2
82 82 tag: tip
83 83 user: test
84 84 date: Thu Jan 01 00:00:00 1970 +0000
85 85 summary: 1
86 86
87 87 $ hg log -r 'bookmark("re:X")'
88 88 changeset: 0:f7b1eb17ad24
89 89 bookmark: X
90 90 user: test
91 91 date: Thu Jan 01 00:00:00 1970 +0000
92 92 summary: 0
93 93
94 94 changeset: 1:925d80f479bb
95 95 bookmark: X2
96 96 tag: tip
97 97 user: test
98 98 date: Thu Jan 01 00:00:00 1970 +0000
99 99 summary: 1
100 100
101 101 $ hg log -r 'bookmark(unknown)'
102 102 abort: bookmark 'unknown' does not exist
103 103 [255]
104 104
105 105 $ hg help revsets | grep 'bookmark('
106 106 "bookmark([name])"
107 107
108 108 bookmarks X and X2 moved to rev 1, Y at rev -1
109 109
110 110 $ hg bookmarks
111 111 X 0:f7b1eb17ad24
112 112 * X2 1:925d80f479bb
113 113 Y -1:000000000000
114 114
115 115 bookmark rev 0 again
116 116
117 117 $ hg bookmark -r 0 Z
118 118
119 119 $ hg update X
120 120 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
121 121 $ echo c > c
122 122 $ hg add c
123 123 $ hg commit -m 2
124 124 created new head
125 125
126 126 bookmarks X moved to rev 2, Y at rev -1, Z at rev 0
127 127
128 128 $ hg bookmarks
129 129 * X 2:db815d6d32e6
130 130 X2 1:925d80f479bb
131 131 Y -1:000000000000
132 132 Z 0:f7b1eb17ad24
133 133
134 134 rename nonexistent bookmark
135 135
136 136 $ hg bookmark -m A B
137 137 abort: bookmark 'A' does not exist
138 138 [255]
139 139
140 140 rename to existent bookmark
141 141
142 142 $ hg bookmark -m X Y
143 143 abort: bookmark 'Y' already exists (use -f to force)
144 144 [255]
145 145
146 146 force rename to existent bookmark
147 147
148 148 $ hg bookmark -f -m X Y
149 149
150 150 list bookmarks
151 151
152 152 $ hg bookmark
153 153 X2 1:925d80f479bb
154 154 * Y 2:db815d6d32e6
155 155 Z 0:f7b1eb17ad24
156 156
157 157 bookmarks from a revset
158 158 $ hg bookmark -r '.^1' REVSET
159 159 $ hg bookmark -r ':tip' TIP
160 160 $ hg bookmarks
161 161 REVSET 0:f7b1eb17ad24
162 162 * TIP 2:db815d6d32e6
163 163 X2 1:925d80f479bb
164 164 Y 2:db815d6d32e6
165 165 Z 0:f7b1eb17ad24
166 166
167 167 $ hg bookmark -d REVSET
168 168 $ hg bookmark -d TIP
169 169
170 170 rename without new name
171 171
172 172 $ hg bookmark -m Y
173 173 abort: new bookmark name required
174 174 [255]
175 175
176 176 delete without name
177 177
178 178 $ hg bookmark -d
179 179 abort: bookmark name required
180 180 [255]
181 181
182 182 delete nonexistent bookmark
183 183
184 184 $ hg bookmark -d A
185 185 abort: bookmark 'A' does not exist
186 186 [255]
187 187
188 188 bookmark name with spaces should be stripped
189 189
190 190 $ hg bookmark ' x y '
191 191
192 192 list bookmarks
193 193
194 194 $ hg bookmarks
195 195 X2 1:925d80f479bb
196 196 Y 2:db815d6d32e6
197 197 Z 0:f7b1eb17ad24
198 198 * x y 2:db815d6d32e6
199 199
200 200 look up stripped bookmark name
201 201
202 202 $ hg log -r '"x y"'
203 203 changeset: 2:db815d6d32e6
204 204 bookmark: Y
205 205 bookmark: x y
206 206 tag: tip
207 207 parent: 0:f7b1eb17ad24
208 208 user: test
209 209 date: Thu Jan 01 00:00:00 1970 +0000
210 210 summary: 2
211 211
212 212
213 213 reject bookmark name with newline
214 214
215 215 $ hg bookmark '
216 216 > '
217 217 abort: bookmark names cannot consist entirely of whitespace
218 218 [255]
219 219
220 220 $ hg bookmark -m Z '
221 221 > '
222 222 abort: bookmark names cannot consist entirely of whitespace
223 223 [255]
224 224
225 225 bookmark with reserved name
226 226
227 227 $ hg bookmark tip
228 228 abort: the name 'tip' is reserved
229 229 [255]
230 230
231 231 $ hg bookmark .
232 232 abort: the name '.' is reserved
233 233 [255]
234 234
235 235 $ hg bookmark null
236 236 abort: the name 'null' is reserved
237 237 [255]
238 238
239 239
240 240 bookmark with existing name
241 241
242 242 $ hg bookmark X2
243 243 abort: bookmark 'X2' already exists (use -f to force)
244 244 [255]
245 245
246 246 $ hg bookmark -m Y Z
247 247 abort: bookmark 'Z' already exists (use -f to force)
248 248 [255]
249 249
250 250 bookmark with name of branch
251 251
252 252 $ hg bookmark default
253 253 abort: a bookmark cannot have the name of an existing branch
254 254 [255]
255 255
256 256 $ hg bookmark -m Y default
257 257 abort: a bookmark cannot have the name of an existing branch
258 258 [255]
259 259
260 260 bookmark with integer name
261 261
262 262 $ hg bookmark 10
263 263 abort: a bookmark cannot have an integer as its name
264 264 [255]
265 265
266 266 incompatible options
267 267
268 268 $ hg bookmark -m Y -d Z
269 269 abort: --delete and --rename are incompatible
270 270 [255]
271 271
272 272 $ hg bookmark -r 1 -d Z
273 273 abort: --rev is incompatible with --delete
274 274 [255]
275 275
276 276 $ hg bookmark -r 1 -m Z Y
277 277 abort: --rev is incompatible with --rename
278 278 [255]
279 279
280 280 force bookmark with existing name
281 281
282 282 $ hg bookmark -f X2
283 283 $ hg bookmark -fr1 X2
284 284
285 285 forward bookmark to descendant without --force
286 286
287 287 $ hg bookmark Z
288 moving bookmark 'Z' forward from 663762316562
288 moving bookmark 'Z' forward from f7b1eb17ad24
289 289
290 290 list bookmarks
291 291
292 292 $ hg bookmark
293 293 X2 1:925d80f479bb
294 294 Y 2:db815d6d32e6
295 295 * Z 2:db815d6d32e6
296 296 x y 2:db815d6d32e6
297 297
298 298 revision but no bookmark name
299 299
300 300 $ hg bookmark -r .
301 301 abort: bookmark name required
302 302 [255]
303 303
304 304 bookmark name with whitespace only
305 305
306 306 $ hg bookmark ' '
307 307 abort: bookmark names cannot consist entirely of whitespace
308 308 [255]
309 309
310 310 $ hg bookmark -m Y ' '
311 311 abort: bookmark names cannot consist entirely of whitespace
312 312 [255]
313 313
314 314 invalid bookmark
315 315
316 316 $ hg bookmark 'foo:bar'
317 317 abort: ':' cannot be used in a name
318 318 [255]
319 319
320 320 $ hg bookmark 'foo
321 321 > bar'
322 322 abort: '\n' cannot be used in a name
323 323 [255]
324 324
325 325 the bookmark extension should be ignored now that it is part of core
326 326
327 327 $ echo "[extensions]" >> $HGRCPATH
328 328 $ echo "bookmarks=" >> $HGRCPATH
329 329 $ hg bookmarks
330 330 X2 1:925d80f479bb
331 331 Y 2:db815d6d32e6
332 332 * Z 2:db815d6d32e6
333 333 x y 2:db815d6d32e6
334 334
335 335 test summary
336 336
337 337 $ hg summary
338 338 parent: 2:db815d6d32e6 tip
339 339 2
340 340 branch: default
341 341 bookmarks: *Z Y x y
342 342 commit: (clean)
343 343 update: 1 new changesets, 2 branch heads (merge)
344 344
345 345 test id
346 346
347 347 $ hg id
348 348 db815d6d32e6 tip Y/Z/x y
349 349
350 350 test rollback
351 351
352 352 $ echo foo > f1
353 353 $ hg ci -Amr
354 354 adding f1
355 355 $ hg bookmark -f Y -r 1
356 356 $ hg bookmark -f Z -r 1
357 357 $ hg rollback
358 358 repository tip rolled back to revision 2 (undo commit)
359 359 working directory now based on revision 2
360 360 $ hg bookmarks
361 361 X2 1:925d80f479bb
362 362 Y 2:db815d6d32e6
363 363 * Z 2:db815d6d32e6
364 364 x y 2:db815d6d32e6
365 365
366 366 test clone
367 367
368 368 $ hg bookmark -r 2 -i @
369 369 $ hg bookmark -r 2 -i a@
370 370 $ hg bookmarks
371 371 @ 2:db815d6d32e6
372 372 X2 1:925d80f479bb
373 373 Y 2:db815d6d32e6
374 374 * Z 2:db815d6d32e6
375 375 a@ 2:db815d6d32e6
376 376 x y 2:db815d6d32e6
377 377 $ hg clone . cloned-bookmarks
378 378 updating to bookmark @
379 379 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 380 $ hg -R cloned-bookmarks bookmarks
381 381 * @ 2:db815d6d32e6
382 382 X2 1:925d80f479bb
383 383 Y 2:db815d6d32e6
384 384 Z 2:db815d6d32e6
385 385 a@ 2:db815d6d32e6
386 386 x y 2:db815d6d32e6
387 387
388 388 test clone with pull protocol
389 389
390 390 $ hg clone --pull . cloned-bookmarks-pull
391 391 requesting all changes
392 392 adding changesets
393 393 adding manifests
394 394 adding file changes
395 395 added 3 changesets with 3 changes to 3 files (+1 heads)
396 396 updating to bookmark @
397 397 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
398 398 $ hg -R cloned-bookmarks-pull bookmarks
399 399 * @ 2:db815d6d32e6
400 400 X2 1:925d80f479bb
401 401 Y 2:db815d6d32e6
402 402 Z 2:db815d6d32e6
403 403 a@ 2:db815d6d32e6
404 404 x y 2:db815d6d32e6
405 405
406 406 $ hg bookmark -d @
407 407 $ hg bookmark -d a@
408 408
409 409 test clone with a bookmark named "default" (issue3677)
410 410
411 411 $ hg bookmark -r 1 -f -i default
412 412 $ hg clone . cloned-bookmark-default
413 413 updating to branch default
414 414 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 415 $ hg -R cloned-bookmark-default bookmarks
416 416 X2 1:925d80f479bb
417 417 Y 2:db815d6d32e6
418 418 Z 2:db815d6d32e6
419 419 default 1:925d80f479bb
420 420 x y 2:db815d6d32e6
421 421 $ hg -R cloned-bookmark-default parents -q
422 422 2:db815d6d32e6
423 423 $ hg bookmark -d default
424 424
425 425 test clone with a specific revision
426 426
427 427 $ hg clone -r 925d80 . cloned-bookmarks-rev
428 428 adding changesets
429 429 adding manifests
430 430 adding file changes
431 431 added 2 changesets with 2 changes to 2 files
432 432 updating to branch default
433 433 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 434 $ hg -R cloned-bookmarks-rev bookmarks
435 435 X2 1:925d80f479bb
436 436
437 437 test clone with update to a bookmark
438 438
439 439 $ hg clone -u Z . cloned-bookmarks-update
440 440 updating to branch default
441 441 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 442 $ hg -R cloned-bookmarks-update bookmarks
443 443 X2 1:925d80f479bb
444 444 Y 2:db815d6d32e6
445 445 * Z 2:db815d6d32e6
446 446 x y 2:db815d6d32e6
447 447
448 448 create bundle with two heads
449 449
450 450 $ hg clone . tobundle
451 451 updating to branch default
452 452 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
453 453 $ echo x > tobundle/x
454 454 $ hg -R tobundle add tobundle/x
455 455 $ hg -R tobundle commit -m'x'
456 456 $ hg -R tobundle update -r -2
457 457 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
458 458 $ echo y > tobundle/y
459 459 $ hg -R tobundle branch test
460 460 marked working directory as branch test
461 461 (branches are permanent and global, did you want a bookmark?)
462 462 $ hg -R tobundle add tobundle/y
463 463 $ hg -R tobundle commit -m'y'
464 464 $ hg -R tobundle bundle tobundle.hg
465 465 searching for changes
466 466 2 changesets found
467 467 $ hg unbundle tobundle.hg
468 468 adding changesets
469 469 adding manifests
470 470 adding file changes
471 471 added 2 changesets with 2 changes to 2 files (+1 heads)
472 472 (run 'hg heads' to see heads, 'hg merge' to merge)
473 473
474 474 update to current bookmark if it's not the parent
475 475
476 476 $ hg summary
477 477 parent: 2:db815d6d32e6
478 478 2
479 479 branch: default
480 480 bookmarks: [Z] Y x y
481 481 commit: 1 added, 1 unknown (new branch head)
482 482 update: 2 new changesets (update)
483 483 $ hg update
484 484 updating to active bookmark Z
485 485 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 486 $ hg bookmarks
487 487 X2 1:925d80f479bb
488 488 Y 2:db815d6d32e6
489 489 * Z 3:125c9a1d6df6
490 490 x y 2:db815d6d32e6
491 491
492 492 test wrongly formated bookmark
493 493
494 494 $ echo '' >> .hg/bookmarks
495 495 $ hg bookmarks
496 496 X2 1:925d80f479bb
497 497 Y 2:db815d6d32e6
498 498 * Z 3:125c9a1d6df6
499 499 x y 2:db815d6d32e6
500 500 $ echo "Ican'thasformatedlines" >> .hg/bookmarks
501 501 $ hg bookmarks
502 502 malformed line in .hg/bookmarks: "Ican'thasformatedlines"
503 503 X2 1:925d80f479bb
504 504 Y 2:db815d6d32e6
505 505 * Z 3:125c9a1d6df6
506 506 x y 2:db815d6d32e6
507 507
508 508 test missing revisions
509 509
510 510 $ echo "925d80f479bc z" > .hg/bookmarks
511 511 $ hg book
512 512 no bookmarks set
513 513
514 514 test stripping a non-checked-out but bookmarked revision
515 515
516 516 $ hg --config extensions.graphlog= log --graph
517 517 o changeset: 4:9ba5f110a0b3
518 518 | branch: test
519 519 | tag: tip
520 520 | parent: 2:db815d6d32e6
521 521 | user: test
522 522 | date: Thu Jan 01 00:00:00 1970 +0000
523 523 | summary: y
524 524 |
525 525 | @ changeset: 3:125c9a1d6df6
526 526 |/ user: test
527 527 | date: Thu Jan 01 00:00:00 1970 +0000
528 528 | summary: x
529 529 |
530 530 o changeset: 2:db815d6d32e6
531 531 | parent: 0:f7b1eb17ad24
532 532 | user: test
533 533 | date: Thu Jan 01 00:00:00 1970 +0000
534 534 | summary: 2
535 535 |
536 536 | o changeset: 1:925d80f479bb
537 537 |/ user: test
538 538 | date: Thu Jan 01 00:00:00 1970 +0000
539 539 | summary: 1
540 540 |
541 541 o changeset: 0:f7b1eb17ad24
542 542 user: test
543 543 date: Thu Jan 01 00:00:00 1970 +0000
544 544 summary: 0
545 545
546 546 $ hg book should-end-on-two
547 547 $ hg co --clean 4
548 548 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
549 549 $ hg book four
550 550 $ hg --config extensions.mq= strip 3
551 551 saved backup bundle to * (glob)
552 552 should-end-on-two should end up pointing to revision 2, as that's the
553 553 tipmost surviving ancestor of the stripped revision.
554 554 $ hg --config extensions.graphlog= log --graph
555 555 @ changeset: 3:9ba5f110a0b3
556 556 | branch: test
557 557 | bookmark: four
558 558 | tag: tip
559 559 | user: test
560 560 | date: Thu Jan 01 00:00:00 1970 +0000
561 561 | summary: y
562 562 |
563 563 o changeset: 2:db815d6d32e6
564 564 | bookmark: should-end-on-two
565 565 | parent: 0:f7b1eb17ad24
566 566 | user: test
567 567 | date: Thu Jan 01 00:00:00 1970 +0000
568 568 | summary: 2
569 569 |
570 570 | o changeset: 1:925d80f479bb
571 571 |/ user: test
572 572 | date: Thu Jan 01 00:00:00 1970 +0000
573 573 | summary: 1
574 574 |
575 575 o changeset: 0:f7b1eb17ad24
576 576 user: test
577 577 date: Thu Jan 01 00:00:00 1970 +0000
578 578 summary: 0
579 579
General Comments 0
You need to be logged in to leave comments. Login now