aboutsummaryrefslogtreecommitdiff
path: root/notmuch-restore.c
Commit message (Collapse)AuthorAge
* notmuch-restore: replace positional argument for input with optionDavid Bremner2012-08-06
| | | | | Since notmuch dump doesn't use positional arguments anymore, it seems better to be consistent.
* lib/cli: Make notmuch_database_open return a status codeAustin Clements2012-05-05
| | | | | | | | | | | | It has been a long-standing issue that notmuch_database_open doesn't return any indication of why it failed. This patch changes its prototype to return a notmuch_status_t and set an out-argument to the database itself, like other functions that return both a status and an object. In the interest of atomicity, this also updates every use in the CLI so that notmuch still compiles. Since this patch does not update the bindings, the Python bindings test fails.
* Use notmuch_database_destroy instead of notmuch_database_closeJustus Winter2012-04-28
| | | | | | Adapt the notmuch binaries source to the notmuch_database_close split. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* cli: refactor "notmuch restore" message tagging into a separate functionJani Nikula2012-03-30
| | | | | | | Refactor to make tagging code easier to reuse in the future. No functional changes. Signed-off-by: Jani Nikula <jani@nikula.org>
* notmuch-restore: convert to command-line-argumentsDavid Bremner2011-12-08
| | | | | | 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.
* xregcomp: don't consider every regex compilation failure an internal error.David Bremner2011-10-30
| | | | | | This pushes the error handling up one step, but makes the function more flexible. Running out of memory still triggers an internal error, in the spirit of other xutils functions.
* notmuch-restore: check for extra arguments.David Bremner2011-10-23
| | | | | We consider it an error to pass more than one file to restore, since extra ones are ignored.
* notmuch-restore: implement --accumulate optionDavid Bremner2011-10-23
| | | | | | | | | | | | | Modify command line argument handling to take a --accumulate flag. Test for extra arguments beyond the input file. The --accumulate switch causes the union of the existing and new tags to be applied, instead of replacing each message's tags as they are read in from the dump file. Based on a patch by Thomas Schwinge: id:"1317317857-29636-1-git-send-email-thomas@schwinge.name"
* cli: change argument parsing convention for subcommandsDavid Bremner2011-10-22
| | | | | | | | | previously we deleted the subcommand name from argv before passing to the subcommand. In this version, the deletion is done in the actual subcommands. Although this causes some duplication of code, it allows us to be more flexible about how we parse command line arguments in the subcommand, including possibly using off-the-shelf routines like getopt_long that expect the name of the command in argv[0].
* lib: make find_message{,by_filename) report errorsAli Polatel2011-10-04
| | | | | | | | | | | | | | | | 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()
* lib: Rework interface for maildir_flags synchronizationCarl Worth2010-11-11
| | | | | | | | | | | | | Instead of having an API for setting a library-wide flag for synchronization (notmuch_database_set_maildir_sync) we instead implement maildir synchronization with two new library functions: notmuch_message_maildir_flags_to_tags and notmuch_message_tags_to_maildir_flags These functions are nicely documented here, (though the implementation does not quite match the documentation yet---as plainly evidenced by the current results of the test suite).
* Avoid abbreviation, preferring notmuch_config_get_maildir_synchronize_flagsCarl Worth2010-11-11
| | | | | | | | | | | | | Since the name of the configuration parameter here is: maildir.synchronize_flags the convention is that the functions to get and set this parameter should match it in name. Hence: notmuch_config_get_maildir_synchronize_flags etc. (as opposed to notmuch_config_get_maildir_sync).
* Make maildir synchronization configurableMichal Sojka2010-11-10
| | | | | | | This adds group [maildir] and key 'synchronize_flags' to the configuration file. Its value enables (true) or diables (false) the synchronization between notmuch tags and maildir flags. By default, the synchronization is disabled.
* lib: Rename iterator functions to prepare for reverse iteration.Carl Worth2010-03-09
| | | | | | | | We rename 'has_more' to 'valid' so that it can function whether iterating in a forward or reverse direction. We also rename 'advance' to 'move_to_next' to setup parallel naming with the proposed functions 'move_to_first', 'move_to_last', and 'move_to_previous'.
* notmuch restore: Don't waste time with messages with unchanged tags.Carl Worth2010-02-05
| | | | | | | | | | It's a simple optimization to look at a message and check that the existing tags are actually different than the tags we are setting before we do anything. For my mail store this takes a "notmuch restore" that does nothing from about 10 minutes down to 1 minute, so there's a significant speedup here.
* Rename NOTMUCH_DATABASE_MODE_WRITABLE to NOTMUCH_DATABASE_MODE_READ_WRITECarl Worth2009-11-21
| | | | And correspondingly, READONLY to READ_ONLY.
* Permit opening the notmuch database in read-only mode.Chris Wilson2009-11-21
| | | | | | | | | We only rarely need to actually open the database for writing, but we always create a Xapian::WritableDatabase. This has the effect of preventing searches and like whilst updating the index. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Carl Worth <cworth@cworth.org>
* notmuch restore was skipping entries with no new tagsKeith Packard2009-11-16
| | | | | | | | | | | notmuch restore used to only add tags; now that it clears existing tags, it needs to operate on messages even if the new tag list is empty. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Carl Worth <cworth@cworth.org>: I fixed up the indentation here, (someday we might switch to 8-space indents, but we haven't yet).
* Unbreak several notmuch commands after the addition of configuration.Carl Worth2009-11-11
| | | | | | | | | | | | | | | | | | | | | | All of the following commands: notmuch dump notmuch reply notmuch restore notmuch search notmuch show notmuch tag were calling notmuch_database_open with an argument of NULL. This was a legitimate call until the recent addition of configuration, after which it is expected that all commands will lookup the correct path in the configuration file. So fix all these commands to do that. Also, while touching all of these commands, we fix them to use the talloc context that is passed in rather than creating a local talloc context. We also switch from using goto for return values, to doing direct returns as soon as an error is detected, (which can be leak free thanks to talloc).
* notmuch: Break notmuch.c up into several smaller files.Carl Worth2009-11-10
Now that the client sources are alone here in their own directory, (with all the library sources down inside the lib directory), we can break the client up into multiple files without mixing the files up. The hope is that these smaller files will be easier to manage and maintain.