notmuch.git
13 years agotest: add tests for hooks
Jani Nikula [Thu, 8 Dec 2011 22:48:31 +0000 (00:48 +0200)]
test: add tests for hooks

Signed-off-by: Jani Nikula <jani@nikula.org>
13 years agocli: add support for pre and post notmuch new hooks
Jani Nikula [Thu, 8 Dec 2011 22:48:30 +0000 (00:48 +0200)]
cli: add support for pre and post notmuch new hooks

Run notmuch new pre and post hooks, named "pre-new" and "post-new", if
present in the notmuch hooks directory. The hooks will be run before and
after incorporating new messages to the database.

Typical use cases for pre-new and post-new hooks are fetching or delivering
new mail to the maildir, and custom tagging of the mail incorporated to the
database.

Also add command line option --no-hooks to notmuch new to bypass the hooks.

Signed-off-by: Jani Nikula <jani@nikula.org>
13 years agocli: introduce the concept of user defined hooks
Jani Nikula [Thu, 8 Dec 2011 22:48:29 +0000 (00:48 +0200)]
cli: introduce the concept of user defined hooks

Add mechanism for running user defined hooks. Hooks are executables or
symlinks to executables stored under the new notmuch hooks directory,
<database-path>/.notmuch/hooks.

No hooks are introduced here, but adding support for a hook is now a simple
matter of calling the new notmuch_run_hook() function at an appropriate
location with the hook name.

Signed-off-by: Jani Nikula <jani@nikula.org>
13 years agotest: use python2 instead of python if available
Thomas Jost [Wed, 7 Dec 2011 09:46:18 +0000 (10:46 +0100)]
test: use python2 instead of python if available

Some distros (Arch Linux) ship Python as python2 and Python 3 as python.
Checking for python2 is necessary for the Python tests to work on these
platforms.

13 years agotest: add a function to run Python tests
Thomas Jost [Wed, 7 Dec 2011 09:46:17 +0000 (10:46 +0100)]
test: add a function to run Python tests

The new test_python() function makes writing Python tests a little easier:
- it sets the environment variables as needed
- it redirects stdout to the OUTPUT file (like test_emacs()).

This commit also declares python as an external prereq.

The stdout redirection is required to avoid trouble when running commands like
"python 'script' | sort > OUTPUT": in such a case, any error due to a missing
external prereq would be "swallowed" by sort, resulting to a failed test instead
of a skipped one.

13 years agoRelease memory allocated by internet_address_list_parse_string()
Tomi Ollila [Sat, 10 Dec 2011 10:18:54 +0000 (12:18 +0200)]
Release memory allocated by internet_address_list_parse_string()

g_object_unref() releases the memory of the InternetAddressList object
returned by internet_address_list_parse_string() -- when last (only)
reference is released, internet_address_list_finalize() will do cleanup.

13 years agotest: cleanup gdb external dependency in atomicity tests
Dmitry Kurochkin [Thu, 1 Dec 2011 22:02:46 +0000 (02:02 +0400)]
test: cleanup gdb external dependency in atomicity tests

Change atomicity tests to use the new external binary dependencies.
This simplifies the code and makes output consistent.

13 years agonotmuch-search: convert to command-line-arguments
David Bremner [Sun, 4 Dec 2011 15:26:22 +0000 (11:26 -0400)]
notmuch-search: convert to command-line-arguments

The switch on format_sel is slightly clunky, but it doesn't seem worth
special casing argument processing for function pointers, when I think
the function pointer approach will be modified/abandoned.

13 years agonotmuch-restore: convert to command-line-arguments
David Bremner [Sun, 4 Dec 2011 02:10:50 +0000 (21:10 -0500)]
notmuch-restore: convert to command-line-arguments

The new argument handling is a bit more concise, and bit more
flexible.  It allows the input file name to go before the --accumulate
option.

13 years agonotmuch-dump: convert to command-line-arguments
David Bremner [Fri, 2 Dec 2011 06:08:51 +0000 (22:08 -0800)]
notmuch-dump: convert to command-line-arguments

The output file is handled via positional arguments. There are
currently no "normal" options.

13 years agotest: tests for command-line-arguments.c
David Bremner [Wed, 7 Dec 2011 18:37:13 +0000 (14:37 -0400)]
test: tests for command-line-arguments.c

This was needed because no current notmuch code exercises the
NOTMUCH_OPT_STRING style arguments.

13 years agocommand-line-arguments.[ch]: new argument parsing framework for notmuch.
David Bremner [Thu, 1 Dec 2011 00:27:26 +0000 (16:27 -0800)]
command-line-arguments.[ch]: new argument parsing framework for notmuch.

As we noticed when Jani kindly converted things to getopt_long, much
of the work in argument parsing in notmuch is due to the the key-value
style arguments like --format=(raw|json|text).

The framework here provides positional arguments, simple switches,
and --key=value style arguments that can take a value being an integer,
a string, or one of a set of keywords.

13 years agojson: date_relative for threads
pazz [Sat, 23 Jul 2011 09:54:04 +0000 (10:54 +0100)]
json: date_relative for threads

include the date_relative field in the
json formated output of notmuch search

13 years agotest: date_relative in notmuch search json output
pazz [Sat, 23 Jul 2011 09:54:03 +0000 (10:54 +0100)]
test: date_relative in notmuch search json output

expect the date_relative field for thread entries
in notmuch search's json output

note from Commiter: we don't have to worry about the date changing
because the date in question is more than 180 days old.

13 years agoemacs: do not call notmuch show for non-inlinable parts
Dmitry Kurochkin [Tue, 29 Nov 2011 21:19:54 +0000 (01:19 +0400)]
emacs: do not call notmuch show for non-inlinable parts

Before the change, there was a workaround to avoid notmuch show calls
for parts with application/* Content-Type.  But non-inlinable parts
are not limited to this Content-Type (e.g. mp3 files have audio/mpeg
Content-Type and are not inlinable).  For such parts
`notmuch-show-insert-part-*/*' handler is called which unconditionally
fetches contents for all parts.

The patch moves content fetching from `notmuch-show-insert-part-*/*'
to `notmuch-show-mm-display-part-inline' function after MIME inlinable
checks are done to avoid useless notmuch show calls.  The
application/* hack is no longer needed and removed.

13 years agotest: check that Emacs UI does not call notmuch for non-inlinable parts
Dmitry Kurochkin [Tue, 29 Nov 2011 21:19:53 +0000 (01:19 +0400)]
test: check that Emacs UI does not call notmuch for non-inlinable parts

The patch adds two new test cases:

* Do not call notmuch for non-inlinable application/mpeg parts
* Do not call notmuch for non-inlinable audio/mpeg parts

The application/mpeg test passes thanks to a workaround for
application/* Content-Types.  The audio/mpeg is currently broken.

13 years agotest: add functions to count how much times notmuch was called
Dmitry Kurochkin [Tue, 29 Nov 2011 21:19:52 +0000 (01:19 +0400)]
test: add functions to count how much times notmuch was called

The patch adds two auxiliary functions and a variable:

  notmuch_counter_reset
  $notmuch_counter_command
  notmuch_counter_value

They allow to count how many times notmuch binary is called.
notmuch_counter_reset() function generates a script that counts how
many times it is called and resets the counter to zero.  The function
sets $notmuch_counter_command variable to the path to the generated
script that should be called instead of notmuch to do the counting.
The notmuch_counter_value() function returns the current counter
value.

13 years agoemacs: remove unused variable in `notmuch-show-insert-part-message/rfc822'
Dmitry Kurochkin [Fri, 25 Nov 2011 22:23:31 +0000 (02:23 +0400)]
emacs: remove unused variable in `notmuch-show-insert-part-message/rfc822'

An obvious cleanup.  I wonder why there was no warning about this
during compilation.

13 years agoemacs: remove some code duplication in notmuch-show
Dmitry Kurochkin [Fri, 25 Nov 2011 22:23:30 +0000 (02:23 +0400)]
emacs: remove some code duplication in notmuch-show

Add optional props argument to `notmuch-show-get-header'.  Use it to
get headers in `notmuch-show-insert-part-multipart/signed' and
`notmuch-show-insert-part-multipart/encrypted'.

13 years agotest/symbol-hiding: compare exported symbols with existing one
David Bremner [Tue, 29 Nov 2011 06:51:16 +0000 (22:51 -0800)]
test/symbol-hiding: compare exported symbols with existing one

We assume that any symbol starting with notmuch_ in lib/*.o should be
exported, and that only those symbols should be exported.

13 years agotest/symbol-hiding: add some whitespace between tests
David Bremner [Tue, 29 Nov 2011 06:51:15 +0000 (22:51 -0800)]
test/symbol-hiding: add some whitespace between tests

This is in preparation for adding a third test to this file

13 years agoMerge branch 'release'
David Bremner [Tue, 6 Dec 2011 23:39:33 +0000 (19:39 -0400)]
Merge branch 'release'

Conflicts:
NEWS

Conflicts resolved by inserting the 0.10.2 stanza before 0.11

13 years agofix format string in Message.__unicode__
Patrick Totzke [Tue, 6 Dec 2011 20:22:43 +0000 (20:22 +0000)]
fix format string in Message.__unicode__

Since 2b0116119160f2dc83, Message.__str__ doesn't
construct a hash containing the thread data before
constructing the formatstring. This changes the formatstring
to accept positional parameters instead of a hash.

13 years agocontrib/.gitattributes: remove
David Bremner [Tue, 6 Dec 2011 15:20:57 +0000 (11:20 -0400)]
contrib/.gitattributes: remove

Now that licensing of notmuch-deliver has been harmonized with
notmuch, there is no reason not to export it.

13 years agonotmuch-deliver: GPL-3+
Ali Polatel [Tue, 6 Dec 2011 15:06:30 +0000 (17:06 +0200)]
notmuch-deliver: GPL-3+

13 years agonotmuch-deliver: Import from maildrop-2.5.5
Ali Polatel [Tue, 6 Dec 2011 14:41:33 +0000 (16:41 +0200)]
notmuch-deliver: Import from maildrop-2.5.5

maildrop-2.5.5 is GPL-3.
No change in functionality, just a precaution before relicensing.

13 years agomake release: remove LATEST-$(PACKAGE)-*
Tomi Ollila [Mon, 5 Dec 2011 11:39:32 +0000 (13:39 +0200)]
make release: remove LATEST-$(PACKAGE)-*

The tar file of particular package (notmuch in this case) is named
as $(PACKAGE)-$(VERSION).tar.gz. Therefore the best way to remove
previous link to LATEST is to remove all files beginning with
LATEST-$(PACKAGE)- and not relying how $(VERSION) string is constructed.

13 years agohave LATEST-notmuch-<version>.tar.gz on releases web page
Tomi Ollila [Thu, 24 Nov 2011 20:41:01 +0000 (22:41 +0200)]
have LATEST-notmuch-<version>.tar.gz on releases web page

The notmuchmail/releases page used to have LATEST-notmuch-<version>
to link to the latest notmuch source tarball. This is confusing on
web page and on disk when the file has been downloaded. This change
looks a bit inconsistent with the 'rm' command just executed before.
$(TAR_FILE) is defined (currently) as $(PACKAGE)-$(VERSION).tar.gz;
as long as the prefix stays $(PACKAGE)-$(VERSION) and version begins
with a digit then this line is good in execution point of view.

13 years agotest: add test-binaries target
David Bremner [Sat, 3 Dec 2011 22:05:08 +0000 (14:05 -0800)]
test: add test-binaries target

The goal here is to have a simple way of making sure all of the
binaries needed to run tests are available.

13 years agopython: Remove stray debug comment
Sebastian Spaeth [Tue, 6 Dec 2011 12:36:48 +0000 (13:36 +0100)]
python: Remove stray debug comment

This slipped in wrongly in commit 71e0082eff (due to my fault).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: use wrapped notmuch_*_t types instead of raw pointers
Thomas Jost [Tue, 6 Dec 2011 10:03:22 +0000 (11:03 +0100)]
python: use wrapped notmuch_*_t types instead of raw pointers

Now that types are checked correctly, we also need to make sure that all the
arguments actually are instances of these types. Otherwise the function calls
will fail and raise an exception similar to this one:
   ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: expected
   LP_LP_NotmuchMessageS instance instead of pointer to c_void_p

13 years agoerrors='ignore' when decode to unicode
Patrick Totzke [Mon, 5 Dec 2011 20:45:27 +0000 (20:45 +0000)]
errors='ignore' when decode to unicode

13 years agouse __unicode__ for string representation
Patrick Totzke [Mon, 5 Dec 2011 22:51:10 +0000 (22:51 +0000)]
use __unicode__ for string representation

13 years agoclean up Thread.__str__
Patrick Totzke [Mon, 5 Dec 2011 21:19:27 +0000 (21:19 +0000)]
clean up Thread.__str__

13 years agopython: Return a STATUS value in tags_to_flags and flags_to_tags
Sebastian Spaeth [Tue, 6 Dec 2011 11:38:52 +0000 (12:38 +0100)]
python: Return a STATUS value in tags_to_flags and flags_to_tags

We were not returning anything at all, which does not match the API
documentation. Fixed. Thanks to Patrick Totzke for the heads up.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoremove unused imports
Patrick Totzke [Mon, 5 Dec 2011 21:12:34 +0000 (21:12 +0000)]
remove unused imports

13 years agofix sphinx compile-time warnings
Patrick Totzke [Mon, 5 Dec 2011 21:12:35 +0000 (21:12 +0000)]
fix sphinx compile-time warnings

no changes to the code, only makes compiling the docs smoother
as some rsT syntax errors were fixed

13 years agopep8 fixes
Patrick Totzke [Mon, 5 Dec 2011 21:12:33 +0000 (21:12 +0000)]
pep8 fixes

no changes to the code, only fixed stuff denounced by `pep8 *py`

13 years agotest/python: set LD_LIBRARY_PATH and PYTHONPATH to use local notmuch 0.10.2 debian/0.10.2-1
David Bremner [Tue, 6 Dec 2011 03:06:50 +0000 (23:06 -0400)]
test/python: set LD_LIBRARY_PATH and PYTHONPATH to use local notmuch

Possibly this should be factored out into some kind of "run_python"
function.

13 years agobuild system: allow decreasing debian versions for debian-snapshot
David Bremner [Tue, 6 Dec 2011 02:27:08 +0000 (22:27 -0400)]
build system: allow decreasing debian versions for debian-snapshot

This allows the debian-snapshot to continue working between when
debian/changelog is updated and when the release is tagged.

13 years agoNEWS: add news for 0.10.2
David Bremner [Mon, 5 Dec 2011 02:14:12 +0000 (22:14 -0400)]
NEWS: add news for 0.10.2

13 years agofixup for changelog
David Bremner [Tue, 6 Dec 2011 02:03:38 +0000 (22:03 -0400)]
fixup for changelog

13 years agodebian/changelog: add new changelog stanza for 0.10.2
David Bremner [Mon, 5 Dec 2011 02:08:40 +0000 (22:08 -0400)]
debian/changelog: add new changelog stanza for 0.10.2

13 years agoversion: bump for bugfix release 0.10.2
David Bremner [Mon, 5 Dec 2011 02:03:04 +0000 (22:03 -0400)]
version: bump for bugfix release 0.10.2

13 years agotest: add tests for python bindings
David Bremner [Mon, 5 Dec 2011 01:50:08 +0000 (21:50 -0400)]
test: add tests for python bindings

We start modestly, with a (slightly modified) test case from Kazuo
Teramoto. Originally it just made sure the bindings didn't crash; here
we check that by comparing the output with that of notmuch search.

13 years agolib: call g_type_init from notmuch_database_open
David Bremner [Sun, 4 Dec 2011 19:20:39 +0000 (15:20 -0400)]
lib: call g_type_init from notmuch_database_open

We want to make sure g_type_init is called before any GObject
functionality is used.

13 years agonotmuch-dump.c: whitespace cleanup
David Bremner [Sat, 3 Dec 2011 22:32:18 +0000 (14:32 -0800)]
notmuch-dump.c: whitespace cleanup

13 years agopython: annotate all calls into libnotmuch with types
Justus Winter [Sun, 9 Oct 2011 22:12:54 +0000 (00:12 +0200)]
python: annotate all calls into libnotmuch with types

Add type information to the ctypes._FuncPtr wrappers and
use the wrapper classes instead of c_void_p for pointers
to notmuch_*_t.

This enables the ctypes library to type check parameters
being handed to functions from the notmuch library.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: add classes to wrap all notmuch_*_t types
Justus Winter [Sun, 9 Oct 2011 22:12:53 +0000 (00:12 +0200)]
python: add classes to wrap all notmuch_*_t types

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agotest: fix error messages for missing binary dependencies
Dmitry Kurochkin [Mon, 28 Nov 2011 22:41:07 +0000 (02:41 +0400)]
test: fix error messages for missing binary dependencies

The fake missing binary functions check if the binary has already be
added to the diagnostic message to avoid duplicates.  Unfortunately,
this check was buggy because the message string does not have the
trailing space.

13 years agotest: fix spurious output from missing external binaries functions
Dmitry Kurochkin [Mon, 28 Nov 2011 22:41:06 +0000 (02:41 +0400)]
test: fix spurious output from missing external binaries functions

The grep(1) command used in the fake binary functions was missing the
quiet option.

13 years agotest: add missing escape backslash in test_declare_external_prereq()
Dmitry Kurochkin [Mon, 28 Nov 2011 22:41:05 +0000 (02:41 +0400)]
test: add missing escape backslash in test_declare_external_prereq()

13 years agotest: fix test_require_external_prereq()
Dmitry Kurochkin [Mon, 28 Nov 2011 22:41:04 +0000 (02:41 +0400)]
test: fix test_require_external_prereq()

test_missing_external_prereq_${binary}_ variable indicates that the
binary is missing.  It must be set in test_declare_external_prereq()
outside of the fake $binary() function.

13 years agoemacs: Use notmuch-command variable in process-lines.
Chris Gray [Tue, 29 Nov 2011 17:58:31 +0000 (10:58 -0700)]
emacs: Use notmuch-command variable in process-lines.

The process-lines function calls the notmuch binary.  The location of
the binary may have been customized by the user, so it is better to
use the customized location rather than allowing the process-lines
function to search the user's PATH for the binary.

13 years agodump: Don't sort the output by message id.
Thomas Schwinge [Sun, 27 Nov 2011 18:40:53 +0000 (13:40 -0500)]
dump: Don't sort the output by message id.

Asking xapian to sort the messages for us causes suboptimal IO patterns. This
would be useful, if we only wanted the first few results, but since we want
everything anyway, this is pessimization.

On 2011-10-29, a measurement on a 372981 messages instance showed that wall
time can be reduced from 28 minutes (sorted by Message-ID) to 15 minutes
(unsorted).

Timings on 189605 messages:

$ time notmuch.old dump
19.48user 5.83system 12:10.42elapsed 3%CPU (0avgtext+0avgdata 110656maxresident)k
3629584inputs+22720outputs (33major+7073minor)pagefaults 0swaps
$ echo 3 > /proc/sys/vm/drop_caches
$ time notmuch.new
14.89user 1.20system 3:23.58elapsed 7%CPU (0avgtext+0avgdata 46032maxresident)k
1256264inputs+22464outputs (43major+1990minor)pagefaults 0swaps

13 years agotag: Automatically limit to messages whose tags will actually change.
Austin Clements [Wed, 9 Nov 2011 13:44:35 +0000 (08:44 -0500)]
tag: Automatically limit to messages whose tags will actually change.

This optimizes the user's tagging query to exclude messages that won't
be affected by the tagging operation, saving computation and IO for
redundant tagging operations.

For example,
  notmuch tag +notmuch to:notmuch@notmuchmail.org
will now use the query
  ( to:notmuch@notmuchmail.org ) and (not tag:"notmuch")

In the past, we've often suggested that people do this exact
transformation by hand for slow tagging operations.  This makes that
unnecessary.

13 years agotest: fix "Stashing in notmuch-search" test when emacs is not available
Dmitry Kurochkin [Sun, 27 Nov 2011 18:36:19 +0000 (22:36 +0400)]
test: fix "Stashing in notmuch-search" test when emacs is not available

If emacs is not available, test_expect_equal would be called with only
one argument.  The patch fixes this by quoting the (possibly empty)
$(cat OUTPUT) argument.

13 years agotest: check if emacs is available in the beginning of test_emacs
Dmitry Kurochkin [Sun, 27 Nov 2011 18:36:18 +0000 (22:36 +0400)]
test: check if emacs is available in the beginning of test_emacs

Unfortunately, this is needed to avoid the emacs waiting loop.

13 years agotest: add function to explicitly check for external dependencies
Dmitry Kurochkin [Sun, 27 Nov 2011 18:36:17 +0000 (22:36 +0400)]
test: add function to explicitly check for external dependencies

Useful when binary is called indirectly (e.g. from emacs).

13 years agotest: declare external dependencies for the tests
Dmitry Kurochkin [Sun, 27 Nov 2011 18:36:16 +0000 (22:36 +0400)]
test: declare external dependencies for the tests

That are: dtach(1), emacs(1), emacsclient(1), gdb(1) and gpg(1).

13 years agotest: skip all subtests if external dependencies are missing during init
Dmitry Kurochkin [Sun, 27 Nov 2011 18:36:15 +0000 (22:36 +0400)]
test: skip all subtests if external dependencies are missing during init

Some tests (e.g. crypto) do a common initialization required for all
subtests.  The patch adds a check for missing external dependencies
during this initialization.  If any prerequisites are missing, all
subtests are skipped.

The check is run on the first call of test_reset_state_ function, so
no changes for the tests are needed.

13 years agotest: fix "skipping test" verbose output
Dmitry Kurochkin [Sun, 27 Nov 2011 18:36:14 +0000 (22:36 +0400)]
test: fix "skipping test" verbose output

13 years agotest: add support for external executable dependencies
Dmitry Kurochkin [Sun, 27 Nov 2011 18:36:13 +0000 (22:36 +0400)]
test: add support for external executable dependencies

There is existing support for general prerequisites in the test suite.
But it is not very convenient to use: every test case has to keep
track for it's dependencies and they have to be explicitly listed.

The patch aims to add better support for a particular type of external
dependencies: external executables.  The main idea is to replace
missing external binaries with shell functions that have the same
name.  These functions always fail and keep track of missing
dependencies for a subtest.  The result reporting functions later can
check that an external binaries are missing and correctly report SKIP
result instead of FAIL.  The primary benefit is that the test cases do
not need to declare their dependencies or be changed in any way.

13 years agotest: add test state reset to test_expect_* functions that did not have it
Dmitry Kurochkin [Thu, 17 Nov 2011 13:05:56 +0000 (17:05 +0400)]
test: add test state reset to test_expect_* functions that did not have it

13 years agotest: set EMACS_SERVER variable only after dtach(1) was successfully started
Dmitry Kurochkin [Thu, 17 Nov 2011 13:05:55 +0000 (17:05 +0400)]
test: set EMACS_SERVER variable only after dtach(1) was successfully started

Otherwise, we can set the EMACS_SERVER and return with an error.  And
subsequent calls to test_emacs would assume that emacs server is running.

13 years agotest: move subtest variables reset into a dedicated function
Dmitry Kurochkin [Thu, 17 Nov 2011 13:05:54 +0000 (17:05 +0400)]
test: move subtest variables reset into a dedicated function

Currently, there is only one such variable test_subtest_known_broken_.
But more will be added in the future.

13 years agoBuild symbol-test with make instead of hardcoding in symbol-hiding.
Amadeusz Żołnowski [Sat, 26 Nov 2011 21:14:20 +0000 (22:14 +0100)]
Build symbol-test with make instead of hardcoding in symbol-hiding.

If symbol-test is built in symbol-hiding with hardcoded g++ invokation,
it's not so easy to pass $(srcdir) which is required to find notmuch.h
when srcdir and builddir are separate directories.

13 years agoMerge branch 'release'
David Bremner [Sun, 27 Nov 2011 05:15:20 +0000 (21:15 -0800)]
Merge branch 'release'

13 years agobuild system: clean up object files in ./test and ./util
David Bremner [Sat, 26 Nov 2011 17:55:07 +0000 (09:55 -0800)]
build system: clean up object files in ./test and ./util

13 years agoWhitespaces cleanup.
Amadeusz Żołnowski [Fri, 25 Nov 2011 15:34:48 +0000 (16:34 +0100)]
Whitespaces cleanup.

13 years agoFix warnings for test/symbol-test.cc.
Amadeusz Żołnowski [Fri, 25 Nov 2011 15:34:47 +0000 (16:34 +0100)]
Fix warnings for test/symbol-test.cc.

13 years agotest: cleanup basic tests
Dmitry Kurochkin [Sat, 26 Nov 2011 06:12:26 +0000 (10:12 +0400)]
test: cleanup basic tests

Basic test 'Ensure that all available tests will be run by
notmuch-test' compares all tests that are run with listing of test/
directory.  There is a growing list of exceptions for files and
directories which located in the test/ directory but are not tests.
Moreover some (probably buggy) tests do create files in the the test/
directory which may be left behind in case of failure.  This makes the
basic test fail.

The patch changes the test to look only for regular executable files.
This makes the exception list much smaller.  And since no tests should
create executables in the test/ directory (if there are, they should
be fixed), the basic test should not be affected by failed or
interrupted tests.

13 years agotest: fix sed error in basic tests
Dmitry Kurochkin [Fri, 18 Nov 2011 15:21:00 +0000 (19:21 +0400)]
test: fix sed error in basic tests

The error is easy to miss, because the test passes and stderr is not
printed.  But if you run basic tests in verbose mode (./basic
--verbose), you get:

  sed: can't read notmuch-test: No such file or directory

The issue is that sed command is given two files: notmuch-test and
$TEST_DIRECTORY/notmuch-test.  And there is no notmuch-test file in
the current directory (test/tmp.basic/).  The patch just removes the
non-existing file from the sed command.

13 years agotest: remove executable permissions from test-lib.sh
Dmitry Kurochkin [Sat, 26 Nov 2011 06:12:25 +0000 (10:12 +0400)]
test: remove executable permissions from test-lib.sh

It is not supposed to be run, only sourced.

13 years agoemacs: test notmuch show with fourfold message indentation
Gregor Zattler [Thu, 24 Nov 2011 22:03:24 +0000 (23:03 +0100)]
emacs: test notmuch show with fourfold message indentation

Previous behaviour was to indent messages in a thread according
to depth by one space per level.  This commit tests if setting
notmuch-indent-messages-width to `4' provides a message thread
with four spaces of indentation thread depth.

13 years agoemacs: test: notmuch show without indentation
Gregor Zattler [Thu, 24 Nov 2011 22:03:23 +0000 (23:03 +0100)]
emacs: test: notmuch show without indentation

Previous behaviour was to indent messages in a thread according
to depth by one space per level.  In
id:1311028119-50637-1-git-send-email-fgeller@gmail.com Felix
Geller proposed a patch in order to turn indentation off.  This
commit tests if instead setting notmuch-indent-messages-width to
`0' does turn off indentation.

13 years agoemacs: test notmuch-indent-messages-width default
Gregor Zattler [Thu, 24 Nov 2011 22:03:22 +0000 (23:03 +0100)]
emacs: test notmuch-indent-messages-width default

Previous behaviour was to indent messages in a thread according
to depth by one space per level.  This is still the case with
notmuch-indent-messages-width default value `1'.  This test
succeeds if output with default value is same as in "Basic
notmuch-show view in emacs".

13 years agoemacs: make message indentation width customisable
Gregor Zattler [Thu, 24 Nov 2011 22:03:21 +0000 (23:03 +0100)]
emacs: make message indentation width customisable

Till now Emacs UI indents messages according to their respecive
depth of neting in the thread.  The actual width of indentation
per level is hardcoded to `1' space.
This patch makes message indentation customisable by introducing
a variable `notmuch-indent-messages-width' which defaults to `1',
which is the same as before.  Felix could set this variable to
`0' in order to disable indentation, I tested it with a value of
`4' for a clearer separation of messages in a thread.

13 years agotest: add simple tests for online help 0.10.1 debian/0.10.1-1
David Bremner [Fri, 25 Nov 2011 17:28:11 +0000 (12:28 -0500)]
test: add simple tests for online help

Nothing fancy, but we can at least detect segmentation faults.

13 years agoNEWS: add NEWS stanza for 0.10.1
David Bremner [Fri, 25 Nov 2011 17:17:35 +0000 (12:17 -0500)]
NEWS: add NEWS stanza for 0.10.1

Explain the bug fix in slightly less technical language than in the
Debian changelog.

13 years agodebian: changelog stanza for 0.10.1
David Bremner [Fri, 25 Nov 2011 17:13:01 +0000 (12:13 -0500)]
debian: changelog stanza for 0.10.1

13 years agoversion: update to 0.10.1
David Bremner [Fri, 25 Nov 2011 17:11:04 +0000 (12:11 -0500)]
version: update to 0.10.1

13 years agoCLI: update call to notmuch_help_command for new calling conventions.
David Bremner [Thu, 24 Nov 2011 20:02:41 +0000 (16:02 -0400)]
CLI: update call to notmuch_help_command for new calling conventions.

When I changed the calling convention to pass in all but the zero-th
argument to subcommands, I missed this one call, resulting in a
segmentation fault.

As a bonus, the syntax "notmuch --help foo" is now equivalent to
"notmuch help foo".

13 years agomake release: use sed to check debian version
Tomi Ollila [Mon, 21 Nov 2011 16:34:24 +0000 (18:34 +0200)]
make release: use sed to check debian version

Use common sed tool instead of dpkg-parsechangelog (which is usually
available on debian systems only) to verify that debian version
information is consistent with version file.

13 years agomake release: added goal verify-version-manpage
Tomi Ollila [Mon, 21 Nov 2011 16:27:09 +0000 (18:27 +0200)]
make release: added goal verify-version-manpage

Check that the version mentioned in notmuch manual page
is consistent with the version file.

13 years agomake release: verify-version-*: change comparison logic
Tomi Ollila [Mon, 21 Nov 2011 15:55:20 +0000 (17:55 +0200)]
make release: verify-version-*: change comparison logic

verfy-version-debian, verify-version-python and verify-version-components
checked noneqality of the comparison strings and if got "positive"
answer then made that goal fail. But in case of the test ([ ])
execution failed it never got to the 'then' part of the line (and
the 'if [ ... ] then ... fi ' construct doesn't make the script line
fail in case of problems inside [ ].
This commit inverses the "logic", so that only if the comparison for
equality succeeds the script line will exit with 0 and execution
can continue past the failure case to the next line (executed by another
shell) with '@echo done'

13 years agoemacs: Avoid unnecessary markers.
Austin Clements [Mon, 21 Nov 2011 01:07:02 +0000 (20:07 -0500)]
emacs: Avoid unnecessary markers.

This is just cleanup.  These markers are all immediately resolved to
points by Emacs, so using markers here is just unncessary overhead.

13 years agoemacs: Don't record undo information for search or show buffers.
Austin Clements [Mon, 21 Nov 2011 01:00:55 +0000 (20:00 -0500)]
emacs: Don't record undo information for search or show buffers.

There's no reason to record undo information for read-only,
programmatically-constructed buffers.  The undo list just chews up
memory keeping track of our calls to insert.

13 years agodebian/control: require dtach version >= 0.8 in Build-Depends
Tomi Ollila [Mon, 21 Nov 2011 15:18:00 +0000 (17:18 +0200)]
debian/control: require dtach version >= 0.8 in Build-Depends

Since version 0.8 of dtach -n does no longer require controlling
tty to be present when executed. Currently controlling tty is not
always (if ever) present when tests are executed.

13 years agoMerge branch 'release'
David Bremner [Wed, 23 Nov 2011 20:02:47 +0000 (16:02 -0400)]
Merge branch 'release'

13 years agodebian: changelog stanza for 0.10 0.10
David Bremner [Wed, 23 Nov 2011 11:46:39 +0000 (07:46 -0400)]
debian: changelog stanza for 0.10

Give a brief summary of (and pointer to) NEWS

13 years agoNEWS: set (approximate) date for 0.10 release
David Bremner [Wed, 23 Nov 2011 11:43:01 +0000 (07:43 -0400)]
NEWS: set (approximate) date for 0.10 release

It doesn't really matter if we are off by a day.

13 years agoversion: update to 0.10
David Bremner [Wed, 23 Nov 2011 11:37:02 +0000 (07:37 -0400)]
version: update to 0.10

13 years agoNEWS: item for silent killing of search buffers.
David Bremner [Wed, 23 Nov 2011 11:34:22 +0000 (07:34 -0400)]
NEWS: item for silent killing of search buffers.

This is maybe borderline for inclusion in NEWS, but maybe the NEWS
item helps someone who thinks there is a bug.

13 years agocontrib/notmuch-deliver: don't export from git
David Bremner [Wed, 23 Nov 2011 11:25:24 +0000 (07:25 -0400)]
contrib/notmuch-deliver: don't export from git

This prevents it from being part of the release tarballs. Hopefully
this is only temporary while we sort out the GPL2 versus GPL3
question.

13 years agoemacs: Make saving new saved searches append, not prepend
Jani Nikula [Fri, 23 Sep 2011 18:57:38 +0000 (21:57 +0300)]
emacs: Make saving new saved searches append, not prepend

Append new saved searches at the end of saved searches rather than insert
in front.

Signed-off-by: Jani Nikula <jani@nikula.org>
13 years agoemacs: Add new customization option to sort saved searches
Jani Nikula [Fri, 23 Sep 2011 18:57:37 +0000 (21:57 +0300)]
emacs: Add new customization option to sort saved searches

Add new customization option notmuch-saved-search-sort-function to sort
saved searches in user-defined order. Provide a sort function to sort the
saved searches in alphabetical order. Setting the search function to nil
causes the saved searches not to be sorted, as before. This also remains
the default. The function only affects display of the saved searches, not
the order in which they are stored by custom.

Signed-off-by: Jani Nikula <jani@nikula.org>
13 years agotags_to_maildir_flags: Cleanup double assignement
Louis Rilling [Wed, 14 Sep 2011 22:23:19 +0000 (00:23 +0200)]
tags_to_maildir_flags: Cleanup double assignement

The for loop right after already does the job.

Signed-off-by: Louis Rilling <l.rilling@av7.net>
13 years agolib: Kill last usage of C++ type bool
Louis Rilling [Wed, 14 Sep 2011 22:23:18 +0000 (00:23 +0200)]
lib: Kill last usage of C++ type bool

Signed-off-by: Louis Rilling <l.rilling@av7.net>
13 years agoMerge branch 'release'
David Bremner [Mon, 21 Nov 2011 11:26:11 +0000 (07:26 -0400)]
Merge branch 'release'