[PATCH 0/2] lib: Allow read-only messages to be synchronized to a writable database
authorMichael Forney <mforney@mforney.org>
Tue, 11 Dec 2012 06:54:51 +0000 (22:54 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:52:02 +0000 (09:52 -0800)
02/4e2addd0b5b5557ed10b532709c4317ec7977d [new file with mode: 0644]

diff --git a/02/4e2addd0b5b5557ed10b532709c4317ec7977d b/02/4e2addd0b5b5557ed10b532709c4317ec7977d
new file mode 100644 (file)
index 0000000..5e0ce41
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <mforney@mforney.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 CA5F1431FAF\r
+       for <notmuch@notmuchmail.org>; Mon, 10 Dec 2012 22:55:32 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 V9yUcbzFhzbV for <notmuch@notmuchmail.org>;\r
+       Mon, 10 Dec 2012 22:55:32 -0800 (PST)\r
+Received: from mail-da0-f53.google.com (mail-da0-f53.google.com\r
+       [209.85.210.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 338E9431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 10 Dec 2012 22:55:32 -0800 (PST)\r
+Received: by mail-da0-f53.google.com with SMTP id x6so1438442dac.26\r
+       for <notmuch@notmuchmail.org>; Mon, 10 Dec 2012 22:55:31 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:subject:date:message-id:x-mailer:x-gm-message-state;\r
+       bh=xrc1QyoClPTLoE1AI4Z0kUTyAVDv1BIelVeZ1mcaL50=;\r
+       b=AwWp1kKjQphS0lpRArricXvXBJbKSSpHfvxyf8YEqLTlxjWtKCf1pa40JHQbIIK0RU\r
+       4LYk1wiG/+ombReJjGADqISHlWlzJgUBCHEOPNidSZ+QVE81UHWlX3iEjryqREWkRMV8\r
+       QF3j5+Fjl/NJ+7jWrt+qfUrSeFcD3lRtfKpXTnU4PafALVlhoKleDkTwysKnB5kMuQWk\r
+       gq/nJ5tIXE0btX35izw3T/lvPE2htHvcQNClLPoQqtguSQoY/vY1WUMB6w1aF+rPPSOj\r
+       7MjIgJ/7O1SVOPPZxR5+mBB8MFYNoJLCusuhT7zXX74IOJUD5hTCcJAM50xzHTJ/2IGI\r
+       Vvyg==\r
+Received: by 10.68.190.38 with SMTP id gn6mr46324456pbc.6.1355208930383;\r
+       Mon, 10 Dec 2012 22:55:30 -0800 (PST)\r
+Received: from localhost ([2601:9:580:4c:21f:16ff:fe34:119e])\r
+       by mx.google.com with ESMTPS id d1sm4902265pav.6.2012.12.10.22.55.28\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 10 Dec 2012 22:55:29 -0800 (PST)\r
+From: Michael Forney <mforney@mforney.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 0/2] lib: Allow read-only messages to be synchronized to a\r
+       writable database\r
+Date: Mon, 10 Dec 2012 22:54:51 -0800\r
+Message-Id: <1355208893-16122-1-git-send-email-mforney@mforney.org>\r
+X-Mailer: git-send-email 1.8.0\r
+X-Gm-Message-State:\r
+ ALoCoQmhUlhlC3iOjmp52p7fTF+d1EYD+noC4KmVVSu28lP0pvqb5IqHTAVcdr/b6mp4OOxA1EPU\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, 11 Dec 2012 06:55:32 -0000\r
+\r
+In developing ner (a notmuch ui), I open a read-only database connection so I\r
+don't interfere with other notmuch programs, but this makes it difficult to\r
+make modifications to the tags of messages I open.\r
+\r
+The first patch replaces the freeze/thaw functionality with a single sync\r
+function. This way, read-only messages can be modified just as writable ones\r
+can be, but the notmuch_message_sync operation requires a writable database\r
+connection.\r
+\r
+The second patch adds a function `notmuch_database_sync_message' which will\r
+perform the synchronization using the given database (and does not care if the\r
+modified message was opened with a read-only database).\r
+\r
+I've attempted to make these changes in the notmuch bindings as well, but\r
+haven't tested them.\r
+\r
+Feedback is welcome!\r
+\r
+Michael Forney (2):\r
+  lib: Replace freeze/thaw functionality with single sync function\r
+  lib: Allow synchronizing message changes with a separate database\r
+    connection\r
+\r
+ bindings/go/src/notmuch/notmuch.go      |  70 ++++------------\r
+ bindings/python/docs/source/message.rst |   4 +-\r
+ bindings/python/notmuch/__init__.py     |   1 -\r
+ bindings/python/notmuch/errors.py       |   7 --\r
+ bindings/python/notmuch/message.py      | 141 ++++++++------------------------\r
+ bindings/ruby/defs.h                    |   6 +-\r
+ bindings/ruby/init.c                    |  12 +--\r
+ bindings/ruby/message.c                 |  27 +-----\r
+ bindings/ruby/status.c                  |   2 -\r
+ contrib/notmuch-deliver/src/main.c      |  10 +++\r
+ lib/database.cc                         |  21 +++--\r
+ lib/message.cc                          |  92 +++++----------------\r
+ lib/notmuch-private.h                   |   7 +-\r
+ lib/notmuch.h                           | 107 ++++++++++--------------\r
+ notmuch-new.c                           |   4 +-\r
+ notmuch-tag.c                           |   4 +-\r
+ tag-util.c                              |  10 +--\r
+ 17 files changed, 153 insertions(+), 372 deletions(-)\r
+\r
+-- \r
+1.8.0\r
+\r