Fossil SCM
Versionable settings are only attempt is the local _FOSSIL_ database is already opened. Versionable settings no longer attempts to open that database itself. This fixes an issue with the Admin/Settings page.
Commit
a2cc6bc6dc50a9d6aec8050d25d7ef0188a64f0f
Parent
8a5f2a7a3a3fded…
2 files changed
+2
-2
+1
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1426,11 +1426,11 @@ | ||
| 1426 | 1426 | } |
| 1427 | 1427 | cacheEntry = cacheEntry->next; |
| 1428 | 1428 | } |
| 1429 | 1429 | /* Attempt to read value from file in checkout if there wasn't a cache hit |
| 1430 | 1430 | ** and a checkout is open. */ |
| 1431 | - if( cacheEntry==0 && db_open_local() ){ | |
| 1431 | + if( cacheEntry==0 ){ | |
| 1432 | 1432 | Blob versionedPathname; |
| 1433 | 1433 | char *zVersionedPathname; |
| 1434 | 1434 | blob_zero(&versionedPathname); |
| 1435 | 1435 | blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", |
| 1436 | 1436 | g.zLocalRoot, zName); |
| @@ -1500,11 +1500,11 @@ | ||
| 1500 | 1500 | if( z==0 && g.configOpen ){ |
| 1501 | 1501 | db_swap_connections(); |
| 1502 | 1502 | z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName); |
| 1503 | 1503 | db_swap_connections(); |
| 1504 | 1504 | } |
| 1505 | - if( ctrlSetting!=0 && ctrlSetting->versionable ){ | |
| 1505 | + if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){ | |
| 1506 | 1506 | /* This is a versionable setting, try and get the info from a checked out file */ |
| 1507 | 1507 | z = db_get_do_versionable(zName, z); |
| 1508 | 1508 | } |
| 1509 | 1509 | if( z==0 ){ |
| 1510 | 1510 | z = zDefault; |
| 1511 | 1511 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1426,11 +1426,11 @@ | |
| 1426 | } |
| 1427 | cacheEntry = cacheEntry->next; |
| 1428 | } |
| 1429 | /* Attempt to read value from file in checkout if there wasn't a cache hit |
| 1430 | ** and a checkout is open. */ |
| 1431 | if( cacheEntry==0 && db_open_local() ){ |
| 1432 | Blob versionedPathname; |
| 1433 | char *zVersionedPathname; |
| 1434 | blob_zero(&versionedPathname); |
| 1435 | blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", |
| 1436 | g.zLocalRoot, zName); |
| @@ -1500,11 +1500,11 @@ | |
| 1500 | if( z==0 && g.configOpen ){ |
| 1501 | db_swap_connections(); |
| 1502 | z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName); |
| 1503 | db_swap_connections(); |
| 1504 | } |
| 1505 | if( ctrlSetting!=0 && ctrlSetting->versionable ){ |
| 1506 | /* This is a versionable setting, try and get the info from a checked out file */ |
| 1507 | z = db_get_do_versionable(zName, z); |
| 1508 | } |
| 1509 | if( z==0 ){ |
| 1510 | z = zDefault; |
| 1511 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1426,11 +1426,11 @@ | |
| 1426 | } |
| 1427 | cacheEntry = cacheEntry->next; |
| 1428 | } |
| 1429 | /* Attempt to read value from file in checkout if there wasn't a cache hit |
| 1430 | ** and a checkout is open. */ |
| 1431 | if( cacheEntry==0 ){ |
| 1432 | Blob versionedPathname; |
| 1433 | char *zVersionedPathname; |
| 1434 | blob_zero(&versionedPathname); |
| 1435 | blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", |
| 1436 | g.zLocalRoot, zName); |
| @@ -1500,11 +1500,11 @@ | |
| 1500 | if( z==0 && g.configOpen ){ |
| 1501 | db_swap_connections(); |
| 1502 | z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName); |
| 1503 | db_swap_connections(); |
| 1504 | } |
| 1505 | if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){ |
| 1506 | /* This is a versionable setting, try and get the info from a checked out file */ |
| 1507 | z = db_get_do_versionable(zName, z); |
| 1508 | } |
| 1509 | if( z==0 ){ |
| 1510 | z = zDefault; |
| 1511 |
+1
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1050,10 +1050,11 @@ | ||
| 1050 | 1050 | if( !g.okSetup ){ |
| 1051 | 1051 | login_needed(); |
| 1052 | 1052 | } |
| 1053 | 1053 | |
| 1054 | 1054 | style_header("Settings"); |
| 1055 | + db_open_local(); | |
| 1055 | 1056 | db_begin_transaction(); |
| 1056 | 1057 | @ <p>This page provides a simple interface to the "fossil setting" command. |
| 1057 | 1058 | @ See the "fossil help setting" output below for further information on |
| 1058 | 1059 | @ the meaning of each setting.</p><hr /> |
| 1059 | 1060 | @ <form action="%s(g.zTop)/setup_settings" method="post"><div> |
| 1060 | 1061 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1050,10 +1050,11 @@ | |
| 1050 | if( !g.okSetup ){ |
| 1051 | login_needed(); |
| 1052 | } |
| 1053 | |
| 1054 | style_header("Settings"); |
| 1055 | db_begin_transaction(); |
| 1056 | @ <p>This page provides a simple interface to the "fossil setting" command. |
| 1057 | @ See the "fossil help setting" output below for further information on |
| 1058 | @ the meaning of each setting.</p><hr /> |
| 1059 | @ <form action="%s(g.zTop)/setup_settings" method="post"><div> |
| 1060 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1050,10 +1050,11 @@ | |
| 1050 | if( !g.okSetup ){ |
| 1051 | login_needed(); |
| 1052 | } |
| 1053 | |
| 1054 | style_header("Settings"); |
| 1055 | db_open_local(); |
| 1056 | db_begin_transaction(); |
| 1057 | @ <p>This page provides a simple interface to the "fossil setting" command. |
| 1058 | @ See the "fossil help setting" output below for further information on |
| 1059 | @ the meaning of each setting.</p><hr /> |
| 1060 | @ <form action="%s(g.zTop)/setup_settings" method="post"><div> |
| 1061 |