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