Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 3b / 1ce3197d7b09936c8d1a90ce89c108b89873b3
1 Return-Path: <bremner@tethera.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id B8816431FC0\r
6         for <notmuch@notmuchmail.org>; Sat, 22 Mar 2014 19:26:43 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id hYMR7G+1ocAC for <notmuch@notmuchmail.org>;\r
16         Sat, 22 Mar 2014 19:26:38 -0700 (PDT)\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
18         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id B9331431FC2\r
21         for <notmuch@notmuchmail.org>; Sat, 22 Mar 2014 19:26:37 -0700 (PDT)\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
23         (envelope-from <bremner@tethera.net>)\r
24         id 1WRY7R-0008P9-CR; Sat, 22 Mar 2014 23:26:37 -0300\r
25 Received: (nullmailer pid 2941 invoked by uid 1000); Sun, 23 Mar 2014\r
26         02:26:26 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: notmuch@notmuchmail.org\r
29 Subject: [PATCH 2/2] notmuch-new: block database upgrades in default\r
30         configuration.\r
31 Date: Sat, 22 Mar 2014 23:26:13 -0300\r
32 Message-Id: <1395541573-2417-3-git-send-email-david@tethera.net>\r
33 X-Mailer: git-send-email 1.9.0\r
34 In-Reply-To: <1395541573-2417-1-git-send-email-david@tethera.net>\r
35 References: <87bnx4jyyp.fsf@servo.finestructure.net>\r
36         <1395541573-2417-1-git-send-email-david@tethera.net>\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Sun, 23 Mar 2014 02:26:43 -0000\r
50 \r
51 People who prefer the current behaviour can set the configuration\r
52 variable and forget it.\r
53 ---\r
54  notmuch-new.c        |  9 +++++++++\r
55  test/T530-upgrade.sh | 11 +++++++++++\r
56  2 files changed, 20 insertions(+)\r
57 \r
58 diff --git a/notmuch-new.c b/notmuch-new.c\r
59 index 82acf69..c6a15b0 100644\r
60 --- a/notmuch-new.c\r
61 +++ b/notmuch-new.c\r
62 @@ -989,6 +989,15 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])\r
63             return EXIT_FAILURE;\r
64  \r
65         if (notmuch_database_needs_upgrade (notmuch)) {\r
66 +           if (strcasecmp(notmuch_config_get_database_upgrades (config), "yes") != 0) {\r
67 +               fprintf (stderr,\r
68 +                        "Database upgrade needed. Please enable with\n\n"\r
69 +                        "  notmuch config set database.upgrades yes\n\n"\r
70 +                        "after taking appropriate precautions.\n");\r
71 +\r
72 +               return EXIT_FAILURE;\r
73 +           }\r
74 +\r
75             if (add_files_state.verbosity >= VERBOSITY_NORMAL)\r
76                 printf ("Welcome to a new version of notmuch! Your database will now be upgraded.\n");\r
77             gettimeofday (&add_files_state.tv_start, NULL);\r
78 diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh\r
79 index 67bbf31..00dcb1e 100755\r
80 --- a/test/T530-upgrade.sh\r
81 +++ b/test/T530-upgrade.sh\r
82 @@ -25,8 +25,19 @@ test_begin_subtest "path: search does not work with old database version"\r
83  output=$(notmuch search path:foo)\r
84  test_expect_equal "$output" ""\r
85  \r
86 +test_begin_subtest "database upgrade blocked by default config"\r
87 +output=$(notmuch new 2>&1)\r
88 +test_expect_equal "$output" "\\r
89 +Database upgrade needed. Please enable with\r
90 +\r
91 +  notmuch config set database.upgrades yes\r
92 +\r
93 +after taking appropriate precautions."\r
94 +\r
95  test_begin_subtest "database upgrade from format version 1"\r
96 +notmuch config set database.upgrades yes\r
97  output=$(notmuch new)\r
98 +\r
99  test_expect_equal "$output" "\\r
100  Welcome to a new version of notmuch! Your database will now be upgraded.\r
101  Your notmuch database has now been upgraded to database format version 2.\r
102 -- \r
103 1.9.0\r
104 \r