[PATCH v2 14/14] lib: Update doc of notmuch_database_{needs_upgrade, upgrade}
authorAustin Clements <amdragon@MIT.EDU>
Tue, 29 Jul 2014 16:48:12 +0000 (12:48 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:03:57 +0000 (10:03 -0800)
4a/77714a5e451a96e95b9774788caef203a90260 [new file with mode: 0644]

diff --git a/4a/77714a5e451a96e95b9774788caef203a90260 b/4a/77714a5e451a96e95b9774788caef203a90260
new file mode 100644 (file)
index 0000000..f6b98b9
--- /dev/null
@@ -0,0 +1,125 @@
+Return-Path: <amdragon@mit.edu>\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 A8CCA431FAE\r
+       for <notmuch@notmuchmail.org>; Tue, 29 Jul 2014 09:48:59 -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 A0LqXMlR2Izp for <notmuch@notmuchmail.org>;\r
+       Tue, 29 Jul 2014 09:48:54 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
+       [18.9.25.13])\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 A8069431FD5\r
+       for <notmuch@notmuchmail.org>; Tue, 29 Jul 2014 09:48:23 -0700 (PDT)\r
+X-AuditID: 1209190d-f79c06d000002f07-87-53d7d057ad7b\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       (using TLS with cipher AES256-SHA (256/256 bits))\r
+       (Client did not present a certificate)\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 2C.0D.12039.750D7D35; Tue, 29 Jul 2014 12:48:23 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s6TGmMHg003485; \r
+       Tue, 29 Jul 2014 12:48:22 -0400\r
+Received: from drake.dyndns.org (31-33-71.wireless.csail.mit.edu\r
+       [128.31.33.71]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s6TGmFph030276\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Tue, 29 Jul 2014 12:48:21 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1XCAZT-0007HD-2K; Tue, 29 Jul 2014 12:48:15 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 14/14] lib: Update doc of notmuch_database_{needs_upgrade,\r
+       upgrade}\r
+Date: Tue, 29 Jul 2014 12:48:12 -0400\r
+Message-Id: <1406652492-27803-15-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 2.0.0\r
+In-Reply-To: <1406652492-27803-1-git-send-email-amdragon@mit.edu>\r
+References: <1406652492-27803-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsUixCmqrBt+4XqwQe8DeYvVc3ksrt+cyezA\r
+       5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZVz9/4utYL9AxeXm2ywNjAd4uxg5OSQETCQW\r
+       7lrDDGGLSVy4t56ti5GLQ0hgNpPE/bY1rCAJIYGNjBLTNkRDJI4xSZz//JcFIjGXUWJLUwqI\r
+       zSagIbFt/3JGEFtEQFpi593ZYM3MAo4Sn/cvYgOxhQVCJVr+rwWrYRFQleiYfBtsMy9QzZ5b\r
+       91ghrpCTaLjxCayeEyh+695dJohdDhKHZm1mmcDIv4CRYRWjbEpulW5uYmZOcWqybnFyYl5e\r
+       apGukV5uZoleakrpJkZwGEny7mB8d1DpEKMAB6MSDy/HgmvBQqyJZcWVuYcYJTmYlER59fZd\r
+       DxbiS8pPqcxILM6ILyrNSS0+xCjBwawkwst3FijHm5JYWZValA+TkuZgURLnfWttFSwkkJ5Y\r
+       kpqdmlqQWgSTleHgUJLgXXseqFGwKDU9tSItM6cEIc3EwQkynAdo+D6QGt7igsTc4sx0iPwp\r
+       RkUpcd7sc0AJAZBERmkeXC8szl8xigO9IszbBtLOA0wRcN2vgAYzAQ1mdQEbXJKIkJJqYKws\r
+       KA/MTOm7lPzjXsGW8sTztUwZtU8sTsqxZNzzbfEtSwrI2F/C4s/0KueHrcAPtepQJjWf7Cbu\r
+       V78sfPTPpbnMLOF4YLzIxSfkzYPY7zuYXA9ve5n74rP+drmFR1dHdJxY9NjQ9eKu6v8FieLt\r
+       Ky/41pTevTnnh1uw6VGWh/bOxm/bWN9eVWIpzkg01GIuKk4EAC6sQn/OAgAA\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: Tue, 29 Jul 2014 16:48:59 -0000\r
+\r
+Clients are no longer required to call these functions after opening a\r
+database in read/write mode (which is good, because almost none of\r
+them do!).\r
+---\r
+ lib/notmuch.h | 21 ++++++++++++---------\r
+ 1 file changed, 12 insertions(+), 9 deletions(-)\r
+\r
+diff --git a/lib/notmuch.h b/lib/notmuch.h\r
+index cbf2ba5..d771eb2 100644\r
+--- a/lib/notmuch.h\r
++++ b/lib/notmuch.h\r
+@@ -352,22 +352,25 @@ unsigned int\r
+ notmuch_database_get_version (notmuch_database_t *database);\r
\r
+ /**\r
+- * Does this database need to be upgraded before writing to it?\r
++ * Is the database behind the latest supported database version?\r
+  *\r
+- * If this function returns TRUE then no functions that modify the\r
+- * database (notmuch_database_add_message, notmuch_message_add_tag,\r
+- * notmuch_directory_set_mtime, etc.) will work unless the function\r
+- * notmuch_database_upgrade is called successfully first.\r
++ * If this function returns TRUE, then the caller may call\r
++ * notmuch_database_upgrade to upgrade the database.  If the caller\r
++ * does not upgrade an out-of-date database, then some functions may\r
++ * fail with NOTMUCH_STATUS_UPGRADE_REQUIRED.\r
+  */\r
+ notmuch_bool_t\r
+ notmuch_database_needs_upgrade (notmuch_database_t *database);\r
\r
+ /**\r
+- * Upgrade the current database.\r
++ * Upgrade the current database to the latest supported version.\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
++ * This ensures that all current notmuch functionality will be\r
++ * available on the database.  After opening a database in read-write\r
++ * mode, it is recommended that clients check if an upgrade is needed\r
++ * (notmuch_database_needs_upgrade) and if so, upgrade with this\r
++ * function before making any modifications.  If\r
++ * notmuch_database_needs_upgrade returns FALSE, this will be a no-op.\r
+  *\r
+  * The optional progress_notify callback can be used by the caller to\r
+  * provide progress indication to the user. If non-NULL it will be\r
+-- \r
+2.0.0\r
+\r