Mercurial > hg
comparison tests/test-patchbomb.t @ 23487:c14af817ab76
patchbomb: add a 'patchbomb.intro' option
This option allows the user to control the default behavior for
including an introduction message. This avoids having to tirelessly
skip the intro for people contributing to Mercurial.
The three possibles values are:
- always,
- auto (default, current behavior),
- never.
I was thinking of ("true", "false", "") (empty value being auto) but I ruled it
out as too confusing.
This new config option reuses the pre-existing 'patchbomb' section.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 02 Dec 2014 17:24:52 -0800 |
parents | a074eeeabe32 |
children | 11b215731e74 |
comparison
equal
deleted
inserted
replaced
23486:1de214837f5e | 23487:c14af817ab76 |
---|---|
2661 +++ b/d Thu Jan 01 00:00:04 1970 +0000 | 2661 +++ b/d Thu Jan 01 00:00:04 1970 +0000 |
2662 @@ -0,0 +1,1 @@ | 2662 @@ -0,0 +1,1 @@ |
2663 +d | 2663 +d |
2664 | 2664 |
2665 | 2665 |
2666 $ cd .. | 2666 Test introduction configuration |
2667 ================================= | |
2668 | |
2669 $ echo '[patchbomb]' >> $HGRCPATH | |
2670 | |
2671 "auto" setting | |
2672 ---------------- | |
2673 | |
2674 $ echo 'intro=auto' >> $HGRCPATH | |
2675 | |
2676 single rev | |
2677 | |
2678 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '10' | grep "Write the introductory message for the patch series." | |
2679 [1] | |
2680 | |
2681 single rev + flag | |
2682 | |
2683 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '10' --intro | grep "Write the introductory message for the patch series." | |
2684 Write the introductory message for the patch series. | |
2685 | |
2686 | |
2687 Multi rev | |
2688 | |
2689 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '9::' | grep "Write the introductory message for the patch series." | |
2690 Write the introductory message for the patch series. | |
2691 | |
2692 "never" setting | |
2693 ----------------- | |
2694 | |
2695 $ echo 'intro=never' >> $HGRCPATH | |
2696 | |
2697 single rev | |
2698 | |
2699 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '10' | grep "Write the introductory message for the patch series." | |
2700 [1] | |
2701 | |
2702 single rev + flag | |
2703 | |
2704 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '10' --intro | grep "Write the introductory message for the patch series." | |
2705 Write the introductory message for the patch series. | |
2706 | |
2707 | |
2708 Multi rev | |
2709 | |
2710 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '9::' | grep "Write the introductory message for the patch series." | |
2711 [1] | |
2712 | |
2713 Multi rev + flag | |
2714 | |
2715 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '9::' --intro | grep "Write the introductory message for the patch series." | |
2716 Write the introductory message for the patch series. | |
2717 | |
2718 "always" setting | |
2719 ----------------- | |
2720 | |
2721 $ echo 'intro=always' >> $HGRCPATH | |
2722 | |
2723 single rev | |
2724 | |
2725 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '10' | grep "Write the introductory message for the patch series." | |
2726 Write the introductory message for the patch series. | |
2727 | |
2728 single rev + flag | |
2729 | |
2730 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '10' --intro | grep "Write the introductory message for the patch series." | |
2731 Write the introductory message for the patch series. | |
2732 | |
2733 | |
2734 Multi rev | |
2735 | |
2736 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '9::' | grep "Write the introductory message for the patch series." | |
2737 Write the introductory message for the patch series. | |
2738 | |
2739 Multi rev + flag | |
2740 | |
2741 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '9::' --intro | grep "Write the introductory message for the patch series." | |
2742 Write the introductory message for the patch series. | |
2743 | |
2744 bad value setting | |
2745 ----------------- | |
2746 | |
2747 $ echo 'intro=mpmwearaclownnose' >> $HGRCPATH | |
2748 | |
2749 single rev | |
2750 | |
2751 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -r '10' | |
2752 From [test]: test | |
2753 this patch series consists of 1 patches. | |
2754 | |
2755 warning: invalid patchbomb.intro value "mpmwearaclownnose" | |
2756 (should be one of always, never, auto) | |
2757 Cc: | |
2758 | |
2759 displaying [PATCH] test ... | |
2760 Content-Type: text/plain; charset="us-ascii" | |
2761 MIME-Version: 1.0 | |
2762 Content-Transfer-Encoding: 7bit | |
2763 Subject: [PATCH] test | |
2764 X-Mercurial-Node: 3b6f1ec9dde933a40a115a7990f8b320477231af | |
2765 X-Mercurial-Series-Index: 1 | |
2766 X-Mercurial-Series-Total: 1 | |
2767 Message-Id: <3b6f1ec9dde933a40a11*> (glob) | |
2768 X-Mercurial-Series-Id: <3b6f1ec9dde933a40a11.*> (glob) | |
2769 User-Agent: Mercurial-patchbomb/* (glob) | |
2770 Date: Tue, 01 Jan 1980 00:01:00 +0000 | |
2771 From: test | |
2772 To: foo | |
2773 | |
2774 # HG changeset patch | |
2775 # User test | |
2776 # Date 5 0 | |
2777 # Thu Jan 01 00:00:05 1970 +0000 | |
2778 # Branch test | |
2779 # Node ID 3b6f1ec9dde933a40a115a7990f8b320477231af | |
2780 # Parent 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268 | |
2781 dd | |
2782 | |
2783 diff -r 2f9fa9b998c5 -r 3b6f1ec9dde9 d | |
2784 --- a/d Thu Jan 01 00:00:04 1970 +0000 | |
2785 +++ b/d Thu Jan 01 00:00:05 1970 +0000 | |
2786 @@ -1,1 +1,2 @@ | |
2787 d | |
2788 +d | |
2789 |