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.
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.
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.
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.
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.
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.
The insert-part-message/rfc822 function is overhauled to properly
processes the new formatting of message/rfc822 parts. The json output
for message parts now includes "headers" and "body" fields, which are
now parsed and output appropriately.
Improve handling of message/rfc822 parts by adding a new header_message_part function to the formating structure.
This new function takes a GMimeMessage as input, and outputs the
formatted headers. This allows for message/rfc822 parts to be
formatted on output in a similar way to full messages (see previous
patch that overhauls the multipart test for more info).
test: overhaul multipart test to test for improved message/rfc822 handling
The main goal of this overhaul is to define how message/rfc822 parts
should be handled. message/rfc822 parts should be output in a similar
fashion to the outer message, including some subset of the rfc822
headers. The following decisions about formatting of message/rfc822
parts were made:
The format and content of message/rfc822 parts shall be as similar as
possible to that of full messages. In particular, for formatted
outputs, the "content" of rfc822 part output should include "headers"
and "body" fields).
The "body" field shall include the body of the message.
The "headers" field shall include the following headers, since these
are the ones available from the GMimeMessage:
"From"
"To"
"Cc"
"Subject"
"Date"
However, for the case of --format=raw the raw rfc822 should be output,
including all headers.
A subset of relevant headers shall be output in reply.
The test embedded rfc822 message is also modified to be itself
multipart, so we can more fully test how all sub parts of the message
part are output.
Note added by Committer:
Currently, expect one test (--format=raw --part=3, rfc822 part) to fail.
Decode and Encode from/to unicode objects as required to be able to take
unicode path names. Previously we would error out when an unicode object
were handed it.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
The test message date, "Tue, 05 Jan 2001 15:43:57 -0000", is not
actually a real date. 05 Jan 2001 was in fact a Friday, not a
Tuesday. Date parsers (such as "date" in coreutils) will return "Fri"
as the day for this string, even if "Tue" is specified.
Also, the time zone "-0000" is actually always returned as "+0000", so
we change that here was well.
This will be relevant for later patches when we begin parsing rfc822
part headers, where gmime returns a parsed date string.
If we do want to test date parsing, we should do that in a separate
test.
David Bremner [Mon, 5 Sep 2011 11:45:28 +0000 (08:45 -0300)]
build system: Check that python bindings have consistent version when releasing
Thanks to Sebastian Spaeth breaking out version.py, this can be done
without loading notmuch.py, or using sed. version.py is not (yet)
autogenerated because it seems more important to minimize the
differences between the tagged version and the tarball.
David Bremner [Mon, 5 Sep 2011 03:19:32 +0000 (00:19 -0300)]
lib/gen-version-script.h: add getline and getdelim to notmuch.sym if needed
If the configure script detects missing getline and/or getdelim
symbols, then notmuch will use it's own versions. This patch, based on
id:"87k49v12i5.fsf@pc44es141.cs.uni-magdeburg.de" by Matthias
Guedemann, adds the symbols to notmuch.sym as well so they are
properly exported from the library.
Tomi Ollila [Mon, 22 Aug 2011 11:59:02 +0000 (14:59 +0300)]
fix checking whether header is member of message-hidden-headers
Emacs lisp function 'member' takes element and list as an
argument. I.e. the second argument is list, not symbol
referencing the list.
On emacs 23.x the member call always returned nil (thus buggy),
on emacs 22.x the call failed, making it unusable.
Sebastian Spaeth [Wed, 24 Aug 2011 07:13:34 +0000 (09:13 +0200)]
python: Have setup.py read the version number without importing
Importing the notmuch module in setup.py is a no-no, and we want
to auto-generate the version number in the release process.
Outsource __VERSION__ to the new version.py which contains nothing else
and which can therefor easily be autogenerated. Have setup.py read in
the file via execfile and test if importing the version number actually
worked.
This should make all happy.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
It seems that importing the module in setup.py is controversial at best,
as it will fail for users that don't have all dependencies
installed. This was the case in e.g. the Ubuntu autobuilder, so building
notmuch failed. The plan is to create an autogenerated setup.py that can
be used for version information.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Sebastian Spaeth [Tue, 23 Aug 2011 07:30:49 +0000 (09:30 +0200)]
python: Simplify setup.py
We were using a template setup.py which parsed __init__.py in complex
ways just to find out the version number. Simply import notmuch and use
__VERSION__ directly. Also adapt some wording and setup.py values while
going through.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
David Bremner [Sun, 21 Aug 2011 19:45:00 +0000 (16:45 -0300)]
re-enable notmuch.sym generation using POSIX sed
Unfortunately Robin Green's patch 52e4dedf9aa was lost when I created
gen-version-script.sh. This merges his changes manually into that
script. It turns out tabs seem not needed in version script
files, so I simplified a bit and removed the printf.
Thanks to Alexander Botero-Lowry for help and testing.
pazz [Tue, 16 Aug 2011 21:37:47 +0000 (22:37 +0100)]
python: Fix unsafe utf-8 decodings
This prevents unsafe calls to decode for return value None in
get_authors/get_subject which would current throw an Exception. Original
patch modified by Sebastian Spaeth.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
python: Do explicitly check if the next tag exists
If we try to pull a non-existing tag, Tags._get will return None and the
appended .decode() command will fail. So make sure that there is a tag to
be fetched before fetching it.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
python: Really throw an error if search_threads() fails
In case, search_threads returns an error we are supposed to throw an
Exception. But we did not "raise" it, this was an oversight and this
commit fixes it.
There is still the problem that there is often output to stderr by
libnotmuch detailing the xapian error and this is simply printed
out. But this requires fixing at the libnotmuch level...
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Thomas Jost [Wed, 20 Jul 2011 23:31:37 +0000 (01:31 +0200)]
libnotmuch: only build symbols list after the modules are built
If the notmuch.sym target does not explicitly depend on $(libnotmuch_modules),
gen-version-script.sh may be run before all the .o files are created, for
example when doing a parallel build on a machine with many cores.
David Bremner [Sun, 17 Jul 2011 14:18:10 +0000 (11:18 -0300)]
build-system: tag debian-version as part of the release target
This allows, e.g. gitpkg debian/0.x-1 to do the right thing. It also
helps enforce the convention that Debian upload -1 is identical to the
release tarball.
David Bremner [Sun, 17 Jul 2011 14:11:57 +0000 (11:11 -0300)]
debian: use 3.0 (quilt) source format.
This generates a seperate notmuch-0.x.debian.tar.gz containing
./debian.
In the initial release this is redundant, but for Debian only updates
between releases, this allows updating the contents of ./debian, and
using the rest of the release tarball.
David Bremner [Mon, 4 Jul 2011 11:39:04 +0000 (08:39 -0300)]
build-system: guard parts irrevokable parts of release target with REALLY_UPLOAD
This supports both testing and use by non-upload privileged
users. Along with previous commits in the series, this lets one do a
dry run of the release process and created a tarball, signature file,
and release announcement to inspect before uploading.
David Bremner [Sun, 17 Jul 2011 12:52:05 +0000 (09:52 -0300)]
build-system: run make clean before testing.
The reasoning is that we might have some error in the build system
that causes something not to be rebuilt; this would potentially have
the tests run on the wrong version of the code.
David Bremner [Sun, 3 Jul 2011 18:18:30 +0000 (15:18 -0300)]
build-system: replace use of ssh with wget for checking the website
The idea is to see if the version we are already releasing exists on
the notmuch website. Using wget allows more people to run this target,
and also allows people with ssh access to run it without access to
their keys.
David Bremner [Sun, 17 Jul 2011 13:42:53 +0000 (10:42 -0300)]
debian: use a non-native version number.
There is concensus to use non-native version number for updates that
contain only Debian changes. Unfortunately changing back and forth
between native and non-native packages has the potential for
confusion, since the archive will end up with notmuch-0.x.tar.gz and
notmuch-0.x.orig.tar.gz. So we use non-native numbering from the
beginning.
David Bremner [Sat, 16 Jul 2011 18:59:44 +0000 (15:59 -0300)]
libnotmuch: export Xapian typeinfo symbols
The lack of such exporting seems to cause problems catching
exceptions, as suggested by
http://gcc.gnu.org/wiki/Visibility
This manifested in the symbol-hiding test failing when notmuch was
compile with gcc 4.4.5. On i386, this further manifested as notmuch
new failing to run (crashing with an uncaught exception on first run).
Jason Woofenden [Mon, 11 Jul 2011 05:40:09 +0000 (01:40 -0400)]
vim: fix (hack) cig/cit parsing within multipart/*
The vim front-end isn't written to handle nested parts.
This patch doesn't change that, it just changes the code to pretend that
multipart/* sections end immediately. This makes the parsing code think that
all sections are top-level, and are thus parsed well enough.
The lovely result of this is that citation folds and signature folds now work
in text/plain parts that are within multipart/* sections. Also, all mime
section starts are now shown correctly (before some were not parsed and showed
the ugly ^L and an ID and so on from notmuch.)
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Jason Woofenden [Mon, 11 Jul 2011 05:40:07 +0000 (01:40 -0400)]
vim: fix from list reformatting in search view
This patch rewrites the reformatting of the from list so it shows full
capitalized names when available (without truncating them as the old code did)
and removes the pipe characters that appear between some names.
The old code appears to assume from list (the list of senders in the thread)
coming from notmuch would be e-mail addresses, but in this version it is mostly
full names. Also in this version, the names are sometimes separated by pipe
instead of comma.
For consistency with old versions, names are still truncated at the first
period. Perhaps they shouldn't be though.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
vim: skip trailing slash for g:notmuch_compose_temp_file_dir
With the trailing slash I get
Error detected while processing function <SNR>10_NM_new_mail..<SNR>10_NM_cmd_compose..<SNR>10_NM_newComposeBuffer..<SNR>10_NM_newFileBuffer:
line 3:
E739: Cannot create directory: /home/ukleinek/.notmuch/compose/
when hitting 'm' to compose a new mail. strace shows:
stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314a10) = -1 ENOENT (No such file or directory)
stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314e30) = -1 ENOENT (No such file or directory)
stat("/home/ukleinek/.notmuch/compose", 0x7fffee315270) = -1 ENOENT (No such file or directory)
stat("/home/ukleinek/.notmuch", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
mkdir("/home/ukleinek/.notmuch/compose", 0755) = 0
mkdir("/home/ukleinek/.notmuch/compose/", 0755) = -1 EEXIST (File exists)
so it seems vim's mkdir() isn't able to handle a trailing slash.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Sebastian Spaeth [Mon, 11 Jul 2011 13:02:12 +0000 (15:02 +0200)]
python: represent message tags as unicode instances
Rather than returning simply strings and having to guess their encoding,
return explicit unicode() strings for the tags. Xapian stores UTF8, so
we know that they come as UTF8 encoded string.
Note: I tried to directly use the c_wchar_p type of the ctypes library
which translates directly into an unicode type, but that did not work
out so well, so we take c_char_p and .decode() them manually.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Sebastian Spaeth [Mon, 11 Jul 2011 09:39:42 +0000 (11:39 +0200)]
python: Encode query string as a utf-8 byte array
If we pass in an unicode instance as query string, we would probably get
weird behavior (and indeed do so, see mail
id:"20110707113700.GA16347@megatron"). If a unicode instance is passed
in, make sure we encode it properly to an utf-8 encoded byte string.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
debian: strictly depend on the same version of libnotmuch
It took quite some time to debug why folder: searches didn't work for me
though I had notmuch 0.6~rc1 installed. amdragon in #notmuch found out
that I still had libnotmuch1 0.5+nmu3 installed.
To prevent the same problem in the future let notmuch depend on the same
version of libnotmuch1.
Reviewed-By: David Bremner <david@tethera.net>
The underlying issue is that the libnotmuch interface is not
entirely captured by the set of exported symbols. In particular the
query syntax can change without being visible to the linker at all.
A stupid typo was preventing this from ever working and it was not
detected until now. Patrick noted the typo and proposed the fix in mail
id:"20110704203926.GA20238@brick.lan".
Patch-by: Patrick Totzke <patricktotzke@googlemail.com> Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
David Bremner [Fri, 1 Jul 2011 14:48:01 +0000 (11:48 -0300)]
debian: add changelog stanza for release 0.6, install upstream docs referred to.
This perhaps breaks the "one thing at a time rule", but seems better
than leaving the changelog pointing to nothing.
(cherry picked from commit 8c5129bb510b9f4f7acc9752cc61a457eceb6f01)