comparison tests/test-command-template.t @ 38433:ddce7bdf7f3c

tests: extract test-template-map.t from test-command-template.t test-command-template.t is one of the slowest tests. Let's split it into 4 files of manageable size.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 16 Jun 2018 12:37:43 +0900
parents 4b73f316ba0e
children 70f551a3f52e
comparison
equal deleted inserted replaced
38432:05b7dd11918e 38433:ddce7bdf7f3c
243 $ hg tip --config 'ui.logtemplate="{rev}\n"' 243 $ hg tip --config 'ui.logtemplate="{rev}\n"'
244 8 244 8
245 $ hg tip --config 'ui.logtemplate=n{rev}\n' 245 $ hg tip --config 'ui.logtemplate=n{rev}\n'
246 n8 246 n8
247 247
248 Make sure user/global hgrc does not affect tests
249
250 $ echo '[ui]' > .hg/hgrc
251 $ echo 'logtemplate =' >> .hg/hgrc
252 $ echo 'style =' >> .hg/hgrc
253
254 Add some simple styles to settings
255
256 $ cat <<'EOF' >> .hg/hgrc
257 > [templates]
258 > simple = "{rev}\n"
259 > simple2 = {rev}\n
260 > rev = "should not precede {rev} keyword\n"
261 > EOF
262
263 $ hg log -l1 -Tsimple
264 8
265 $ hg log -l1 -Tsimple2
266 8
267 $ hg log -l1 -Trev
268 should not precede 8 keyword
269 $ hg log -l1 -T '{simple}'
270 8
271
272 Map file shouldn't see user templates:
273
274 $ cat <<EOF > tmpl
275 > changeset = 'nothing expanded:{simple}\n'
276 > EOF
277 $ hg log -l1 --style ./tmpl
278 nothing expanded:
279
280 Test templates and style maps in files:
281
282 $ echo "{rev}" > tmpl
283 $ hg log -l1 -T./tmpl
284 8
285 $ hg log -l1 -Tblah/blah
286 blah/blah (no-eol)
287
288 $ printf 'changeset = "{rev}\\n"\n' > map-simple
289 $ hg log -l1 -T./map-simple
290 8
291
292 a map file may have [templates] and [templatealias] sections:
293
294 $ cat <<'EOF' > map-simple
295 > [templates]
296 > changeset = "{a}\n"
297 > [templatealias]
298 > a = rev
299 > EOF
300 $ hg log -l1 -T./map-simple
301 8
302
303 so it can be included in hgrc
304
305 $ cat <<EOF > myhgrc
306 > %include $HGRCPATH
307 > %include map-simple
308 > [templates]
309 > foo = "{changeset}"
310 > EOF
311 $ HGRCPATH=./myhgrc hg log -l1 -Tfoo
312 8
313 $ HGRCPATH=./myhgrc hg log -l1 -T'{a}\n'
314 8
315
316 Test template map inheritance
317
318 $ echo "__base__ = map-cmdline.default" > map-simple
319 $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple
320 $ hg log -l1 -T./map-simple
321 changeset: ***8***
322 tag: tip
323 user: test
324 date: Wed Jan 01 10:01:00 2020 +0000
325 summary: third
326
327
328 Test docheader, docfooter and separator in template map
329
330 $ cat <<'EOF' > map-myjson
331 > docheader = '\{\n'
332 > docfooter = '\n}\n'
333 > separator = ',\n'
334 > changeset = ' {dict(rev, node|short)|json}'
335 > EOF
336 $ hg log -l2 -T./map-myjson
337 {
338 {"node": "95c24699272e", "rev": 8},
339 {"node": "29114dbae42b", "rev": 7}
340 }
341
342 Test docheader, docfooter and separator in [templates] section
343
344 $ cat <<'EOF' >> .hg/hgrc
345 > [templates]
346 > myjson = ' {dict(rev, node|short)|json}'
347 > myjson:docheader = '\{\n'
348 > myjson:docfooter = '\n}\n'
349 > myjson:separator = ',\n'
350 > :docheader = 'should not be selected as a docheader for literal templates\n'
351 > EOF
352 $ hg log -l2 -Tmyjson
353 {
354 {"node": "95c24699272e", "rev": 8},
355 {"node": "29114dbae42b", "rev": 7}
356 }
357 $ hg log -l1 -T'{rev}\n'
358 8
359
360 Template should precede style option
361
362 $ hg log -l1 --style default -T '{rev}\n'
363 8
364
365 Add a commit with empty description, to ensure that the templates
366 below will omit the description line.
367
368 $ echo c >> c
369 $ hg add c
370 $ hg commit -qm ' '
371
372 Default style is like normal output. Phases style should be the same
373 as default style, except for extra phase lines.
374
375 $ hg log > log.out
376 $ hg log --style default > style.out
377 $ cmp log.out style.out || diff -u log.out style.out
378 $ hg log -T phases > phases.out
379 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
380 +phase: draft
381 +phase: draft
382 +phase: draft
383 +phase: draft
384 +phase: draft
385 +phase: draft
386 +phase: draft
387 +phase: draft
388 +phase: draft
389 +phase: draft
390
391 $ hg log -v > log.out
392 $ hg log -v --style default > style.out
393 $ cmp log.out style.out || diff -u log.out style.out
394 $ hg log -v -T phases > phases.out
395 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
396 +phase: draft
397 +phase: draft
398 +phase: draft
399 +phase: draft
400 +phase: draft
401 +phase: draft
402 +phase: draft
403 +phase: draft
404 +phase: draft
405 +phase: draft
406
407 $ hg log -q > log.out
408 $ hg log -q --style default > style.out
409 $ cmp log.out style.out || diff -u log.out style.out
410 $ hg log -q -T phases > phases.out
411 $ cmp log.out phases.out || diff -u log.out phases.out
412
413 $ hg log --debug > log.out
414 $ hg log --debug --style default > style.out
415 $ cmp log.out style.out || diff -u log.out style.out
416 $ hg log --debug -T phases > phases.out
417 $ cmp log.out phases.out || diff -u log.out phases.out
418
419 Default style of working-directory revision should also be the same (but
420 date may change while running tests):
421
422 $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out
423 $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out
424 $ cmp log.out style.out || diff -u log.out style.out
425
426 $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out
427 $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out
428 $ cmp log.out style.out || diff -u log.out style.out
429
430 $ hg log -r 'wdir()' -q > log.out
431 $ hg log -r 'wdir()' -q --style default > style.out
432 $ cmp log.out style.out || diff -u log.out style.out
433
434 $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out
435 $ hg log -r 'wdir()' --debug --style default \
436 > | sed 's|^date:.*|date:|' > style.out
437 $ cmp log.out style.out || diff -u log.out style.out
438
439 Default style should also preserve color information (issue2866):
440
441 $ cp $HGRCPATH $HGRCPATH-bak
442 $ cat <<EOF >> $HGRCPATH
443 > [extensions]
444 > color=
445 > EOF
446
447 $ hg --color=debug log > log.out
448 $ hg --color=debug log --style default > style.out
449 $ cmp log.out style.out || diff -u log.out style.out
450 $ hg --color=debug log -T phases > phases.out
451 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
452 +[log.phase|phase: draft]
453 +[log.phase|phase: draft]
454 +[log.phase|phase: draft]
455 +[log.phase|phase: draft]
456 +[log.phase|phase: draft]
457 +[log.phase|phase: draft]
458 +[log.phase|phase: draft]
459 +[log.phase|phase: draft]
460 +[log.phase|phase: draft]
461 +[log.phase|phase: draft]
462
463 $ hg --color=debug -v log > log.out
464 $ hg --color=debug -v log --style default > style.out
465 $ cmp log.out style.out || diff -u log.out style.out
466 $ hg --color=debug -v log -T phases > phases.out
467 $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@'
468 +[log.phase|phase: draft]
469 +[log.phase|phase: draft]
470 +[log.phase|phase: draft]
471 +[log.phase|phase: draft]
472 +[log.phase|phase: draft]
473 +[log.phase|phase: draft]
474 +[log.phase|phase: draft]
475 +[log.phase|phase: draft]
476 +[log.phase|phase: draft]
477 +[log.phase|phase: draft]
478
479 $ hg --color=debug -q log > log.out
480 $ hg --color=debug -q log --style default > style.out
481 $ cmp log.out style.out || diff -u log.out style.out
482 $ hg --color=debug -q log -T phases > phases.out
483 $ cmp log.out phases.out || diff -u log.out phases.out
484
485 $ hg --color=debug --debug log > log.out
486 $ hg --color=debug --debug log --style default > style.out
487 $ cmp log.out style.out || diff -u log.out style.out
488 $ hg --color=debug --debug log -T phases > phases.out
489 $ cmp log.out phases.out || diff -u log.out phases.out
490
491 $ mv $HGRCPATH-bak $HGRCPATH
492
493 Remove commit with empty commit message, so as to not pollute further
494 tests.
495
496 $ hg --config extensions.strip= strip -q .
497
498 Revision with no copies (used to print a traceback):
499
500 $ hg tip -v --template '\n'
501
502
503 Compact style works:
504
505 $ hg log -Tcompact
506 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
507 third
508
509 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user
510 second
511
512 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
513 merge
514
515 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
516 new head
517
518 4 bbe44766e73d 1970-01-17 04:53 +0000 person
519 new branch
520
521 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
522 no user, no domain
523
524 2 97054abb4ab8 1970-01-14 21:20 +0000 other
525 no person
526
527 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other
528 other 1
529
530 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user
531 line 1
532
533
534 $ hg log -v --style compact
535 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test
536 third
537
538 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
539 second
540
541 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
542 merge
543
544 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person
545 new head
546
547 4 bbe44766e73d 1970-01-17 04:53 +0000 person
548 new branch
549
550 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person
551 no user, no domain
552
553 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place
554 no person
555
556 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
557 other 1
558 other 2
559
560 other 3
561
562 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
563 line 1
564 line 2
565
566
567 $ hg log --debug --style compact
568 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test
569 third
570
571 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name <user@hostname>
572 second
573
574 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person
575 merge
576
577 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person
578 new head
579
580 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person
581 new branch
582
583 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person
584 no user, no domain
585
586 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place
587 no person
588
589 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other <other@place>
590 other 1
591 other 2
592
593 other 3
594
595 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name <user@hostname>
596 line 1
597 line 2
598
599
600 Test xml styles:
601
602 $ hg log --style xml -r 'not all()'
603 <?xml version="1.0"?>
604 <log>
605 </log>
606
607 $ hg log --style xml
608 <?xml version="1.0"?>
609 <log>
610 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
611 <tag>tip</tag>
612 <author email="test">test</author>
613 <date>2020-01-01T10:01:00+00:00</date>
614 <msg xml:space="preserve">third</msg>
615 </logentry>
616 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
617 <parent revision="-1" node="0000000000000000000000000000000000000000" />
618 <author email="user@hostname">User Name</author>
619 <date>1970-01-12T13:46:40+00:00</date>
620 <msg xml:space="preserve">second</msg>
621 </logentry>
622 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
623 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
624 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
625 <author email="person">person</author>
626 <date>1970-01-18T08:40:01+00:00</date>
627 <msg xml:space="preserve">merge</msg>
628 </logentry>
629 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
630 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
631 <author email="person">person</author>
632 <date>1970-01-18T08:40:00+00:00</date>
633 <msg xml:space="preserve">new head</msg>
634 </logentry>
635 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
636 <branch>foo</branch>
637 <author email="person">person</author>
638 <date>1970-01-17T04:53:20+00:00</date>
639 <msg xml:space="preserve">new branch</msg>
640 </logentry>
641 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
642 <author email="person">person</author>
643 <date>1970-01-16T01:06:40+00:00</date>
644 <msg xml:space="preserve">no user, no domain</msg>
645 </logentry>
646 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
647 <author email="other@place">other</author>
648 <date>1970-01-14T21:20:00+00:00</date>
649 <msg xml:space="preserve">no person</msg>
650 </logentry>
651 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
652 <author email="other@place">A. N. Other</author>
653 <date>1970-01-13T17:33:20+00:00</date>
654 <msg xml:space="preserve">other 1
655 other 2
656
657 other 3</msg>
658 </logentry>
659 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
660 <author email="user@hostname">User Name</author>
661 <date>1970-01-12T13:46:40+00:00</date>
662 <msg xml:space="preserve">line 1
663 line 2</msg>
664 </logentry>
665 </log>
666
667 $ hg log -v --style xml
668 <?xml version="1.0"?>
669 <log>
670 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
671 <tag>tip</tag>
672 <author email="test">test</author>
673 <date>2020-01-01T10:01:00+00:00</date>
674 <msg xml:space="preserve">third</msg>
675 <paths>
676 <path action="A">fourth</path>
677 <path action="A">third</path>
678 <path action="R">second</path>
679 </paths>
680 <copies>
681 <copy source="second">fourth</copy>
682 </copies>
683 </logentry>
684 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
685 <parent revision="-1" node="0000000000000000000000000000000000000000" />
686 <author email="user@hostname">User Name</author>
687 <date>1970-01-12T13:46:40+00:00</date>
688 <msg xml:space="preserve">second</msg>
689 <paths>
690 <path action="A">second</path>
691 </paths>
692 </logentry>
693 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
694 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
695 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
696 <author email="person">person</author>
697 <date>1970-01-18T08:40:01+00:00</date>
698 <msg xml:space="preserve">merge</msg>
699 <paths>
700 </paths>
701 </logentry>
702 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
703 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
704 <author email="person">person</author>
705 <date>1970-01-18T08:40:00+00:00</date>
706 <msg xml:space="preserve">new head</msg>
707 <paths>
708 <path action="A">d</path>
709 </paths>
710 </logentry>
711 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
712 <branch>foo</branch>
713 <author email="person">person</author>
714 <date>1970-01-17T04:53:20+00:00</date>
715 <msg xml:space="preserve">new branch</msg>
716 <paths>
717 </paths>
718 </logentry>
719 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
720 <author email="person">person</author>
721 <date>1970-01-16T01:06:40+00:00</date>
722 <msg xml:space="preserve">no user, no domain</msg>
723 <paths>
724 <path action="M">c</path>
725 </paths>
726 </logentry>
727 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
728 <author email="other@place">other</author>
729 <date>1970-01-14T21:20:00+00:00</date>
730 <msg xml:space="preserve">no person</msg>
731 <paths>
732 <path action="A">c</path>
733 </paths>
734 </logentry>
735 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
736 <author email="other@place">A. N. Other</author>
737 <date>1970-01-13T17:33:20+00:00</date>
738 <msg xml:space="preserve">other 1
739 other 2
740
741 other 3</msg>
742 <paths>
743 <path action="A">b</path>
744 </paths>
745 </logentry>
746 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
747 <author email="user@hostname">User Name</author>
748 <date>1970-01-12T13:46:40+00:00</date>
749 <msg xml:space="preserve">line 1
750 line 2</msg>
751 <paths>
752 <path action="A">a</path>
753 </paths>
754 </logentry>
755 </log>
756
757 $ hg log --debug --style xml
758 <?xml version="1.0"?>
759 <log>
760 <logentry revision="8" node="95c24699272ef57d062b8bccc32c878bf841784a">
761 <tag>tip</tag>
762 <parent revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453" />
763 <parent revision="-1" node="0000000000000000000000000000000000000000" />
764 <author email="test">test</author>
765 <date>2020-01-01T10:01:00+00:00</date>
766 <msg xml:space="preserve">third</msg>
767 <paths>
768 <path action="A">fourth</path>
769 <path action="A">third</path>
770 <path action="R">second</path>
771 </paths>
772 <copies>
773 <copy source="second">fourth</copy>
774 </copies>
775 <extra key="branch">default</extra>
776 </logentry>
777 <logentry revision="7" node="29114dbae42b9f078cf2714dbe3a86bba8ec7453">
778 <parent revision="-1" node="0000000000000000000000000000000000000000" />
779 <parent revision="-1" node="0000000000000000000000000000000000000000" />
780 <author email="user@hostname">User Name</author>
781 <date>1970-01-12T13:46:40+00:00</date>
782 <msg xml:space="preserve">second</msg>
783 <paths>
784 <path action="A">second</path>
785 </paths>
786 <extra key="branch">default</extra>
787 </logentry>
788 <logentry revision="6" node="d41e714fe50d9e4a5f11b4d595d543481b5f980b">
789 <parent revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f" />
790 <parent revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74" />
791 <author email="person">person</author>
792 <date>1970-01-18T08:40:01+00:00</date>
793 <msg xml:space="preserve">merge</msg>
794 <paths>
795 </paths>
796 <extra key="branch">default</extra>
797 </logentry>
798 <logentry revision="5" node="13207e5a10d9fd28ec424934298e176197f2c67f">
799 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
800 <parent revision="-1" node="0000000000000000000000000000000000000000" />
801 <author email="person">person</author>
802 <date>1970-01-18T08:40:00+00:00</date>
803 <msg xml:space="preserve">new head</msg>
804 <paths>
805 <path action="A">d</path>
806 </paths>
807 <extra key="branch">default</extra>
808 </logentry>
809 <logentry revision="4" node="bbe44766e73d5f11ed2177f1838de10c53ef3e74">
810 <branch>foo</branch>
811 <parent revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47" />
812 <parent revision="-1" node="0000000000000000000000000000000000000000" />
813 <author email="person">person</author>
814 <date>1970-01-17T04:53:20+00:00</date>
815 <msg xml:space="preserve">new branch</msg>
816 <paths>
817 </paths>
818 <extra key="branch">foo</extra>
819 </logentry>
820 <logentry revision="3" node="10e46f2dcbf4823578cf180f33ecf0b957964c47">
821 <parent revision="2" node="97054abb4ab824450e9164180baf491ae0078465" />
822 <parent revision="-1" node="0000000000000000000000000000000000000000" />
823 <author email="person">person</author>
824 <date>1970-01-16T01:06:40+00:00</date>
825 <msg xml:space="preserve">no user, no domain</msg>
826 <paths>
827 <path action="M">c</path>
828 </paths>
829 <extra key="branch">default</extra>
830 </logentry>
831 <logentry revision="2" node="97054abb4ab824450e9164180baf491ae0078465">
832 <parent revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965" />
833 <parent revision="-1" node="0000000000000000000000000000000000000000" />
834 <author email="other@place">other</author>
835 <date>1970-01-14T21:20:00+00:00</date>
836 <msg xml:space="preserve">no person</msg>
837 <paths>
838 <path action="A">c</path>
839 </paths>
840 <extra key="branch">default</extra>
841 </logentry>
842 <logentry revision="1" node="b608e9d1a3f0273ccf70fb85fd6866b3482bf965">
843 <parent revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f" />
844 <parent revision="-1" node="0000000000000000000000000000000000000000" />
845 <author email="other@place">A. N. Other</author>
846 <date>1970-01-13T17:33:20+00:00</date>
847 <msg xml:space="preserve">other 1
848 other 2
849
850 other 3</msg>
851 <paths>
852 <path action="A">b</path>
853 </paths>
854 <extra key="branch">default</extra>
855 </logentry>
856 <logentry revision="0" node="1e4e1b8f71e05681d422154f5421e385fec3454f">
857 <parent revision="-1" node="0000000000000000000000000000000000000000" />
858 <parent revision="-1" node="0000000000000000000000000000000000000000" />
859 <author email="user@hostname">User Name</author>
860 <date>1970-01-12T13:46:40+00:00</date>
861 <msg xml:space="preserve">line 1
862 line 2</msg>
863 <paths>
864 <path action="A">a</path>
865 </paths>
866 <extra key="branch">default</extra>
867 </logentry>
868 </log>
869
870
871 Test JSON style:
872
873 $ hg log -k nosuch -Tjson
874 [
875 ]
876
877 $ hg log -qr . -Tjson
878 [
879 {
880 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
881 "rev": 8
882 }
883 ]
884
885 $ hg log -vpr . -Tjson --stat
886 [
887 {
888 "bookmarks": [],
889 "branch": "default",
890 "date": [1577872860, 0],
891 "desc": "third",
892 "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n",
893 "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n",
894 "files": ["fourth", "second", "third"],
895 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
896 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
897 "phase": "draft",
898 "rev": 8,
899 "tags": ["tip"],
900 "user": "test"
901 }
902 ]
903
904 honor --git but not format-breaking diffopts
905 $ hg --config diff.noprefix=True log --git -vpr . -Tjson
906 [
907 {
908 "bookmarks": [],
909 "branch": "default",
910 "date": [1577872860, 0],
911 "desc": "third",
912 "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n",
913 "files": ["fourth", "second", "third"],
914 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
915 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
916 "phase": "draft",
917 "rev": 8,
918 "tags": ["tip"],
919 "user": "test"
920 }
921 ]
922
923 $ hg log -T json
924 [
925 {
926 "bookmarks": [],
927 "branch": "default",
928 "date": [1577872860, 0],
929 "desc": "third",
930 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
931 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
932 "phase": "draft",
933 "rev": 8,
934 "tags": ["tip"],
935 "user": "test"
936 },
937 {
938 "bookmarks": [],
939 "branch": "default",
940 "date": [1000000, 0],
941 "desc": "second",
942 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
943 "parents": ["0000000000000000000000000000000000000000"],
944 "phase": "draft",
945 "rev": 7,
946 "tags": [],
947 "user": "User Name <user@hostname>"
948 },
949 {
950 "bookmarks": [],
951 "branch": "default",
952 "date": [1500001, 0],
953 "desc": "merge",
954 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
955 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
956 "phase": "draft",
957 "rev": 6,
958 "tags": [],
959 "user": "person"
960 },
961 {
962 "bookmarks": [],
963 "branch": "default",
964 "date": [1500000, 0],
965 "desc": "new head",
966 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
967 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
968 "phase": "draft",
969 "rev": 5,
970 "tags": [],
971 "user": "person"
972 },
973 {
974 "bookmarks": [],
975 "branch": "foo",
976 "date": [1400000, 0],
977 "desc": "new branch",
978 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
979 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
980 "phase": "draft",
981 "rev": 4,
982 "tags": [],
983 "user": "person"
984 },
985 {
986 "bookmarks": [],
987 "branch": "default",
988 "date": [1300000, 0],
989 "desc": "no user, no domain",
990 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
991 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
992 "phase": "draft",
993 "rev": 3,
994 "tags": [],
995 "user": "person"
996 },
997 {
998 "bookmarks": [],
999 "branch": "default",
1000 "date": [1200000, 0],
1001 "desc": "no person",
1002 "node": "97054abb4ab824450e9164180baf491ae0078465",
1003 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1004 "phase": "draft",
1005 "rev": 2,
1006 "tags": [],
1007 "user": "other@place"
1008 },
1009 {
1010 "bookmarks": [],
1011 "branch": "default",
1012 "date": [1100000, 0],
1013 "desc": "other 1\nother 2\n\nother 3",
1014 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1015 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1016 "phase": "draft",
1017 "rev": 1,
1018 "tags": [],
1019 "user": "A. N. Other <other@place>"
1020 },
1021 {
1022 "bookmarks": [],
1023 "branch": "default",
1024 "date": [1000000, 0],
1025 "desc": "line 1\nline 2",
1026 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1027 "parents": ["0000000000000000000000000000000000000000"],
1028 "phase": "draft",
1029 "rev": 0,
1030 "tags": [],
1031 "user": "User Name <user@hostname>"
1032 }
1033 ]
1034
1035 $ hg heads -v -Tjson
1036 [
1037 {
1038 "bookmarks": [],
1039 "branch": "default",
1040 "date": [1577872860, 0],
1041 "desc": "third",
1042 "files": ["fourth", "second", "third"],
1043 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1044 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1045 "phase": "draft",
1046 "rev": 8,
1047 "tags": ["tip"],
1048 "user": "test"
1049 },
1050 {
1051 "bookmarks": [],
1052 "branch": "default",
1053 "date": [1500001, 0],
1054 "desc": "merge",
1055 "files": [],
1056 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1057 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1058 "phase": "draft",
1059 "rev": 6,
1060 "tags": [],
1061 "user": "person"
1062 },
1063 {
1064 "bookmarks": [],
1065 "branch": "foo",
1066 "date": [1400000, 0],
1067 "desc": "new branch",
1068 "files": [],
1069 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1070 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1071 "phase": "draft",
1072 "rev": 4,
1073 "tags": [],
1074 "user": "person"
1075 }
1076 ]
1077
1078 $ hg log --debug -Tjson
1079 [
1080 {
1081 "added": ["fourth", "third"],
1082 "bookmarks": [],
1083 "branch": "default",
1084 "date": [1577872860, 0],
1085 "desc": "third",
1086 "extra": {"branch": "default"},
1087 "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64",
1088 "modified": [],
1089 "node": "95c24699272ef57d062b8bccc32c878bf841784a",
1090 "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"],
1091 "phase": "draft",
1092 "removed": ["second"],
1093 "rev": 8,
1094 "tags": ["tip"],
1095 "user": "test"
1096 },
1097 {
1098 "added": ["second"],
1099 "bookmarks": [],
1100 "branch": "default",
1101 "date": [1000000, 0],
1102 "desc": "second",
1103 "extra": {"branch": "default"},
1104 "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf",
1105 "modified": [],
1106 "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453",
1107 "parents": ["0000000000000000000000000000000000000000"],
1108 "phase": "draft",
1109 "removed": [],
1110 "rev": 7,
1111 "tags": [],
1112 "user": "User Name <user@hostname>"
1113 },
1114 {
1115 "added": [],
1116 "bookmarks": [],
1117 "branch": "default",
1118 "date": [1500001, 0],
1119 "desc": "merge",
1120 "extra": {"branch": "default"},
1121 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1122 "modified": [],
1123 "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b",
1124 "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"],
1125 "phase": "draft",
1126 "removed": [],
1127 "rev": 6,
1128 "tags": [],
1129 "user": "person"
1130 },
1131 {
1132 "added": ["d"],
1133 "bookmarks": [],
1134 "branch": "default",
1135 "date": [1500000, 0],
1136 "desc": "new head",
1137 "extra": {"branch": "default"},
1138 "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216",
1139 "modified": [],
1140 "node": "13207e5a10d9fd28ec424934298e176197f2c67f",
1141 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1142 "phase": "draft",
1143 "removed": [],
1144 "rev": 5,
1145 "tags": [],
1146 "user": "person"
1147 },
1148 {
1149 "added": [],
1150 "bookmarks": [],
1151 "branch": "foo",
1152 "date": [1400000, 0],
1153 "desc": "new branch",
1154 "extra": {"branch": "foo"},
1155 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1156 "modified": [],
1157 "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74",
1158 "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"],
1159 "phase": "draft",
1160 "removed": [],
1161 "rev": 4,
1162 "tags": [],
1163 "user": "person"
1164 },
1165 {
1166 "added": [],
1167 "bookmarks": [],
1168 "branch": "default",
1169 "date": [1300000, 0],
1170 "desc": "no user, no domain",
1171 "extra": {"branch": "default"},
1172 "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc",
1173 "modified": ["c"],
1174 "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47",
1175 "parents": ["97054abb4ab824450e9164180baf491ae0078465"],
1176 "phase": "draft",
1177 "removed": [],
1178 "rev": 3,
1179 "tags": [],
1180 "user": "person"
1181 },
1182 {
1183 "added": ["c"],
1184 "bookmarks": [],
1185 "branch": "default",
1186 "date": [1200000, 0],
1187 "desc": "no person",
1188 "extra": {"branch": "default"},
1189 "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1",
1190 "modified": [],
1191 "node": "97054abb4ab824450e9164180baf491ae0078465",
1192 "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"],
1193 "phase": "draft",
1194 "removed": [],
1195 "rev": 2,
1196 "tags": [],
1197 "user": "other@place"
1198 },
1199 {
1200 "added": ["b"],
1201 "bookmarks": [],
1202 "branch": "default",
1203 "date": [1100000, 0],
1204 "desc": "other 1\nother 2\n\nother 3",
1205 "extra": {"branch": "default"},
1206 "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55",
1207 "modified": [],
1208 "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965",
1209 "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"],
1210 "phase": "draft",
1211 "removed": [],
1212 "rev": 1,
1213 "tags": [],
1214 "user": "A. N. Other <other@place>"
1215 },
1216 {
1217 "added": ["a"],
1218 "bookmarks": [],
1219 "branch": "default",
1220 "date": [1000000, 0],
1221 "desc": "line 1\nline 2",
1222 "extra": {"branch": "default"},
1223 "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0",
1224 "modified": [],
1225 "node": "1e4e1b8f71e05681d422154f5421e385fec3454f",
1226 "parents": ["0000000000000000000000000000000000000000"],
1227 "phase": "draft",
1228 "removed": [],
1229 "rev": 0,
1230 "tags": [],
1231 "user": "User Name <user@hostname>"
1232 }
1233 ]
1234
1235 Error if style not readable:
1236
1237 #if unix-permissions no-root
1238 $ touch q
1239 $ chmod 0 q
1240 $ hg log --style ./q
1241 abort: Permission denied: ./q
1242 [255]
1243 #endif
1244
1245 Error if no style:
1246
1247 $ hg log --style notexist
1248 abort: style 'notexist' not found
1249 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
1250 [255]
1251
1252 $ hg log -T list
1253 available styles: bisect, changelog, compact, default, phases, show, status, xml
1254 abort: specify a template
1255 [255]
1256
1257 Error if style missing key:
1258
1259 $ echo 'q = q' > t
1260 $ hg log --style ./t
1261 abort: "changeset" not in template map
1262 [255]
1263
1264 Error if style missing value:
1265
1266 $ echo 'changeset =' > t
1267 $ hg log --style t
1268 hg: parse error at t:1: missing value
1269 [255]
1270
1271 Error if include fails:
1272
1273 $ echo 'changeset = q' >> t
1274 #if unix-permissions no-root
1275 $ hg log --style ./t
1276 abort: template file ./q: Permission denied
1277 [255]
1278 $ rm -f q
1279 #endif
1280
1281 Include works:
1282
1283 $ echo '{rev}' > q
1284 $ hg log --style ./t
1285 8
1286 7
1287 6
1288 5
1289 4
1290 3
1291 2
1292 1
1293 0
1294
1295 Check that recursive reference does not fall into RuntimeError (issue4758): 248 Check that recursive reference does not fall into RuntimeError (issue4758):
1296 249
1297 common mistake: 250 common mistake:
1298 251
1299 $ cat << EOF > issue4758 252 $ cat << EOF > issue4758
1355 o 2 (public): 1 (public) -1 (public) 308 o 2 (public): 1 (public) -1 (public)
1356 | 309 |
1357 o 1 (public): 0 (public) -1 (public) 310 o 1 (public): 0 (public) -1 (public)
1358 | 311 |
1359 o 0 (public): -1 (public) -1 (public) 312 o 0 (public): -1 (public) -1 (public)
1360
1361
1362 Missing non-standard names give no error (backward compatibility):
1363
1364 $ echo "changeset = '{c}'" > t
1365 $ hg log --style ./t
1366
1367 Defining non-standard name works:
1368
1369 $ cat <<EOF > t
1370 > changeset = '{c}'
1371 > c = q
1372 > EOF
1373 $ hg log --style ./t
1374 8
1375 7
1376 6
1377 5
1378 4
1379 3
1380 2
1381 1
1382 0
1383
1384 ui.style works:
1385
1386 $ echo '[ui]' > .hg/hgrc
1387 $ echo 'style = t' >> .hg/hgrc
1388 $ hg log
1389 8
1390 7
1391 6
1392 5
1393 4
1394 3
1395 2
1396 1
1397 0
1398
1399
1400 Issue338:
1401
1402 $ hg log --style=changelog > changelog
1403
1404 $ cat changelog
1405 2020-01-01 test <test>
1406
1407 * fourth, second, third:
1408 third
1409 [95c24699272e] [tip]
1410
1411 1970-01-12 User Name <user@hostname>
1412
1413 * second:
1414 second
1415 [29114dbae42b]
1416
1417 1970-01-18 person <person>
1418
1419 * merge
1420 [d41e714fe50d]
1421
1422 * d:
1423 new head
1424 [13207e5a10d9]
1425
1426 1970-01-17 person <person>
1427
1428 * new branch
1429 [bbe44766e73d] <foo>
1430
1431 1970-01-16 person <person>
1432
1433 * c:
1434 no user, no domain
1435 [10e46f2dcbf4]
1436
1437 1970-01-14 other <other@place>
1438
1439 * c:
1440 no person
1441 [97054abb4ab8]
1442
1443 1970-01-13 A. N. Other <other@place>
1444
1445 * b:
1446 other 1 other 2
1447
1448 other 3
1449 [b608e9d1a3f0]
1450
1451 1970-01-12 User Name <user@hostname>
1452
1453 * a:
1454 line 1 line 2
1455 [1e4e1b8f71e0]
1456
1457
1458 Issue2130: xml output for 'hg heads' is malformed
1459
1460 $ hg heads --style changelog
1461 2020-01-01 test <test>
1462
1463 * fourth, second, third:
1464 third
1465 [95c24699272e] [tip]
1466
1467 1970-01-18 person <person>
1468
1469 * merge
1470 [d41e714fe50d]
1471
1472 1970-01-17 person <person>
1473
1474 * new branch
1475 [bbe44766e73d] <foo>
1476 313
1477 314
1478 Keys work: 315 Keys work:
1479 316
1480 $ for key in author branch branches date desc file_adds file_dels file_mods \ 317 $ for key in author branch branches date desc file_adds file_dels file_mods \
2318 $ hg add b 1155 $ hg add b
2319 $ hg mv fourth fifth 1156 $ hg mv fourth fifth
2320 $ hg rm a 1157 $ hg rm a
2321 $ hg ci -m "Modify, add, remove, rename" 1158 $ hg ci -m "Modify, add, remove, rename"
2322 1159
2323 Check the status template 1160 Error on syntax:
2324 1161
2325 $ cat <<EOF >> $HGRCPATH 1162 $ cat <<EOF > t
2326 > [extensions] 1163 > changeset = '{c}'
2327 > color= 1164 > c = q
1165 > x = "f
2328 > EOF 1166 > EOF
2329 1167 $ echo '[ui]' > .hg/hgrc
2330 $ hg log -T status -r 10 1168 $ echo 'style = t' >> .hg/hgrc
2331 changeset: 10:0f9759ec227a
2332 tag: tip
2333 user: test
2334 date: Thu Jan 01 00:00:00 1970 +0000
2335 summary: Modify, add, remove, rename
2336 files:
2337 M third
2338 A b
2339 A fifth
2340 R a
2341 R fourth
2342
2343 $ hg log -T status -C -r 10
2344 changeset: 10:0f9759ec227a
2345 tag: tip
2346 user: test
2347 date: Thu Jan 01 00:00:00 1970 +0000
2348 summary: Modify, add, remove, rename
2349 files:
2350 M third
2351 A b
2352 A fifth
2353 fourth
2354 R a
2355 R fourth
2356
2357 $ hg log -T status -C -r 10 -v
2358 changeset: 10:0f9759ec227a
2359 tag: tip
2360 user: test
2361 date: Thu Jan 01 00:00:00 1970 +0000
2362 description:
2363 Modify, add, remove, rename
2364
2365 files:
2366 M third
2367 A b
2368 A fifth
2369 fourth
2370 R a
2371 R fourth
2372
2373 $ hg log -T status -C -r 10 --debug
2374 changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c
2375 tag: tip
2376 phase: secret
2377 parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066
2378 parent: -1:0000000000000000000000000000000000000000
2379 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567
2380 user: test
2381 date: Thu Jan 01 00:00:00 1970 +0000
2382 extra: branch=default
2383 description:
2384 Modify, add, remove, rename
2385
2386 files:
2387 M third
2388 A b
2389 A fifth
2390 fourth
2391 R a
2392 R fourth
2393
2394 $ hg log -T status -C -r 10 --quiet
2395 10:0f9759ec227a
2396 $ hg --color=debug log -T status -r 10
2397 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2398 [log.tag|tag: tip]
2399 [log.user|user: test]
2400 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2401 [log.summary|summary: Modify, add, remove, rename]
2402 [ui.note log.files|files:]
2403 [status.modified|M third]
2404 [status.added|A b]
2405 [status.added|A fifth]
2406 [status.removed|R a]
2407 [status.removed|R fourth]
2408
2409 $ hg --color=debug log -T status -C -r 10
2410 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2411 [log.tag|tag: tip]
2412 [log.user|user: test]
2413 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2414 [log.summary|summary: Modify, add, remove, rename]
2415 [ui.note log.files|files:]
2416 [status.modified|M third]
2417 [status.added|A b]
2418 [status.added|A fifth]
2419 [status.copied| fourth]
2420 [status.removed|R a]
2421 [status.removed|R fourth]
2422
2423 $ hg --color=debug log -T status -C -r 10 -v
2424 [log.changeset changeset.secret|changeset: 10:0f9759ec227a]
2425 [log.tag|tag: tip]
2426 [log.user|user: test]
2427 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2428 [ui.note log.description|description:]
2429 [ui.note log.description|Modify, add, remove, rename]
2430
2431 [ui.note log.files|files:]
2432 [status.modified|M third]
2433 [status.added|A b]
2434 [status.added|A fifth]
2435 [status.copied| fourth]
2436 [status.removed|R a]
2437 [status.removed|R fourth]
2438
2439 $ hg --color=debug log -T status -C -r 10 --debug
2440 [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c]
2441 [log.tag|tag: tip]
2442 [log.phase|phase: secret]
2443 [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066]
2444 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2445 [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567]
2446 [log.user|user: test]
2447 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
2448 [ui.debug log.extra|extra: branch=default]
2449 [ui.note log.description|description:]
2450 [ui.note log.description|Modify, add, remove, rename]
2451
2452 [ui.note log.files|files:]
2453 [status.modified|M third]
2454 [status.added|A b]
2455 [status.added|A fifth]
2456 [status.copied| fourth]
2457 [status.removed|R a]
2458 [status.removed|R fourth]
2459
2460 $ hg --color=debug log -T status -C -r 10 --quiet
2461 [log.node|10:0f9759ec227a]
2462
2463 Check the bisect template
2464
2465 $ hg bisect -g 1
2466 $ hg bisect -b 3 --noupdate
2467 Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests)
2468 $ hg log -T bisect -r 0:4
2469 changeset: 0:1e4e1b8f71e0
2470 bisect: good (implicit)
2471 user: User Name <user@hostname>
2472 date: Mon Jan 12 13:46:40 1970 +0000
2473 summary: line 1
2474
2475 changeset: 1:b608e9d1a3f0
2476 bisect: good
2477 user: A. N. Other <other@place>
2478 date: Tue Jan 13 17:33:20 1970 +0000
2479 summary: other 1
2480
2481 changeset: 2:97054abb4ab8
2482 bisect: untested
2483 user: other@place
2484 date: Wed Jan 14 21:20:00 1970 +0000
2485 summary: no person
2486
2487 changeset: 3:10e46f2dcbf4
2488 bisect: bad
2489 user: person
2490 date: Fri Jan 16 01:06:40 1970 +0000
2491 summary: no user, no domain
2492
2493 changeset: 4:bbe44766e73d
2494 bisect: bad (implicit)
2495 branch: foo
2496 user: person
2497 date: Sat Jan 17 04:53:20 1970 +0000
2498 summary: new branch
2499
2500 $ hg log --debug -T bisect -r 0:4
2501 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2502 bisect: good (implicit)
2503 phase: public
2504 parent: -1:0000000000000000000000000000000000000000
2505 parent: -1:0000000000000000000000000000000000000000
2506 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
2507 user: User Name <user@hostname>
2508 date: Mon Jan 12 13:46:40 1970 +0000
2509 files+: a
2510 extra: branch=default
2511 description:
2512 line 1
2513 line 2
2514
2515
2516 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2517 bisect: good
2518 phase: public
2519 parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f
2520 parent: -1:0000000000000000000000000000000000000000
2521 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
2522 user: A. N. Other <other@place>
2523 date: Tue Jan 13 17:33:20 1970 +0000
2524 files+: b
2525 extra: branch=default
2526 description:
2527 other 1
2528 other 2
2529
2530 other 3
2531
2532
2533 changeset: 2:97054abb4ab824450e9164180baf491ae0078465
2534 bisect: untested
2535 phase: public
2536 parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
2537 parent: -1:0000000000000000000000000000000000000000
2538 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
2539 user: other@place
2540 date: Wed Jan 14 21:20:00 1970 +0000
2541 files+: c
2542 extra: branch=default
2543 description:
2544 no person
2545
2546
2547 changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2548 bisect: bad
2549 phase: public
2550 parent: 2:97054abb4ab824450e9164180baf491ae0078465
2551 parent: -1:0000000000000000000000000000000000000000
2552 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2553 user: person
2554 date: Fri Jan 16 01:06:40 1970 +0000
2555 files: c
2556 extra: branch=default
2557 description:
2558 no user, no domain
2559
2560
2561 changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74
2562 bisect: bad (implicit)
2563 branch: foo
2564 phase: draft
2565 parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47
2566 parent: -1:0000000000000000000000000000000000000000
2567 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
2568 user: person
2569 date: Sat Jan 17 04:53:20 1970 +0000
2570 extra: branch=foo
2571 description:
2572 new branch
2573
2574
2575 $ hg log -v -T bisect -r 0:4
2576 changeset: 0:1e4e1b8f71e0
2577 bisect: good (implicit)
2578 user: User Name <user@hostname>
2579 date: Mon Jan 12 13:46:40 1970 +0000
2580 files: a
2581 description:
2582 line 1
2583 line 2
2584
2585
2586 changeset: 1:b608e9d1a3f0
2587 bisect: good
2588 user: A. N. Other <other@place>
2589 date: Tue Jan 13 17:33:20 1970 +0000
2590 files: b
2591 description:
2592 other 1
2593 other 2
2594
2595 other 3
2596
2597
2598 changeset: 2:97054abb4ab8
2599 bisect: untested
2600 user: other@place
2601 date: Wed Jan 14 21:20:00 1970 +0000
2602 files: c
2603 description:
2604 no person
2605
2606
2607 changeset: 3:10e46f2dcbf4
2608 bisect: bad
2609 user: person
2610 date: Fri Jan 16 01:06:40 1970 +0000
2611 files: c
2612 description:
2613 no user, no domain
2614
2615
2616 changeset: 4:bbe44766e73d
2617 bisect: bad (implicit)
2618 branch: foo
2619 user: person
2620 date: Sat Jan 17 04:53:20 1970 +0000
2621 description:
2622 new branch
2623
2624
2625 $ hg --color=debug log -T bisect -r 0:4
2626 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2627 [log.bisect bisect.good|bisect: good (implicit)]
2628 [log.user|user: User Name <user@hostname>]
2629 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2630 [log.summary|summary: line 1]
2631
2632 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2633 [log.bisect bisect.good|bisect: good]
2634 [log.user|user: A. N. Other <other@place>]
2635 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2636 [log.summary|summary: other 1]
2637
2638 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2639 [log.bisect bisect.untested|bisect: untested]
2640 [log.user|user: other@place]
2641 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2642 [log.summary|summary: no person]
2643
2644 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2645 [log.bisect bisect.bad|bisect: bad]
2646 [log.user|user: person]
2647 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2648 [log.summary|summary: no user, no domain]
2649
2650 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2651 [log.bisect bisect.bad|bisect: bad (implicit)]
2652 [log.branch|branch: foo]
2653 [log.user|user: person]
2654 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2655 [log.summary|summary: new branch]
2656
2657 $ hg --color=debug log --debug -T bisect -r 0:4
2658 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2659 [log.bisect bisect.good|bisect: good (implicit)]
2660 [log.phase|phase: public]
2661 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2662 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2663 [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0]
2664 [log.user|user: User Name <user@hostname>]
2665 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2666 [ui.debug log.files|files+: a]
2667 [ui.debug log.extra|extra: branch=default]
2668 [ui.note log.description|description:]
2669 [ui.note log.description|line 1
2670 line 2]
2671
2672
2673 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2674 [log.bisect bisect.good|bisect: good]
2675 [log.phase|phase: public]
2676 [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f]
2677 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2678 [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55]
2679 [log.user|user: A. N. Other <other@place>]
2680 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2681 [ui.debug log.files|files+: b]
2682 [ui.debug log.extra|extra: branch=default]
2683 [ui.note log.description|description:]
2684 [ui.note log.description|other 1
2685 other 2
2686
2687 other 3]
2688
2689
2690 [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465]
2691 [log.bisect bisect.untested|bisect: untested]
2692 [log.phase|phase: public]
2693 [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965]
2694 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2695 [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1]
2696 [log.user|user: other@place]
2697 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2698 [ui.debug log.files|files+: c]
2699 [ui.debug log.extra|extra: branch=default]
2700 [ui.note log.description|description:]
2701 [ui.note log.description|no person]
2702
2703
2704 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2705 [log.bisect bisect.bad|bisect: bad]
2706 [log.phase|phase: public]
2707 [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465]
2708 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2709 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2710 [log.user|user: person]
2711 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2712 [ui.debug log.files|files: c]
2713 [ui.debug log.extra|extra: branch=default]
2714 [ui.note log.description|description:]
2715 [ui.note log.description|no user, no domain]
2716
2717
2718 [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74]
2719 [log.bisect bisect.bad|bisect: bad (implicit)]
2720 [log.branch|branch: foo]
2721 [log.phase|phase: draft]
2722 [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47]
2723 [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000]
2724 [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc]
2725 [log.user|user: person]
2726 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2727 [ui.debug log.extra|extra: branch=foo]
2728 [ui.note log.description|description:]
2729 [ui.note log.description|new branch]
2730
2731
2732 $ hg --color=debug log -v -T bisect -r 0:4
2733 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0]
2734 [log.bisect bisect.good|bisect: good (implicit)]
2735 [log.user|user: User Name <user@hostname>]
2736 [log.date|date: Mon Jan 12 13:46:40 1970 +0000]
2737 [ui.note log.files|files: a]
2738 [ui.note log.description|description:]
2739 [ui.note log.description|line 1
2740 line 2]
2741
2742
2743 [log.changeset changeset.public|changeset: 1:b608e9d1a3f0]
2744 [log.bisect bisect.good|bisect: good]
2745 [log.user|user: A. N. Other <other@place>]
2746 [log.date|date: Tue Jan 13 17:33:20 1970 +0000]
2747 [ui.note log.files|files: b]
2748 [ui.note log.description|description:]
2749 [ui.note log.description|other 1
2750 other 2
2751
2752 other 3]
2753
2754
2755 [log.changeset changeset.public|changeset: 2:97054abb4ab8]
2756 [log.bisect bisect.untested|bisect: untested]
2757 [log.user|user: other@place]
2758 [log.date|date: Wed Jan 14 21:20:00 1970 +0000]
2759 [ui.note log.files|files: c]
2760 [ui.note log.description|description:]
2761 [ui.note log.description|no person]
2762
2763
2764 [log.changeset changeset.public|changeset: 3:10e46f2dcbf4]
2765 [log.bisect bisect.bad|bisect: bad]
2766 [log.user|user: person]
2767 [log.date|date: Fri Jan 16 01:06:40 1970 +0000]
2768 [ui.note log.files|files: c]
2769 [ui.note log.description|description:]
2770 [ui.note log.description|no user, no domain]
2771
2772
2773 [log.changeset changeset.draft|changeset: 4:bbe44766e73d]
2774 [log.bisect bisect.bad|bisect: bad (implicit)]
2775 [log.branch|branch: foo]
2776 [log.user|user: person]
2777 [log.date|date: Sat Jan 17 04:53:20 1970 +0000]
2778 [ui.note log.description|description:]
2779 [ui.note log.description|new branch]
2780
2781
2782 $ hg bisect --reset
2783
2784 Error on syntax:
2785
2786 $ echo 'x = "f' >> t
2787 $ hg log 1169 $ hg log
2788 hg: parse error at t:3: unmatched quotes 1170 hg: parse error at t:3: unmatched quotes
2789 [255] 1171 [255]
2790 1172
2791 $ hg log -T '{date' 1173 $ hg log -T '{date'
3188 | 1570 |
3189 o 0: null, C: 1, D: 1 1571 o 0: null, C: 1, D: 1
3190 1572
3191 1573
3192 $ cd .. 1574 $ cd ..
3193
3194
3195 Style path expansion: issue1948 - ui.style option doesn't work on OSX
3196 if it is a relative path
3197
3198 $ mkdir -p home/styles
3199
3200 $ cat > home/styles/teststyle <<EOF
3201 > changeset = 'test {rev}:{node|short}\n'
3202 > EOF
3203
3204 $ HOME=`pwd`/home; export HOME
3205
3206 $ cat > latesttag/.hg/hgrc <<EOF
3207 > [ui]
3208 > style = ~/styles/teststyle
3209 > EOF
3210
3211 $ hg -R latesttag tip
3212 test 11:97e5943b523a
3213
3214 Test recursive showlist template (issue1989):
3215
3216 $ cat > style1989 <<EOF
3217 > changeset = '{file_mods}{manifest}{extras}'
3218 > file_mod = 'M|{author|person}\n'
3219 > manifest = '{rev},{author}\n'
3220 > extra = '{key}: {author}\n'
3221 > EOF
3222
3223 $ hg -R latesttag log -r tip --style=style1989
3224 M|test
3225 11,test
3226 branch: test
3227 1575
3228 Test new-style inline templating: 1576 Test new-style inline templating:
3229 1577
3230 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n' 1578 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
3231 modified files: .hgtags 1579 modified files: .hgtags