lib/config: add NOTMUCH_CONFIG_AUTOCOMMIT

This will be used to control how often atomic transactions are
committed.
This commit is contained in:
David Bremner 2021-05-21 12:54:10 -03:00
parent 65f923219e
commit 2f608d2a94
5 changed files with 11 additions and 0 deletions

View file

@ -593,6 +593,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key)
return "user.other_email";
case NOTMUCH_CONFIG_USER_NAME:
return "user.name";
case NOTMUCH_CONFIG_AUTOCOMMIT:
return "database.autocommit";
default:
return NULL;
}
@ -638,6 +640,8 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key)
return email;
case NOTMUCH_CONFIG_NEW_IGNORE:
return "";
case NOTMUCH_CONFIG_AUTOCOMMIT:
return "8000";
case NOTMUCH_CONFIG_HOOK_DIR:
case NOTMUCH_CONFIG_BACKUP_DIR:
case NOTMUCH_CONFIG_OTHER_EMAIL:

View file

@ -2520,6 +2520,7 @@ typedef enum _notmuch_config_key {
NOTMUCH_CONFIG_PRIMARY_EMAIL,
NOTMUCH_CONFIG_OTHER_EMAIL,
NOTMUCH_CONFIG_USER_NAME,
NOTMUCH_CONFIG_AUTOCOMMIT,
NOTMUCH_CONFIG_LAST
} notmuch_config_key_t;

View file

@ -51,6 +51,7 @@ cat <<EOF > EXPECTED
built_with.compact=something
built_with.field_processor=something
built_with.retry_lock=something
database.autocommit=8000
database.mail_root=MAIL_DIR
database.path=MAIL_DIR
foo.list=this;is another;list value;

View file

@ -259,6 +259,7 @@ EOF
built_with.compact=true
built_with.field_processor=true
built_with.retry_lock=true
database.autocommit=8000
database.backup_dir
database.hook_dir
database.mail_root=MAIL_DIR

View file

@ -419,6 +419,7 @@ cat <<'EOF' >EXPECTED
08: 'USERNAME@FQDN'
09: 'NULL'
10: 'USER_FULL_NAME'
11: '8000'
== stderr ==
EOF
unset MAILDIR
@ -730,6 +731,7 @@ cat <<'EOF' >EXPECTED
08: 'test_suite@notmuchmail.org'
09: 'test_suite_other@notmuchmail.org;test_suite@otherdomain.org'
10: 'Notmuch Test Suite'
11: '8000'
== stderr ==
EOF
test_expect_equal_file EXPECTED OUTPUT
@ -762,6 +764,7 @@ cat <<'EOF' >EXPECTED
08: 'USERNAME@FQDN'
09: 'NULL'
10: 'USER_FULL_NAME'
11: '8000'
== stderr ==
EOF
test_expect_equal_file EXPECTED OUTPUT.clean
@ -828,6 +831,7 @@ EOF
cat <<'EOF' >EXPECTED
== stdout ==
aaabefore beforeval
database.autocommit 8000
database.backup_dir MAIL_DIR/.notmuch/backups
database.hook_dir MAIL_DIR/.notmuch/hooks
database.mail_root MAIL_DIR