Mercurial > hg
comparison tests/test-notify.t @ 28951:1bba1b43525a
notify: do not load style file if template is specified (BC)
This patch makes sure that either "tmpl" or "mapfile" is exclusively set,
which is the same behavior as common log-like templates and formatter outputs.
See the previous patch for why.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 04 Apr 2016 22:50:50 +0900 |
parents | 58f8b29c37ff |
children | 22c53b3a390d |
comparison
equal
deleted
inserted
replaced
28950:9e1c9f016b72 | 28951:1bba1b43525a |
---|---|
551 | 551 |
552 changeset 38b42fa092de in b | 552 changeset 38b42fa092de in b |
553 description: test | 553 description: test |
554 (run 'hg heads' to see heads) | 554 (run 'hg heads' to see heads) |
555 | 555 |
556 default template: | |
557 | |
558 $ grep -v '^template =' $HGRCPATH > "$HGRCPATH.new" | |
559 $ mv "$HGRCPATH.new" $HGRCPATH | |
560 $ echo a >> a/a | |
561 $ hg --cwd a commit -m 'default template' | |
562 $ hg --cwd b pull ../a -q | \ | |
563 > $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),' | |
564 Content-Type: text/plain; charset="us-ascii" | |
565 MIME-Version: 1.0 | |
566 Content-Transfer-Encoding: 7bit | |
567 Date: * (glob) | |
568 Subject: changeset in b: default template | |
569 From: test@test.com | |
570 X-Hg-Notification: changeset 3548c9e294b6 | |
571 Message-Id: <hg.3548c9e294b6.*.*@*> (glob) | |
572 To: baz@test.com, foo@bar | |
573 | |
574 changeset 3548c9e294b6 in $TESTTMP/b | |
575 details: http://test/b?cmd=changeset;node=3548c9e294b6 | |
576 description: default template | |
577 | |
578 with style: | |
579 | |
580 $ cat <<EOF > notifystyle.map | |
581 > changeset = "Subject: {desc|firstline|strip} | |
582 > From: {author} | |
583 > {""} | |
584 > changeset {node|short}" | |
585 > EOF | |
586 $ cat <<EOF >> $HGRCPATH | |
587 > [notify] | |
588 > style = $TESTTMP/notifystyle.map | |
589 > EOF | |
590 $ echo a >> a/a | |
591 $ hg --cwd a commit -m 'with style' | |
592 $ hg --cwd b pull ../a -q | \ | |
593 > $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),' | |
594 Content-Type: text/plain; charset="us-ascii" | |
595 MIME-Version: 1.0 | |
596 Content-Transfer-Encoding: 7bit | |
597 Date: * (glob) | |
598 Subject: with style | |
599 From: test@test.com | |
600 X-Hg-Notification: changeset e917dbd961d3 | |
601 Message-Id: <hg.e917dbd961d3.*.*@*> (glob) | |
602 To: baz@test.com, foo@bar | |
603 | |
604 changeset e917dbd961d3 | |
605 | |
606 with template (overrides style): | |
607 | |
608 $ cat <<EOF >> $HGRCPATH | |
609 > template = Subject: {node|short}: {desc|firstline|strip} | |
610 > From: {author} | |
611 > {""} | |
612 > {desc} | |
613 > EOF | |
614 $ echo a >> a/a | |
615 $ hg --cwd a commit -m 'with template' | |
616 $ hg --cwd b pull ../a -q | \ | |
617 > $PYTHON -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),' | |
618 Content-Type: text/plain; charset="us-ascii" | |
619 MIME-Version: 1.0 | |
620 Content-Transfer-Encoding: 7bit | |
621 Date: * (glob) | |
622 Subject: a09743fd3edd: with template | |
623 From: test@test.com | |
624 X-Hg-Notification: changeset a09743fd3edd | |
625 Message-Id: <hg.a09743fd3edd.*.*@*> (glob) | |
626 To: baz@test.com, foo@bar | |
627 | |
628 with template |