aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-12-19 13:11:00 -0800
committerGravatar Carl Worth <cworth@cworth.org>2010-01-06 10:32:05 -0800
commit154bf7ac677c41168c5c6a982fee3f22350adfef (patch)
tree43123ac6b204ac8c7727d80fc688926b0f2773a4 /lib
parent9257622da8ed50502e59adec69e5daa043ef242a (diff)
database: Store directory paths as relative, not absolute.
We were already storing relative mail filenames, so this is consistent with that. Additionally, it means that directory documents remain valid even if the database is relocated within its containing filesystem.
Diffstat (limited to 'lib')
-rw-r--r--lib/database.cc4
-rw-r--r--lib/notmuch.h5
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/database.cc b/lib/database.cc
index f7f9943f..0ef59ea9 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -86,7 +86,7 @@ typedef struct {
*
* The directory document is indexed with a single prefixed term:
*
- * directory: The directory path (an absolute path)
+ * directory: The directory path (relative to the database path)
*
* and has a single value:
*
@@ -639,6 +639,8 @@ notmuch_database_set_directory_mtime (notmuch_database_t *notmuch,
return NOTMUCH_STATUS_READONLY_DATABASE;
}
+ path = _notmuch_database_relative_path (notmuch, path);
+
db = static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db);
db_path = directory_db_path (path);
diff --git a/lib/notmuch.h b/lib/notmuch.h
index a98241de..786b8e9f 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -180,6 +180,11 @@ notmuch_database_get_path (notmuch_database_t *database);
/* Store an mtime within the database for 'path'.
*
+ * Here,'path' should be the path of a directory relative to the path
+ * of 'database' (see notmuch_database_get_path), or else should be an
+ * absolute path with initial components that match the path of
+ * 'database'.
+ *
* The intention is for the caller to use the mtime to allow efficient
* identification of new messages to be added to the database. The
* recommended usage is as follows: