From ad08d25686bf151cc7c7fa17d7499f4a70a9cc0f Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 27 Jul 2014 23:52:53 +2000 Subject: [PATCH] [PATCH 14/14] lib: Update doc of notmuch_database_{needs_upgrade, upgrade} --- 54/3600232b002ed36077daa6ee601158054db06b | 126 ++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 54/3600232b002ed36077daa6ee601158054db06b diff --git a/54/3600232b002ed36077daa6ee601158054db06b b/54/3600232b002ed36077daa6ee601158054db06b new file mode 100644 index 000000000..9b3e554c6 --- /dev/null +++ b/54/3600232b002ed36077daa6ee601158054db06b @@ -0,0 +1,126 @@ +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 BE479431FC7 + for ; Sat, 26 Jul 2014 20:53:57 -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 SwhEwg-7rKcE for ; + Sat, 26 Jul 2014 20:53:52 -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 20B63431FDA + for ; Sat, 26 Jul 2014 20:53:15 -0700 (PDT) +X-AuditID: 12074424-f79146d00000067c-0f-53d477aab65d +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 54.C1.01660.AA774D35; Sat, 26 Jul 2014 23:53:14 -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 s6R3r32L008824; + Sat, 26 Jul 2014 23:53:04 -0400 +Received: from drake.dyndns.org + (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [216.15.114.40]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s6R3r0Hr016414 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Sat, 26 Jul 2014 23:53:03 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1XBFW8-00051j-IL; Sat, 26 Jul 2014 23:53:00 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH 14/14] lib: Update doc of notmuch_database_{needs_upgrade, + upgrade} +Date: Sat, 26 Jul 2014 23:52:53 -0400 +Message-Id: <1406433173-19169-15-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 2.0.0 +In-Reply-To: <1406433173-19169-1-git-send-email-amdragon@mit.edu> +References: <1406433173-19169-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsUixCmqrLuq/Eqwwf+nihbXb85kdmD0eLbq + FnMAYxSXTUpqTmZZapG+XQJXxtX/v9gK9gtUXG6+zdLAeIC3i5GDQ0LARKJ/WVwXIyeQKSZx + 4d56ti5GLg4hgdlMEq/eLmKCcDYySux78YgNpEpI4A6TxIW5sRCJuYwSP0/vZAJJsAloSGzb + v5wRxBYRkJbYeXc2K8gGZgE1iT9dKiBhYYEgiaVH5zGD2CwCqhIvWmazg9i8Ao4SH3dCxCUE + 5CQabnwC28UJFD/+7AQbyBghAQeJW5cSJzDyL2BkWMUom5JbpZubmJlTnJqsW5ycmJeXWqRr + rpebWaKXmlK6iREUMOwuKjsYmw8pHWIU4GBU4uHNYLsSLMSaWFZcmXuIUZKDSUmUd78ZUIgv + KT+lMiOxOCO+qDQntfgQowQHs5IIr1AxUI43JbGyKrUoHyYlzcGiJM771toqWEggPbEkNTs1 + tSC1CCYrw8GhJMF7owyoUbAoNT21Ii0zpwQhzcTBCTKcB2j4hlKQ4cUFibnFmekQ+VOMilLi + vL9AEgIgiYzSPLheWES/YhQHekWYlxVkBQ8wGcB1vwIazAQ0mMX/MsjgkkSElFQD445s69ka + q2a26kinCPwQZgmz6l62c+YvU5OPVV/Z4u5oa1uVh7/guKbiobovOY2P+dPKeT8N5q/23qtw + Y0vMnb86bO9mN8VVnsuXF//wstt2yx2vgohp19ayuWy4HPC3Vln6jZy8xcZ/dfn/b5vuULpl + 7/6Pp/u684L4Nr3tNpE3X37YM/GRgBJLcUaioRZzUXEiALEtb6rDAgAA +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: Sun, 27 Jul 2014 03:53:58 -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 | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/lib/notmuch.h b/lib/notmuch.h +index cbf2ba5..d771eb2 100644 +--- a/lib/notmuch.h ++++ b/lib/notmuch.h +@@ -352,22 +352,25 @@ unsigned int + notmuch_database_get_version (notmuch_database_t *database); + + /** +- * Does this database need to be upgraded before writing to it? ++ * Is the database behind the latest supported 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. + */ + 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 + -- 2.26.2