##// END OF EJS Templates
test-log: test that fctx.ancestors() can't index parents only by linkrev...
Yuya Nishihara -
r35270:2af38229 default
parent child Browse files
Show More
@@ -1,2395 +1,2466 b''
1 1 Log on empty repository: checking consistency
2 2
3 3 $ hg init empty
4 4 $ cd empty
5 5 $ hg log
6 6 $ hg log -r 1
7 7 abort: unknown revision '1'!
8 8 [255]
9 9 $ hg log -r -1:0
10 10 abort: unknown revision '-1'!
11 11 [255]
12 12 $ hg log -r 'branch(name)'
13 13 abort: unknown revision 'name'!
14 14 [255]
15 15 $ hg log -r null -q
16 16 -1:000000000000
17 17
18 18 $ cd ..
19 19
20 20 The g is crafted to have 2 filelog topological heads in a linear
21 21 changeset graph
22 22
23 23 $ hg init a
24 24 $ cd a
25 25 $ echo a > a
26 26 $ echo f > f
27 27 $ hg ci -Ama -d '1 0'
28 28 adding a
29 29 adding f
30 30
31 31 $ hg cp a b
32 32 $ hg cp f g
33 33 $ hg ci -mb -d '2 0'
34 34
35 35 $ mkdir dir
36 36 $ hg mv b dir
37 37 $ echo g >> g
38 38 $ echo f >> f
39 39 $ hg ci -mc -d '3 0'
40 40
41 41 $ hg mv a b
42 42 $ hg cp -f f g
43 43 $ echo a > d
44 44 $ hg add d
45 45 $ hg ci -md -d '4 0'
46 46
47 47 $ hg mv dir/b e
48 48 $ hg ci -me -d '5 0'
49 49
50 50 Make sure largefiles doesn't interfere with logging a regular file
51 51 $ hg --debug log a -T '{rev}: {desc}\n' --config extensions.largefiles=
52 52 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
53 53 updated patterns: .hglf/a, a
54 54 0: a
55 55 $ hg log a
56 56 changeset: 0:9161b9aeaf16
57 57 user: test
58 58 date: Thu Jan 01 00:00:01 1970 +0000
59 59 summary: a
60 60
61 61 $ hg log glob:a*
62 62 changeset: 3:2ca5ba701980
63 63 user: test
64 64 date: Thu Jan 01 00:00:04 1970 +0000
65 65 summary: d
66 66
67 67 changeset: 0:9161b9aeaf16
68 68 user: test
69 69 date: Thu Jan 01 00:00:01 1970 +0000
70 70 summary: a
71 71
72 72 $ hg --debug log glob:a* -T '{rev}: {desc}\n' --config extensions.largefiles=
73 73 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
74 74 updated patterns: glob:.hglf/a*, glob:a*
75 75 3: d
76 76 0: a
77 77
78 78 log on directory
79 79
80 80 $ hg log dir
81 81 changeset: 4:7e4639b4691b
82 82 tag: tip
83 83 user: test
84 84 date: Thu Jan 01 00:00:05 1970 +0000
85 85 summary: e
86 86
87 87 changeset: 2:f8954cd4dc1f
88 88 user: test
89 89 date: Thu Jan 01 00:00:03 1970 +0000
90 90 summary: c
91 91
92 92 $ hg log somethingthatdoesntexist dir
93 93 changeset: 4:7e4639b4691b
94 94 tag: tip
95 95 user: test
96 96 date: Thu Jan 01 00:00:05 1970 +0000
97 97 summary: e
98 98
99 99 changeset: 2:f8954cd4dc1f
100 100 user: test
101 101 date: Thu Jan 01 00:00:03 1970 +0000
102 102 summary: c
103 103
104 104
105 105 -f, non-existent directory
106 106
107 107 $ hg log -f dir
108 108 abort: cannot follow file not in parent revision: "dir"
109 109 [255]
110 110
111 111 -f, directory
112 112
113 113 $ hg up -q 3
114 114 $ hg log -f dir
115 115 changeset: 2:f8954cd4dc1f
116 116 user: test
117 117 date: Thu Jan 01 00:00:03 1970 +0000
118 118 summary: c
119 119
120 120 -f, directory with --patch
121 121
122 122 $ hg log -f dir -p
123 123 changeset: 2:f8954cd4dc1f
124 124 user: test
125 125 date: Thu Jan 01 00:00:03 1970 +0000
126 126 summary: c
127 127
128 128 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
129 129 --- /dev/null* (glob)
130 130 +++ b/dir/b* (glob)
131 131 @@ -0,0 +1,1 @@
132 132 +a
133 133
134 134
135 135 -f, pattern
136 136
137 137 $ hg log -f -I 'dir**' -p
138 138 changeset: 2:f8954cd4dc1f
139 139 user: test
140 140 date: Thu Jan 01 00:00:03 1970 +0000
141 141 summary: c
142 142
143 143 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
144 144 --- /dev/null* (glob)
145 145 +++ b/dir/b* (glob)
146 146 @@ -0,0 +1,1 @@
147 147 +a
148 148
149 149 $ hg up -q 4
150 150
151 151 -f, a wrong style
152 152
153 153 $ hg log -f -l1 --style something
154 154 abort: style 'something' not found
155 155 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
156 156 [255]
157 157
158 158 -f, phases style
159 159
160 160
161 161 $ hg log -f -l1 --style phases
162 162 changeset: 4:7e4639b4691b
163 163 tag: tip
164 164 phase: draft
165 165 user: test
166 166 date: Thu Jan 01 00:00:05 1970 +0000
167 167 summary: e
168 168
169 169
170 170 $ hg log -f -l1 --style phases -q
171 171 4:7e4639b4691b
172 172
173 173 -f, but no args
174 174
175 175 $ hg log -f
176 176 changeset: 4:7e4639b4691b
177 177 tag: tip
178 178 user: test
179 179 date: Thu Jan 01 00:00:05 1970 +0000
180 180 summary: e
181 181
182 182 changeset: 3:2ca5ba701980
183 183 user: test
184 184 date: Thu Jan 01 00:00:04 1970 +0000
185 185 summary: d
186 186
187 187 changeset: 2:f8954cd4dc1f
188 188 user: test
189 189 date: Thu Jan 01 00:00:03 1970 +0000
190 190 summary: c
191 191
192 192 changeset: 1:d89b0a12d229
193 193 user: test
194 194 date: Thu Jan 01 00:00:02 1970 +0000
195 195 summary: b
196 196
197 197 changeset: 0:9161b9aeaf16
198 198 user: test
199 199 date: Thu Jan 01 00:00:01 1970 +0000
200 200 summary: a
201 201
202 202
203 203 one rename
204 204
205 205 $ hg up -q 2
206 206 $ hg log -vf a
207 207 changeset: 0:9161b9aeaf16
208 208 user: test
209 209 date: Thu Jan 01 00:00:01 1970 +0000
210 210 files: a f
211 211 description:
212 212 a
213 213
214 214
215 215
216 216 many renames
217 217
218 218 $ hg up -q tip
219 219 $ hg log -vf e
220 220 changeset: 4:7e4639b4691b
221 221 tag: tip
222 222 user: test
223 223 date: Thu Jan 01 00:00:05 1970 +0000
224 224 files: dir/b e
225 225 description:
226 226 e
227 227
228 228
229 229 changeset: 2:f8954cd4dc1f
230 230 user: test
231 231 date: Thu Jan 01 00:00:03 1970 +0000
232 232 files: b dir/b f g
233 233 description:
234 234 c
235 235
236 236
237 237 changeset: 1:d89b0a12d229
238 238 user: test
239 239 date: Thu Jan 01 00:00:02 1970 +0000
240 240 files: b g
241 241 description:
242 242 b
243 243
244 244
245 245 changeset: 0:9161b9aeaf16
246 246 user: test
247 247 date: Thu Jan 01 00:00:01 1970 +0000
248 248 files: a f
249 249 description:
250 250 a
251 251
252 252
253 253
254 254
255 255 log -pf dir/b
256 256
257 257 $ hg up -q 3
258 258 $ hg log -pf dir/b
259 259 changeset: 2:f8954cd4dc1f
260 260 user: test
261 261 date: Thu Jan 01 00:00:03 1970 +0000
262 262 summary: c
263 263
264 264 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
265 265 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
266 266 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
267 267 @@ -0,0 +1,1 @@
268 268 +a
269 269
270 270 changeset: 1:d89b0a12d229
271 271 user: test
272 272 date: Thu Jan 01 00:00:02 1970 +0000
273 273 summary: b
274 274
275 275 diff -r 9161b9aeaf16 -r d89b0a12d229 b
276 276 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
277 277 +++ b/b Thu Jan 01 00:00:02 1970 +0000
278 278 @@ -0,0 +1,1 @@
279 279 +a
280 280
281 281 changeset: 0:9161b9aeaf16
282 282 user: test
283 283 date: Thu Jan 01 00:00:01 1970 +0000
284 284 summary: a
285 285
286 286 diff -r 000000000000 -r 9161b9aeaf16 a
287 287 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
288 288 +++ b/a Thu Jan 01 00:00:01 1970 +0000
289 289 @@ -0,0 +1,1 @@
290 290 +a
291 291
292 292
293 293 log -pf b inside dir
294 294
295 295 $ hg --cwd=dir log -pf b
296 296 changeset: 2:f8954cd4dc1f
297 297 user: test
298 298 date: Thu Jan 01 00:00:03 1970 +0000
299 299 summary: c
300 300
301 301 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
302 302 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
303 303 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
304 304 @@ -0,0 +1,1 @@
305 305 +a
306 306
307 307 changeset: 1:d89b0a12d229
308 308 user: test
309 309 date: Thu Jan 01 00:00:02 1970 +0000
310 310 summary: b
311 311
312 312 diff -r 9161b9aeaf16 -r d89b0a12d229 b
313 313 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
314 314 +++ b/b Thu Jan 01 00:00:02 1970 +0000
315 315 @@ -0,0 +1,1 @@
316 316 +a
317 317
318 318 changeset: 0:9161b9aeaf16
319 319 user: test
320 320 date: Thu Jan 01 00:00:01 1970 +0000
321 321 summary: a
322 322
323 323 diff -r 000000000000 -r 9161b9aeaf16 a
324 324 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
325 325 +++ b/a Thu Jan 01 00:00:01 1970 +0000
326 326 @@ -0,0 +1,1 @@
327 327 +a
328 328
329 329
330 330 log -pf, but no args
331 331
332 332 $ hg log -pf
333 333 changeset: 3:2ca5ba701980
334 334 user: test
335 335 date: Thu Jan 01 00:00:04 1970 +0000
336 336 summary: d
337 337
338 338 diff -r f8954cd4dc1f -r 2ca5ba701980 a
339 339 --- a/a Thu Jan 01 00:00:03 1970 +0000
340 340 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
341 341 @@ -1,1 +0,0 @@
342 342 -a
343 343 diff -r f8954cd4dc1f -r 2ca5ba701980 b
344 344 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
345 345 +++ b/b Thu Jan 01 00:00:04 1970 +0000
346 346 @@ -0,0 +1,1 @@
347 347 +a
348 348 diff -r f8954cd4dc1f -r 2ca5ba701980 d
349 349 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
350 350 +++ b/d Thu Jan 01 00:00:04 1970 +0000
351 351 @@ -0,0 +1,1 @@
352 352 +a
353 353 diff -r f8954cd4dc1f -r 2ca5ba701980 g
354 354 --- a/g Thu Jan 01 00:00:03 1970 +0000
355 355 +++ b/g Thu Jan 01 00:00:04 1970 +0000
356 356 @@ -1,2 +1,2 @@
357 357 f
358 358 -g
359 359 +f
360 360
361 361 changeset: 2:f8954cd4dc1f
362 362 user: test
363 363 date: Thu Jan 01 00:00:03 1970 +0000
364 364 summary: c
365 365
366 366 diff -r d89b0a12d229 -r f8954cd4dc1f b
367 367 --- a/b Thu Jan 01 00:00:02 1970 +0000
368 368 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
369 369 @@ -1,1 +0,0 @@
370 370 -a
371 371 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
372 372 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
373 373 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
374 374 @@ -0,0 +1,1 @@
375 375 +a
376 376 diff -r d89b0a12d229 -r f8954cd4dc1f f
377 377 --- a/f Thu Jan 01 00:00:02 1970 +0000
378 378 +++ b/f Thu Jan 01 00:00:03 1970 +0000
379 379 @@ -1,1 +1,2 @@
380 380 f
381 381 +f
382 382 diff -r d89b0a12d229 -r f8954cd4dc1f g
383 383 --- a/g Thu Jan 01 00:00:02 1970 +0000
384 384 +++ b/g Thu Jan 01 00:00:03 1970 +0000
385 385 @@ -1,1 +1,2 @@
386 386 f
387 387 +g
388 388
389 389 changeset: 1:d89b0a12d229
390 390 user: test
391 391 date: Thu Jan 01 00:00:02 1970 +0000
392 392 summary: b
393 393
394 394 diff -r 9161b9aeaf16 -r d89b0a12d229 b
395 395 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
396 396 +++ b/b Thu Jan 01 00:00:02 1970 +0000
397 397 @@ -0,0 +1,1 @@
398 398 +a
399 399 diff -r 9161b9aeaf16 -r d89b0a12d229 g
400 400 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
401 401 +++ b/g Thu Jan 01 00:00:02 1970 +0000
402 402 @@ -0,0 +1,1 @@
403 403 +f
404 404
405 405 changeset: 0:9161b9aeaf16
406 406 user: test
407 407 date: Thu Jan 01 00:00:01 1970 +0000
408 408 summary: a
409 409
410 410 diff -r 000000000000 -r 9161b9aeaf16 a
411 411 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
412 412 +++ b/a Thu Jan 01 00:00:01 1970 +0000
413 413 @@ -0,0 +1,1 @@
414 414 +a
415 415 diff -r 000000000000 -r 9161b9aeaf16 f
416 416 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
417 417 +++ b/f Thu Jan 01 00:00:01 1970 +0000
418 418 @@ -0,0 +1,1 @@
419 419 +f
420 420
421 421
422 422 log -vf dir/b
423 423
424 424 $ hg log -vf dir/b
425 425 changeset: 2:f8954cd4dc1f
426 426 user: test
427 427 date: Thu Jan 01 00:00:03 1970 +0000
428 428 files: b dir/b f g
429 429 description:
430 430 c
431 431
432 432
433 433 changeset: 1:d89b0a12d229
434 434 user: test
435 435 date: Thu Jan 01 00:00:02 1970 +0000
436 436 files: b g
437 437 description:
438 438 b
439 439
440 440
441 441 changeset: 0:9161b9aeaf16
442 442 user: test
443 443 date: Thu Jan 01 00:00:01 1970 +0000
444 444 files: a f
445 445 description:
446 446 a
447 447
448 448
449 449
450 450
451 451 -f and multiple filelog heads
452 452
453 453 $ hg up -q 2
454 454 $ hg log -f g --template '{rev}\n'
455 455 2
456 456 1
457 457 0
458 458 $ hg up -q tip
459 459 $ hg log -f g --template '{rev}\n'
460 460 3
461 461 2
462 462 0
463 463
464 464
465 465 log copies with --copies
466 466
467 467 $ hg log -vC --template '{rev} {file_copies}\n'
468 468 4 e (dir/b)
469 469 3 b (a)g (f)
470 470 2 dir/b (b)
471 471 1 b (a)g (f)
472 472 0
473 473
474 474 log copies switch without --copies, with old filecopy template
475 475
476 476 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
477 477 4
478 478 3
479 479 2
480 480 1
481 481 0
482 482
483 483 log copies switch with --copies
484 484
485 485 $ hg log -vC --template '{rev} {file_copies_switch}\n'
486 486 4 e (dir/b)
487 487 3 b (a)g (f)
488 488 2 dir/b (b)
489 489 1 b (a)g (f)
490 490 0
491 491
492 492
493 493 log copies with hardcoded style and with --style=default
494 494
495 495 $ hg log -vC -r4
496 496 changeset: 4:7e4639b4691b
497 497 tag: tip
498 498 user: test
499 499 date: Thu Jan 01 00:00:05 1970 +0000
500 500 files: dir/b e
501 501 copies: e (dir/b)
502 502 description:
503 503 e
504 504
505 505
506 506 $ hg log -vC -r4 --style=default
507 507 changeset: 4:7e4639b4691b
508 508 tag: tip
509 509 user: test
510 510 date: Thu Jan 01 00:00:05 1970 +0000
511 511 files: dir/b e
512 512 copies: e (dir/b)
513 513 description:
514 514 e
515 515
516 516
517 517 $ hg log -vC -r4 -Tjson
518 518 [
519 519 {
520 520 "rev": 4,
521 521 "node": "7e4639b4691b9f84b81036a8d4fb218ce3c5e3a3",
522 522 "branch": "default",
523 523 "phase": "draft",
524 524 "user": "test",
525 525 "date": [5, 0],
526 526 "desc": "e",
527 527 "bookmarks": [],
528 528 "tags": ["tip"],
529 529 "parents": ["2ca5ba7019804f1f597249caddf22a64d34df0ba"],
530 530 "files": ["dir/b", "e"],
531 531 "copies": {"e": "dir/b"}
532 532 }
533 533 ]
534 534
535 535 log copies, non-linear manifest
536 536
537 537 $ hg up -C 3
538 538 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
539 539 $ hg mv dir/b e
540 540 $ echo foo > foo
541 541 $ hg ci -Ame2 -d '6 0'
542 542 adding foo
543 543 created new head
544 544 $ hg log -v --template '{rev} {file_copies}\n' -r 5
545 545 5 e (dir/b)
546 546
547 547
548 548 log copies, execute bit set
549 549
550 550 #if execbit
551 551 $ chmod +x e
552 552 $ hg ci -me3 -d '7 0'
553 553 $ hg log -v --template '{rev} {file_copies}\n' -r 6
554 554 6
555 555 #endif
556 556
557 557
558 558 log -p d
559 559
560 560 $ hg log -pv d
561 561 changeset: 3:2ca5ba701980
562 562 user: test
563 563 date: Thu Jan 01 00:00:04 1970 +0000
564 564 files: a b d g
565 565 description:
566 566 d
567 567
568 568
569 569 diff -r f8954cd4dc1f -r 2ca5ba701980 d
570 570 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
571 571 +++ b/d Thu Jan 01 00:00:04 1970 +0000
572 572 @@ -0,0 +1,1 @@
573 573 +a
574 574
575 575
576 576
577 577 log --removed file
578 578
579 579 $ hg log --removed -v a
580 580 changeset: 3:2ca5ba701980
581 581 user: test
582 582 date: Thu Jan 01 00:00:04 1970 +0000
583 583 files: a b d g
584 584 description:
585 585 d
586 586
587 587
588 588 changeset: 0:9161b9aeaf16
589 589 user: test
590 590 date: Thu Jan 01 00:00:01 1970 +0000
591 591 files: a f
592 592 description:
593 593 a
594 594
595 595
596 596
597 597 log --removed revrange file
598 598
599 599 $ hg log --removed -v -r0:2 a
600 600 changeset: 0:9161b9aeaf16
601 601 user: test
602 602 date: Thu Jan 01 00:00:01 1970 +0000
603 603 files: a f
604 604 description:
605 605 a
606 606
607 607
608 608 $ cd ..
609 609
610 610 log --follow tests
611 611
612 612 $ hg init follow
613 613 $ cd follow
614 614
615 615 $ echo base > base
616 616 $ hg ci -Ambase -d '1 0'
617 617 adding base
618 618
619 619 $ echo r1 >> base
620 620 $ hg ci -Amr1 -d '1 0'
621 621 $ echo r2 >> base
622 622 $ hg ci -Amr2 -d '1 0'
623 623
624 624 $ hg up -C 1
625 625 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
626 626 $ echo b1 > b1
627 627
628 628 log -r "follow('set:clean()')"
629 629
630 630 $ hg log -r "follow('set:clean()')"
631 631 changeset: 0:67e992f2c4f3
632 632 user: test
633 633 date: Thu Jan 01 00:00:01 1970 +0000
634 634 summary: base
635 635
636 636 changeset: 1:3d5bf5654eda
637 637 user: test
638 638 date: Thu Jan 01 00:00:01 1970 +0000
639 639 summary: r1
640 640
641 641
642 642 $ hg ci -Amb1 -d '1 0'
643 643 adding b1
644 644 created new head
645 645
646 646
647 647 log -f
648 648
649 649 $ hg log -f
650 650 changeset: 3:e62f78d544b4
651 651 tag: tip
652 652 parent: 1:3d5bf5654eda
653 653 user: test
654 654 date: Thu Jan 01 00:00:01 1970 +0000
655 655 summary: b1
656 656
657 657 changeset: 1:3d5bf5654eda
658 658 user: test
659 659 date: Thu Jan 01 00:00:01 1970 +0000
660 660 summary: r1
661 661
662 662 changeset: 0:67e992f2c4f3
663 663 user: test
664 664 date: Thu Jan 01 00:00:01 1970 +0000
665 665 summary: base
666 666
667 667
668 668 log -r follow('glob:b*')
669 669
670 670 $ hg log -r "follow('glob:b*')"
671 671 changeset: 0:67e992f2c4f3
672 672 user: test
673 673 date: Thu Jan 01 00:00:01 1970 +0000
674 674 summary: base
675 675
676 676 changeset: 1:3d5bf5654eda
677 677 user: test
678 678 date: Thu Jan 01 00:00:01 1970 +0000
679 679 summary: r1
680 680
681 681 changeset: 3:e62f78d544b4
682 682 tag: tip
683 683 parent: 1:3d5bf5654eda
684 684 user: test
685 685 date: Thu Jan 01 00:00:01 1970 +0000
686 686 summary: b1
687 687
688 688 log -f -r '1 + 4'
689 689
690 690 $ hg up -C 0
691 691 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
692 692 $ echo b2 > b2
693 693 $ hg ci -Amb2 -d '1 0'
694 694 adding b2
695 695 created new head
696 696 $ hg log -f -r '1 + 4'
697 697 changeset: 4:ddb82e70d1a1
698 698 tag: tip
699 699 parent: 0:67e992f2c4f3
700 700 user: test
701 701 date: Thu Jan 01 00:00:01 1970 +0000
702 702 summary: b2
703 703
704 704 changeset: 1:3d5bf5654eda
705 705 user: test
706 706 date: Thu Jan 01 00:00:01 1970 +0000
707 707 summary: r1
708 708
709 709 changeset: 0:67e992f2c4f3
710 710 user: test
711 711 date: Thu Jan 01 00:00:01 1970 +0000
712 712 summary: base
713 713
714 714 log -r "follow('set:grep(b2)')"
715 715
716 716 $ hg log -r "follow('set:grep(b2)')"
717 717 changeset: 4:ddb82e70d1a1
718 718 tag: tip
719 719 parent: 0:67e992f2c4f3
720 720 user: test
721 721 date: Thu Jan 01 00:00:01 1970 +0000
722 722 summary: b2
723 723
724 724 log -r "follow('set:grep(b2)', 4)"
725 725
726 726 $ hg up -qC 0
727 727 $ hg log -r "follow('set:grep(b2)', 4)"
728 728 changeset: 4:ddb82e70d1a1
729 729 tag: tip
730 730 parent: 0:67e992f2c4f3
731 731 user: test
732 732 date: Thu Jan 01 00:00:01 1970 +0000
733 733 summary: b2
734 734
735 735 $ hg up -qC 4
736 736
737 737 log -f -r null
738 738
739 739 $ hg log -f -r null
740 740 changeset: -1:000000000000
741 741 user:
742 742 date: Thu Jan 01 00:00:00 1970 +0000
743 743
744 744 $ hg log -f -r null -G
745 745 o changeset: -1:000000000000
746 746 user:
747 747 date: Thu Jan 01 00:00:00 1970 +0000
748 748
749 749
750 750
751 751 log -f with null parent
752 752
753 753 $ hg up -C null
754 754 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
755 755 $ hg log -f
756 756
757 757
758 758 log -r . with two parents
759 759
760 760 $ hg up -C 3
761 761 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
762 762 $ hg merge tip
763 763 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
764 764 (branch merge, don't forget to commit)
765 765 $ hg log -r .
766 766 changeset: 3:e62f78d544b4
767 767 parent: 1:3d5bf5654eda
768 768 user: test
769 769 date: Thu Jan 01 00:00:01 1970 +0000
770 770 summary: b1
771 771
772 772
773 773
774 774 log -r . with one parent
775 775
776 776 $ hg ci -mm12 -d '1 0'
777 777 $ hg log -r .
778 778 changeset: 5:302e9dd6890d
779 779 tag: tip
780 780 parent: 3:e62f78d544b4
781 781 parent: 4:ddb82e70d1a1
782 782 user: test
783 783 date: Thu Jan 01 00:00:01 1970 +0000
784 784 summary: m12
785 785
786 786
787 787 $ echo postm >> b1
788 788 $ hg ci -Amb1.1 -d'1 0'
789 789
790 790
791 791 log --follow-first
792 792
793 793 $ hg log --follow-first
794 794 changeset: 6:2404bbcab562
795 795 tag: tip
796 796 user: test
797 797 date: Thu Jan 01 00:00:01 1970 +0000
798 798 summary: b1.1
799 799
800 800 changeset: 5:302e9dd6890d
801 801 parent: 3:e62f78d544b4
802 802 parent: 4:ddb82e70d1a1
803 803 user: test
804 804 date: Thu Jan 01 00:00:01 1970 +0000
805 805 summary: m12
806 806
807 807 changeset: 3:e62f78d544b4
808 808 parent: 1:3d5bf5654eda
809 809 user: test
810 810 date: Thu Jan 01 00:00:01 1970 +0000
811 811 summary: b1
812 812
813 813 changeset: 1:3d5bf5654eda
814 814 user: test
815 815 date: Thu Jan 01 00:00:01 1970 +0000
816 816 summary: r1
817 817
818 818 changeset: 0:67e992f2c4f3
819 819 user: test
820 820 date: Thu Jan 01 00:00:01 1970 +0000
821 821 summary: base
822 822
823 823
824 824
825 825 log -P 2
826 826
827 827 $ hg log -P 2
828 828 changeset: 6:2404bbcab562
829 829 tag: tip
830 830 user: test
831 831 date: Thu Jan 01 00:00:01 1970 +0000
832 832 summary: b1.1
833 833
834 834 changeset: 5:302e9dd6890d
835 835 parent: 3:e62f78d544b4
836 836 parent: 4:ddb82e70d1a1
837 837 user: test
838 838 date: Thu Jan 01 00:00:01 1970 +0000
839 839 summary: m12
840 840
841 841 changeset: 4:ddb82e70d1a1
842 842 parent: 0:67e992f2c4f3
843 843 user: test
844 844 date: Thu Jan 01 00:00:01 1970 +0000
845 845 summary: b2
846 846
847 847 changeset: 3:e62f78d544b4
848 848 parent: 1:3d5bf5654eda
849 849 user: test
850 850 date: Thu Jan 01 00:00:01 1970 +0000
851 851 summary: b1
852 852
853 853
854 854
855 855 log -r tip -p --git
856 856
857 857 $ hg log -r tip -p --git
858 858 changeset: 6:2404bbcab562
859 859 tag: tip
860 860 user: test
861 861 date: Thu Jan 01 00:00:01 1970 +0000
862 862 summary: b1.1
863 863
864 864 diff --git a/b1 b/b1
865 865 --- a/b1
866 866 +++ b/b1
867 867 @@ -1,1 +1,2 @@
868 868 b1
869 869 +postm
870 870
871 871
872 872
873 873 log -r ""
874 874
875 875 $ hg log -r ''
876 876 hg: parse error: empty query
877 877 [255]
878 878
879 879 log -r <some unknown node id>
880 880
881 881 $ hg log -r 1000000000000000000000000000000000000000
882 882 abort: unknown revision '1000000000000000000000000000000000000000'!
883 883 [255]
884 884
885 885 log -k r1
886 886
887 887 $ hg log -k r1
888 888 changeset: 1:3d5bf5654eda
889 889 user: test
890 890 date: Thu Jan 01 00:00:01 1970 +0000
891 891 summary: r1
892 892
893 893 log -p -l2 --color=always
894 894
895 895 $ hg --config extensions.color= --config color.mode=ansi \
896 896 > log -p -l2 --color=always
897 897 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
898 898 tag: tip
899 899 user: test
900 900 date: Thu Jan 01 00:00:01 1970 +0000
901 901 summary: b1.1
902 902
903 903 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
904 904 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
905 905 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
906 906 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
907 907 b1
908 908 \x1b[0;32m+postm\x1b[0m (esc)
909 909
910 910 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
911 911 parent: 3:e62f78d544b4
912 912 parent: 4:ddb82e70d1a1
913 913 user: test
914 914 date: Thu Jan 01 00:00:01 1970 +0000
915 915 summary: m12
916 916
917 917 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
918 918 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
919 919 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
920 920 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
921 921 \x1b[0;32m+b2\x1b[0m (esc)
922 922
923 923
924 924
925 925 log -r tip --stat
926 926
927 927 $ hg log -r tip --stat
928 928 changeset: 6:2404bbcab562
929 929 tag: tip
930 930 user: test
931 931 date: Thu Jan 01 00:00:01 1970 +0000
932 932 summary: b1.1
933 933
934 934 b1 | 1 +
935 935 1 files changed, 1 insertions(+), 0 deletions(-)
936 936
937 937
938 938 $ cd ..
939 939
940 940 log --follow --patch FILE in repository where linkrev isn't trustworthy
941 941 (issue5376)
942 942
943 943 $ hg init follow-dup
944 944 $ cd follow-dup
945 945 $ cat <<EOF >> .hg/hgrc
946 946 > [ui]
947 947 > logtemplate = '=== {rev}: {desc}\n'
948 948 > [diff]
949 949 > nodates = True
950 950 > EOF
951 951 $ echo 0 >> a
952 952 $ hg ci -qAm 'a0'
953 953 $ echo 1 >> a
954 954 $ hg ci -m 'a1'
955 955 $ hg up -q 0
956 956 $ echo 1 >> a
957 957 $ touch b
958 958 $ hg ci -qAm 'a1 with b'
959 959 $ echo 3 >> a
960 960 $ hg ci -m 'a3'
961 961
962 962 fctx.rev() == 2, but fctx.linkrev() == 1
963 963
964 964 $ hg log -pf a
965 965 === 3: a3
966 966 diff -r 4ea02ba94d66 -r e7a6331a34f0 a
967 967 --- a/a
968 968 +++ b/a
969 969 @@ -1,2 +1,3 @@
970 970 0
971 971 1
972 972 +3
973 973
974 974 === 2: a1 with b
975 975 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
976 976 --- a/a
977 977 +++ b/a
978 978 @@ -1,1 +1,2 @@
979 979 0
980 980 +1
981 981
982 982 === 0: a0
983 983 diff -r 000000000000 -r 49b5e81287e2 a
984 984 --- /dev/null
985 985 +++ b/a
986 986 @@ -0,0 +1,1 @@
987 987 +0
988 988
989 989
990 990 fctx.introrev() == 2, but fctx.linkrev() == 1
991 991
992 992 $ hg up -q 2
993 993 $ hg log -pf a
994 994 === 2: a1 with b
995 995 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
996 996 --- a/a
997 997 +++ b/a
998 998 @@ -1,1 +1,2 @@
999 999 0
1000 1000 +1
1001 1001
1002 1002 === 0: a0
1003 1003 diff -r 000000000000 -r 49b5e81287e2 a
1004 1004 --- /dev/null
1005 1005 +++ b/a
1006 1006 @@ -0,0 +1,1 @@
1007 1007 +0
1008 1008
1009 1009
1010 1010 $ cd ..
1011 1011
1012 Multiple copy sources of a file:
1013
1014 $ hg init follow-multi
1015 $ cd follow-multi
1016 $ echo 0 >> a
1017 $ hg ci -qAm 'a'
1018 $ hg cp a b
1019 $ hg ci -m 'a->b'
1020 $ echo 2 >> a
1021 $ hg ci -m 'a'
1022 $ echo 3 >> b
1023 $ hg ci -m 'b'
1024 $ echo 4 >> a
1025 $ echo 4 >> b
1026 $ hg ci -m 'a,b'
1027 $ echo 5 >> a
1028 $ hg ci -m 'a0'
1029 $ echo 6 >> b
1030 $ hg ci -m 'b0'
1031 $ hg up -q 4
1032 $ echo 7 >> b
1033 $ hg ci -m 'b1'
1034 created new head
1035 $ echo 8 >> a
1036 $ hg ci -m 'a1'
1037 $ hg rm a
1038 $ hg mv b a
1039 $ hg ci -m 'b1->a1'
1040 $ hg merge -qt :local
1041 $ hg ci -m '(a0,b1->a1)->a'
1042
1043 $ hg log -GT '{rev}: {desc}\n'
1044 @ 10: (a0,b1->a1)->a
1045 |\
1046 | o 9: b1->a1
1047 | |
1048 | o 8: a1
1049 | |
1050 | o 7: b1
1051 | |
1052 o | 6: b0
1053 | |
1054 o | 5: a0
1055 |/
1056 o 4: a,b
1057 |
1058 o 3: b
1059 |
1060 o 2: a
1061 |
1062 o 1: a->b
1063 |
1064 o 0: a
1065
1066
1067 since file 'a' has multiple copy sources at the revision 4, ancestors can't
1068 be indexed solely by fctx.linkrev().
1069
1070 $ hg log -T '{rev}: {desc}\n' -f a
1071 10: (a0,b1->a1)->a
1072 9: b1->a1
1073 7: b1
1074 5: a0
1075 4: a,b
1076 3: b
1077 2: a
1078 1: a->b
1079 0: a
1080
1081 $ cd ..
1082
1012 1083 Test that log should respect the order of -rREV even if multiple OR conditions
1013 1084 are specified (issue5100):
1014 1085
1015 1086 $ hg init revorder
1016 1087 $ cd revorder
1017 1088
1018 1089 $ hg branch -q b0
1019 1090 $ echo 0 >> f0
1020 1091 $ hg ci -qAm k0 -u u0
1021 1092 $ hg branch -q b1
1022 1093 $ echo 1 >> f1
1023 1094 $ hg ci -qAm k1 -u u1
1024 1095 $ hg branch -q b2
1025 1096 $ echo 2 >> f2
1026 1097 $ hg ci -qAm k2 -u u2
1027 1098
1028 1099 $ hg update -q b2
1029 1100 $ echo 3 >> f2
1030 1101 $ hg ci -qAm k2 -u u2
1031 1102 $ hg update -q b1
1032 1103 $ echo 4 >> f1
1033 1104 $ hg ci -qAm k1 -u u1
1034 1105 $ hg update -q b0
1035 1106 $ echo 5 >> f0
1036 1107 $ hg ci -qAm k0 -u u0
1037 1108
1038 1109 summary of revisions:
1039 1110
1040 1111 $ hg log -G -T '{rev} {branch} {author} {desc} {files}\n'
1041 1112 @ 5 b0 u0 k0 f0
1042 1113 |
1043 1114 | o 4 b1 u1 k1 f1
1044 1115 | |
1045 1116 | | o 3 b2 u2 k2 f2
1046 1117 | | |
1047 1118 | | o 2 b2 u2 k2 f2
1048 1119 | |/
1049 1120 | o 1 b1 u1 k1 f1
1050 1121 |/
1051 1122 o 0 b0 u0 k0 f0
1052 1123
1053 1124
1054 1125 log -b BRANCH in ascending order:
1055 1126
1056 1127 $ hg log -r0:tip -T '{rev} {branch}\n' -b b0 -b b1
1057 1128 0 b0
1058 1129 1 b1
1059 1130 4 b1
1060 1131 5 b0
1061 1132 $ hg log -r0:tip -T '{rev} {branch}\n' -b b1 -b b0
1062 1133 0 b0
1063 1134 1 b1
1064 1135 4 b1
1065 1136 5 b0
1066 1137
1067 1138 log --only-branch BRANCH in descending order:
1068 1139
1069 1140 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b1 --only-branch b2
1070 1141 4 b1
1071 1142 3 b2
1072 1143 2 b2
1073 1144 1 b1
1074 1145 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b2 --only-branch b1
1075 1146 4 b1
1076 1147 3 b2
1077 1148 2 b2
1078 1149 1 b1
1079 1150
1080 1151 log -u USER in ascending order, against compound set:
1081 1152
1082 1153 $ hg log -r'::head()' -T '{rev} {author}\n' -u u0 -u u2
1083 1154 0 u0
1084 1155 2 u2
1085 1156 3 u2
1086 1157 5 u0
1087 1158 $ hg log -r'::head()' -T '{rev} {author}\n' -u u2 -u u0
1088 1159 0 u0
1089 1160 2 u2
1090 1161 3 u2
1091 1162 5 u0
1092 1163
1093 1164 log -k TEXT in descending order, against compound set:
1094 1165
1095 1166 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k0 -k k1 -k k2
1096 1167 5 k0
1097 1168 3 k2
1098 1169 2 k2
1099 1170 1 k1
1100 1171 0 k0
1101 1172 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k2 -k k1 -k k0
1102 1173 5 k0
1103 1174 3 k2
1104 1175 2 k2
1105 1176 1 k1
1106 1177 0 k0
1107 1178
1108 1179 log FILE in ascending order, against dagrange:
1109 1180
1110 1181 $ hg log -r1:: -T '{rev} {files}\n' f1 f2
1111 1182 1 f1
1112 1183 2 f2
1113 1184 3 f2
1114 1185 4 f1
1115 1186 $ hg log -r1:: -T '{rev} {files}\n' f2 f1
1116 1187 1 f1
1117 1188 2 f2
1118 1189 3 f2
1119 1190 4 f1
1120 1191
1121 1192 $ cd ..
1122 1193
1123 1194 User
1124 1195
1125 1196 $ hg init usertest
1126 1197 $ cd usertest
1127 1198
1128 1199 $ echo a > a
1129 1200 $ hg ci -A -m "a" -u "User One <user1@example.org>"
1130 1201 adding a
1131 1202 $ echo b > b
1132 1203 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
1133 1204 adding b
1134 1205
1135 1206 $ hg log -u "User One <user1@example.org>"
1136 1207 changeset: 0:29a4c94f1924
1137 1208 user: User One <user1@example.org>
1138 1209 date: Thu Jan 01 00:00:00 1970 +0000
1139 1210 summary: a
1140 1211
1141 1212 $ hg log -u "user1" -u "user2"
1142 1213 changeset: 1:e834b5e69c0e
1143 1214 tag: tip
1144 1215 user: User Two <user2@example.org>
1145 1216 date: Thu Jan 01 00:00:00 1970 +0000
1146 1217 summary: b
1147 1218
1148 1219 changeset: 0:29a4c94f1924
1149 1220 user: User One <user1@example.org>
1150 1221 date: Thu Jan 01 00:00:00 1970 +0000
1151 1222 summary: a
1152 1223
1153 1224 $ hg log -u "user3"
1154 1225
1155 1226 $ cd ..
1156 1227
1157 1228 $ hg init branches
1158 1229 $ cd branches
1159 1230
1160 1231 $ echo a > a
1161 1232 $ hg ci -A -m "commit on default"
1162 1233 adding a
1163 1234 $ hg branch test
1164 1235 marked working directory as branch test
1165 1236 (branches are permanent and global, did you want a bookmark?)
1166 1237 $ echo b > b
1167 1238 $ hg ci -A -m "commit on test"
1168 1239 adding b
1169 1240
1170 1241 $ hg up default
1171 1242 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1172 1243 $ echo c > c
1173 1244 $ hg ci -A -m "commit on default"
1174 1245 adding c
1175 1246 $ hg up test
1176 1247 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1177 1248 $ echo c > c
1178 1249 $ hg ci -A -m "commit on test"
1179 1250 adding c
1180 1251
1181 1252
1182 1253 log -b default
1183 1254
1184 1255 $ hg log -b default
1185 1256 changeset: 2:c3a4f03cc9a7
1186 1257 parent: 0:24427303d56f
1187 1258 user: test
1188 1259 date: Thu Jan 01 00:00:00 1970 +0000
1189 1260 summary: commit on default
1190 1261
1191 1262 changeset: 0:24427303d56f
1192 1263 user: test
1193 1264 date: Thu Jan 01 00:00:00 1970 +0000
1194 1265 summary: commit on default
1195 1266
1196 1267
1197 1268
1198 1269 log -b test
1199 1270
1200 1271 $ hg log -b test
1201 1272 changeset: 3:f5d8de11c2e2
1202 1273 branch: test
1203 1274 tag: tip
1204 1275 parent: 1:d32277701ccb
1205 1276 user: test
1206 1277 date: Thu Jan 01 00:00:00 1970 +0000
1207 1278 summary: commit on test
1208 1279
1209 1280 changeset: 1:d32277701ccb
1210 1281 branch: test
1211 1282 user: test
1212 1283 date: Thu Jan 01 00:00:00 1970 +0000
1213 1284 summary: commit on test
1214 1285
1215 1286
1216 1287
1217 1288 log -b dummy
1218 1289
1219 1290 $ hg log -b dummy
1220 1291 abort: unknown revision 'dummy'!
1221 1292 [255]
1222 1293
1223 1294
1224 1295 log -b .
1225 1296
1226 1297 $ hg log -b .
1227 1298 changeset: 3:f5d8de11c2e2
1228 1299 branch: test
1229 1300 tag: tip
1230 1301 parent: 1:d32277701ccb
1231 1302 user: test
1232 1303 date: Thu Jan 01 00:00:00 1970 +0000
1233 1304 summary: commit on test
1234 1305
1235 1306 changeset: 1:d32277701ccb
1236 1307 branch: test
1237 1308 user: test
1238 1309 date: Thu Jan 01 00:00:00 1970 +0000
1239 1310 summary: commit on test
1240 1311
1241 1312
1242 1313
1243 1314 log -b default -b test
1244 1315
1245 1316 $ hg log -b default -b test
1246 1317 changeset: 3:f5d8de11c2e2
1247 1318 branch: test
1248 1319 tag: tip
1249 1320 parent: 1:d32277701ccb
1250 1321 user: test
1251 1322 date: Thu Jan 01 00:00:00 1970 +0000
1252 1323 summary: commit on test
1253 1324
1254 1325 changeset: 2:c3a4f03cc9a7
1255 1326 parent: 0:24427303d56f
1256 1327 user: test
1257 1328 date: Thu Jan 01 00:00:00 1970 +0000
1258 1329 summary: commit on default
1259 1330
1260 1331 changeset: 1:d32277701ccb
1261 1332 branch: test
1262 1333 user: test
1263 1334 date: Thu Jan 01 00:00:00 1970 +0000
1264 1335 summary: commit on test
1265 1336
1266 1337 changeset: 0:24427303d56f
1267 1338 user: test
1268 1339 date: Thu Jan 01 00:00:00 1970 +0000
1269 1340 summary: commit on default
1270 1341
1271 1342
1272 1343
1273 1344 log -b default -b .
1274 1345
1275 1346 $ hg log -b default -b .
1276 1347 changeset: 3:f5d8de11c2e2
1277 1348 branch: test
1278 1349 tag: tip
1279 1350 parent: 1:d32277701ccb
1280 1351 user: test
1281 1352 date: Thu Jan 01 00:00:00 1970 +0000
1282 1353 summary: commit on test
1283 1354
1284 1355 changeset: 2:c3a4f03cc9a7
1285 1356 parent: 0:24427303d56f
1286 1357 user: test
1287 1358 date: Thu Jan 01 00:00:00 1970 +0000
1288 1359 summary: commit on default
1289 1360
1290 1361 changeset: 1:d32277701ccb
1291 1362 branch: test
1292 1363 user: test
1293 1364 date: Thu Jan 01 00:00:00 1970 +0000
1294 1365 summary: commit on test
1295 1366
1296 1367 changeset: 0:24427303d56f
1297 1368 user: test
1298 1369 date: Thu Jan 01 00:00:00 1970 +0000
1299 1370 summary: commit on default
1300 1371
1301 1372
1302 1373
1303 1374 log -b . -b test
1304 1375
1305 1376 $ hg log -b . -b test
1306 1377 changeset: 3:f5d8de11c2e2
1307 1378 branch: test
1308 1379 tag: tip
1309 1380 parent: 1:d32277701ccb
1310 1381 user: test
1311 1382 date: Thu Jan 01 00:00:00 1970 +0000
1312 1383 summary: commit on test
1313 1384
1314 1385 changeset: 1:d32277701ccb
1315 1386 branch: test
1316 1387 user: test
1317 1388 date: Thu Jan 01 00:00:00 1970 +0000
1318 1389 summary: commit on test
1319 1390
1320 1391
1321 1392
1322 1393 log -b 2
1323 1394
1324 1395 $ hg log -b 2
1325 1396 changeset: 2:c3a4f03cc9a7
1326 1397 parent: 0:24427303d56f
1327 1398 user: test
1328 1399 date: Thu Jan 01 00:00:00 1970 +0000
1329 1400 summary: commit on default
1330 1401
1331 1402 changeset: 0:24427303d56f
1332 1403 user: test
1333 1404 date: Thu Jan 01 00:00:00 1970 +0000
1334 1405 summary: commit on default
1335 1406
1336 1407 #if gettext
1337 1408
1338 1409 Test that all log names are translated (e.g. branches, bookmarks, tags):
1339 1410
1340 1411 $ hg bookmark babar -r tip
1341 1412
1342 1413 $ HGENCODING=UTF-8 LANGUAGE=de hg log -r tip
1343 1414 \xc3\x84nderung: 3:f5d8de11c2e2 (esc)
1344 1415 Zweig: test
1345 1416 Lesezeichen: babar
1346 1417 Marke: tip
1347 1418 Vorg\xc3\xa4nger: 1:d32277701ccb (esc)
1348 1419 Nutzer: test
1349 1420 Datum: Thu Jan 01 00:00:00 1970 +0000
1350 1421 Zusammenfassung: commit on test
1351 1422
1352 1423 $ hg bookmark -d babar
1353 1424
1354 1425 #endif
1355 1426
1356 1427 log -p --cwd dir (in subdir)
1357 1428
1358 1429 $ mkdir dir
1359 1430 $ hg log -p --cwd dir
1360 1431 changeset: 3:f5d8de11c2e2
1361 1432 branch: test
1362 1433 tag: tip
1363 1434 parent: 1:d32277701ccb
1364 1435 user: test
1365 1436 date: Thu Jan 01 00:00:00 1970 +0000
1366 1437 summary: commit on test
1367 1438
1368 1439 diff -r d32277701ccb -r f5d8de11c2e2 c
1369 1440 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1370 1441 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1371 1442 @@ -0,0 +1,1 @@
1372 1443 +c
1373 1444
1374 1445 changeset: 2:c3a4f03cc9a7
1375 1446 parent: 0:24427303d56f
1376 1447 user: test
1377 1448 date: Thu Jan 01 00:00:00 1970 +0000
1378 1449 summary: commit on default
1379 1450
1380 1451 diff -r 24427303d56f -r c3a4f03cc9a7 c
1381 1452 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1382 1453 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1383 1454 @@ -0,0 +1,1 @@
1384 1455 +c
1385 1456
1386 1457 changeset: 1:d32277701ccb
1387 1458 branch: test
1388 1459 user: test
1389 1460 date: Thu Jan 01 00:00:00 1970 +0000
1390 1461 summary: commit on test
1391 1462
1392 1463 diff -r 24427303d56f -r d32277701ccb b
1393 1464 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1394 1465 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1395 1466 @@ -0,0 +1,1 @@
1396 1467 +b
1397 1468
1398 1469 changeset: 0:24427303d56f
1399 1470 user: test
1400 1471 date: Thu Jan 01 00:00:00 1970 +0000
1401 1472 summary: commit on default
1402 1473
1403 1474 diff -r 000000000000 -r 24427303d56f a
1404 1475 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1405 1476 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1406 1477 @@ -0,0 +1,1 @@
1407 1478 +a
1408 1479
1409 1480
1410 1481
1411 1482 log -p -R repo
1412 1483
1413 1484 $ cd dir
1414 1485 $ hg log -p -R .. ../a
1415 1486 changeset: 0:24427303d56f
1416 1487 user: test
1417 1488 date: Thu Jan 01 00:00:00 1970 +0000
1418 1489 summary: commit on default
1419 1490
1420 1491 diff -r 000000000000 -r 24427303d56f a
1421 1492 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1422 1493 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1423 1494 @@ -0,0 +1,1 @@
1424 1495 +a
1425 1496
1426 1497
1427 1498 $ cd ../..
1428 1499
1429 1500 $ hg init follow2
1430 1501 $ cd follow2
1431 1502
1432 1503 # Build the following history:
1433 1504 # tip - o - x - o - x - x
1434 1505 # \ /
1435 1506 # o - o - o - x
1436 1507 # \ /
1437 1508 # o
1438 1509 #
1439 1510 # Where "o" is a revision containing "foo" and
1440 1511 # "x" is a revision without "foo"
1441 1512
1442 1513 $ touch init
1443 1514 $ hg ci -A -m "init, unrelated"
1444 1515 adding init
1445 1516 $ echo 'foo' > init
1446 1517 $ hg ci -m "change, unrelated"
1447 1518 $ echo 'foo' > foo
1448 1519 $ hg ci -A -m "add unrelated old foo"
1449 1520 adding foo
1450 1521 $ hg rm foo
1451 1522 $ hg ci -m "delete foo, unrelated"
1452 1523 $ echo 'related' > foo
1453 1524 $ hg ci -A -m "add foo, related"
1454 1525 adding foo
1455 1526
1456 1527 $ hg up 0
1457 1528 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1458 1529 $ touch branch
1459 1530 $ hg ci -A -m "first branch, unrelated"
1460 1531 adding branch
1461 1532 created new head
1462 1533 $ touch foo
1463 1534 $ hg ci -A -m "create foo, related"
1464 1535 adding foo
1465 1536 $ echo 'change' > foo
1466 1537 $ hg ci -m "change foo, related"
1467 1538
1468 1539 $ hg up 6
1469 1540 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1470 1541 $ echo 'change foo in branch' > foo
1471 1542 $ hg ci -m "change foo in branch, related"
1472 1543 created new head
1473 1544 $ hg merge 7
1474 1545 merging foo
1475 1546 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1476 1547 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1477 1548 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1478 1549 [1]
1479 1550 $ echo 'merge 1' > foo
1480 1551 $ hg resolve -m foo
1481 1552 (no more unresolved files)
1482 1553 $ hg ci -m "First merge, related"
1483 1554
1484 1555 $ hg merge 4
1485 1556 merging foo
1486 1557 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1487 1558 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1488 1559 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1489 1560 [1]
1490 1561 $ echo 'merge 2' > foo
1491 1562 $ hg resolve -m foo
1492 1563 (no more unresolved files)
1493 1564 $ hg ci -m "Last merge, related"
1494 1565
1495 1566 $ hg log --graph
1496 1567 @ changeset: 10:4dae8563d2c5
1497 1568 |\ tag: tip
1498 1569 | | parent: 9:7b35701b003e
1499 1570 | | parent: 4:88176d361b69
1500 1571 | | user: test
1501 1572 | | date: Thu Jan 01 00:00:00 1970 +0000
1502 1573 | | summary: Last merge, related
1503 1574 | |
1504 1575 | o changeset: 9:7b35701b003e
1505 1576 | |\ parent: 8:e5416ad8a855
1506 1577 | | | parent: 7:87fe3144dcfa
1507 1578 | | | user: test
1508 1579 | | | date: Thu Jan 01 00:00:00 1970 +0000
1509 1580 | | | summary: First merge, related
1510 1581 | | |
1511 1582 | | o changeset: 8:e5416ad8a855
1512 1583 | | | parent: 6:dc6c325fe5ee
1513 1584 | | | user: test
1514 1585 | | | date: Thu Jan 01 00:00:00 1970 +0000
1515 1586 | | | summary: change foo in branch, related
1516 1587 | | |
1517 1588 | o | changeset: 7:87fe3144dcfa
1518 1589 | |/ user: test
1519 1590 | | date: Thu Jan 01 00:00:00 1970 +0000
1520 1591 | | summary: change foo, related
1521 1592 | |
1522 1593 | o changeset: 6:dc6c325fe5ee
1523 1594 | | user: test
1524 1595 | | date: Thu Jan 01 00:00:00 1970 +0000
1525 1596 | | summary: create foo, related
1526 1597 | |
1527 1598 | o changeset: 5:73db34516eb9
1528 1599 | | parent: 0:e87515fd044a
1529 1600 | | user: test
1530 1601 | | date: Thu Jan 01 00:00:00 1970 +0000
1531 1602 | | summary: first branch, unrelated
1532 1603 | |
1533 1604 o | changeset: 4:88176d361b69
1534 1605 | | user: test
1535 1606 | | date: Thu Jan 01 00:00:00 1970 +0000
1536 1607 | | summary: add foo, related
1537 1608 | |
1538 1609 o | changeset: 3:dd78ae4afb56
1539 1610 | | user: test
1540 1611 | | date: Thu Jan 01 00:00:00 1970 +0000
1541 1612 | | summary: delete foo, unrelated
1542 1613 | |
1543 1614 o | changeset: 2:c4c64aedf0f7
1544 1615 | | user: test
1545 1616 | | date: Thu Jan 01 00:00:00 1970 +0000
1546 1617 | | summary: add unrelated old foo
1547 1618 | |
1548 1619 o | changeset: 1:e5faa7440653
1549 1620 |/ user: test
1550 1621 | date: Thu Jan 01 00:00:00 1970 +0000
1551 1622 | summary: change, unrelated
1552 1623 |
1553 1624 o changeset: 0:e87515fd044a
1554 1625 user: test
1555 1626 date: Thu Jan 01 00:00:00 1970 +0000
1556 1627 summary: init, unrelated
1557 1628
1558 1629
1559 1630 $ hg --traceback log -f foo
1560 1631 changeset: 10:4dae8563d2c5
1561 1632 tag: tip
1562 1633 parent: 9:7b35701b003e
1563 1634 parent: 4:88176d361b69
1564 1635 user: test
1565 1636 date: Thu Jan 01 00:00:00 1970 +0000
1566 1637 summary: Last merge, related
1567 1638
1568 1639 changeset: 9:7b35701b003e
1569 1640 parent: 8:e5416ad8a855
1570 1641 parent: 7:87fe3144dcfa
1571 1642 user: test
1572 1643 date: Thu Jan 01 00:00:00 1970 +0000
1573 1644 summary: First merge, related
1574 1645
1575 1646 changeset: 8:e5416ad8a855
1576 1647 parent: 6:dc6c325fe5ee
1577 1648 user: test
1578 1649 date: Thu Jan 01 00:00:00 1970 +0000
1579 1650 summary: change foo in branch, related
1580 1651
1581 1652 changeset: 7:87fe3144dcfa
1582 1653 user: test
1583 1654 date: Thu Jan 01 00:00:00 1970 +0000
1584 1655 summary: change foo, related
1585 1656
1586 1657 changeset: 6:dc6c325fe5ee
1587 1658 user: test
1588 1659 date: Thu Jan 01 00:00:00 1970 +0000
1589 1660 summary: create foo, related
1590 1661
1591 1662 changeset: 4:88176d361b69
1592 1663 user: test
1593 1664 date: Thu Jan 01 00:00:00 1970 +0000
1594 1665 summary: add foo, related
1595 1666
1596 1667
1597 1668 Also check when maxrev < lastrevfilelog
1598 1669
1599 1670 $ hg --traceback log -f -r4 foo
1600 1671 changeset: 4:88176d361b69
1601 1672 user: test
1602 1673 date: Thu Jan 01 00:00:00 1970 +0000
1603 1674 summary: add foo, related
1604 1675
1605 1676 changeset: 2:c4c64aedf0f7
1606 1677 user: test
1607 1678 date: Thu Jan 01 00:00:00 1970 +0000
1608 1679 summary: add unrelated old foo
1609 1680
1610 1681 $ cd ..
1611 1682
1612 1683 Issue2383: hg log showing _less_ differences than hg diff
1613 1684
1614 1685 $ hg init issue2383
1615 1686 $ cd issue2383
1616 1687
1617 1688 Create a test repo:
1618 1689
1619 1690 $ echo a > a
1620 1691 $ hg ci -Am0
1621 1692 adding a
1622 1693 $ echo b > b
1623 1694 $ hg ci -Am1
1624 1695 adding b
1625 1696 $ hg co 0
1626 1697 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1627 1698 $ echo b > a
1628 1699 $ hg ci -m2
1629 1700 created new head
1630 1701
1631 1702 Merge:
1632 1703
1633 1704 $ hg merge
1634 1705 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1635 1706 (branch merge, don't forget to commit)
1636 1707
1637 1708 Make sure there's a file listed in the merge to trigger the bug:
1638 1709
1639 1710 $ echo c > a
1640 1711 $ hg ci -m3
1641 1712
1642 1713 Two files shown here in diff:
1643 1714
1644 1715 $ hg diff --rev 2:3
1645 1716 diff -r b09be438c43a -r 8e07aafe1edc a
1646 1717 --- a/a Thu Jan 01 00:00:00 1970 +0000
1647 1718 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1648 1719 @@ -1,1 +1,1 @@
1649 1720 -b
1650 1721 +c
1651 1722 diff -r b09be438c43a -r 8e07aafe1edc b
1652 1723 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1653 1724 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1654 1725 @@ -0,0 +1,1 @@
1655 1726 +b
1656 1727
1657 1728 Diff here should be the same:
1658 1729
1659 1730 $ hg log -vpr 3
1660 1731 changeset: 3:8e07aafe1edc
1661 1732 tag: tip
1662 1733 parent: 2:b09be438c43a
1663 1734 parent: 1:925d80f479bb
1664 1735 user: test
1665 1736 date: Thu Jan 01 00:00:00 1970 +0000
1666 1737 files: a
1667 1738 description:
1668 1739 3
1669 1740
1670 1741
1671 1742 diff -r b09be438c43a -r 8e07aafe1edc a
1672 1743 --- a/a Thu Jan 01 00:00:00 1970 +0000
1673 1744 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1674 1745 @@ -1,1 +1,1 @@
1675 1746 -b
1676 1747 +c
1677 1748 diff -r b09be438c43a -r 8e07aafe1edc b
1678 1749 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1679 1750 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1680 1751 @@ -0,0 +1,1 @@
1681 1752 +b
1682 1753
1683 1754 $ cd ..
1684 1755
1685 1756 'hg log -r rev fn' when last(filelog(fn)) != rev
1686 1757
1687 1758 $ hg init simplelog
1688 1759 $ cd simplelog
1689 1760 $ echo f > a
1690 1761 $ hg ci -Am'a' -d '0 0'
1691 1762 adding a
1692 1763 $ echo f >> a
1693 1764 $ hg ci -Am'a bis' -d '1 0'
1694 1765
1695 1766 $ hg log -r0 a
1696 1767 changeset: 0:9f758d63dcde
1697 1768 user: test
1698 1769 date: Thu Jan 01 00:00:00 1970 +0000
1699 1770 summary: a
1700 1771
1701 1772 enable obsolete to test hidden feature
1702 1773
1703 1774 $ cat >> $HGRCPATH << EOF
1704 1775 > [experimental]
1705 1776 > evolution.createmarkers=True
1706 1777 > EOF
1707 1778
1708 1779 $ hg log --template='{rev}:{node}\n'
1709 1780 1:a765632148dc55d38c35c4f247c618701886cb2f
1710 1781 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1711 1782 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1712 1783 obsoleted 1 changesets
1713 1784 $ hg up null -q
1714 1785 $ hg log --template='{rev}:{node}\n'
1715 1786 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1716 1787 $ hg log --template='{rev}:{node}\n' --hidden
1717 1788 1:a765632148dc55d38c35c4f247c618701886cb2f
1718 1789 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1719 1790 $ hg log -r a
1720 1791 abort: hidden revision 'a'!
1721 1792 (use --hidden to access hidden revisions)
1722 1793 [255]
1723 1794
1724 1795 test that parent prevent a changeset to be hidden
1725 1796
1726 1797 $ hg up 1 -q --hidden
1727 1798 $ hg log --template='{rev}:{node}\n'
1728 1799 1:a765632148dc55d38c35c4f247c618701886cb2f
1729 1800 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1730 1801
1731 1802 test that second parent prevent a changeset to be hidden too
1732 1803
1733 1804 $ hg debugsetparents 0 1 # nothing suitable to merge here
1734 1805 $ hg log --template='{rev}:{node}\n'
1735 1806 1:a765632148dc55d38c35c4f247c618701886cb2f
1736 1807 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1737 1808 $ hg debugsetparents 1
1738 1809 $ hg up -q null
1739 1810
1740 1811 bookmarks prevent a changeset being hidden
1741 1812
1742 1813 $ hg bookmark --hidden -r 1 X
1743 1814 $ hg log --template '{rev}:{node}\n'
1744 1815 1:a765632148dc55d38c35c4f247c618701886cb2f
1745 1816 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1746 1817 $ hg bookmark -d X
1747 1818
1748 1819 divergent bookmarks are not hidden
1749 1820
1750 1821 $ hg bookmark --hidden -r 1 X@foo
1751 1822 $ hg log --template '{rev}:{node}\n'
1752 1823 1:a765632148dc55d38c35c4f247c618701886cb2f
1753 1824 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1754 1825
1755 1826 test hidden revision 0 (issue5385)
1756 1827
1757 1828 $ hg bookmark -d X@foo
1758 1829 $ hg up null -q
1759 1830 $ hg debugobsolete 9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1760 1831 obsoleted 1 changesets
1761 1832 $ echo f > b
1762 1833 $ hg ci -Am'b' -d '2 0'
1763 1834 adding b
1764 1835 $ echo f >> b
1765 1836 $ hg ci -m'b bis' -d '3 0'
1766 1837 $ hg log -T'{rev}:{node}\n'
1767 1838 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1768 1839 2:94375ec45bddd2a824535fc04855bd058c926ec0
1769 1840
1770 1841 $ hg log -T'{rev}:{node}\n' -r:
1771 1842 2:94375ec45bddd2a824535fc04855bd058c926ec0
1772 1843 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1773 1844 $ hg log -T'{rev}:{node}\n' -r:tip
1774 1845 2:94375ec45bddd2a824535fc04855bd058c926ec0
1775 1846 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1776 1847 $ hg log -T'{rev}:{node}\n' -r:0
1777 1848 abort: hidden revision '0'!
1778 1849 (use --hidden to access hidden revisions)
1779 1850 [255]
1780 1851 $ hg log -T'{rev}:{node}\n' -f
1781 1852 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
1782 1853 2:94375ec45bddd2a824535fc04855bd058c926ec0
1783 1854
1784 1855 clear extensions configuration
1785 1856 $ echo '[extensions]' >> $HGRCPATH
1786 1857 $ echo "obs=!" >> $HGRCPATH
1787 1858 $ cd ..
1788 1859
1789 1860 test -u/-k for problematic encoding
1790 1861 # unicode: cp932:
1791 1862 # u30A2 0x83 0x41(= 'A')
1792 1863 # u30C2 0x83 0x61(= 'a')
1793 1864
1794 1865 $ hg init problematicencoding
1795 1866 $ cd problematicencoding
1796 1867
1797 1868 $ $PYTHON > setup.sh <<EOF
1798 1869 > print(u'''
1799 1870 > echo a > text
1800 1871 > hg add text
1801 1872 > hg --encoding utf-8 commit -u '\u30A2' -m none
1802 1873 > echo b > text
1803 1874 > hg --encoding utf-8 commit -u '\u30C2' -m none
1804 1875 > echo c > text
1805 1876 > hg --encoding utf-8 commit -u none -m '\u30A2'
1806 1877 > echo d > text
1807 1878 > hg --encoding utf-8 commit -u none -m '\u30C2'
1808 1879 > '''.encode('utf-8'))
1809 1880 > EOF
1810 1881 $ sh < setup.sh
1811 1882
1812 1883 test in problematic encoding
1813 1884 $ $PYTHON > test.sh <<EOF
1814 1885 > print(u'''
1815 1886 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
1816 1887 > echo ====
1817 1888 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
1818 1889 > echo ====
1819 1890 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
1820 1891 > echo ====
1821 1892 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
1822 1893 > '''.encode('cp932'))
1823 1894 > EOF
1824 1895 $ sh < test.sh
1825 1896 0
1826 1897 ====
1827 1898 1
1828 1899 ====
1829 1900 2
1830 1901 0
1831 1902 ====
1832 1903 3
1833 1904 1
1834 1905
1835 1906 $ cd ..
1836 1907
1837 1908 test hg log on non-existent files and on directories
1838 1909 $ hg init issue1340
1839 1910 $ cd issue1340
1840 1911 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
1841 1912 $ echo 1 > d1/f1
1842 1913 $ echo 1 > D2/f1
1843 1914 $ echo 1 > D3.i/f1
1844 1915 $ echo 1 > d4.hg/f1
1845 1916 $ echo 1 > d5.d/f1
1846 1917 $ echo 1 > .d6/f1
1847 1918 $ hg -q add .
1848 1919 $ hg commit -m "a bunch of weird directories"
1849 1920 $ hg log -l1 d1/f1 | grep changeset
1850 1921 changeset: 0:65624cd9070a
1851 1922 $ hg log -l1 f1
1852 1923 $ hg log -l1 . | grep changeset
1853 1924 changeset: 0:65624cd9070a
1854 1925 $ hg log -l1 ./ | grep changeset
1855 1926 changeset: 0:65624cd9070a
1856 1927 $ hg log -l1 d1 | grep changeset
1857 1928 changeset: 0:65624cd9070a
1858 1929 $ hg log -l1 D2 | grep changeset
1859 1930 changeset: 0:65624cd9070a
1860 1931 $ hg log -l1 D2/f1 | grep changeset
1861 1932 changeset: 0:65624cd9070a
1862 1933 $ hg log -l1 D3.i | grep changeset
1863 1934 changeset: 0:65624cd9070a
1864 1935 $ hg log -l1 D3.i/f1 | grep changeset
1865 1936 changeset: 0:65624cd9070a
1866 1937 $ hg log -l1 d4.hg | grep changeset
1867 1938 changeset: 0:65624cd9070a
1868 1939 $ hg log -l1 d4.hg/f1 | grep changeset
1869 1940 changeset: 0:65624cd9070a
1870 1941 $ hg log -l1 d5.d | grep changeset
1871 1942 changeset: 0:65624cd9070a
1872 1943 $ hg log -l1 d5.d/f1 | grep changeset
1873 1944 changeset: 0:65624cd9070a
1874 1945 $ hg log -l1 .d6 | grep changeset
1875 1946 changeset: 0:65624cd9070a
1876 1947 $ hg log -l1 .d6/f1 | grep changeset
1877 1948 changeset: 0:65624cd9070a
1878 1949
1879 1950 issue3772: hg log -r :null showing revision 0 as well
1880 1951
1881 1952 $ hg log -r :null
1882 1953 changeset: 0:65624cd9070a
1883 1954 tag: tip
1884 1955 user: test
1885 1956 date: Thu Jan 01 00:00:00 1970 +0000
1886 1957 summary: a bunch of weird directories
1887 1958
1888 1959 changeset: -1:000000000000
1889 1960 user:
1890 1961 date: Thu Jan 01 00:00:00 1970 +0000
1891 1962
1892 1963 $ hg log -r null:null
1893 1964 changeset: -1:000000000000
1894 1965 user:
1895 1966 date: Thu Jan 01 00:00:00 1970 +0000
1896 1967
1897 1968 working-directory revision requires special treatment
1898 1969
1899 1970 clean:
1900 1971
1901 1972 $ hg log -r 'wdir()' --debug
1902 1973 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
1903 1974 phase: draft
1904 1975 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
1905 1976 parent: -1:0000000000000000000000000000000000000000
1906 1977 user: test
1907 1978 date: [A-Za-z0-9:+ ]+ (re)
1908 1979 extra: branch=default
1909 1980
1910 1981 $ hg log -r 'wdir()' -p --stat
1911 1982 changeset: 2147483647:ffffffffffff
1912 1983 parent: 0:65624cd9070a
1913 1984 user: test
1914 1985 date: [A-Za-z0-9:+ ]+ (re)
1915 1986
1916 1987
1917 1988
1918 1989
1919 1990 dirty:
1920 1991
1921 1992 $ echo 2 >> d1/f1
1922 1993 $ echo 2 > d1/f2
1923 1994 $ hg add d1/f2
1924 1995 $ hg remove .d6/f1
1925 1996 $ hg status
1926 1997 M d1/f1
1927 1998 A d1/f2
1928 1999 R .d6/f1
1929 2000
1930 2001 $ hg log -r 'wdir()'
1931 2002 changeset: 2147483647:ffffffffffff
1932 2003 parent: 0:65624cd9070a
1933 2004 user: test
1934 2005 date: [A-Za-z0-9:+ ]+ (re)
1935 2006
1936 2007 $ hg log -r 'wdir()' -q
1937 2008 2147483647:ffffffffffff
1938 2009
1939 2010 $ hg log -r 'wdir()' --debug
1940 2011 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
1941 2012 phase: draft
1942 2013 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
1943 2014 parent: -1:0000000000000000000000000000000000000000
1944 2015 user: test
1945 2016 date: [A-Za-z0-9:+ ]+ (re)
1946 2017 files: d1/f1
1947 2018 files+: d1/f2
1948 2019 files-: .d6/f1
1949 2020 extra: branch=default
1950 2021
1951 2022 $ hg log -r 'wdir()' -p --stat --git
1952 2023 changeset: 2147483647:ffffffffffff
1953 2024 parent: 0:65624cd9070a
1954 2025 user: test
1955 2026 date: [A-Za-z0-9:+ ]+ (re)
1956 2027
1957 2028 .d6/f1 | 1 -
1958 2029 d1/f1 | 1 +
1959 2030 d1/f2 | 1 +
1960 2031 3 files changed, 2 insertions(+), 1 deletions(-)
1961 2032
1962 2033 diff --git a/.d6/f1 b/.d6/f1
1963 2034 deleted file mode 100644
1964 2035 --- a/.d6/f1
1965 2036 +++ /dev/null
1966 2037 @@ -1,1 +0,0 @@
1967 2038 -1
1968 2039 diff --git a/d1/f1 b/d1/f1
1969 2040 --- a/d1/f1
1970 2041 +++ b/d1/f1
1971 2042 @@ -1,1 +1,2 @@
1972 2043 1
1973 2044 +2
1974 2045 diff --git a/d1/f2 b/d1/f2
1975 2046 new file mode 100644
1976 2047 --- /dev/null
1977 2048 +++ b/d1/f2
1978 2049 @@ -0,0 +1,1 @@
1979 2050 +2
1980 2051
1981 2052 $ hg log -r 'wdir()' -Tjson
1982 2053 [
1983 2054 {
1984 2055 "rev": null,
1985 2056 "node": null,
1986 2057 "branch": "default",
1987 2058 "phase": "draft",
1988 2059 "user": "test",
1989 2060 "date": [*, 0], (glob)
1990 2061 "desc": "",
1991 2062 "bookmarks": [],
1992 2063 "tags": [],
1993 2064 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"]
1994 2065 }
1995 2066 ]
1996 2067
1997 2068 $ hg log -r 'wdir()' -Tjson -q
1998 2069 [
1999 2070 {
2000 2071 "rev": null,
2001 2072 "node": null
2002 2073 }
2003 2074 ]
2004 2075
2005 2076 $ hg log -r 'wdir()' -Tjson --debug
2006 2077 [
2007 2078 {
2008 2079 "rev": null,
2009 2080 "node": null,
2010 2081 "branch": "default",
2011 2082 "phase": "draft",
2012 2083 "user": "test",
2013 2084 "date": [*, 0], (glob)
2014 2085 "desc": "",
2015 2086 "bookmarks": [],
2016 2087 "tags": [],
2017 2088 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
2018 2089 "manifest": null,
2019 2090 "extra": {"branch": "default"},
2020 2091 "modified": ["d1/f1"],
2021 2092 "added": ["d1/f2"],
2022 2093 "removed": [".d6/f1"]
2023 2094 }
2024 2095 ]
2025 2096
2026 2097 $ hg revert -aqC
2027 2098
2028 2099 Check that adding an arbitrary name shows up in log automatically
2029 2100
2030 2101 $ cat > ../names.py <<EOF
2031 2102 > """A small extension to test adding arbitrary names to a repo"""
2032 2103 > from __future__ import absolute_import
2033 2104 > from mercurial import namespaces
2034 2105 >
2035 2106 > def reposetup(ui, repo):
2036 2107 > foo = {'foo': repo[0].node()}
2037 2108 > names = lambda r: foo.keys()
2038 2109 > namemap = lambda r, name: foo.get(name)
2039 2110 > nodemap = lambda r, node: [name for name, n in foo.iteritems()
2040 2111 > if n == node]
2041 2112 > ns = namespaces.namespace(
2042 2113 > "bars", templatename="bar", logname="barlog",
2043 2114 > colorname="barcolor", listnames=names, namemap=namemap,
2044 2115 > nodemap=nodemap)
2045 2116 >
2046 2117 > repo.names.addnamespace(ns)
2047 2118 > EOF
2048 2119
2049 2120 $ hg --config extensions.names=../names.py log -r 0
2050 2121 changeset: 0:65624cd9070a
2051 2122 tag: tip
2052 2123 barlog: foo
2053 2124 user: test
2054 2125 date: Thu Jan 01 00:00:00 1970 +0000
2055 2126 summary: a bunch of weird directories
2056 2127
2057 2128 $ hg --config extensions.names=../names.py \
2058 2129 > --config extensions.color= --config color.log.barcolor=red \
2059 2130 > --color=always log -r 0
2060 2131 \x1b[0;33mchangeset: 0:65624cd9070a\x1b[0m (esc)
2061 2132 tag: tip
2062 2133 \x1b[0;31mbarlog: foo\x1b[0m (esc)
2063 2134 user: test
2064 2135 date: Thu Jan 01 00:00:00 1970 +0000
2065 2136 summary: a bunch of weird directories
2066 2137
2067 2138 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n'
2068 2139 foo
2069 2140
2070 2141 $ cd ..
2071 2142
2072 2143 hg log -f dir across branches
2073 2144
2074 2145 $ hg init acrossbranches
2075 2146 $ cd acrossbranches
2076 2147 $ mkdir d
2077 2148 $ echo a > d/a && hg ci -Aqm a
2078 2149 $ echo b > d/a && hg ci -Aqm b
2079 2150 $ hg up -q 0
2080 2151 $ echo b > d/a && hg ci -Aqm c
2081 2152 $ hg log -f d -T '{desc}' -G
2082 2153 @ c
2083 2154 |
2084 2155 o a
2085 2156
2086 2157 Ensure that largefiles doesn't interfere with following a normal file
2087 2158 $ hg --config extensions.largefiles= log -f d -T '{desc}' -G
2088 2159 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
2089 2160 @ c
2090 2161 |
2091 2162 o a
2092 2163
2093 2164 $ hg log -f d/a -T '{desc}' -G
2094 2165 @ c
2095 2166 |
2096 2167 o a
2097 2168
2098 2169 $ cd ..
2099 2170
2100 2171 hg log -f with linkrev pointing to another branch
2101 2172 -------------------------------------------------
2102 2173
2103 2174 create history with a filerev whose linkrev points to another branch
2104 2175
2105 2176 $ hg init branchedlinkrev
2106 2177 $ cd branchedlinkrev
2107 2178 $ echo 1 > a
2108 2179 $ hg commit -Am 'content1'
2109 2180 adding a
2110 2181 $ echo 2 > a
2111 2182 $ hg commit -m 'content2'
2112 2183 $ hg up --rev 'desc(content1)'
2113 2184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2114 2185 $ echo unrelated > unrelated
2115 2186 $ hg commit -Am 'unrelated'
2116 2187 adding unrelated
2117 2188 created new head
2118 2189 $ hg graft -r 'desc(content2)'
2119 2190 grafting 1:2294ae80ad84 "content2"
2120 2191 $ echo 3 > a
2121 2192 $ hg commit -m 'content3'
2122 2193 $ hg log -G
2123 2194 @ changeset: 4:50b9b36e9c5d
2124 2195 | tag: tip
2125 2196 | user: test
2126 2197 | date: Thu Jan 01 00:00:00 1970 +0000
2127 2198 | summary: content3
2128 2199 |
2129 2200 o changeset: 3:15b2327059e5
2130 2201 | user: test
2131 2202 | date: Thu Jan 01 00:00:00 1970 +0000
2132 2203 | summary: content2
2133 2204 |
2134 2205 o changeset: 2:2029acd1168c
2135 2206 | parent: 0:ae0a3c9f9e95
2136 2207 | user: test
2137 2208 | date: Thu Jan 01 00:00:00 1970 +0000
2138 2209 | summary: unrelated
2139 2210 |
2140 2211 | o changeset: 1:2294ae80ad84
2141 2212 |/ user: test
2142 2213 | date: Thu Jan 01 00:00:00 1970 +0000
2143 2214 | summary: content2
2144 2215 |
2145 2216 o changeset: 0:ae0a3c9f9e95
2146 2217 user: test
2147 2218 date: Thu Jan 01 00:00:00 1970 +0000
2148 2219 summary: content1
2149 2220
2150 2221
2151 2222 log -f on the file should list the graft result.
2152 2223
2153 2224 $ hg log -Gf a
2154 2225 @ changeset: 4:50b9b36e9c5d
2155 2226 | tag: tip
2156 2227 | user: test
2157 2228 | date: Thu Jan 01 00:00:00 1970 +0000
2158 2229 | summary: content3
2159 2230 |
2160 2231 o changeset: 3:15b2327059e5
2161 2232 : user: test
2162 2233 : date: Thu Jan 01 00:00:00 1970 +0000
2163 2234 : summary: content2
2164 2235 :
2165 2236 o changeset: 0:ae0a3c9f9e95
2166 2237 user: test
2167 2238 date: Thu Jan 01 00:00:00 1970 +0000
2168 2239 summary: content1
2169 2240
2170 2241
2171 2242 plain log lists the original version
2172 2243 (XXX we should probably list both)
2173 2244
2174 2245 $ hg log -G a
2175 2246 @ changeset: 4:50b9b36e9c5d
2176 2247 : tag: tip
2177 2248 : user: test
2178 2249 : date: Thu Jan 01 00:00:00 1970 +0000
2179 2250 : summary: content3
2180 2251 :
2181 2252 : o changeset: 1:2294ae80ad84
2182 2253 :/ user: test
2183 2254 : date: Thu Jan 01 00:00:00 1970 +0000
2184 2255 : summary: content2
2185 2256 :
2186 2257 o changeset: 0:ae0a3c9f9e95
2187 2258 user: test
2188 2259 date: Thu Jan 01 00:00:00 1970 +0000
2189 2260 summary: content1
2190 2261
2191 2262
2192 2263 hg log -f from the grafted changeset
2193 2264 (The bootstrap should properly take the topology in account)
2194 2265
2195 2266 $ hg up 'desc(content3)^'
2196 2267 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2197 2268 $ hg log -Gf a
2198 2269 @ changeset: 3:15b2327059e5
2199 2270 : user: test
2200 2271 : date: Thu Jan 01 00:00:00 1970 +0000
2201 2272 : summary: content2
2202 2273 :
2203 2274 o changeset: 0:ae0a3c9f9e95
2204 2275 user: test
2205 2276 date: Thu Jan 01 00:00:00 1970 +0000
2206 2277 summary: content1
2207 2278
2208 2279
2209 2280 Test that we use the first non-hidden changeset in that case.
2210 2281
2211 2282 (hide the changeset)
2212 2283
2213 2284 $ hg log -T '{node}\n' -r 1
2214 2285 2294ae80ad8447bc78383182eeac50cb049df623
2215 2286 $ hg debugobsolete 2294ae80ad8447bc78383182eeac50cb049df623
2216 2287 obsoleted 1 changesets
2217 2288 $ hg log -G
2218 2289 o changeset: 4:50b9b36e9c5d
2219 2290 | tag: tip
2220 2291 | user: test
2221 2292 | date: Thu Jan 01 00:00:00 1970 +0000
2222 2293 | summary: content3
2223 2294 |
2224 2295 @ changeset: 3:15b2327059e5
2225 2296 | user: test
2226 2297 | date: Thu Jan 01 00:00:00 1970 +0000
2227 2298 | summary: content2
2228 2299 |
2229 2300 o changeset: 2:2029acd1168c
2230 2301 | parent: 0:ae0a3c9f9e95
2231 2302 | user: test
2232 2303 | date: Thu Jan 01 00:00:00 1970 +0000
2233 2304 | summary: unrelated
2234 2305 |
2235 2306 o changeset: 0:ae0a3c9f9e95
2236 2307 user: test
2237 2308 date: Thu Jan 01 00:00:00 1970 +0000
2238 2309 summary: content1
2239 2310
2240 2311
2241 2312 Check that log on the file does not drop the file revision.
2242 2313
2243 2314 $ hg log -G a
2244 2315 o changeset: 4:50b9b36e9c5d
2245 2316 | tag: tip
2246 2317 | user: test
2247 2318 | date: Thu Jan 01 00:00:00 1970 +0000
2248 2319 | summary: content3
2249 2320 |
2250 2321 @ changeset: 3:15b2327059e5
2251 2322 : user: test
2252 2323 : date: Thu Jan 01 00:00:00 1970 +0000
2253 2324 : summary: content2
2254 2325 :
2255 2326 o changeset: 0:ae0a3c9f9e95
2256 2327 user: test
2257 2328 date: Thu Jan 01 00:00:00 1970 +0000
2258 2329 summary: content1
2259 2330
2260 2331
2261 2332 Even when a head revision is linkrev-shadowed.
2262 2333
2263 2334 $ hg log -T '{node}\n' -r 4
2264 2335 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2265 2336 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2266 2337 obsoleted 1 changesets
2267 2338 $ hg log -G a
2268 2339 @ changeset: 3:15b2327059e5
2269 2340 : tag: tip
2270 2341 : user: test
2271 2342 : date: Thu Jan 01 00:00:00 1970 +0000
2272 2343 : summary: content2
2273 2344 :
2274 2345 o changeset: 0:ae0a3c9f9e95
2275 2346 user: test
2276 2347 date: Thu Jan 01 00:00:00 1970 +0000
2277 2348 summary: content1
2278 2349
2279 2350
2280 2351 $ cd ..
2281 2352
2282 2353 Even when the file revision is missing from some head:
2283 2354
2284 2355 $ hg init issue4490
2285 2356 $ cd issue4490
2286 2357 $ echo '[experimental]' >> .hg/hgrc
2287 2358 $ echo 'evolution.createmarkers=True' >> .hg/hgrc
2288 2359 $ echo a > a
2289 2360 $ hg ci -Am0
2290 2361 adding a
2291 2362 $ echo b > b
2292 2363 $ hg ci -Am1
2293 2364 adding b
2294 2365 $ echo B > b
2295 2366 $ hg ci --amend -m 1
2296 2367 $ hg up 0
2297 2368 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2298 2369 $ echo c > c
2299 2370 $ hg ci -Am2
2300 2371 adding c
2301 2372 created new head
2302 2373 $ hg up 'head() and not .'
2303 2374 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
2304 2375 $ hg log -G
2305 2376 o changeset: 3:db815d6d32e6
2306 2377 | tag: tip
2307 2378 | parent: 0:f7b1eb17ad24
2308 2379 | user: test
2309 2380 | date: Thu Jan 01 00:00:00 1970 +0000
2310 2381 | summary: 2
2311 2382 |
2312 2383 | @ changeset: 2:9bc8ce7f9356
2313 2384 |/ parent: 0:f7b1eb17ad24
2314 2385 | user: test
2315 2386 | date: Thu Jan 01 00:00:00 1970 +0000
2316 2387 | summary: 1
2317 2388 |
2318 2389 o changeset: 0:f7b1eb17ad24
2319 2390 user: test
2320 2391 date: Thu Jan 01 00:00:00 1970 +0000
2321 2392 summary: 0
2322 2393
2323 2394 $ hg log -f -G b
2324 2395 @ changeset: 2:9bc8ce7f9356
2325 2396 | parent: 0:f7b1eb17ad24
2326 2397 ~ user: test
2327 2398 date: Thu Jan 01 00:00:00 1970 +0000
2328 2399 summary: 1
2329 2400
2330 2401 $ hg log -G b
2331 2402 @ changeset: 2:9bc8ce7f9356
2332 2403 | parent: 0:f7b1eb17ad24
2333 2404 ~ user: test
2334 2405 date: Thu Jan 01 00:00:00 1970 +0000
2335 2406 summary: 1
2336 2407
2337 2408 $ cd ..
2338 2409
2339 2410 Check proper report when the manifest changes but not the file issue4499
2340 2411 ------------------------------------------------------------------------
2341 2412
2342 2413 $ hg init issue4499
2343 2414 $ cd issue4499
2344 2415 $ for f in A B C D F E G H I J K L M N O P Q R S T U; do
2345 2416 > echo 1 > $f;
2346 2417 > hg add $f;
2347 2418 > done
2348 2419 $ hg commit -m 'A1B1C1'
2349 2420 $ echo 2 > A
2350 2421 $ echo 2 > B
2351 2422 $ echo 2 > C
2352 2423 $ hg commit -m 'A2B2C2'
2353 2424 $ hg up 0
2354 2425 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
2355 2426 $ echo 3 > A
2356 2427 $ echo 2 > B
2357 2428 $ echo 2 > C
2358 2429 $ hg commit -m 'A3B2C2'
2359 2430 created new head
2360 2431
2361 2432 $ hg log -G
2362 2433 @ changeset: 2:fe5fc3d0eb17
2363 2434 | tag: tip
2364 2435 | parent: 0:abf4f0e38563
2365 2436 | user: test
2366 2437 | date: Thu Jan 01 00:00:00 1970 +0000
2367 2438 | summary: A3B2C2
2368 2439 |
2369 2440 | o changeset: 1:07dcc6b312c0
2370 2441 |/ user: test
2371 2442 | date: Thu Jan 01 00:00:00 1970 +0000
2372 2443 | summary: A2B2C2
2373 2444 |
2374 2445 o changeset: 0:abf4f0e38563
2375 2446 user: test
2376 2447 date: Thu Jan 01 00:00:00 1970 +0000
2377 2448 summary: A1B1C1
2378 2449
2379 2450
2380 2451 Log -f on B should reports current changesets
2381 2452
2382 2453 $ hg log -fG B
2383 2454 @ changeset: 2:fe5fc3d0eb17
2384 2455 | tag: tip
2385 2456 | parent: 0:abf4f0e38563
2386 2457 | user: test
2387 2458 | date: Thu Jan 01 00:00:00 1970 +0000
2388 2459 | summary: A3B2C2
2389 2460 |
2390 2461 o changeset: 0:abf4f0e38563
2391 2462 user: test
2392 2463 date: Thu Jan 01 00:00:00 1970 +0000
2393 2464 summary: A1B1C1
2394 2465
2395 2466 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now