[PATCH 5/7] go: Partially bind notmuch_database_upgrade
authorAdrien Bustany <adrien@bustany.org>
Wed, 18 Jul 2012 18:34:33 +0000 (21:34 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:22 +0000 (09:48 -0800)
81/0a0d75f2241d29a3842b99f92aa8303c2b28e2 [new file with mode: 0644]

diff --git a/81/0a0d75f2241d29a3842b99f92aa8303c2b28e2 b/81/0a0d75f2241d29a3842b99f92aa8303c2b28e2
new file mode 100644 (file)
index 0000000..974f9e7
--- /dev/null
@@ -0,0 +1,80 @@
+Return-Path: <adrien@bustany.org>\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 92A63431FC7\r
+       for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 11:41:05 -0700 (PDT)\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 AxF+L66LRTCq for <notmuch@notmuchmail.org>;\r
+       Wed, 18 Jul 2012 11:41:05 -0700 (PDT)\r
+X-Greylist: delayed 384 seconds by postgrey-1.32 at olra;\r
+       Wed, 18 Jul 2012 11:41:04 PDT\r
+Received: from mail.bustany.org (bustany.org [176.31.244.208])\r
+       by olra.theworths.org (Postfix) with ESMTP id D7E7C431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 11:41:04 -0700 (PDT)\r
+Received: from localhost.localdomain (91-158-2-79.elisa-laajakaista.fi\r
+       [91.158.2.79])\r
+       by mail.bustany.org (Postfix) with ESMTPSA id 256B11400D7\r
+       for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 20:37:09 +0200 (CEST)\r
+From: Adrien Bustany <adrien@bustany.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 5/7] go: Partially bind notmuch_database_upgrade\r
+Date: Wed, 18 Jul 2012 21:34:33 +0300\r
+Message-Id: <1342636475-16057-6-git-send-email-adrien@bustany.org>\r
+X-Mailer: git-send-email 1.7.7.6\r
+In-Reply-To: <1342636475-16057-1-git-send-email-adrien@bustany.org>\r
+References: <1342636475-16057-1-git-send-email-adrien@bustany.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: Wed, 18 Jul 2012 18:41:05 -0000\r
+\r
+This binding does not handle the progress callback, but at least allows\r
+opening and upgrading a database if needed.\r
+---\r
+ bindings/go/src/notmuch/notmuch.go |   13 ++++++++++++-\r
+ 1 files changed, 12 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go\r
+index d8b2739..384d5a5 100644\r
+--- a/bindings/go/src/notmuch/notmuch.go\r
++++ b/bindings/go/src/notmuch/notmuch.go\r
+@@ -296,7 +296,18 @@ func (self *Database) NeedsUpgrade() bool {\r
+       return true\r
+ }\r
+ \r
+-// TODO: notmuch_database_upgrade\r
++// TODO: Proper notmuch_database_upgrade\r
++/* Upgrade the current database.\r
++ *\r
++ * After opening a database in read-write mode, the client should\r
++ * check if an upgrade is needed (notmuch_database_needs_upgrade) and\r
++ * if so, upgrade with this function before making any modifications.\r
++ */\r
++func (self *Database) Upgrade() Status {\r
++      st := Status(C.notmuch_database_upgrade(self.db, nil, nil));\r
++\r
++      return st;\r
++}\r
+ \r
+ /* Retrieve a directory object from the database for 'path'.\r
+  *\r
+-- \r
+1.7.7.6\r
+\r