notmuch.git
13 years agodebian: changelog stanza for 0.9 0.9
David Bremner [Wed, 12 Oct 2011 00:53:57 +0000 (21:53 -0300)]
debian: changelog stanza for 0.9

Admit that there have been no changes since the last release
candidate.

13 years agoversion: bump to 0.9
David Bremner [Wed, 12 Oct 2011 00:50:56 +0000 (21:50 -0300)]
version: bump to 0.9

also bump python bindings version.

13 years agoNEWS: document API changes to n_d_find_message{,_by_filename}
David Bremner [Tue, 11 Oct 2011 12:10:33 +0000 (09:10 -0300)]
NEWS: document API changes to n_d_find_message{,_by_filename}

For details the user will have to refer to the source.  Reformat Ruby
news consistently with Python.

13 years agoNEWS: document API changes to n_d_find_message{,_by_filename}
David Bremner [Tue, 11 Oct 2011 12:05:41 +0000 (09:05 -0300)]
NEWS: document API changes to n_d_find_message{,_by_filename}

For details the user will have to refer to the source.

13 years agotest: add two emacs tests for show mode refresh
Jameson Graef Rollins [Sun, 9 Oct 2011 03:21:26 +0000 (20:21 -0700)]
test: add two emacs tests for show mode refresh

The first test tests that the notmuch-show-refresh-view function
produces the exact same output for an unmodified show buffer.  This
test should pass since the relevant functionality has already been
applied.

The second test tests show refresh for a show buffer that has been
modified by navigation and message visibility toggling.  Ideally
refresh-view should preserve this state of the notmuch-show buffer.
Unfortunately it currently does not, so this test is know to be broken
and is marked as such.

13 years agoNEWS: add notes about emacs improvements and reply formating cleanup
Jameson Graef Rollins [Sun, 9 Oct 2011 03:47:47 +0000 (20:47 -0700)]
NEWS: add notes about emacs improvements and reply formating cleanup

13 years agoversion: bump to 0.9~rc2
David Bremner [Sat, 8 Oct 2011 01:42:18 +0000 (22:42 -0300)]
version: bump to 0.9~rc2

We continue to keep the python bindings version in sync manually

13 years agodebian: update changelog for 0.9~rc2-1
David Bremner [Fri, 7 Oct 2011 21:54:27 +0000 (18:54 -0300)]
debian: update changelog for 0.9~rc2-1

Document upstream changes since 0.9~rc1-1

13 years agoemacs: add notmuch-show-refresh-view function
Jameson Graef Rollins [Sun, 29 May 2011 00:09:43 +0000 (17:09 -0700)]
emacs: add notmuch-show-refresh-view function

This function, like the equivalent for notmuch-search, just refreshes
the current show view.  Like in notmuch-search, this new function is
bound to "=".  If a prefix is given then the redisplay happens with the
crypto-switch set, which displays the thread with the opposite logic
of whatever is set in the notmuch-crypto-process-mime customization
variable.

13 years agoemacs: Add callback functions to crypto sigstatus button.
Jameson Graef Rollins [Tue, 31 May 2011 17:07:13 +0000 (10:07 -0700)]
emacs: Add callback functions to crypto sigstatus button.

This adds two callback functions to the sigstatus button.  If the sig
status is "good", then clicking the button displays the output of "gpg
--list-keys" on the key fingerprint.  If the sigstatus is "bad", then
clicking the button will retrieve the key from the keyserver, and
redisplay the current buffer.

Thanks to David Bremner <bremner@unb.ca> for help with this.

13 years agoIgnore "application/pgp-*" parts in reply.
Jameson Graef Rollins [Wed, 8 Jun 2011 19:30:09 +0000 (12:30 -0700)]
Ignore "application/pgp-*" parts in reply.

The quoted text doesn't need to mention that the message being replied
to had these crufty parts.

13 years agotest: test for absence of "Non-text part: application/pgp-*" lines in reply
Jameson Graef Rollins [Wed, 8 Jun 2011 19:30:08 +0000 (12:30 -0700)]
test: test for absence of "Non-text part: application/pgp-*" lines in reply

In reply, the quoted text does not need to mention that the original
message had "application/pgp-signed" or "application/pgp-encrypted"
parts.

13 years agoFix notmuch-reply to not output "Non-text part:" lines for non-leafnode parts.
Jameson Graef Rollins [Wed, 8 Jun 2011 19:30:07 +0000 (12:30 -0700)]
Fix notmuch-reply to not output "Non-text part:" lines for non-leafnode parts.

These lines are just cruft in this case, and can be removed.

13 years agotest/multipart: test for absence of "Non-text part:" lines in reply for multipart...
Jameson Graef Rollins [Wed, 8 Jun 2011 19:30:06 +0000 (12:30 -0700)]
test/multipart: test for absence of "Non-text part:" lines in reply for multipart/* and message/rfc822 parts

There's no reason to output "Non-text part:" lines for parts that are
not leaf nodes, eg. multipart/* and message/rfc822.  We fix the text
here to test for their absence.  The next patch will fix reply
accordingly.

13 years agopython: Set status in the class definitions
Sebastian Spaeth [Wed, 5 Oct 2011 15:57:46 +0000 (17:57 +0200)]
python: Set status in the class definitions

Technically, this is a superfluous change, as the self.status variable
currently gets set in NotmuchErrors's __new__ function. However, in the
long run I would like to get rid of the weird __new__ implementation which
might be somewhat confusing for users (NotmuchError(status) returns a
different class, e.g. OutOfMemoryError)

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: help function Query._assert_query_is_initialized
Sebastian Spaeth [Wed, 5 Oct 2011 15:55:30 +0000 (17:55 +0200)]
python: help function Query._assert_query_is_initialized

Remove code duplication by using the new helper function. Also raise the
new fine grained exceptions in many cases, rather than the more generic
NotmuchErrors.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: clean up docstrings and API documentation
Sebastian Spaeth [Wed, 5 Oct 2011 15:54:09 +0000 (17:54 +0200)]
python: clean up docstrings and API documentation

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: whitespace fixed in docstrings
Sebastian Spaeth [Wed, 5 Oct 2011 15:05:37 +0000 (17:05 +0200)]
python: whitespace fixed in docstrings

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: Add the new exception types in the API documentation
Sebastian Spaeth [Wed, 5 Oct 2011 14:58:13 +0000 (16:58 +0200)]
python: Add the new exception types in the API documentation

as they should be documented...

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: Catch up with find_message(by_filename) API changes
Sebastian Spaeth [Wed, 5 Oct 2011 14:44:35 +0000 (16:44 +0200)]
python: Catch up with find_message(by_filename) API changes

message is now an out parameter, and we get an additional status code as
a result. Hurray \o/.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: also use libnotmuch.so.2
Sebastian Spaeth [Wed, 5 Oct 2011 13:46:03 +0000 (15:46 +0200)]
python: also use libnotmuch.so.2

Catch up with the major version bump. I wonder if this could somehow be
automatically made the correct version number. Oh well, I hope it
doesn't change too often :-).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agodebian: update packaging for new soname
David Bremner [Tue, 4 Oct 2011 17:01:21 +0000 (14:01 -0300)]
debian: update packaging for new soname

we need
   - a new changelog stanza, because the symbols files need a new version
   - s/libnotmuch1/libnotmuch2/ everywhere
   - update symbols file, s/.so.1/.so.2/, and bump minimum versions on changed
     symbols (although the latter is just documentation)

13 years agolib: bump SONAME
David Bremner [Tue, 4 Oct 2011 16:47:04 +0000 (13:47 -0300)]
lib: bump SONAME

Based on discussions with amdragon, tschwinge, and others on IRC, I concluded that

1) symbol versioning was probably overkill for libnotmuch
2) It was also probably GNU ld specific
3) Most importantly, nobody could tell me on short notice how exactly it works.

So since the change to the notmuch_database_find_message breaks the
previous ABI, we need to bump the SONAME.

13 years agoruby: Fix macros, use quoting
Ali Polatel [Tue, 4 Oct 2011 13:57:33 +0000 (16:57 +0300)]
ruby: Fix macros, use quoting

Fix Data_Get_Notmuch_* macro definitions broken by prev. commit
Adequate quoting for Data_Get_Notmuch_* macros
Remove duplicated RSTRING_PTR() macros, move it to defs.h

13 years agoruby: Really add wrappers for database_find_message*
Ali Polatel [Tue, 4 Oct 2011 13:48:34 +0000 (16:48 +0300)]
ruby: Really add wrappers for database_find_message*

Commit 898613116db746aa0f915ae43da8aba28545203d only added wrapper
functions but did not register them. Register the functions in module's
initialization function.

13 years agoruby: be consistent with notmuch's coding style
Ali Polatel [Tue, 4 Oct 2011 13:41:52 +0000 (16:41 +0300)]
ruby: be consistent with notmuch's coding style

No functional change, just indentation

13 years agoruby: Add wrappers for database_find_message*
Ali Polatel [Tue, 4 Oct 2011 13:06:20 +0000 (16:06 +0300)]
ruby: Add wrappers for database_find_message*

Two new wrappers:
Notmuch::Database.find_message(id) => Notmuch::Message or nil
Notmuch::Database.find_message_by_filename(path) => Notmuch::Message or nil

13 years agoMerge remote-tracking branch 'alip/find_message-v3'
David Bremner [Tue, 4 Oct 2011 10:35:40 +0000 (07:35 -0300)]
Merge remote-tracking branch 'alip/find_message-v3'

13 years agolib: make find_message{,by_filename) report errors
Ali Polatel [Tue, 4 Oct 2011 04:55:29 +0000 (07:55 +0300)]
lib: make find_message{,by_filename) report errors

Previously, the functions notmuch_database_find_message() and
notmuch_database_find_message_by_filename() functions did not properly
report error condition to the library user.

For more information, read the thread on the notmuch mailing list
starting with my mail "id:871uv2unfd.fsf@gmail.com"

Make these functions accept a pointer to 'notmuch_message_t' as argument
and return notmuch_status_t which may be used to check for any error
condition.

restore: Modify for the new notmuch_database_find_message()
new: Modify for the new notmuch_database_find_message_by_filename()

13 years agolib: destroy message object after message removal
Ali Polatel [Mon, 3 Oct 2011 20:27:32 +0000 (23:27 +0300)]
lib: destroy message object after message removal

notmuch_database_remove_message() must call notmuch_message_destroy()
once it is done handling message removal.

13 years agopython: fix Message.get_filenames()
Thomas Jost [Fri, 30 Sep 2011 10:16:47 +0000 (12:16 +0200)]
python: fix Message.get_filenames()

Previously, the Filenames generator only yielded *one* filename before
returning, making Message.get_filenames() behave as Message.get_filename(). This
commit fixes this incorrect behavior: now the generator yields all the
filenames, as expected.

13 years agopython: rework creating of Subclasses
Sebastian Spaeth [Fri, 30 Sep 2011 14:04:42 +0000 (16:04 +0200)]
python: rework creating of Subclasses

Add some smart magic, so that when we invoke a
NotmuchError(STATUSVALUE), a nicely derived subclass is created, e.g. a
OutOfMemoryError. This way users can easily distinguish between error
types, while still catching NotmuchError.

I have tested this, and hope it works for others too.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: provide more exception classes
Justus Winter [Mon, 26 Sep 2011 01:05:35 +0000 (03:05 +0200)]
python: provide more exception classes

To make the exception handling more effective in code using the
python bindings it is necessary to differentiate between the
different kind of failures.

Add an exception class for each status code and add a decode
classmethod to the NotmuchError class that acts as a factory.

Import the new classes in __init__.py so they can be easily
imported by anyone.

Patch modifed by Sebastian Spaeth.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: fix docstring of Message.get_header()
Justus Winter [Fri, 30 Sep 2011 01:05:04 +0000 (03:05 +0200)]
python: fix docstring of Message.get_header()

Update the docstring from notmuch.h.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: Add new functions in API documentation
Sebastian Spaeth [Thu, 29 Sep 2011 09:00:43 +0000 (11:00 +0200)]
python: Add new functions in API documentation

Add documentation for the three new functions and add in which version
they have been added.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: Improve code documentation
Sebastian Spaeth [Thu, 29 Sep 2011 08:47:28 +0000 (10:47 +0200)]
python: Improve code documentation

1) Fix added .gitignore from commit dc8a1745 to work on the docs folder
2) Improve in-code developer documentation to produce better
   sphinx-generated documentation. No code changes.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoNEWS: Note implementation bug for python binding
Sebastian Spaeth [Thu, 29 Sep 2011 07:55:14 +0000 (09:55 +0200)]
NEWS: Note implementation bug for python binding

Make note that find_message_by_name currently crashes the python process
if the Database is READ-ONLY. This should be fixed in the underlying
libnotmuch.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoNEWS: Update with python binding news
Sebastian Spaeth [Thu, 29 Sep 2011 07:51:42 +0000 (09:51 +0200)]
NEWS: Update with python binding news

List major changes.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoproperly raise exceptions in python bindings
Justus Winter [Sun, 25 Sep 2011 21:07:35 +0000 (23:07 +0200)]
properly raise exceptions in python bindings

There are various locations where exceptions are constructed but
not raised. This patch adds the necessary raise statements.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: raise a more specific error in Messages.print_messages
Justus Winter [Mon, 26 Sep 2011 01:05:37 +0000 (03:05 +0200)]
python: raise a more specific error in Messages.print_messages

Raising Exception is considered bad since the only way to catch
it is to do 'except Exception'. Raising a TypeError is more
appropriate.

Since the format parameter has already been validated, checking
it again is not necessary. Simplify this conditional.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: rename _verify_dir_initialized to _assert_dir_is_initialized
Justus Winter [Mon, 26 Sep 2011 01:05:34 +0000 (03:05 +0200)]
python: rename _verify_dir_initialized to _assert_dir_is_initialized

Rename the function to clarify its effect and remove all the comments
accompanying each call to the function.

Modified by Sebastian Spaeth to apply cleanly again and remove some
blank lines.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: rename _verify_initialized_db to _assert_db_is_initialized
Justus Winter [Mon, 26 Sep 2011 01:05:33 +0000 (03:05 +0200)]
python: rename _verify_initialized_db to _assert_db_is_initialized

Rename the function to clarify its effect and remove all the comments
accompanying each call to the function.

Modified slightly by Sebastian Spaeth to catch all new instances and
remove some blank lines too.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: fix NotmuchError.__str__ if status == None
Justus Winter [Mon, 26 Sep 2011 01:05:32 +0000 (03:05 +0200)]
python: fix NotmuchError.__str__ if status == None

Passing None to STATUS.status2str raises an ArgumentError. Add a
check for this case and provide a generic message.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: add status and message attributes to NotmuchError
Justus Winter [Mon, 26 Sep 2011 01:05:30 +0000 (03:05 +0200)]
python: add status and message attributes to NotmuchError

Providing exception objects with meaningful attribute names
is much nicer than using e.args[].

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: add a .gitignore file and refine the toplevel one
Justus Winter [Mon, 26 Sep 2011 01:05:29 +0000 (03:05 +0200)]
python: add a .gitignore file and refine the toplevel one

The line 'notmuch' in the toplevel .gitignore file is to broad
and matches bindings/python/notmuch making it cumbersome to
git-add files within that directory.

Refine the toplevel file to only match the generated notmuch
executable and add a more specialized .gitignore file to the
python directory.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: add begin|end_atomic bindings
Sebastian Spaeth [Wed, 28 Sep 2011 15:50:57 +0000 (17:50 +0200)]
python: add begin|end_atomic bindings

* Add UNBALANCED_ATOMIC status code
  Catch up with the notmuch status codes, and add the UNBALANCED_ATOMIC
  one.
* Add the begin_atomic and end_atomic calls to libnotmuch

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: Add database_find_message_by_filename bindings
Sebastian Spaeth [Wed, 28 Sep 2011 16:27:44 +0000 (18:27 +0200)]
python: Add database_find_message_by_filename bindings

Add it :-)

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoNEWS: add item for python bindings.
David Bremner [Mon, 26 Sep 2011 23:27:42 +0000 (20:27 -0300)]
NEWS: add item for python bindings.

Just the one unicode related change this release.

13 years agoNEWS: add item for Ruby bindings.
David Bremner [Mon, 26 Sep 2011 23:23:23 +0000 (20:23 -0300)]
NEWS: add item for Ruby bindings.

This is based on a quick scan of git log.

13 years agoNEWS: start release notes for 0.9
David Bremner [Mon, 26 Sep 2011 23:18:55 +0000 (20:18 -0300)]
NEWS: start release notes for 0.9

Thanks to Austin Clements for providing these notes, and the patches
they describe.

13 years agodebian: add brief summary of changes since 0.8 0.9_rc1 debian/0.9_rc1-1
David Bremner [Sun, 25 Sep 2011 14:27:03 +0000 (11:27 -0300)]
debian: add brief summary of changes since 0.8

13 years agodebian: build-depend on gdb
David Bremner [Sun, 25 Sep 2011 14:16:06 +0000 (11:16 -0300)]
debian: build-depend on gdb

This is needed to enable the atomicity tests at build time.

13 years agotest/atomicity: redirect output from "which"
David Bremner [Sun, 25 Sep 2011 12:12:48 +0000 (09:12 -0300)]
test/atomicity: redirect output from "which"

Without redirection, this produced some slightly confusing output in
case gdb was present.

13 years agodebian: close bug 642240
David Bremner [Sun, 25 Sep 2011 02:15:01 +0000 (23:15 -0300)]
debian: close bug 642240

The bug was really closed by the commit that updated the dependency,
of course.

13 years agotest: make atomicity setup conditional on gdb being present.
David Bremner [Sun, 25 Sep 2011 01:45:33 +0000 (22:45 -0300)]
test: make atomicity setup conditional on gdb being present.

The setup is useless if gdb is not present, so it doesn't hurt to skip
it.  The diff here is huge, but the commit is really just moving most
of the script inside the initial if, and adding an else block to print
a warning.

13 years agolib: bump library minor version because of new symbols.
David Bremner [Sat, 24 Sep 2011 19:13:49 +0000 (16:13 -0300)]
lib: bump library minor version because of new symbols.

This bump is because of the new symbols introduced by the atomicity
patches.

13 years agodebian: set versioned dependency on notmuch for notmuch-emacs
David Bremner [Sat, 24 Sep 2011 18:37:27 +0000 (14:37 -0400)]
debian: set versioned dependency on notmuch for notmuch-emacs

As long as we have no version information in the json output, this
seems like the only possible way of ensuring that the emacs client
code understands the output from the command line tool notmuch.

13 years agoversion: bump to 0.9~rc1
David Bremner [Sat, 24 Sep 2011 16:19:32 +0000 (12:19 -0400)]
version: bump to 0.9~rc1

This version number change should not be taken as definitive, rather
refer to the signed tag.

13 years agodebian: changlog stanza for release candidate
David Bremner [Sat, 24 Sep 2011 16:15:47 +0000 (12:15 -0400)]
debian: changlog stanza for release candidate

13 years agodebian: new symbols for atomicity api
David Bremner [Sat, 24 Sep 2011 18:17:44 +0000 (14:17 -0400)]
debian: new symbols for atomicity api

There are three new symbols in libnotmuch. In addition to notmuch_{begin,end)_atomic,
notmuch_database_find_message_by_filename was exposed.

13 years agolib: Improve notmuch_database_{add,remove}_message documentation.
Austin Clements [Sat, 11 Jun 2011 19:34:11 +0000 (15:34 -0400)]
lib: Improve notmuch_database_{add,remove}_message documentation.

State up front that these functions may add a filename to an existing
message or remove only a filename (and not the message), respectively.
Previously, this key information was buried in return value
documentation or in "notes", which made it seem secondary to these
functions' semantics.

13 years agonew: Wrap adding and removing messages in atomic sections.
Austin Clements [Sat, 29 Jan 2011 16:25:56 +0000 (11:25 -0500)]
new: Wrap adding and removing messages in atomic sections.

This addresses atomicity of tag synchronization, the last atomicity
problems in notmuch new.  Each message add or remove is wrapped in its
own atomic section, so interrupting notmuch new doesn't lose progress.

13 years agonew: Synchronize maildir flags eagerly.
Austin Clements [Fri, 28 Jan 2011 01:51:04 +0000 (20:51 -0500)]
new: Synchronize maildir flags eagerly.

Because flag synchronization is stateless, it can be performed at any
time as long as it's guaranteed to be performed after any change to a
message's filename list.  Take advantage of this to synchronize tags
immediately after a filename is added or removed.

This does not yet make adding or removing a message atomic, but it is
a big step toward atomicity because it reduces the window where the
database tags are inconsistent from nearly the entire notmuch-new to
just around when the message is added or removed.

13 years agonew: Cleanup. De-duplicate file name removal code.
Austin Clements [Sun, 6 Feb 2011 09:28:01 +0000 (04:28 -0500)]
new: Cleanup.  De-duplicate file name removal code.

Previously, file name removal was implemented identically in two
places.  Now it's captured in one function.

This is important because file name removal is about to get slightly
more complicated with eager tag synchronization and correct removal
atomicity.

13 years agonew: Cleanup. Put removed/renamed message count in add_files_state_t.
Austin Clements [Sat, 11 Jun 2011 16:54:05 +0000 (12:54 -0400)]
new: Cleanup.  Put removed/renamed message count in add_files_state_t.

Previously, pointers to these variables were passed around
individually.  This was okay when only one function needed them, but
we're about to need them in a few more places.

13 years agolib: Wrap notmuch_database_add_message in an atomic section.
Austin Clements [Sat, 11 Jun 2011 04:42:58 +0000 (00:42 -0400)]
lib: Wrap notmuch_database_add_message in an atomic section.

Adding a message may involve changes to multiple database documents,
and thus needs to be done in a transaction.  This makes add_message
(and, I think, the whole library) atomicity-safe: library callers only
needs to use atomic sections if they needs atomicity across multiple
library calls.

13 years agolib: Add an API to find a message by filename.
Austin Clements [Sat, 11 Jun 2011 04:19:31 +0000 (00:19 -0400)]
lib: Add an API to find a message by filename.

notmuch_database_find_message_by_filename is mostly stolen from
notmuch_database_remove_message, so this patch also vastly simplfies
the latter using the former.

This API is also useful in its own right and will be used in a later
patch for eager maildir flag synchronization.

13 years agoruby: New exception Notmuch::UnbalancedAtomicError
Ali Polatel [Sat, 24 Sep 2011 12:54:45 +0000 (15:54 +0300)]
ruby: New exception Notmuch::UnbalancedAtomicError

This exception wraps NOTMUCH_STATUS_UNBALANCED_ATOMIC which was added
with the commit e59cc0031fbf84f49e32dedb9927f427d2c49309.

13 years agoruby: Wrap notmuch_database_{begin,end}_atomic
Ali Polatel [Sat, 24 Sep 2011 12:43:43 +0000 (15:43 +0300)]
ruby: Wrap notmuch_database_{begin,end}_atomic

Adding ruby wrappers for functions:
- notmuch_database_begin_atomic()
- notmuch_database_end_atomic()
added by 957f1ba3fc1d737887029ff1787fc6bea94de00b

New functions:
Notmuch::Database.begin_atomic()
Notmuch::Database.end_atomic()

13 years agoruby: Rename destroy to destroy!
Ali Polatel [Sat, 24 Sep 2011 12:25:24 +0000 (15:25 +0300)]
ruby: Rename destroy to destroy!

According to the common Ruby function naming convention, potentially
dangerous functions or functions which operate on the object itself are
suffixed with an exclamation mark. Both of these are true for object
destroying functions.

The following modules are affected:
- Notmuch::Directory
- Notmuch::FileNames
- Notmuch::Query
- Notmuch::Threads
- Notmuch::Thread
- Notmuch::Messages
- Notmuch::Message
- Notmuch::Tags

13 years agolib: Remove message document directly after removing the last file name.
Austin Clements [Sat, 11 Jun 2011 04:07:54 +0000 (00:07 -0400)]
lib: Remove message document directly after removing the last file name.

Previously, notmuch_database_remove_message would remove the message
file name, sync the change to the message document, re-find the
message document, and then delete it if there were no more file names.
An interruption after sync'ing would result in a file-name-less,
permanently un-removable zombie message that would produce errors and
odd results in searches.  We could wrap this in an atomic section, but
it's much simpler to eliminate the round-about approach and just
delete the message document instead of sync'ing it if we removed the
last filename.

13 years agolib: Indicate if there are more filenames after removal.
Austin Clements [Sun, 6 Feb 2011 09:17:49 +0000 (04:17 -0500)]
lib: Indicate if there are more filenames after removal.

Make _notmuch_message_remove_filename return
NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID if the message has more filenames
and fix callers to handle this.

13 years agolib: Add support for nested atomic sections.
Austin Clements [Sat, 11 Jun 2011 03:35:06 +0000 (23:35 -0400)]
lib: Add support for nested atomic sections.

notmuch_database_t now keeps a nesting count and we only start a
transaction or commit for the outermost atomic section.

Introduces a new error, NOTMUCH_STATUS_UNBALANCED_ATOMIC.

13 years agolib: Add notmuch_database_{begin,end}_atomic.
Austin Clements [Sat, 29 Jan 2011 16:25:24 +0000 (11:25 -0500)]
lib: Add notmuch_database_{begin,end}_atomic.

These operations translate into non-flushed Xapian transactions,
allowing arbitrary groups of database operations to be performed
atomically.

13 years agonew: Defer updating directory mtimes until the end.
Austin Clements [Tue, 8 Feb 2011 23:24:33 +0000 (18:24 -0500)]
new: Defer updating directory mtimes until the end.

Previously, if notmuch new were interrupted between updating the
directory mtime and handling removals from that directory, a
subsequent notmuch new would not handle those removals until something
else changed in that directory.  This defers recording the updated
mtime until after removals are handled to eliminate this problem.

13 years agopython: Ensure that we pass utf-8 encoded string to libnotmuch
Martin Owens [Fri, 16 Sep 2011 11:19:14 +0000 (13:19 +0200)]
python: Ensure that we pass utf-8 encoded string to libnotmuch

If we use unicode objects, libnotmuch would not cope with null bytes in
the byte array, so we need to make sure they are nicely formatted as
utf-8.

Introduce a helper function _str which does this throughout the code.

Patch slightly modified by Sebastian Spaeth.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agonew: Don't lose messages on SIGINT.
Austin Clements [Wed, 9 Feb 2011 01:56:31 +0000 (20:56 -0500)]
new: Don't lose messages on SIGINT.

Previously, message removals were always performed, even after a
SIGINT.  As a result, when a message was moved from one folder to
another, a SIGINT between processing the directory the message was
removed from and processing the directory it was added to would result
in notmuch removing that message from the database.

13 years agotest: use test_expect_equal_file in atomicity
David Bremner [Tue, 13 Sep 2011 12:31:46 +0000 (09:31 -0300)]
test: use test_expect_equal_file in atomicity

The documentation claims this is more robust, and it seems to work
fine to switch to the _file variant.

13 years agotest: Convert atomicity test to use test_subtest_known_broken
David Bremner [Sat, 10 Sep 2011 22:02:34 +0000 (19:02 -0300)]
test: Convert atomicity test to use test_subtest_known_broken

This is required because test_expect_equal_failure went away.

13 years agotest: Test atomicity of notmuch new.
Austin Clements [Fri, 28 Jan 2011 18:03:24 +0000 (13:03 -0500)]
test: Test atomicity of notmuch new.

This tests notmuch new's ability to recover from arbitrary stopping
failures.  It interrupts notmuch new after every database commit and,
on every resulting database snapshot, re-runs notmuch new to
completion and checks that the final database state is invariant.

13 years agolib: Add missing status check in _notmuch_message_remove_filename.
Austin Clements [Fri, 10 Jun 2011 19:58:18 +0000 (15:58 -0400)]
lib: Add missing status check in _notmuch_message_remove_filename.

Previously, this function would synchronize the folder list even if
removing the file name failed.  Now it returns immediately if removing
the file name fails.

13 years agotest: Report test failures from test_expect_*
Austin Clements [Thu, 12 May 2011 13:11:36 +0000 (09:11 -0400)]
test: Report test failures from test_expect_*

This makes test_expect_* return non-zero if the test fails, so the
caller can make decisions based on this, such as setting test
prerequisites.

13 years agotest: Fix message when skipping test_expect_equal* tests
Austin Clements [Thu, 12 May 2011 13:09:06 +0000 (09:09 -0400)]
test: Fix message when skipping test_expect_equal* tests

For these types of tests, the test name is previously recorded in a
variable, not passed to the test function, so pass this variable to
test_skip.

13 years agotest: reset test_subtest_known_broken_ after each success/failure.
David Bremner [Tue, 13 Sep 2011 01:40:57 +0000 (22:40 -0300)]
test: reset test_subtest_known_broken_ after each success/failure.

This means that test_subtest_known_broken needs to be called before
every known broken subtest, which is no different than what is
documented for the test_begin_subtest case.

The assumption is that every test ends up calling either skipping,
calling test_ok_ or test_failure_ and and the latter in turn delegate
to the known_broken versions in the case where
test_subtest_known_broken_ is set.

13 years agoAdd missing call to g_type_init()
Aaron Ecay [Mon, 25 Jul 2011 23:38:58 +0000 (19:38 -0400)]
Add missing call to g_type_init()

The Glib docs state "Prior to any use of the type system, g_type_init() has to
be called".[1] To not do so can lead to segfaults.  The g_type system is
currently used by various "filters" that operate on uuencoded text, message
headers, etc.

[1] http://developer.gnome.org/gobject/2.28/gobject-Type-Information.html#g-type-init

13 years agotest: mark multipart rfc822 part test as broken
David Bremner [Sat, 10 Sep 2011 18:00:17 +0000 (15:00 -0300)]
test: mark multipart rfc822 part test as broken

Using the new test_subtest_known_broken support thanks to Dmitry
Kurochkin.  This makes the output less scary until we can fix the
underlying problems.

13 years agotest: remove documentation for test_expect_equal_failure.
David Bremner [Sat, 10 Sep 2011 17:54:56 +0000 (14:54 -0300)]
test: remove documentation for test_expect_equal_failure.

The actual function was deleted in commit 4cc67276

13 years agotest: add emacs test for hiding a message following an HTML part
Dmitry Kurochkin [Mon, 4 Jul 2011 04:07:21 +0000 (08:07 +0400)]
test: add emacs test for hiding a message following an HTML part

Human-friendly scenario:

* open a thread where a message which ends with an HTML part is
  followed by another message

* make the first message visible

* goto the beginning of the second message (first line, first colon)

* hit "RET"

Result: nothing happens except for "No URL at point" message

Expected result: the second message is shown/hidden

The root cause is that the HTML part has `keymap' text property set.
In particular, "RET" is bound to visit a URL at point.  The problem is
that `keymap' property affects the next character following the region
it is set to (see elisp manual [1]).  Hence, the first character of
the next message has a keymap inherited from the HTML part.

[1] http://www.gnu.org/software/emacs/elisp/html_node/Special-Properties.html

13 years agotest: improve known broken tests support
Dmitry Kurochkin [Mon, 4 Jul 2011 04:07:20 +0000 (08:07 +0400)]
test: improve known broken tests support

There is existing support for broken tests.  But it is not convenient
to use.  The primary issue is that we have to maintain a set of
test_expect_*_failure functions which are equivalent to the normal
test_expect_* counterparts except for what functions are called for
result reporting.  The patch adds test_subtest_known_broken function
which marks a subset as broken, making the normal test_expect_*
functions behave as test_expect_*_failure.  All test_expect_*_failure
functions are removed.  Test_known_broken_failure_ is changed to
format details the same way as test_failure_ does.

Another benefit of this change is that the diff when a broken test is
fixed would be small and nice.

Documentation is updated accordingly.

13 years agotest: update documentation for test_emacs in test/README
Dmitry Kurochkin [Mon, 4 Jul 2011 04:07:19 +0000 (08:07 +0400)]
test: update documentation for test_emacs in test/README

Update test_emacs documentation in test/README according to the latest
changes in emacs tests.  Move the note regarding setting variables
from test/emacs to test/README.

13 years agoMerge branch 'release'
David Bremner [Sat, 10 Sep 2011 13:11:25 +0000 (10:11 -0300)]
Merge branch 'release'

13 years agoupdate date in NEWS to better approximate real release date for 0.8 0.8
David Bremner [Sat, 10 Sep 2011 12:00:40 +0000 (09:00 -0300)]
update date in NEWS to better approximate real release date for 0.8

13 years agodebian: update changelog for 0.8
David Bremner [Sat, 10 Sep 2011 11:57:43 +0000 (08:57 -0300)]
debian: update changelog for 0.8

13 years agoupdate versions for release 0.8
David Bremner [Sat, 10 Sep 2011 11:55:33 +0000 (08:55 -0300)]
update versions for release 0.8

See commit 6979b65 for more discussion.

13 years agoNEWS: add blurb for python bindings changes
David Bremner [Sat, 10 Sep 2011 11:52:22 +0000 (08:52 -0300)]
NEWS: add blurb for python bindings changes

13 years agoadd news item for ruby
David Bremner [Fri, 9 Sep 2011 13:56:49 +0000 (10:56 -0300)]
add news item for ruby

13 years agoNEWS: add item for build system fixes
David Bremner [Thu, 8 Sep 2011 10:54:10 +0000 (07:54 -0300)]
NEWS: add item for build system fixes

Sed was POSIXed and use of nm dumbed down, replaced by awk hackery.

13 years agoDo not attempt to output part raw if part is not GMimePart.
Jameson Graef Rollins [Fri, 3 Jun 2011 17:01:06 +0000 (10:01 -0700)]
Do not attempt to output part raw if part is not GMimePart.

This was a minor oversite in checking of part type when outputing
content raw.  This was causing gmime was to throw an exception to
stderr.

Unfortunately the gmime exception was not being caught by notmuch, or
the test suite.  I'm not sure if notmuch should have done anything in
this case, but certainly the test suite should be capable of detecting
that something unexpected was output to stderr.

13 years agoupdate versions for release candidate 0.8_rc1
David Bremner [Wed, 7 Sep 2011 01:34:02 +0000 (22:34 -0300)]
update versions for release candidate

we now have three files to keep in sync. That seems wrong, but I guess
we will live with it for now.

The main problem is that the python code is distributed separately, so
it can't get the version from 'version'.

The choice ~rcX is for convenience with debian versioning.

13 years agoAdd NEWS item output improvements to rfc822 part handling.
Jameson Graef Rollins [Tue, 6 Sep 2011 07:17:30 +0000 (00:17 -0700)]
Add NEWS item output improvements to rfc822 part handling.