##// END OF EJS Templates
namespaces: add test for log...
Sean Farley -
r23773:c517b97c default
parent child Browse files
Show More
@@ -1,1820 +1,1844
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 The g is crafted to have 2 filelog topological heads in a linear
19 19 changeset graph
20 20
21 21 $ hg init a
22 22 $ cd a
23 23 $ echo a > a
24 24 $ echo f > f
25 25 $ hg ci -Ama -d '1 0'
26 26 adding a
27 27 adding f
28 28
29 29 $ hg cp a b
30 30 $ hg cp f g
31 31 $ hg ci -mb -d '2 0'
32 32
33 33 $ mkdir dir
34 34 $ hg mv b dir
35 35 $ echo g >> g
36 36 $ echo f >> f
37 37 $ hg ci -mc -d '3 0'
38 38
39 39 $ hg mv a b
40 40 $ hg cp -f f g
41 41 $ echo a > d
42 42 $ hg add d
43 43 $ hg ci -md -d '4 0'
44 44
45 45 $ hg mv dir/b e
46 46 $ hg ci -me -d '5 0'
47 47
48 48 $ hg log a
49 49 changeset: 0:9161b9aeaf16
50 50 user: test
51 51 date: Thu Jan 01 00:00:01 1970 +0000
52 52 summary: a
53 53
54 54 log on directory
55 55
56 56 $ hg log dir
57 57 changeset: 4:7e4639b4691b
58 58 tag: tip
59 59 user: test
60 60 date: Thu Jan 01 00:00:05 1970 +0000
61 61 summary: e
62 62
63 63 changeset: 2:f8954cd4dc1f
64 64 user: test
65 65 date: Thu Jan 01 00:00:03 1970 +0000
66 66 summary: c
67 67
68 68 $ hg log somethingthatdoesntexist dir
69 69 changeset: 4:7e4639b4691b
70 70 tag: tip
71 71 user: test
72 72 date: Thu Jan 01 00:00:05 1970 +0000
73 73 summary: e
74 74
75 75 changeset: 2:f8954cd4dc1f
76 76 user: test
77 77 date: Thu Jan 01 00:00:03 1970 +0000
78 78 summary: c
79 79
80 80
81 81 -f, non-existent directory
82 82
83 83 $ hg log -f dir
84 84 abort: cannot follow file not in parent revision: "dir"
85 85 [255]
86 86
87 87 -f, directory
88 88
89 89 $ hg up -q 3
90 90 $ hg log -f dir
91 91 changeset: 2:f8954cd4dc1f
92 92 user: test
93 93 date: Thu Jan 01 00:00:03 1970 +0000
94 94 summary: c
95 95
96 96 -f, directory with --patch
97 97
98 98 $ hg log -f dir -p
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 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
105 105 --- /dev/null* (glob)
106 106 +++ b/dir/b* (glob)
107 107 @@ -0,0 +1,1 @@
108 108 +a
109 109
110 110
111 111 -f, pattern
112 112
113 113 $ hg log -f -I 'dir**' -p
114 114 changeset: 2:f8954cd4dc1f
115 115 user: test
116 116 date: Thu Jan 01 00:00:03 1970 +0000
117 117 summary: c
118 118
119 119 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
120 120 --- /dev/null* (glob)
121 121 +++ b/dir/b* (glob)
122 122 @@ -0,0 +1,1 @@
123 123 +a
124 124
125 125 $ hg up -q 4
126 126
127 127 -f, a wrong style
128 128
129 129 $ hg log -f -l1 --style something
130 130 abort: style 'something' not found
131 131 (available styles: bisect, changelog, compact, default, phases, xml)
132 132 [255]
133 133
134 134 -f, phases style
135 135
136 136
137 137 $ hg log -f -l1 --style phases
138 138 changeset: 4:7e4639b4691b
139 139 tag: tip
140 140 phase: draft
141 141 user: test
142 142 date: Thu Jan 01 00:00:05 1970 +0000
143 143 summary: e
144 144
145 145
146 146 -f, but no args
147 147
148 148 $ hg log -f
149 149 changeset: 4:7e4639b4691b
150 150 tag: tip
151 151 user: test
152 152 date: Thu Jan 01 00:00:05 1970 +0000
153 153 summary: e
154 154
155 155 changeset: 3:2ca5ba701980
156 156 user: test
157 157 date: Thu Jan 01 00:00:04 1970 +0000
158 158 summary: d
159 159
160 160 changeset: 2:f8954cd4dc1f
161 161 user: test
162 162 date: Thu Jan 01 00:00:03 1970 +0000
163 163 summary: c
164 164
165 165 changeset: 1:d89b0a12d229
166 166 user: test
167 167 date: Thu Jan 01 00:00:02 1970 +0000
168 168 summary: b
169 169
170 170 changeset: 0:9161b9aeaf16
171 171 user: test
172 172 date: Thu Jan 01 00:00:01 1970 +0000
173 173 summary: a
174 174
175 175
176 176 one rename
177 177
178 178 $ hg up -q 2
179 179 $ hg log -vf a
180 180 changeset: 0:9161b9aeaf16
181 181 user: test
182 182 date: Thu Jan 01 00:00:01 1970 +0000
183 183 files: a f
184 184 description:
185 185 a
186 186
187 187
188 188
189 189 many renames
190 190
191 191 $ hg up -q tip
192 192 $ hg log -vf e
193 193 changeset: 4:7e4639b4691b
194 194 tag: tip
195 195 user: test
196 196 date: Thu Jan 01 00:00:05 1970 +0000
197 197 files: dir/b e
198 198 description:
199 199 e
200 200
201 201
202 202 changeset: 2:f8954cd4dc1f
203 203 user: test
204 204 date: Thu Jan 01 00:00:03 1970 +0000
205 205 files: b dir/b f g
206 206 description:
207 207 c
208 208
209 209
210 210 changeset: 1:d89b0a12d229
211 211 user: test
212 212 date: Thu Jan 01 00:00:02 1970 +0000
213 213 files: b g
214 214 description:
215 215 b
216 216
217 217
218 218 changeset: 0:9161b9aeaf16
219 219 user: test
220 220 date: Thu Jan 01 00:00:01 1970 +0000
221 221 files: a f
222 222 description:
223 223 a
224 224
225 225
226 226
227 227
228 228 log -pf dir/b
229 229
230 230 $ hg up -q 3
231 231 $ hg log -pf dir/b
232 232 changeset: 2:f8954cd4dc1f
233 233 user: test
234 234 date: Thu Jan 01 00:00:03 1970 +0000
235 235 summary: c
236 236
237 237 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
238 238 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
239 239 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
240 240 @@ -0,0 +1,1 @@
241 241 +a
242 242
243 243 changeset: 1:d89b0a12d229
244 244 user: test
245 245 date: Thu Jan 01 00:00:02 1970 +0000
246 246 summary: b
247 247
248 248 diff -r 9161b9aeaf16 -r d89b0a12d229 b
249 249 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
250 250 +++ b/b Thu Jan 01 00:00:02 1970 +0000
251 251 @@ -0,0 +1,1 @@
252 252 +a
253 253
254 254 changeset: 0:9161b9aeaf16
255 255 user: test
256 256 date: Thu Jan 01 00:00:01 1970 +0000
257 257 summary: a
258 258
259 259 diff -r 000000000000 -r 9161b9aeaf16 a
260 260 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
261 261 +++ b/a Thu Jan 01 00:00:01 1970 +0000
262 262 @@ -0,0 +1,1 @@
263 263 +a
264 264
265 265
266 266 log -pf b inside dir
267 267
268 268 $ hg --cwd=dir log -pf b
269 269 changeset: 2:f8954cd4dc1f
270 270 user: test
271 271 date: Thu Jan 01 00:00:03 1970 +0000
272 272 summary: c
273 273
274 274 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
275 275 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
276 276 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
277 277 @@ -0,0 +1,1 @@
278 278 +a
279 279
280 280 changeset: 1:d89b0a12d229
281 281 user: test
282 282 date: Thu Jan 01 00:00:02 1970 +0000
283 283 summary: b
284 284
285 285 diff -r 9161b9aeaf16 -r d89b0a12d229 b
286 286 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
287 287 +++ b/b Thu Jan 01 00:00:02 1970 +0000
288 288 @@ -0,0 +1,1 @@
289 289 +a
290 290
291 291 changeset: 0:9161b9aeaf16
292 292 user: test
293 293 date: Thu Jan 01 00:00:01 1970 +0000
294 294 summary: a
295 295
296 296 diff -r 000000000000 -r 9161b9aeaf16 a
297 297 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
298 298 +++ b/a Thu Jan 01 00:00:01 1970 +0000
299 299 @@ -0,0 +1,1 @@
300 300 +a
301 301
302 302
303 303 log -pf, but no args
304 304
305 305 $ hg log -pf
306 306 changeset: 3:2ca5ba701980
307 307 user: test
308 308 date: Thu Jan 01 00:00:04 1970 +0000
309 309 summary: d
310 310
311 311 diff -r f8954cd4dc1f -r 2ca5ba701980 a
312 312 --- a/a Thu Jan 01 00:00:03 1970 +0000
313 313 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
314 314 @@ -1,1 +0,0 @@
315 315 -a
316 316 diff -r f8954cd4dc1f -r 2ca5ba701980 b
317 317 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
318 318 +++ b/b Thu Jan 01 00:00:04 1970 +0000
319 319 @@ -0,0 +1,1 @@
320 320 +a
321 321 diff -r f8954cd4dc1f -r 2ca5ba701980 d
322 322 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
323 323 +++ b/d Thu Jan 01 00:00:04 1970 +0000
324 324 @@ -0,0 +1,1 @@
325 325 +a
326 326 diff -r f8954cd4dc1f -r 2ca5ba701980 g
327 327 --- a/g Thu Jan 01 00:00:03 1970 +0000
328 328 +++ b/g Thu Jan 01 00:00:04 1970 +0000
329 329 @@ -1,2 +1,2 @@
330 330 f
331 331 -g
332 332 +f
333 333
334 334 changeset: 2:f8954cd4dc1f
335 335 user: test
336 336 date: Thu Jan 01 00:00:03 1970 +0000
337 337 summary: c
338 338
339 339 diff -r d89b0a12d229 -r f8954cd4dc1f b
340 340 --- a/b Thu Jan 01 00:00:02 1970 +0000
341 341 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
342 342 @@ -1,1 +0,0 @@
343 343 -a
344 344 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
345 345 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
346 346 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
347 347 @@ -0,0 +1,1 @@
348 348 +a
349 349 diff -r d89b0a12d229 -r f8954cd4dc1f f
350 350 --- a/f Thu Jan 01 00:00:02 1970 +0000
351 351 +++ b/f Thu Jan 01 00:00:03 1970 +0000
352 352 @@ -1,1 +1,2 @@
353 353 f
354 354 +f
355 355 diff -r d89b0a12d229 -r f8954cd4dc1f g
356 356 --- a/g Thu Jan 01 00:00:02 1970 +0000
357 357 +++ b/g Thu Jan 01 00:00:03 1970 +0000
358 358 @@ -1,1 +1,2 @@
359 359 f
360 360 +g
361 361
362 362 changeset: 1:d89b0a12d229
363 363 user: test
364 364 date: Thu Jan 01 00:00:02 1970 +0000
365 365 summary: b
366 366
367 367 diff -r 9161b9aeaf16 -r d89b0a12d229 b
368 368 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
369 369 +++ b/b Thu Jan 01 00:00:02 1970 +0000
370 370 @@ -0,0 +1,1 @@
371 371 +a
372 372 diff -r 9161b9aeaf16 -r d89b0a12d229 g
373 373 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
374 374 +++ b/g Thu Jan 01 00:00:02 1970 +0000
375 375 @@ -0,0 +1,1 @@
376 376 +f
377 377
378 378 changeset: 0:9161b9aeaf16
379 379 user: test
380 380 date: Thu Jan 01 00:00:01 1970 +0000
381 381 summary: a
382 382
383 383 diff -r 000000000000 -r 9161b9aeaf16 a
384 384 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
385 385 +++ b/a Thu Jan 01 00:00:01 1970 +0000
386 386 @@ -0,0 +1,1 @@
387 387 +a
388 388 diff -r 000000000000 -r 9161b9aeaf16 f
389 389 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
390 390 +++ b/f Thu Jan 01 00:00:01 1970 +0000
391 391 @@ -0,0 +1,1 @@
392 392 +f
393 393
394 394
395 395 log -vf dir/b
396 396
397 397 $ hg log -vf dir/b
398 398 changeset: 2:f8954cd4dc1f
399 399 user: test
400 400 date: Thu Jan 01 00:00:03 1970 +0000
401 401 files: b dir/b f g
402 402 description:
403 403 c
404 404
405 405
406 406 changeset: 1:d89b0a12d229
407 407 user: test
408 408 date: Thu Jan 01 00:00:02 1970 +0000
409 409 files: b g
410 410 description:
411 411 b
412 412
413 413
414 414 changeset: 0:9161b9aeaf16
415 415 user: test
416 416 date: Thu Jan 01 00:00:01 1970 +0000
417 417 files: a f
418 418 description:
419 419 a
420 420
421 421
422 422
423 423
424 424 -f and multiple filelog heads
425 425
426 426 $ hg up -q 2
427 427 $ hg log -f g --template '{rev}\n'
428 428 2
429 429 1
430 430 0
431 431 $ hg up -q tip
432 432 $ hg log -f g --template '{rev}\n'
433 433 3
434 434 2
435 435 0
436 436
437 437
438 438 log copies with --copies
439 439
440 440 $ hg log -vC --template '{rev} {file_copies}\n'
441 441 4 e (dir/b)
442 442 3 b (a)g (f)
443 443 2 dir/b (b)
444 444 1 b (a)g (f)
445 445 0
446 446
447 447 log copies switch without --copies, with old filecopy template
448 448
449 449 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
450 450 4
451 451 3
452 452 2
453 453 1
454 454 0
455 455
456 456 log copies switch with --copies
457 457
458 458 $ hg log -vC --template '{rev} {file_copies_switch}\n'
459 459 4 e (dir/b)
460 460 3 b (a)g (f)
461 461 2 dir/b (b)
462 462 1 b (a)g (f)
463 463 0
464 464
465 465
466 466 log copies with hardcoded style and with --style=default
467 467
468 468 $ hg log -vC -r4
469 469 changeset: 4:7e4639b4691b
470 470 tag: tip
471 471 user: test
472 472 date: Thu Jan 01 00:00:05 1970 +0000
473 473 files: dir/b e
474 474 copies: e (dir/b)
475 475 description:
476 476 e
477 477
478 478
479 479 $ hg log -vC -r4 --style=default
480 480 changeset: 4:7e4639b4691b
481 481 tag: tip
482 482 user: test
483 483 date: Thu Jan 01 00:00:05 1970 +0000
484 484 files: dir/b e
485 485 copies: e (dir/b)
486 486 description:
487 487 e
488 488
489 489
490 490
491 491
492 492 log copies, non-linear manifest
493 493
494 494 $ hg up -C 3
495 495 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
496 496 $ hg mv dir/b e
497 497 $ echo foo > foo
498 498 $ hg ci -Ame2 -d '6 0'
499 499 adding foo
500 500 created new head
501 501 $ hg log -v --template '{rev} {file_copies}\n' -r 5
502 502 5 e (dir/b)
503 503
504 504
505 505 log copies, execute bit set
506 506
507 507 #if execbit
508 508 $ chmod +x e
509 509 $ hg ci -me3 -d '7 0'
510 510 $ hg log -v --template '{rev} {file_copies}\n' -r 6
511 511 6
512 512 #endif
513 513
514 514
515 515 log -p d
516 516
517 517 $ hg log -pv d
518 518 changeset: 3:2ca5ba701980
519 519 user: test
520 520 date: Thu Jan 01 00:00:04 1970 +0000
521 521 files: a b d g
522 522 description:
523 523 d
524 524
525 525
526 526 diff -r f8954cd4dc1f -r 2ca5ba701980 d
527 527 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
528 528 +++ b/d Thu Jan 01 00:00:04 1970 +0000
529 529 @@ -0,0 +1,1 @@
530 530 +a
531 531
532 532
533 533
534 534 log --removed file
535 535
536 536 $ hg log --removed -v a
537 537 changeset: 3:2ca5ba701980
538 538 user: test
539 539 date: Thu Jan 01 00:00:04 1970 +0000
540 540 files: a b d g
541 541 description:
542 542 d
543 543
544 544
545 545 changeset: 0:9161b9aeaf16
546 546 user: test
547 547 date: Thu Jan 01 00:00:01 1970 +0000
548 548 files: a f
549 549 description:
550 550 a
551 551
552 552
553 553
554 554 log --removed revrange file
555 555
556 556 $ hg log --removed -v -r0:2 a
557 557 changeset: 0:9161b9aeaf16
558 558 user: test
559 559 date: Thu Jan 01 00:00:01 1970 +0000
560 560 files: a f
561 561 description:
562 562 a
563 563
564 564
565 565 $ cd ..
566 566
567 567 log --follow tests
568 568
569 569 $ hg init follow
570 570 $ cd follow
571 571
572 572 $ echo base > base
573 573 $ hg ci -Ambase -d '1 0'
574 574 adding base
575 575
576 576 $ echo r1 >> base
577 577 $ hg ci -Amr1 -d '1 0'
578 578 $ echo r2 >> base
579 579 $ hg ci -Amr2 -d '1 0'
580 580
581 581 $ hg up -C 1
582 582 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 583 $ echo b1 > b1
584 584 $ hg ci -Amb1 -d '1 0'
585 585 adding b1
586 586 created new head
587 587
588 588
589 589 log -f
590 590
591 591 $ hg log -f
592 592 changeset: 3:e62f78d544b4
593 593 tag: tip
594 594 parent: 1:3d5bf5654eda
595 595 user: test
596 596 date: Thu Jan 01 00:00:01 1970 +0000
597 597 summary: b1
598 598
599 599 changeset: 1:3d5bf5654eda
600 600 user: test
601 601 date: Thu Jan 01 00:00:01 1970 +0000
602 602 summary: r1
603 603
604 604 changeset: 0:67e992f2c4f3
605 605 user: test
606 606 date: Thu Jan 01 00:00:01 1970 +0000
607 607 summary: base
608 608
609 609
610 610
611 611 log -f -r 1:tip
612 612
613 613 $ hg up -C 0
614 614 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
615 615 $ echo b2 > b2
616 616 $ hg ci -Amb2 -d '1 0'
617 617 adding b2
618 618 created new head
619 619 $ hg log -f -r 1:tip
620 620 changeset: 1:3d5bf5654eda
621 621 user: test
622 622 date: Thu Jan 01 00:00:01 1970 +0000
623 623 summary: r1
624 624
625 625 changeset: 2:60c670bf5b30
626 626 user: test
627 627 date: Thu Jan 01 00:00:01 1970 +0000
628 628 summary: r2
629 629
630 630 changeset: 3:e62f78d544b4
631 631 parent: 1:3d5bf5654eda
632 632 user: test
633 633 date: Thu Jan 01 00:00:01 1970 +0000
634 634 summary: b1
635 635
636 636
637 637
638 638 log -r . with two parents
639 639
640 640 $ hg up -C 3
641 641 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
642 642 $ hg merge tip
643 643 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
644 644 (branch merge, don't forget to commit)
645 645 $ hg log -r .
646 646 changeset: 3:e62f78d544b4
647 647 parent: 1:3d5bf5654eda
648 648 user: test
649 649 date: Thu Jan 01 00:00:01 1970 +0000
650 650 summary: b1
651 651
652 652
653 653
654 654 log -r . with one parent
655 655
656 656 $ hg ci -mm12 -d '1 0'
657 657 $ hg log -r .
658 658 changeset: 5:302e9dd6890d
659 659 tag: tip
660 660 parent: 3:e62f78d544b4
661 661 parent: 4:ddb82e70d1a1
662 662 user: test
663 663 date: Thu Jan 01 00:00:01 1970 +0000
664 664 summary: m12
665 665
666 666
667 667 $ echo postm >> b1
668 668 $ hg ci -Amb1.1 -d'1 0'
669 669
670 670
671 671 log --follow-first
672 672
673 673 $ hg log --follow-first
674 674 changeset: 6:2404bbcab562
675 675 tag: tip
676 676 user: test
677 677 date: Thu Jan 01 00:00:01 1970 +0000
678 678 summary: b1.1
679 679
680 680 changeset: 5:302e9dd6890d
681 681 parent: 3:e62f78d544b4
682 682 parent: 4:ddb82e70d1a1
683 683 user: test
684 684 date: Thu Jan 01 00:00:01 1970 +0000
685 685 summary: m12
686 686
687 687 changeset: 3:e62f78d544b4
688 688 parent: 1:3d5bf5654eda
689 689 user: test
690 690 date: Thu Jan 01 00:00:01 1970 +0000
691 691 summary: b1
692 692
693 693 changeset: 1:3d5bf5654eda
694 694 user: test
695 695 date: Thu Jan 01 00:00:01 1970 +0000
696 696 summary: r1
697 697
698 698 changeset: 0:67e992f2c4f3
699 699 user: test
700 700 date: Thu Jan 01 00:00:01 1970 +0000
701 701 summary: base
702 702
703 703
704 704
705 705 log -P 2
706 706
707 707 $ hg log -P 2
708 708 changeset: 6:2404bbcab562
709 709 tag: tip
710 710 user: test
711 711 date: Thu Jan 01 00:00:01 1970 +0000
712 712 summary: b1.1
713 713
714 714 changeset: 5:302e9dd6890d
715 715 parent: 3:e62f78d544b4
716 716 parent: 4:ddb82e70d1a1
717 717 user: test
718 718 date: Thu Jan 01 00:00:01 1970 +0000
719 719 summary: m12
720 720
721 721 changeset: 4:ddb82e70d1a1
722 722 parent: 0:67e992f2c4f3
723 723 user: test
724 724 date: Thu Jan 01 00:00:01 1970 +0000
725 725 summary: b2
726 726
727 727 changeset: 3:e62f78d544b4
728 728 parent: 1:3d5bf5654eda
729 729 user: test
730 730 date: Thu Jan 01 00:00:01 1970 +0000
731 731 summary: b1
732 732
733 733
734 734
735 735 log -r tip -p --git
736 736
737 737 $ hg log -r tip -p --git
738 738 changeset: 6:2404bbcab562
739 739 tag: tip
740 740 user: test
741 741 date: Thu Jan 01 00:00:01 1970 +0000
742 742 summary: b1.1
743 743
744 744 diff --git a/b1 b/b1
745 745 --- a/b1
746 746 +++ b/b1
747 747 @@ -1,1 +1,2 @@
748 748 b1
749 749 +postm
750 750
751 751
752 752
753 753 log -r ""
754 754
755 755 $ hg log -r ''
756 756 hg: parse error: empty query
757 757 [255]
758 758
759 759 log -r <some unknown node id>
760 760
761 761 $ hg log -r 1000000000000000000000000000000000000000
762 762 abort: unknown revision '1000000000000000000000000000000000000000'!
763 763 [255]
764 764
765 765 log -k r1
766 766
767 767 $ hg log -k r1
768 768 changeset: 1:3d5bf5654eda
769 769 user: test
770 770 date: Thu Jan 01 00:00:01 1970 +0000
771 771 summary: r1
772 772
773 773 log -p -l2 --color=always
774 774
775 775 $ hg --config extensions.color= --config color.mode=ansi \
776 776 > log -p -l2 --color=always
777 777 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
778 778 tag: tip
779 779 user: test
780 780 date: Thu Jan 01 00:00:01 1970 +0000
781 781 summary: b1.1
782 782
783 783 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
784 784 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
785 785 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
786 786 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
787 787 b1
788 788 \x1b[0;32m+postm\x1b[0m (esc)
789 789
790 790 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
791 791 parent: 3:e62f78d544b4
792 792 parent: 4:ddb82e70d1a1
793 793 user: test
794 794 date: Thu Jan 01 00:00:01 1970 +0000
795 795 summary: m12
796 796
797 797 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
798 798 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
799 799 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
800 800 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
801 801 \x1b[0;32m+b2\x1b[0m (esc)
802 802
803 803
804 804
805 805 log -r tip --stat
806 806
807 807 $ hg log -r tip --stat
808 808 changeset: 6:2404bbcab562
809 809 tag: tip
810 810 user: test
811 811 date: Thu Jan 01 00:00:01 1970 +0000
812 812 summary: b1.1
813 813
814 814 b1 | 1 +
815 815 1 files changed, 1 insertions(+), 0 deletions(-)
816 816
817 817
818 818 $ cd ..
819 819
820 820
821 821 User
822 822
823 823 $ hg init usertest
824 824 $ cd usertest
825 825
826 826 $ echo a > a
827 827 $ hg ci -A -m "a" -u "User One <user1@example.org>"
828 828 adding a
829 829 $ echo b > b
830 830 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
831 831 adding b
832 832
833 833 $ hg log -u "User One <user1@example.org>"
834 834 changeset: 0:29a4c94f1924
835 835 user: User One <user1@example.org>
836 836 date: Thu Jan 01 00:00:00 1970 +0000
837 837 summary: a
838 838
839 839 $ hg log -u "user1" -u "user2"
840 840 changeset: 1:e834b5e69c0e
841 841 tag: tip
842 842 user: User Two <user2@example.org>
843 843 date: Thu Jan 01 00:00:00 1970 +0000
844 844 summary: b
845 845
846 846 changeset: 0:29a4c94f1924
847 847 user: User One <user1@example.org>
848 848 date: Thu Jan 01 00:00:00 1970 +0000
849 849 summary: a
850 850
851 851 $ hg log -u "user3"
852 852
853 853 $ cd ..
854 854
855 855 $ hg init branches
856 856 $ cd branches
857 857
858 858 $ echo a > a
859 859 $ hg ci -A -m "commit on default"
860 860 adding a
861 861 $ hg branch test
862 862 marked working directory as branch test
863 863 (branches are permanent and global, did you want a bookmark?)
864 864 $ echo b > b
865 865 $ hg ci -A -m "commit on test"
866 866 adding b
867 867
868 868 $ hg up default
869 869 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
870 870 $ echo c > c
871 871 $ hg ci -A -m "commit on default"
872 872 adding c
873 873 $ hg up test
874 874 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
875 875 $ echo c > c
876 876 $ hg ci -A -m "commit on test"
877 877 adding c
878 878
879 879
880 880 log -b default
881 881
882 882 $ hg log -b default
883 883 changeset: 2:c3a4f03cc9a7
884 884 parent: 0:24427303d56f
885 885 user: test
886 886 date: Thu Jan 01 00:00:00 1970 +0000
887 887 summary: commit on default
888 888
889 889 changeset: 0:24427303d56f
890 890 user: test
891 891 date: Thu Jan 01 00:00:00 1970 +0000
892 892 summary: commit on default
893 893
894 894
895 895
896 896 log -b test
897 897
898 898 $ hg log -b test
899 899 changeset: 3:f5d8de11c2e2
900 900 branch: test
901 901 tag: tip
902 902 parent: 1:d32277701ccb
903 903 user: test
904 904 date: Thu Jan 01 00:00:00 1970 +0000
905 905 summary: commit on test
906 906
907 907 changeset: 1:d32277701ccb
908 908 branch: test
909 909 user: test
910 910 date: Thu Jan 01 00:00:00 1970 +0000
911 911 summary: commit on test
912 912
913 913
914 914
915 915 log -b dummy
916 916
917 917 $ hg log -b dummy
918 918 abort: unknown revision 'dummy'!
919 919 [255]
920 920
921 921
922 922 log -b .
923 923
924 924 $ hg log -b .
925 925 changeset: 3:f5d8de11c2e2
926 926 branch: test
927 927 tag: tip
928 928 parent: 1:d32277701ccb
929 929 user: test
930 930 date: Thu Jan 01 00:00:00 1970 +0000
931 931 summary: commit on test
932 932
933 933 changeset: 1:d32277701ccb
934 934 branch: test
935 935 user: test
936 936 date: Thu Jan 01 00:00:00 1970 +0000
937 937 summary: commit on test
938 938
939 939
940 940
941 941 log -b default -b test
942 942
943 943 $ hg log -b default -b test
944 944 changeset: 3:f5d8de11c2e2
945 945 branch: test
946 946 tag: tip
947 947 parent: 1:d32277701ccb
948 948 user: test
949 949 date: Thu Jan 01 00:00:00 1970 +0000
950 950 summary: commit on test
951 951
952 952 changeset: 2:c3a4f03cc9a7
953 953 parent: 0:24427303d56f
954 954 user: test
955 955 date: Thu Jan 01 00:00:00 1970 +0000
956 956 summary: commit on default
957 957
958 958 changeset: 1:d32277701ccb
959 959 branch: test
960 960 user: test
961 961 date: Thu Jan 01 00:00:00 1970 +0000
962 962 summary: commit on test
963 963
964 964 changeset: 0:24427303d56f
965 965 user: test
966 966 date: Thu Jan 01 00:00:00 1970 +0000
967 967 summary: commit on default
968 968
969 969
970 970
971 971 log -b default -b .
972 972
973 973 $ hg log -b default -b .
974 974 changeset: 3:f5d8de11c2e2
975 975 branch: test
976 976 tag: tip
977 977 parent: 1:d32277701ccb
978 978 user: test
979 979 date: Thu Jan 01 00:00:00 1970 +0000
980 980 summary: commit on test
981 981
982 982 changeset: 2:c3a4f03cc9a7
983 983 parent: 0:24427303d56f
984 984 user: test
985 985 date: Thu Jan 01 00:00:00 1970 +0000
986 986 summary: commit on default
987 987
988 988 changeset: 1:d32277701ccb
989 989 branch: test
990 990 user: test
991 991 date: Thu Jan 01 00:00:00 1970 +0000
992 992 summary: commit on test
993 993
994 994 changeset: 0:24427303d56f
995 995 user: test
996 996 date: Thu Jan 01 00:00:00 1970 +0000
997 997 summary: commit on default
998 998
999 999
1000 1000
1001 1001 log -b . -b test
1002 1002
1003 1003 $ hg log -b . -b test
1004 1004 changeset: 3:f5d8de11c2e2
1005 1005 branch: test
1006 1006 tag: tip
1007 1007 parent: 1:d32277701ccb
1008 1008 user: test
1009 1009 date: Thu Jan 01 00:00:00 1970 +0000
1010 1010 summary: commit on test
1011 1011
1012 1012 changeset: 1:d32277701ccb
1013 1013 branch: test
1014 1014 user: test
1015 1015 date: Thu Jan 01 00:00:00 1970 +0000
1016 1016 summary: commit on test
1017 1017
1018 1018
1019 1019
1020 1020 log -b 2
1021 1021
1022 1022 $ hg log -b 2
1023 1023 changeset: 2:c3a4f03cc9a7
1024 1024 parent: 0:24427303d56f
1025 1025 user: test
1026 1026 date: Thu Jan 01 00:00:00 1970 +0000
1027 1027 summary: commit on default
1028 1028
1029 1029 changeset: 0:24427303d56f
1030 1030 user: test
1031 1031 date: Thu Jan 01 00:00:00 1970 +0000
1032 1032 summary: commit on default
1033 1033
1034 1034 #if gettext
1035 1035
1036 1036 Test that all log names are translated (e.g. branches, bookmarks, tags):
1037 1037
1038 1038 $ hg bookmark babar -r tip
1039 1039
1040 1040 $ HGENCODING=UTF-8 LANGUAGE=de hg log -r tip
1041 1041 \xc3\x84nderung: 3:f5d8de11c2e2 (esc)
1042 1042 Zweig: test
1043 1043 Lesezeichen: babar
1044 1044 Marke: tip
1045 1045 Vorg\xc3\xa4nger: 1:d32277701ccb (esc)
1046 1046 Nutzer: test
1047 1047 Datum: Thu Jan 01 00:00:00 1970 +0000
1048 1048 Zusammenfassung: commit on test
1049 1049
1050 1050 $ hg bookmark -d babar
1051 1051
1052 1052 #endif
1053 1053
1054 1054 log -p --cwd dir (in subdir)
1055 1055
1056 1056 $ mkdir dir
1057 1057 $ hg log -p --cwd dir
1058 1058 changeset: 3:f5d8de11c2e2
1059 1059 branch: test
1060 1060 tag: tip
1061 1061 parent: 1:d32277701ccb
1062 1062 user: test
1063 1063 date: Thu Jan 01 00:00:00 1970 +0000
1064 1064 summary: commit on test
1065 1065
1066 1066 diff -r d32277701ccb -r f5d8de11c2e2 c
1067 1067 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1068 1068 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1069 1069 @@ -0,0 +1,1 @@
1070 1070 +c
1071 1071
1072 1072 changeset: 2:c3a4f03cc9a7
1073 1073 parent: 0:24427303d56f
1074 1074 user: test
1075 1075 date: Thu Jan 01 00:00:00 1970 +0000
1076 1076 summary: commit on default
1077 1077
1078 1078 diff -r 24427303d56f -r c3a4f03cc9a7 c
1079 1079 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1080 1080 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1081 1081 @@ -0,0 +1,1 @@
1082 1082 +c
1083 1083
1084 1084 changeset: 1:d32277701ccb
1085 1085 branch: test
1086 1086 user: test
1087 1087 date: Thu Jan 01 00:00:00 1970 +0000
1088 1088 summary: commit on test
1089 1089
1090 1090 diff -r 24427303d56f -r d32277701ccb b
1091 1091 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1092 1092 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1093 1093 @@ -0,0 +1,1 @@
1094 1094 +b
1095 1095
1096 1096 changeset: 0:24427303d56f
1097 1097 user: test
1098 1098 date: Thu Jan 01 00:00:00 1970 +0000
1099 1099 summary: commit on default
1100 1100
1101 1101 diff -r 000000000000 -r 24427303d56f a
1102 1102 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1103 1103 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1104 1104 @@ -0,0 +1,1 @@
1105 1105 +a
1106 1106
1107 1107
1108 1108
1109 1109 log -p -R repo
1110 1110
1111 1111 $ cd dir
1112 1112 $ hg log -p -R .. ../a
1113 1113 changeset: 0:24427303d56f
1114 1114 user: test
1115 1115 date: Thu Jan 01 00:00:00 1970 +0000
1116 1116 summary: commit on default
1117 1117
1118 1118 diff -r 000000000000 -r 24427303d56f a
1119 1119 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1120 1120 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1121 1121 @@ -0,0 +1,1 @@
1122 1122 +a
1123 1123
1124 1124
1125 1125 $ cd ../..
1126 1126
1127 1127 $ hg init follow2
1128 1128 $ cd follow2
1129 1129
1130 1130 # Build the following history:
1131 1131 # tip - o - x - o - x - x
1132 1132 # \ /
1133 1133 # o - o - o - x
1134 1134 # \ /
1135 1135 # o
1136 1136 #
1137 1137 # Where "o" is a revision containing "foo" and
1138 1138 # "x" is a revision without "foo"
1139 1139
1140 1140 $ touch init
1141 1141 $ hg ci -A -m "init, unrelated"
1142 1142 adding init
1143 1143 $ echo 'foo' > init
1144 1144 $ hg ci -m "change, unrelated"
1145 1145 $ echo 'foo' > foo
1146 1146 $ hg ci -A -m "add unrelated old foo"
1147 1147 adding foo
1148 1148 $ hg rm foo
1149 1149 $ hg ci -m "delete foo, unrelated"
1150 1150 $ echo 'related' > foo
1151 1151 $ hg ci -A -m "add foo, related"
1152 1152 adding foo
1153 1153
1154 1154 $ hg up 0
1155 1155 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1156 1156 $ touch branch
1157 1157 $ hg ci -A -m "first branch, unrelated"
1158 1158 adding branch
1159 1159 created new head
1160 1160 $ touch foo
1161 1161 $ hg ci -A -m "create foo, related"
1162 1162 adding foo
1163 1163 $ echo 'change' > foo
1164 1164 $ hg ci -m "change foo, related"
1165 1165
1166 1166 $ hg up 6
1167 1167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1168 1168 $ echo 'change foo in branch' > foo
1169 1169 $ hg ci -m "change foo in branch, related"
1170 1170 created new head
1171 1171 $ hg merge 7
1172 1172 merging foo
1173 1173 warning: conflicts during merge.
1174 1174 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
1175 1175 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1176 1176 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1177 1177 [1]
1178 1178 $ echo 'merge 1' > foo
1179 1179 $ hg resolve -m foo
1180 1180 (no more unresolved files)
1181 1181 $ hg ci -m "First merge, related"
1182 1182
1183 1183 $ hg merge 4
1184 1184 merging foo
1185 1185 warning: conflicts during merge.
1186 1186 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
1187 1187 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1188 1188 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1189 1189 [1]
1190 1190 $ echo 'merge 2' > foo
1191 1191 $ hg resolve -m foo
1192 1192 (no more unresolved files)
1193 1193 $ hg ci -m "Last merge, related"
1194 1194
1195 1195 $ hg log --graph
1196 1196 @ changeset: 10:4dae8563d2c5
1197 1197 |\ tag: tip
1198 1198 | | parent: 9:7b35701b003e
1199 1199 | | parent: 4:88176d361b69
1200 1200 | | user: test
1201 1201 | | date: Thu Jan 01 00:00:00 1970 +0000
1202 1202 | | summary: Last merge, related
1203 1203 | |
1204 1204 | o changeset: 9:7b35701b003e
1205 1205 | |\ parent: 8:e5416ad8a855
1206 1206 | | | parent: 7:87fe3144dcfa
1207 1207 | | | user: test
1208 1208 | | | date: Thu Jan 01 00:00:00 1970 +0000
1209 1209 | | | summary: First merge, related
1210 1210 | | |
1211 1211 | | o changeset: 8:e5416ad8a855
1212 1212 | | | parent: 6:dc6c325fe5ee
1213 1213 | | | user: test
1214 1214 | | | date: Thu Jan 01 00:00:00 1970 +0000
1215 1215 | | | summary: change foo in branch, related
1216 1216 | | |
1217 1217 | o | changeset: 7:87fe3144dcfa
1218 1218 | |/ user: test
1219 1219 | | date: Thu Jan 01 00:00:00 1970 +0000
1220 1220 | | summary: change foo, related
1221 1221 | |
1222 1222 | o changeset: 6:dc6c325fe5ee
1223 1223 | | user: test
1224 1224 | | date: Thu Jan 01 00:00:00 1970 +0000
1225 1225 | | summary: create foo, related
1226 1226 | |
1227 1227 | o changeset: 5:73db34516eb9
1228 1228 | | parent: 0:e87515fd044a
1229 1229 | | user: test
1230 1230 | | date: Thu Jan 01 00:00:00 1970 +0000
1231 1231 | | summary: first branch, unrelated
1232 1232 | |
1233 1233 o | changeset: 4:88176d361b69
1234 1234 | | user: test
1235 1235 | | date: Thu Jan 01 00:00:00 1970 +0000
1236 1236 | | summary: add foo, related
1237 1237 | |
1238 1238 o | changeset: 3:dd78ae4afb56
1239 1239 | | user: test
1240 1240 | | date: Thu Jan 01 00:00:00 1970 +0000
1241 1241 | | summary: delete foo, unrelated
1242 1242 | |
1243 1243 o | changeset: 2:c4c64aedf0f7
1244 1244 | | user: test
1245 1245 | | date: Thu Jan 01 00:00:00 1970 +0000
1246 1246 | | summary: add unrelated old foo
1247 1247 | |
1248 1248 o | changeset: 1:e5faa7440653
1249 1249 |/ user: test
1250 1250 | date: Thu Jan 01 00:00:00 1970 +0000
1251 1251 | summary: change, unrelated
1252 1252 |
1253 1253 o changeset: 0:e87515fd044a
1254 1254 user: test
1255 1255 date: Thu Jan 01 00:00:00 1970 +0000
1256 1256 summary: init, unrelated
1257 1257
1258 1258
1259 1259 $ hg --traceback log -f foo
1260 1260 changeset: 10:4dae8563d2c5
1261 1261 tag: tip
1262 1262 parent: 9:7b35701b003e
1263 1263 parent: 4:88176d361b69
1264 1264 user: test
1265 1265 date: Thu Jan 01 00:00:00 1970 +0000
1266 1266 summary: Last merge, related
1267 1267
1268 1268 changeset: 9:7b35701b003e
1269 1269 parent: 8:e5416ad8a855
1270 1270 parent: 7:87fe3144dcfa
1271 1271 user: test
1272 1272 date: Thu Jan 01 00:00:00 1970 +0000
1273 1273 summary: First merge, related
1274 1274
1275 1275 changeset: 8:e5416ad8a855
1276 1276 parent: 6:dc6c325fe5ee
1277 1277 user: test
1278 1278 date: Thu Jan 01 00:00:00 1970 +0000
1279 1279 summary: change foo in branch, related
1280 1280
1281 1281 changeset: 7:87fe3144dcfa
1282 1282 user: test
1283 1283 date: Thu Jan 01 00:00:00 1970 +0000
1284 1284 summary: change foo, related
1285 1285
1286 1286 changeset: 6:dc6c325fe5ee
1287 1287 user: test
1288 1288 date: Thu Jan 01 00:00:00 1970 +0000
1289 1289 summary: create foo, related
1290 1290
1291 1291 changeset: 4:88176d361b69
1292 1292 user: test
1293 1293 date: Thu Jan 01 00:00:00 1970 +0000
1294 1294 summary: add foo, related
1295 1295
1296 1296
1297 1297 Also check when maxrev < lastrevfilelog
1298 1298
1299 1299 $ hg --traceback log -f -r4 foo
1300 1300 changeset: 4:88176d361b69
1301 1301 user: test
1302 1302 date: Thu Jan 01 00:00:00 1970 +0000
1303 1303 summary: add foo, related
1304 1304
1305 1305 $ cd ..
1306 1306
1307 1307 Issue2383: hg log showing _less_ differences than hg diff
1308 1308
1309 1309 $ hg init issue2383
1310 1310 $ cd issue2383
1311 1311
1312 1312 Create a test repo:
1313 1313
1314 1314 $ echo a > a
1315 1315 $ hg ci -Am0
1316 1316 adding a
1317 1317 $ echo b > b
1318 1318 $ hg ci -Am1
1319 1319 adding b
1320 1320 $ hg co 0
1321 1321 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1322 1322 $ echo b > a
1323 1323 $ hg ci -m2
1324 1324 created new head
1325 1325
1326 1326 Merge:
1327 1327
1328 1328 $ hg merge
1329 1329 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1330 1330 (branch merge, don't forget to commit)
1331 1331
1332 1332 Make sure there's a file listed in the merge to trigger the bug:
1333 1333
1334 1334 $ echo c > a
1335 1335 $ hg ci -m3
1336 1336
1337 1337 Two files shown here in diff:
1338 1338
1339 1339 $ hg diff --rev 2:3
1340 1340 diff -r b09be438c43a -r 8e07aafe1edc a
1341 1341 --- a/a Thu Jan 01 00:00:00 1970 +0000
1342 1342 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1343 1343 @@ -1,1 +1,1 @@
1344 1344 -b
1345 1345 +c
1346 1346 diff -r b09be438c43a -r 8e07aafe1edc b
1347 1347 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1348 1348 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1349 1349 @@ -0,0 +1,1 @@
1350 1350 +b
1351 1351
1352 1352 Diff here should be the same:
1353 1353
1354 1354 $ hg log -vpr 3
1355 1355 changeset: 3:8e07aafe1edc
1356 1356 tag: tip
1357 1357 parent: 2:b09be438c43a
1358 1358 parent: 1:925d80f479bb
1359 1359 user: test
1360 1360 date: Thu Jan 01 00:00:00 1970 +0000
1361 1361 files: a
1362 1362 description:
1363 1363 3
1364 1364
1365 1365
1366 1366 diff -r b09be438c43a -r 8e07aafe1edc a
1367 1367 --- a/a Thu Jan 01 00:00:00 1970 +0000
1368 1368 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1369 1369 @@ -1,1 +1,1 @@
1370 1370 -b
1371 1371 +c
1372 1372 diff -r b09be438c43a -r 8e07aafe1edc b
1373 1373 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1374 1374 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1375 1375 @@ -0,0 +1,1 @@
1376 1376 +b
1377 1377
1378 1378 $ cd ..
1379 1379
1380 1380 'hg log -r rev fn' when last(filelog(fn)) != rev
1381 1381
1382 1382 $ hg init simplelog
1383 1383 $ cd simplelog
1384 1384 $ echo f > a
1385 1385 $ hg ci -Am'a' -d '0 0'
1386 1386 adding a
1387 1387 $ echo f >> a
1388 1388 $ hg ci -Am'a bis' -d '1 0'
1389 1389
1390 1390 $ hg log -r0 a
1391 1391 changeset: 0:9f758d63dcde
1392 1392 user: test
1393 1393 date: Thu Jan 01 00:00:00 1970 +0000
1394 1394 summary: a
1395 1395
1396 1396 enable obsolete to test hidden feature
1397 1397
1398 1398 $ cat >> $HGRCPATH << EOF
1399 1399 > [experimental]
1400 1400 > evolution=createmarkers
1401 1401 > EOF
1402 1402
1403 1403 $ hg log --template='{rev}:{node}\n'
1404 1404 1:a765632148dc55d38c35c4f247c618701886cb2f
1405 1405 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1406 1406 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1407 1407 $ hg up null -q
1408 1408 $ hg log --template='{rev}:{node}\n'
1409 1409 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1410 1410 $ hg log --template='{rev}:{node}\n' --hidden
1411 1411 1:a765632148dc55d38c35c4f247c618701886cb2f
1412 1412 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1413 1413 $ hg log -r a
1414 1414 abort: hidden revision 'a'!
1415 1415 (use --hidden to access hidden revisions)
1416 1416 [255]
1417 1417
1418 1418 test that parent prevent a changeset to be hidden
1419 1419
1420 1420 $ hg up 1 -q --hidden
1421 1421 $ hg log --template='{rev}:{node}\n'
1422 1422 1:a765632148dc55d38c35c4f247c618701886cb2f
1423 1423 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1424 1424
1425 1425 test that second parent prevent a changeset to be hidden too
1426 1426
1427 1427 $ hg debugsetparents 0 1 # nothing suitable to merge here
1428 1428 $ hg log --template='{rev}:{node}\n'
1429 1429 1:a765632148dc55d38c35c4f247c618701886cb2f
1430 1430 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1431 1431 $ hg debugsetparents 1
1432 1432 $ hg up -q null
1433 1433
1434 1434 bookmarks prevent a changeset being hidden
1435 1435
1436 1436 $ hg bookmark --hidden -r 1 X
1437 1437 $ hg log --template '{rev}:{node}\n'
1438 1438 1:a765632148dc55d38c35c4f247c618701886cb2f
1439 1439 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1440 1440 $ hg bookmark -d X
1441 1441
1442 1442 divergent bookmarks are not hidden
1443 1443
1444 1444 $ hg bookmark --hidden -r 1 X@foo
1445 1445 $ hg log --template '{rev}:{node}\n'
1446 1446 1:a765632148dc55d38c35c4f247c618701886cb2f
1447 1447 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1448 1448
1449 1449 clear extensions configuration
1450 1450 $ echo '[extensions]' >> $HGRCPATH
1451 1451 $ echo "obs=!" >> $HGRCPATH
1452 1452 $ cd ..
1453 1453
1454 1454 test -u/-k for problematic encoding
1455 1455 # unicode: cp932:
1456 1456 # u30A2 0x83 0x41(= 'A')
1457 1457 # u30C2 0x83 0x61(= 'a')
1458 1458
1459 1459 $ hg init problematicencoding
1460 1460 $ cd problematicencoding
1461 1461
1462 1462 $ python > setup.sh <<EOF
1463 1463 > print u'''
1464 1464 > echo a > text
1465 1465 > hg add text
1466 1466 > hg --encoding utf-8 commit -u '\u30A2' -m none
1467 1467 > echo b > text
1468 1468 > hg --encoding utf-8 commit -u '\u30C2' -m none
1469 1469 > echo c > text
1470 1470 > hg --encoding utf-8 commit -u none -m '\u30A2'
1471 1471 > echo d > text
1472 1472 > hg --encoding utf-8 commit -u none -m '\u30C2'
1473 1473 > '''.encode('utf-8')
1474 1474 > EOF
1475 1475 $ sh < setup.sh
1476 1476
1477 1477 test in problematic encoding
1478 1478 $ python > test.sh <<EOF
1479 1479 > print u'''
1480 1480 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
1481 1481 > echo ====
1482 1482 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
1483 1483 > echo ====
1484 1484 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
1485 1485 > echo ====
1486 1486 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
1487 1487 > '''.encode('cp932')
1488 1488 > EOF
1489 1489 $ sh < test.sh
1490 1490 0
1491 1491 ====
1492 1492 1
1493 1493 ====
1494 1494 2
1495 1495 0
1496 1496 ====
1497 1497 3
1498 1498 1
1499 1499
1500 1500 $ cd ..
1501 1501
1502 1502 test hg log on non-existent files and on directories
1503 1503 $ hg init issue1340
1504 1504 $ cd issue1340
1505 1505 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
1506 1506 $ echo 1 > d1/f1
1507 1507 $ echo 1 > D2/f1
1508 1508 $ echo 1 > D3.i/f1
1509 1509 $ echo 1 > d4.hg/f1
1510 1510 $ echo 1 > d5.d/f1
1511 1511 $ echo 1 > .d6/f1
1512 1512 $ hg -q add .
1513 1513 $ hg commit -m "a bunch of weird directories"
1514 1514 $ hg log -l1 d1/f1 | grep changeset
1515 1515 changeset: 0:65624cd9070a
1516 1516 $ hg log -l1 f1
1517 1517 $ hg log -l1 . | grep changeset
1518 1518 changeset: 0:65624cd9070a
1519 1519 $ hg log -l1 ./ | grep changeset
1520 1520 changeset: 0:65624cd9070a
1521 1521 $ hg log -l1 d1 | grep changeset
1522 1522 changeset: 0:65624cd9070a
1523 1523 $ hg log -l1 D2 | grep changeset
1524 1524 changeset: 0:65624cd9070a
1525 1525 $ hg log -l1 D2/f1 | grep changeset
1526 1526 changeset: 0:65624cd9070a
1527 1527 $ hg log -l1 D3.i | grep changeset
1528 1528 changeset: 0:65624cd9070a
1529 1529 $ hg log -l1 D3.i/f1 | grep changeset
1530 1530 changeset: 0:65624cd9070a
1531 1531 $ hg log -l1 d4.hg | grep changeset
1532 1532 changeset: 0:65624cd9070a
1533 1533 $ hg log -l1 d4.hg/f1 | grep changeset
1534 1534 changeset: 0:65624cd9070a
1535 1535 $ hg log -l1 d5.d | grep changeset
1536 1536 changeset: 0:65624cd9070a
1537 1537 $ hg log -l1 d5.d/f1 | grep changeset
1538 1538 changeset: 0:65624cd9070a
1539 1539 $ hg log -l1 .d6 | grep changeset
1540 1540 changeset: 0:65624cd9070a
1541 1541 $ hg log -l1 .d6/f1 | grep changeset
1542 1542 changeset: 0:65624cd9070a
1543 1543
1544 1544 issue3772: hg log -r :null showing revision 0 as well
1545 1545
1546 1546 $ hg log -r :null
1547 1547 changeset: 0:65624cd9070a
1548 1548 tag: tip
1549 1549 user: test
1550 1550 date: Thu Jan 01 00:00:00 1970 +0000
1551 1551 summary: a bunch of weird directories
1552 1552
1553 1553 changeset: -1:000000000000
1554 1554 user:
1555 1555 date: Thu Jan 01 00:00:00 1970 +0000
1556 1556
1557 1557 $ hg log -r null:null
1558 1558 changeset: -1:000000000000
1559 1559 user:
1560 1560 date: Thu Jan 01 00:00:00 1970 +0000
1561 1561
1562 Check that adding an arbitrary name shows up in log automatically
1563
1564 $ cat > ../names.py <<EOF
1565 > """A small extension to test adding arbitrary names to a repo"""
1566 > from mercurial.namespaces import namespace
1567 >
1568 > def reposetup(ui, repo):
1569 > foo = {'foo': repo[0].node()}
1570 > ns = namespace("bars", "bar",
1571 > lambda r: foo.keys(),
1572 > lambda r, name: foo.get(name),
1573 > lambda r, node: [name for name, n
1574 > in foo.iteritems()
1575 > if n == node])
1576 > repo.names.addnamespace(ns)
1577 > EOF
1578
1579 $ hg --config extensions.names=../names.py log -r 0
1580 changeset: 0:65624cd9070a
1581 tag: tip
1582 bar: foo
1583 user: test
1584 date: Thu Jan 01 00:00:00 1970 +0000
1585 summary: a bunch of weird directories
1562 1586
1563 1587 $ cd ..
1564 1588
1565 1589 hg log -f dir across branches
1566 1590
1567 1591 $ hg init acrossbranches
1568 1592 $ cd acrossbranches
1569 1593 $ mkdir d
1570 1594 $ echo a > d/a && hg ci -Aqm a
1571 1595 $ echo b > d/a && hg ci -Aqm b
1572 1596 $ hg up -q 0
1573 1597 $ echo b > d/a && hg ci -Aqm c
1574 1598 $ hg log -f d -T '{desc}' -G
1575 1599 @ c
1576 1600 |
1577 1601 o a
1578 1602
1579 1603 $ hg log -f d/a -T '{desc}' -G
1580 1604 @ c
1581 1605 |
1582 1606 o a
1583 1607
1584 1608 $ cd ..
1585 1609
1586 1610 hg log -f with linkrev pointing to another branch
1587 1611 -------------------------------------------------
1588 1612
1589 1613 create history with a filerev whose linkrev points to another branch
1590 1614
1591 1615 $ hg init branchedlinkrev
1592 1616 $ cd branchedlinkrev
1593 1617 $ echo 1 > a
1594 1618 $ hg commit -Am 'content1'
1595 1619 adding a
1596 1620 $ echo 2 > a
1597 1621 $ hg commit -m 'content2'
1598 1622 $ hg up --rev 'desc(content1)'
1599 1623 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1600 1624 $ echo unrelated > unrelated
1601 1625 $ hg commit -Am 'unrelated'
1602 1626 adding unrelated
1603 1627 created new head
1604 1628 $ hg graft -r 'desc(content2)'
1605 1629 grafting 1:2294ae80ad84 "content2"
1606 1630 $ echo 3 > a
1607 1631 $ hg commit -m 'content3'
1608 1632 $ hg log -G
1609 1633 @ changeset: 4:50b9b36e9c5d
1610 1634 | tag: tip
1611 1635 | user: test
1612 1636 | date: Thu Jan 01 00:00:00 1970 +0000
1613 1637 | summary: content3
1614 1638 |
1615 1639 o changeset: 3:15b2327059e5
1616 1640 | user: test
1617 1641 | date: Thu Jan 01 00:00:00 1970 +0000
1618 1642 | summary: content2
1619 1643 |
1620 1644 o changeset: 2:2029acd1168c
1621 1645 | parent: 0:ae0a3c9f9e95
1622 1646 | user: test
1623 1647 | date: Thu Jan 01 00:00:00 1970 +0000
1624 1648 | summary: unrelated
1625 1649 |
1626 1650 | o changeset: 1:2294ae80ad84
1627 1651 |/ user: test
1628 1652 | date: Thu Jan 01 00:00:00 1970 +0000
1629 1653 | summary: content2
1630 1654 |
1631 1655 o changeset: 0:ae0a3c9f9e95
1632 1656 user: test
1633 1657 date: Thu Jan 01 00:00:00 1970 +0000
1634 1658 summary: content1
1635 1659
1636 1660
1637 1661 log -f on the file should list the graft result.
1638 1662
1639 1663 $ hg log -Gf a
1640 1664 @ changeset: 4:50b9b36e9c5d
1641 1665 | tag: tip
1642 1666 | user: test
1643 1667 | date: Thu Jan 01 00:00:00 1970 +0000
1644 1668 | summary: content3
1645 1669 |
1646 1670 o changeset: 3:15b2327059e5
1647 1671 | user: test
1648 1672 | date: Thu Jan 01 00:00:00 1970 +0000
1649 1673 | summary: content2
1650 1674 |
1651 1675 o changeset: 0:ae0a3c9f9e95
1652 1676 user: test
1653 1677 date: Thu Jan 01 00:00:00 1970 +0000
1654 1678 summary: content1
1655 1679
1656 1680
1657 1681 plain log lists the original version
1658 1682 (XXX we should probably list both)
1659 1683
1660 1684 $ hg log -G a
1661 1685 @ changeset: 4:50b9b36e9c5d
1662 1686 | tag: tip
1663 1687 | user: test
1664 1688 | date: Thu Jan 01 00:00:00 1970 +0000
1665 1689 | summary: content3
1666 1690 |
1667 1691 | o changeset: 1:2294ae80ad84
1668 1692 |/ user: test
1669 1693 | date: Thu Jan 01 00:00:00 1970 +0000
1670 1694 | summary: content2
1671 1695 |
1672 1696 o changeset: 0:ae0a3c9f9e95
1673 1697 user: test
1674 1698 date: Thu Jan 01 00:00:00 1970 +0000
1675 1699 summary: content1
1676 1700
1677 1701
1678 1702 hg log -f from the grafted changeset
1679 1703 (The bootstrap should properly take the topology in account)
1680 1704
1681 1705 $ hg up 'desc(content3)^'
1682 1706 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1683 1707 $ hg log -Gf a
1684 1708 @ changeset: 3:15b2327059e5
1685 1709 | user: test
1686 1710 | date: Thu Jan 01 00:00:00 1970 +0000
1687 1711 | summary: content2
1688 1712 |
1689 1713 o changeset: 0:ae0a3c9f9e95
1690 1714 user: test
1691 1715 date: Thu Jan 01 00:00:00 1970 +0000
1692 1716 summary: content1
1693 1717
1694 1718
1695 1719 Test that we use the first non-hidden changeset in that case.
1696 1720
1697 1721 (hide the changeset)
1698 1722
1699 1723 $ hg log -T '{node}\n' -r 1
1700 1724 2294ae80ad8447bc78383182eeac50cb049df623
1701 1725 $ hg debugobsolete 2294ae80ad8447bc78383182eeac50cb049df623
1702 1726 $ hg log -G
1703 1727 o changeset: 4:50b9b36e9c5d
1704 1728 | tag: tip
1705 1729 | user: test
1706 1730 | date: Thu Jan 01 00:00:00 1970 +0000
1707 1731 | summary: content3
1708 1732 |
1709 1733 @ changeset: 3:15b2327059e5
1710 1734 | user: test
1711 1735 | date: Thu Jan 01 00:00:00 1970 +0000
1712 1736 | summary: content2
1713 1737 |
1714 1738 o changeset: 2:2029acd1168c
1715 1739 | parent: 0:ae0a3c9f9e95
1716 1740 | user: test
1717 1741 | date: Thu Jan 01 00:00:00 1970 +0000
1718 1742 | summary: unrelated
1719 1743 |
1720 1744 o changeset: 0:ae0a3c9f9e95
1721 1745 user: test
1722 1746 date: Thu Jan 01 00:00:00 1970 +0000
1723 1747 summary: content1
1724 1748
1725 1749
1726 1750 Check that log on the file does not drop the file revision.
1727 1751
1728 1752 $ hg log -G a
1729 1753 o changeset: 4:50b9b36e9c5d
1730 1754 | tag: tip
1731 1755 | user: test
1732 1756 | date: Thu Jan 01 00:00:00 1970 +0000
1733 1757 | summary: content3
1734 1758 |
1735 1759 @ changeset: 3:15b2327059e5
1736 1760 | user: test
1737 1761 | date: Thu Jan 01 00:00:00 1970 +0000
1738 1762 | summary: content2
1739 1763 |
1740 1764 o changeset: 0:ae0a3c9f9e95
1741 1765 user: test
1742 1766 date: Thu Jan 01 00:00:00 1970 +0000
1743 1767 summary: content1
1744 1768
1745 1769
1746 1770 Even when a head revision is linkrev-shadowed.
1747 1771
1748 1772 $ hg log -T '{node}\n' -r 4
1749 1773 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1750 1774 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1751 1775 $ hg log -G a
1752 1776 @ changeset: 3:15b2327059e5
1753 1777 | tag: tip
1754 1778 | user: test
1755 1779 | date: Thu Jan 01 00:00:00 1970 +0000
1756 1780 | summary: content2
1757 1781 |
1758 1782 o changeset: 0:ae0a3c9f9e95
1759 1783 user: test
1760 1784 date: Thu Jan 01 00:00:00 1970 +0000
1761 1785 summary: content1
1762 1786
1763 1787
1764 1788 $ cd ..
1765 1789
1766 1790 Even when the file revision is missing from some head:
1767 1791
1768 1792 $ hg init issue4490
1769 1793 $ cd issue4490
1770 1794 $ echo '[experimental]' >> .hg/hgrc
1771 1795 $ echo 'evolution=createmarkers' >> .hg/hgrc
1772 1796 $ echo a > a
1773 1797 $ hg ci -Am0
1774 1798 adding a
1775 1799 $ echo b > b
1776 1800 $ hg ci -Am1
1777 1801 adding b
1778 1802 $ echo B > b
1779 1803 $ hg ci --amend -m 1
1780 1804 $ hg up 0
1781 1805 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1782 1806 $ echo c > c
1783 1807 $ hg ci -Am2
1784 1808 adding c
1785 1809 created new head
1786 1810 $ hg up 'head() and not .'
1787 1811 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1788 1812 $ hg log -G
1789 1813 o changeset: 4:db815d6d32e6
1790 1814 | tag: tip
1791 1815 | parent: 0:f7b1eb17ad24
1792 1816 | user: test
1793 1817 | date: Thu Jan 01 00:00:00 1970 +0000
1794 1818 | summary: 2
1795 1819 |
1796 1820 | @ changeset: 3:9bc8ce7f9356
1797 1821 |/ parent: 0:f7b1eb17ad24
1798 1822 | user: test
1799 1823 | date: Thu Jan 01 00:00:00 1970 +0000
1800 1824 | summary: 1
1801 1825 |
1802 1826 o changeset: 0:f7b1eb17ad24
1803 1827 user: test
1804 1828 date: Thu Jan 01 00:00:00 1970 +0000
1805 1829 summary: 0
1806 1830
1807 1831 $ hg log -f -G b
1808 1832 @ changeset: 3:9bc8ce7f9356
1809 1833 | parent: 0:f7b1eb17ad24
1810 1834 | user: test
1811 1835 | date: Thu Jan 01 00:00:00 1970 +0000
1812 1836 | summary: 1
1813 1837 |
1814 1838 $ hg log -G b
1815 1839 @ changeset: 3:9bc8ce7f9356
1816 1840 | parent: 0:f7b1eb17ad24
1817 1841 | user: test
1818 1842 | date: Thu Jan 01 00:00:00 1970 +0000
1819 1843 | summary: 1
1820 1844 |
General Comments 0
You need to be logged in to leave comments. Login now