[PATCH] test: Adding non-maildir tags does not move message from new to cur
authordavid <david@tethera.net>
Sat, 8 Dec 2012 19:15:32 +0000 (15:15 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:50 +0000 (09:51 -0800)
19/f984a2aa916973880391dfcd3742a6fb3c4981 [new file with mode: 0644]

diff --git a/19/f984a2aa916973880391dfcd3742a6fb3c4981 b/19/f984a2aa916973880391dfcd3742a6fb3c4981
new file mode 100644 (file)
index 0000000..2609f04
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 48DDB431FAF\r
+       for <notmuch@notmuchmail.org>; Sat,  8 Dec 2012 11:17:05 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id S4HnjhSufBMk for <notmuch@notmuchmail.org>;\r
+       Sat,  8 Dec 2012 11:17:04 -0800 (PST)\r
+Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
+       (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 2958C431FAE\r
+       for <notmuch@notmuchmail.org>; Sat,  8 Dec 2012 11:17:04 -0800 (PST)\r
+Received: from fctnnbsc30w-142167090129.dhcp-dynamic.fibreop.nb.bellaliant.net\r
+       ([142.167.90.129] helo=zancas.localnet)\r
+       by tesseract.cs.unb.ca with esmtpsa\r
+       (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72)\r
+       (envelope-from <bremner@tethera.net>)\r
+       id 1ThPtW-0005uO-Hx; Sat, 08 Dec 2012 15:17:03 -0400\r
+Received: from bremner by zancas.localnet with local (Exim 4.80)\r
+       (envelope-from <bremner@tethera.net>)\r
+       id 1ThPtO-0000NI-Ux; Sat, 08 Dec 2012 15:16:54 -0400\r
+From: david@tethera.net\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] test: Adding non-maildir tags does not move message from new\r
+       to cur\r
+Date: Sat,  8 Dec 2012 15:15:32 -0400\r
+Message-Id: <1354994132-866-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1316039001-32602-5-git-send-email-l.rilling@av7.net>\r
+References: <1316039001-32602-5-git-send-email-l.rilling@av7.net>\r
+X-Spam_bar: -\r
+Cc: Michal Sojka <sojka@os.inf.tu-dresden.de>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 08 Dec 2012 19:17:05 -0000\r
+\r
+From: Michal Sojka <sojka@os.inf.tu-dresden.de>\r
+\r
+Some MUA's like mutt show the difference between "new" emails living in maildir\r
+directory new/, and "old" emails living in maildir directory cur/. However\r
+notmuch tag unconditionally moves selected messages from new/ to cur/, even if\r
+no maildir synchronized tag is changed.\r
+\r
+While maildir specification forbids messages with tags living in new/, there is\r
+no need to move messages to cur/ when no maildir synchronized tag is changed.\r
+Thus notmuch can remain transparent with respect to other MUA's.\r
+\r
+[ Edited commit log to better describe the intended changes, and tag the\r
+  test as broken until the actual changes are implemented -- Louis Rilling ]\r
+\r
+Signed-off-by: Louis Rilling <l.rilling@av7.net>\r
+\r
+[ Converted to use test_subtest_known_broken, David Bremner ]\r
+---\r
+\r
+Do we agree that the behaviour of moving messages to ./cur on tagging\r
+is broken? If so, maybe it's worth tidying up and applying this.  The\r
+use of cd and ls strikes me as slightly suspect, but I welcome other\r
+opinions.\r
+\r
+ test/maildir-sync |    9 +++++++++\r
+ 1 file changed, 9 insertions(+)\r
+\r
+diff --git a/test/maildir-sync b/test/maildir-sync\r
+index 0fc742a..6165782 100755\r
+--- a/test/maildir-sync\r
++++ b/test/maildir-sync\r
+@@ -83,6 +83,15 @@ test_expect_equal "$output" "No new mail."\r
+ # creating new directories in the mail store, then it should be\r
+ # creating all necessary database state for those directories.\r
\r
++test_begin_subtest "Adding non-maildir tags does not move message from new to cur"\r
++test_subtest_known_broken\r
++add_message [subject]='"Message to stay in new"' \\r
++    [date]='"Sat, 01 Jan 2000 12:00:00 -0000"' \\r
++    [filename]='message-to-stay-in-new' [dir]=new\r
++notmuch tag +donotmove subject:"Message to stay in new"\r
++output=$(cd "$MAIL_DIR"; ls */message-to-stay-in-new*)\r
++test_expect_equal "$output" "new/message-to-stay-in-new"\r
++\r
+ test_begin_subtest "Removing 'S' flag from existing filename adds 'unread' tag"\r
+ add_message [subject]='"Removing S flag"' [filename]='removing-s-flag:2,S' [dir]=cur\r
+ output=$(notmuch search subject:"Removing S flag" | notmuch_search_sanitize)\r
+-- \r
+1.7.10.4\r
+\r