[PATCH 0/2] lib: Allow read-only messages to be synchronized to a writable database

Michael Forney mforney at mforney.org
Mon Dec 10 22:54:51 PST 2012


In developing ner (a notmuch ui), I open a read-only database connection so I
don't interfere with other notmuch programs, but this makes it difficult to
make modifications to the tags of messages I open.

The first patch replaces the freeze/thaw functionality with a single sync
function. This way, read-only messages can be modified just as writable ones
can be, but the notmuch_message_sync operation requires a writable database
connection.

The second patch adds a function `notmuch_database_sync_message' which will
perform the synchronization using the given database (and does not care if the
modified message was opened with a read-only database).

I've attempted to make these changes in the notmuch bindings as well, but
haven't tested them.

Feedback is welcome!

Michael Forney (2):
  lib: Replace freeze/thaw functionality with single sync function
  lib: Allow synchronizing message changes with a separate database
    connection

 bindings/go/src/notmuch/notmuch.go      |  70 ++++------------
 bindings/python/docs/source/message.rst |   4 +-
 bindings/python/notmuch/__init__.py     |   1 -
 bindings/python/notmuch/errors.py       |   7 --
 bindings/python/notmuch/message.py      | 141 ++++++++------------------------
 bindings/ruby/defs.h                    |   6 +-
 bindings/ruby/init.c                    |  12 +--
 bindings/ruby/message.c                 |  27 +-----
 bindings/ruby/status.c                  |   2 -
 contrib/notmuch-deliver/src/main.c      |  10 +++
 lib/database.cc                         |  21 +++--
 lib/message.cc                          |  92 +++++----------------
 lib/notmuch-private.h                   |   7 +-
 lib/notmuch.h                           | 107 ++++++++++--------------
 notmuch-new.c                           |   4 +-
 notmuch-tag.c                           |   4 +-
 tag-util.c                              |  10 +--
 17 files changed, 153 insertions(+), 372 deletions(-)

-- 
1.8.0



More information about the notmuch mailing list