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.

drh 2011-08-27 18:05 trunk
Commit a2cc6bc6dc50a9d6aec8050d25d7ef0188a64f0f
2 files changed +2 -2 +1
+2 -2
--- src/db.c
+++ src/db.c
@@ -1426,11 +1426,11 @@
14261426
}
14271427
cacheEntry = cacheEntry->next;
14281428
}
14291429
/* Attempt to read value from file in checkout if there wasn't a cache hit
14301430
** and a checkout is open. */
1431
- if( cacheEntry==0 && db_open_local() ){
1431
+ if( cacheEntry==0 ){
14321432
Blob versionedPathname;
14331433
char *zVersionedPathname;
14341434
blob_zero(&versionedPathname);
14351435
blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
14361436
g.zLocalRoot, zName);
@@ -1500,11 +1500,11 @@
15001500
if( z==0 && g.configOpen ){
15011501
db_swap_connections();
15021502
z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
15031503
db_swap_connections();
15041504
}
1505
- if( ctrlSetting!=0 && ctrlSetting->versionable ){
1505
+ if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
15061506
/* This is a versionable setting, try and get the info from a checked out file */
15071507
z = db_get_do_versionable(zName, z);
15081508
}
15091509
if( z==0 ){
15101510
z = zDefault;
15111511
--- 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
--- src/setup.c
+++ src/setup.c
@@ -1050,10 +1050,11 @@
10501050
if( !g.okSetup ){
10511051
login_needed();
10521052
}
10531053
10541054
style_header("Settings");
1055
+ db_open_local();
10551056
db_begin_transaction();
10561057
@ <p>This page provides a simple interface to the "fossil setting" command.
10571058
@ See the "fossil help setting" output below for further information on
10581059
@ the meaning of each setting.</p><hr />
10591060
@ <form action="%s(g.zTop)/setup_settings" method="post"><div>
10601061
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button