- notmuch->last_doc_id = notmuch->xapian_db->get_lastdocid ();
- last_thread_id = notmuch->xapian_db->get_metadata ("last_thread_id");
- if (last_thread_id.empty ()) {
- notmuch->last_thread_id = 0;
- } else {
- const char *str;
- char *end;
-
- str = last_thread_id.c_str ();
- notmuch->last_thread_id = strtoull (str, &end, 16);
- if (*end != '\0')
- INTERNAL_ERROR ("Malformed database last_thread_id: %s", str);
- }
-
- /* Get current highest revision number. */
- last_mod = notmuch->xapian_db->get_value_upper_bound (
- NOTMUCH_VALUE_LAST_MOD);
- if (last_mod.empty ())
- notmuch->revision = 0;
- else
- notmuch->revision = Xapian::sortable_unserialise (last_mod);
- notmuch->uuid = talloc_strdup (
- notmuch, notmuch->xapian_db->get_uuid ().c_str ());