comparison tests/test-notify.t @ 38028:d1134ca5b1a3

notify: add option to include function names in the diff output This is a localized version of diff.showfunc. Differential Revision: https://phab.mercurial-scm.org/D3553
author Joerg Sonnenberger <joerg@bec.de>
date Sat, 12 May 2018 23:44:08 +0200
parents a4cac7b0ea4f
children 5abc47d4ca6b
comparison
equal deleted inserted replaced
38027:1b8238f67bf2 38028:d1134ca5b1a3
128 notify.maxsubject 128 notify.maxsubject
129 Maximum number of characters in email's subject line. Default: 67. 129 Maximum number of characters in email's subject line. Default: 67.
130 130
131 notify.diffstat 131 notify.diffstat
132 Set to True to include a diffstat before diff content. Default: True. 132 Set to True to include a diffstat before diff content. Default: True.
133
134 notify.showfunc
135 If set, override "diff.showfunc" for the diff content. Default: None.
133 136
134 notify.merge 137 notify.merge
135 If True, send notifications for merge changesets. Default: True. 138 If True, send notifications for merge changesets. Default: True.
136 139
137 notify.mbox 140 notify.mbox
645 X-Hg-Notification: changeset 14721b538ae3 648 X-Hg-Notification: changeset 14721b538ae3
646 Message-Id: <hg.14721b538ae3.*.*@*> (glob) 649 Message-Id: <hg.14721b538ae3.*.*@*> (glob)
647 To: baz@test.com, foo@bar 650 To: baz@test.com, foo@bar
648 651
649 with template 652 with template
653
654 showfunc diff
655 $ cat <<EOF >> $HGRCPATH
656 > showfunc = True
657 > template =
658 > maxdiff = -1
659 > EOF
660 $ cd a
661 $ cat > f1 << EOF
662 > int main() {
663 > int a = 0;
664 > int b = 1;
665 > int c = 2;
666 > int d = 3;
667 > return a + b + c + d;
668 > }
669 > EOF
670 $ hg commit -Am addfunction
671 adding f1
672 $ hg --cwd ../b pull ../a
673 pulling from ../a
674 searching for changes
675 adding changesets
676 adding manifests
677 adding file changes
678 added 1 changesets with 1 changes to 1 files
679 new changesets b86bc16ff894
680 MIME-Version: 1.0
681 Content-Type: text/plain; charset="us-ascii"
682 Content-Transfer-Encoding: 7bit
683 Date: * (glob)
684 Subject: addfunction
685 From: test@test.com
686 X-Hg-Notification: changeset b86bc16ff894
687 Message-Id: <hg.b86bc16ff894.*.*@*> (glob)
688 To: baz@test.com, foo@bar
689
690 changeset b86bc16ff894
691 diffs (11 lines):
692
693 diff -r 14721b538ae3 -r b86bc16ff894 f1
694 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
695 +++ b/f1 Thu Jan 01 00:00:00 1970 +0000
696 @@ -0,0 +1,7 @@
697 +int main() {
698 + int a = 0;
699 + int b = 1;
700 + int c = 2;
701 + int d = 3;
702 + return a + b + c + d;
703 +}
704 (run 'hg update' to get a working copy)
705 $ cat > f1 << EOF
706 > int main() {
707 > int a = 0;
708 > int b = 1;
709 > int c = 2;
710 > int e = 3;
711 > return a + b + c + e;
712 > }
713 > EOF
714 $ hg commit -m changefunction
715 $ hg --cwd ../b --config notify.showfunc=True pull ../a
716 pulling from ../a
717 searching for changes
718 adding changesets
719 adding manifests
720 adding file changes
721 added 1 changesets with 1 changes to 1 files
722 new changesets e81040e9838c
723 MIME-Version: 1.0
724 Content-Type: text/plain; charset="us-ascii"
725 Content-Transfer-Encoding: 7bit
726 Date: * (glob)
727 Subject: changefunction
728 From: test@test.com
729 X-Hg-Notification: changeset e81040e9838c
730 Message-Id: <hg.e81040e9838c.*.*@*> (glob)
731 To: baz@test.com, foo@bar
732
733 changeset e81040e9838c
734 diffs (12 lines):
735
736 diff -r b86bc16ff894 -r e81040e9838c f1
737 --- a/f1 Thu Jan 01 00:00:00 1970 +0000
738 +++ b/f1 Thu Jan 01 00:00:00 1970 +0000
739 @@ -2,6 +2,6 @@ int main() {
740 int a = 0;
741 int b = 1;
742 int c = 2;
743 - int d = 3;
744 - return a + b + c + d;
745 + int e = 3;
746 + return a + b + c + e;
747 }
748 (run 'hg update' to get a working copy)