[PATCH] lib/database.cc: use flush Xapian method instead of commit
authorDavid Bremner <david@tethera.net>
Fri, 28 Oct 2011 14:56:30 +0000 (11:56 +2100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:49 +0000 (09:39 -0800)
08/92aa71e60bd920fad396dac89d1f990a2c5fff [new file with mode: 0644]

diff --git a/08/92aa71e60bd920fad396dac89d1f990a2c5fff b/08/92aa71e60bd920fad396dac89d1f990a2c5fff
new file mode 100644 (file)
index 0000000..0f25eb3
--- /dev/null
@@ -0,0 +1,74 @@
+Return-Path: <bremner@pivot.cs.unb.ca>\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 6C13B429E21\r
+       for <notmuch@notmuchmail.org>; Fri, 28 Oct 2011 07:56:47 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] 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 TksW1qlyJwTH for <notmuch@notmuchmail.org>;\r
+       Fri, 28 Oct 2011 07:56:46 -0700 (PDT)\r
+Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id B35BF431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 28 Oct 2011 07:56:46 -0700 (PDT)\r
+Received: from convex-new.cs.unb.ca ([131.202.13.154])\r
+       by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p9SEudDO014871;\r
+       Fri, 28 Oct 2011 11:56:41 -0300\r
+Received: from bremner by convex-new.cs.unb.ca with local (Exim 4.72)\r
+       (envelope-from <bremner@pivot.cs.unb.ca>)\r
+       id 1RJnrL-0004XT-KI; Fri, 28 Oct 2011 11:56:39 -0300\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] lib/database.cc: use flush Xapian method instead of commit\r
+Date: Fri, 28 Oct 2011 11:56:30 -0300\r
+Message-Id: <1319813790-17418-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.7.5.4\r
+Cc: David Bremner <bremner@debian.org>\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: Fri, 28 Oct 2011 14:56:48 -0000\r
+\r
+From: David Bremner <bremner@debian.org>\r
+\r
+Apparently the method was renamed in Xapian 1.1.0 but the old method\r
+name will stay around for a while. It seems better to stick with the\r
+old name to make notmuch compile with older versions of Xapian, at\r
+least for now.\r
+---\r
+ lib/database.cc |    2 +-\r
+ 1 files changed, 1 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/lib/database.cc b/lib/database.cc\r
+index e77fd53..5440df2 100644\r
+--- a/lib/database.cc\r
++++ b/lib/database.cc\r
+@@ -1030,7 +1030,7 @@ notmuch_database_end_atomic (notmuch_database_t *notmuch)\r
+        * However, we rely on flushing to test atomicity. */\r
+       const char *thresh = getenv ("XAPIAN_FLUSH_THRESHOLD");\r
+       if (thresh && atoi (thresh) == 1)\r
+-          db->commit ();\r
++          db->flush ();\r
+     } catch (const Xapian::Error &error) {\r
+       fprintf (stderr, "A Xapian exception occurred committing transaction: %s.\n",\r
+                error.get_msg().c_str());\r
+-- \r
+1.7.5.4\r
+\r