]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-new.c
Rename NOTMUCH_DATABASE_MODE_WRITABLE to NOTMUCH_DATABASE_MODE_READ_WRITE
[notmuch] / notmuch-new.c
index 316d26b5c09181859fbb68c996419cf11c6a80b1..bc35b4e8cf32480e1a7d1cf87cb95d7b6e4e3e71 100644 (file)
@@ -193,6 +193,7 @@ add_files_recursive (notmuch_database_t *notmuch,
                                 next);
                        break;
                    /* Fatal issues. Don't process anymore. */
+                   case NOTMUCH_STATUS_READONLY_DATABASE:
                    case NOTMUCH_STATUS_XAPIAN_EXCEPTION:
                    case NOTMUCH_STATUS_OUT_OF_MEMORY:
                        fprintf (stderr, "Error: %s. Halting processing.\n",
@@ -407,11 +408,13 @@ notmuch_new_command (void *ctx,
        if (interrupted)
            return 1;
 
+       printf ("Found %d total files.     \n", count);
        notmuch = notmuch_database_create (db_path);
        add_files_state.ignore_read_only_directories = FALSE;
        add_files_state.total_files = count;
     } else {
-       notmuch = notmuch_database_open (db_path);
+       notmuch = notmuch_database_open (db_path,
+                                        NOTMUCH_DATABASE_MODE_READ_ONLY);
        add_files_state.ignore_read_only_directories = TRUE;
        add_files_state.total_files = 0;
     }