aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2015-08-04 08:48:33 +0200
committerDavid Bremner <david@tethera.net>2015-08-04 20:59:58 +0200
commite4e04bbc328f990e36b77f508aef904d156029b1 (patch)
tree0219366fc9b35b0654ade31398966da71105996b
parente2fb06d369bf7a532b4438ab576ca2969a8882a3 (diff)
cli/new: add more debugging output
Try to narrow down what part of the code adds files and directories to the queue(s) to be deleted. Update one test. The output is slightly confusing, but I believe it is correct, resulting from a directory being discovered but containing only ignored files.
-rw-r--r--notmuch-new.c14
-rwxr-xr-xtest/T050-new.sh1
2 files changed, 15 insertions, 0 deletions
diff --git a/notmuch-new.c b/notmuch-new.c
index 8ff1ade7..ee786a3b 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -528,6 +528,10 @@ add_files (notmuch_database_t *notmuch,
"%s/%s", path,
notmuch_filenames_get (db_files));
+ if (state->debug)
+ printf ("(D) add_files_recursive, pass 2: queuing passed file %s for deletion from database\n",
+ absolute);
+
_filename_list_add (state->removed_files, absolute);
notmuch_filenames_move_to_next (db_files);
@@ -542,6 +546,9 @@ add_files (notmuch_database_t *notmuch,
{
char *absolute = talloc_asprintf (state->removed_directories,
"%s/%s", path, filename);
+ if (state->debug)
+ printf ("(D) add_files_recursive, pass 2: queuing passed directory %s for deletion from database\n",
+ absolute);
_filename_list_add (state->removed_directories, absolute);
}
@@ -610,6 +617,9 @@ add_files (notmuch_database_t *notmuch,
char *absolute = talloc_asprintf (state->removed_files,
"%s/%s", path,
notmuch_filenames_get (db_files));
+ if (state->debug)
+ printf ("(D) add_files_recursive, pass 3: queuing leftover file %s for deletion from database\n",
+ absolute);
_filename_list_add (state->removed_files, absolute);
@@ -622,6 +632,10 @@ add_files (notmuch_database_t *notmuch,
"%s/%s", path,
notmuch_filenames_get (db_subdirs));
+ if (state->debug)
+ printf ("(D) add_files_recursive, pass 3: queuing leftover directory %s for deletion from database\n",
+ absolute);
+
_filename_list_add (state->removed_directories, absolute);
notmuch_filenames_move_to_next (db_subdirs);
diff --git a/test/T050-new.sh b/test/T050-new.sh
index 66ea10fe..ab15ca1f 100755
--- a/test/T050-new.sh
+++ b/test/T050-new.sh
@@ -238,6 +238,7 @@ test_expect_equal "$output" \
(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/ignored_file
(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/.git
(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/ignored_file
+(D) add_files_recursive, pass 3: queuing leftover directory ${MAIL_DIR}/two for deletion from database
No new mail."