From 0498179d46a668febf4453c967f98a2ab20487b3 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Mon, 12 Mar 2012 11:31:54 +0000 Subject: [PATCH] [PATCH 2/2] lib: fix an exclude bug --- 8b/1fa8db5b3ef7c2250e8b650a515bfff554963f | 93 +++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 8b/1fa8db5b3ef7c2250e8b650a515bfff554963f diff --git a/8b/1fa8db5b3ef7c2250e8b650a515bfff554963f b/8b/1fa8db5b3ef7c2250e8b650a515bfff554963f new file mode 100644 index 000000000..8adb8b231 --- /dev/null +++ b/8b/1fa8db5b3ef7c2250e8b650a515bfff554963f @@ -0,0 +1,93 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 97B0D431FDA + for ; Mon, 12 Mar 2012 04:32:07 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id nDindbRcwrwa for ; + Mon, 12 Mar 2012 04:32:06 -0700 (PDT) +Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com + [209.85.212.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A9F04431FD4 + for ; Mon, 12 Mar 2012 04:32:02 -0700 (PDT) +Received: by mail-wi0-f173.google.com with SMTP id hq7so2904632wib.2 + for ; Mon, 12 Mar 2012 04:32:02 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=Plo72Kk2I9vFlWvOC36Ei+d49YpOBszVzPQACGMsqsw=; + b=L5KgxJawoHm75fT/yJd6KiUt0s4+5p3qFYWb8bFhlxPGo1m13HK3GlZBU6o00O+SyJ + 0bCKaR1MSrzjjnXEyT3hd72qR5IFf57RwPfvjaz+yIcgbc6meZkKPubDFuq8sV4z/GSN + XJCKoFwuq6XMjjL0KRzMuL0wbXbHIUmzH7T7y3aEQfVMjqp8iL1ExGkd7z0ZuJxLIkTy + T61pQWEGi+J4pw22X9OIe/97NszVV9vIcjFbxTfLam9CrVf9n58a78Ypkccwv5ypfiO1 + xw8tpGdOEKIL7QSuldB2MCdF6vfhPoWkMwzuGeKSrFfZRyeAEKS2kdYWvYPR6HVA7Mw3 + 8TgQ== +Received: by 10.180.105.69 with SMTP id gk5mr6958371wib.3.1331551922400; + Mon, 12 Mar 2012 04:32:02 -0700 (PDT) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + w14sm33173137wiv.11.2012.03.12.04.32.01 (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 12 Mar 2012 04:32:01 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 2/2] lib: fix an exclude bug +Date: Mon, 12 Mar 2012 11:31:54 +0000 +Message-Id: <1331551914-28323-3-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1331551914-28323-1-git-send-email-markwalters1009@gmail.com> +References: <1331551914-28323-1-git-send-email-markwalters1009@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 12 Mar 2012 11:32:08 -0000 + +One test using the new exclude code was failing in some +configurations. This patch makes it work for me. It may be a "fix" +but I do not see why it fixes it. +--- + lib/query.cc | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/query.cc b/lib/query.cc +index ab18fbc..2b73d72 100644 +--- a/lib/query.cc ++++ b/lib/query.cc +@@ -213,13 +213,14 @@ notmuch_query_search_messages (notmuch_query_t *query) + + if (query->exclude_terms) { + exclude_query = _notmuch_exclude_tags (query, final_query); +- exclude_query = Xapian::Query (Xapian::Query::OP_AND, +- exclude_query, final_query); + + if (query->omit_excluded_messages) + final_query = Xapian::Query (Xapian::Query::OP_AND_NOT, + final_query, exclude_query); + else { ++ exclude_query = Xapian::Query (Xapian::Query::OP_AND, ++ exclude_query, final_query); ++ + enquire.set_weighting_scheme (Xapian::BoolWeight()); + enquire.set_query (exclude_query); + +-- +1.7.9.1 + -- 2.26.2