From: Austin Clements Date: Mon, 25 Aug 2014 17:26:09 +0000 (+2000) Subject: [PATCH v4 11/11] lib: Update doc of notmuch_database_{needs_upgrade, upgrade} X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dc927161fb0605531c5fccab73a0154b54312bbc;p=notmuch-archives.git [PATCH v4 11/11] lib: Update doc of notmuch_database_{needs_upgrade, upgrade} --- diff --git a/40/2f0a457de93fc4feaeab3d03cb08b36311a28b b/40/2f0a457de93fc4feaeab3d03cb08b36311a28b new file mode 100644 index 000000000..4dc4da25c --- /dev/null +++ b/40/2f0a457de93fc4feaeab3d03cb08b36311a28b @@ -0,0 +1,127 @@ +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 36F8F431FDC + for ; Mon, 25 Aug 2014 10:26:36 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 5xrPyhn+kJo1 for ; + Mon, 25 Aug 2014 10:26:31 -0700 (PDT) +Received: from dmz-mailsec-scanner-7.mit.edu (dmz-mailsec-scanner-7.mit.edu + [18.7.68.36]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 64BEA431FBF + for ; Mon, 25 Aug 2014 10:26:21 -0700 (PDT) +X-AuditID: 12074424-f79346d000004923-4f-53fb71bc9962 +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP + id 97.99.18723.DB17BF35; Mon, 25 Aug 2014 13:26:21 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s7PHQJFa007819; + Mon, 25 Aug 2014 13:26:19 -0400 +Received: from drake.dyndns.org (31-35-14.wireless.csail.mit.edu + [128.31.35.14]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s7PHQC7Y029625 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Mon, 25 Aug 2014 13:26:18 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1XLy20-0003jo-2T; Mon, 25 Aug 2014 13:26:12 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v4 11/11] lib: Update doc of notmuch_database_{needs_upgrade, + upgrade} +Date: Mon, 25 Aug 2014 13:26:09 -0400 +Message-Id: <1408987569-14146-12-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 2.0.0 +In-Reply-To: <1408987569-14146-1-git-send-email-amdragon@mit.edu> +References: <1408987569-14146-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsUixCmqrLu38HewwdT/LBY3WrsZLZqmO1tc + vzmT2YHZ49b91+wez1bdYvbYcug9cwBzFJdNSmpOZllqkb5dAlfG4pZG5oLNghXHni5la2Cc + zdfFyMkhIWAiceDnTHYIW0ziwr31bF2MXBxCArOZJJadecYC4WxklDi7+CITSJWQwDEmiYe3 + kyAScxkl/n15wwiSYBPQkPh9azFYkYiAtMTOu7NZQWxmAS+JZRf6wWxhgVCJ+Qf/g9WwCKhK + HFx6jg3E5hVwlGhc8IgF4gw5iYYbn8DinEDx6QtnQy12kPh++TzzBEb+BYwMqxhlU3KrdHMT + M3OKU5N1i5MT8/JSi3TN9XIzS/RSU0o3MYKCi91FZQdj8yGlQ4wCHIxKPLw34n8HC7EmlhVX + 5h5ilORgUhLlnZYPFOJLyk+pzEgszogvKs1JLT7EKMHBrCTC2wyS401JrKxKLcqHSUlzsCiJ + 8761tgoWEkhPLEnNTk0tSC2CycpwcChJ8N4vAGoULEpNT61Iy8wpQUgzcXCCDOcBGh4PUsNb + XJCYW5yZDpE/xagoJc77HyQhAJLIKM2D64VF/ytGcaBXhHmPglTxABMHXPcroMFMQINNe36C + DC5JREhJNTA2SnRPKyjaLVukeuLJs2K7Sbe2F8tfM074UnWRa3q576rdwhfSq24qSkyNNP2V + 8Pm7c6XMqk+F4frF//fpJK+PudlmXeC2xdr4zrtK/RP/dH494dRJ7Zg/deuR75o8s4PK1v37 + lma5Uu6DWXPAuhlOJXrva+yPhiycrBzge7rljeWMhRmFBuZKLMUZiYZazEXFiQCzHfSk2QIA AA== +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, 25 Aug 2014 17:26:36 -0000 + +Clients are no longer required to call these functions after opening a +database in read/write mode (which is good, because almost none of +them do!). +--- + lib/notmuch.h | 23 ++++++++++++++--------- + 1 file changed, 14 insertions(+), 9 deletions(-) + +diff --git a/lib/notmuch.h b/lib/notmuch.h +index cbf2ba5..21a5225 100644 +--- a/lib/notmuch.h ++++ b/lib/notmuch.h +@@ -352,22 +352,27 @@ unsigned int + notmuch_database_get_version (notmuch_database_t *database); + + /** +- * Does this database need to be upgraded before writing to it? ++ * Can the database be upgraded to a newer database version? + * +- * If this function returns TRUE then no functions that modify the +- * database (notmuch_database_add_message, notmuch_message_add_tag, +- * notmuch_directory_set_mtime, etc.) will work unless the function +- * notmuch_database_upgrade is called successfully first. ++ * If this function returns TRUE, then the caller may call ++ * notmuch_database_upgrade to upgrade the database. If the caller ++ * does not upgrade an out-of-date database, then some functions may ++ * fail with NOTMUCH_STATUS_UPGRADE_REQUIRED. This always returns ++ * FALSE for a read-only database because there's no way to upgrade a ++ * read-only database. + */ + notmuch_bool_t + notmuch_database_needs_upgrade (notmuch_database_t *database); + + /** +- * Upgrade the current database. ++ * Upgrade the current database to the latest supported version. + * +- * After opening a database in read-write mode, the client should +- * check if an upgrade is needed (notmuch_database_needs_upgrade) and +- * if so, upgrade with this function before making any modifications. ++ * This ensures that all current notmuch functionality will be ++ * available on the database. After opening a database in read-write ++ * mode, it is recommended that clients check if an upgrade is needed ++ * (notmuch_database_needs_upgrade) and if so, upgrade with this ++ * function before making any modifications. If ++ * notmuch_database_needs_upgrade returns FALSE, this will be a no-op. + * + * The optional progress_notify callback can be used by the caller to + * provide progress indication to the user. If non-NULL it will be +-- +2.0.0 +