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