Fossil SCM
Roll back a broken part of [f3d3d1be59728b5dde702a] which caused only versioned settings' values to be fetched.
Commit
c7221a2e8c8cc175ccf5f32540af3f6f74ab53aff17ed524004983b7c393fdfc
Parent
f3d3d1be59728b5…
1 file changed
+13
-12
+13
-12
| --- src/json_config.c | ||
| +++ src/json_config.c | ||
| @@ -281,12 +281,12 @@ | ||
| 281 | 281 | blob_reset(&content); |
| 282 | 282 | } |
| 283 | 283 | db_reset(&qFoci); |
| 284 | 284 | } |
| 285 | 285 | if( 0==pSrc && g.localOpen ){ |
| 286 | - /* Pull value from a local .fossil-settings/X file, if one | |
| 287 | - ** exists. */ | |
| 286 | + /* Pull value from a checkout-local .fossil-settings/X file, | |
| 287 | + ** if one exists. */ | |
| 288 | 288 | Blob versionedPathname; |
| 289 | 289 | blob_zero(&versionedPathname); |
| 290 | 290 | blob_appendf(&versionedPathname, "%s.fossil-settings/%s", |
| 291 | 291 | g.zLocalRoot, pSet->name); |
| 292 | 292 | if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){ |
| @@ -297,20 +297,21 @@ | ||
| 297 | 297 | pVal = json_new_string(blob_str(&content)); |
| 298 | 298 | blob_reset(&content); |
| 299 | 299 | } |
| 300 | 300 | blob_reset(&versionedPathname); |
| 301 | 301 | } |
| 302 | - if( 0==pSrc ){ | |
| 303 | - /* We had no versioned value, so use the value from | |
| 304 | - ** localdb.vvar or repository.config (in that order). */ | |
| 305 | - db_bind_text(&q, ":name", pSet->name); | |
| 306 | - if( SQLITE_ROW==db_step(&q) ){ | |
| 307 | - pSrc = json_new_string(db_column_text(&q, 0)); | |
| 308 | - pVal = json_new_string(db_column_text(&q, 1)); | |
| 309 | - } | |
| 310 | - db_reset(&q); | |
| 311 | - } | |
| 302 | + } | |
| 303 | + if( 0==pSrc ){ | |
| 304 | + /* Setting is not versionable or we had no versioned value, so | |
| 305 | + ** use the value from localdb.vvar or repository.config (in | |
| 306 | + ** that order). */ | |
| 307 | + db_bind_text(&q, ":name", pSet->name); | |
| 308 | + if( SQLITE_ROW==db_step(&q) ){ | |
| 309 | + pSrc = json_new_string(db_column_text(&q, 0)); | |
| 310 | + pVal = json_new_string(db_column_text(&q, 1)); | |
| 311 | + } | |
| 312 | + db_reset(&q); | |
| 312 | 313 | } |
| 313 | 314 | } |
| 314 | 315 | cson_object_set(jSet, "valueSource", pSrc ? pSrc : cson_value_null()); |
| 315 | 316 | cson_object_set(jSet, "value", pVal ? pVal : cson_value_null()); |
| 316 | 317 | }/*aSetting loop*/ |
| 317 | 318 |
| --- src/json_config.c | |
| +++ src/json_config.c | |
| @@ -281,12 +281,12 @@ | |
| 281 | blob_reset(&content); |
| 282 | } |
| 283 | db_reset(&qFoci); |
| 284 | } |
| 285 | if( 0==pSrc && g.localOpen ){ |
| 286 | /* Pull value from a local .fossil-settings/X file, if one |
| 287 | ** exists. */ |
| 288 | Blob versionedPathname; |
| 289 | blob_zero(&versionedPathname); |
| 290 | blob_appendf(&versionedPathname, "%s.fossil-settings/%s", |
| 291 | g.zLocalRoot, pSet->name); |
| 292 | if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){ |
| @@ -297,20 +297,21 @@ | |
| 297 | pVal = json_new_string(blob_str(&content)); |
| 298 | blob_reset(&content); |
| 299 | } |
| 300 | blob_reset(&versionedPathname); |
| 301 | } |
| 302 | if( 0==pSrc ){ |
| 303 | /* We had no versioned value, so use the value from |
| 304 | ** localdb.vvar or repository.config (in that order). */ |
| 305 | db_bind_text(&q, ":name", pSet->name); |
| 306 | if( SQLITE_ROW==db_step(&q) ){ |
| 307 | pSrc = json_new_string(db_column_text(&q, 0)); |
| 308 | pVal = json_new_string(db_column_text(&q, 1)); |
| 309 | } |
| 310 | db_reset(&q); |
| 311 | } |
| 312 | } |
| 313 | } |
| 314 | cson_object_set(jSet, "valueSource", pSrc ? pSrc : cson_value_null()); |
| 315 | cson_object_set(jSet, "value", pVal ? pVal : cson_value_null()); |
| 316 | }/*aSetting loop*/ |
| 317 |
| --- src/json_config.c | |
| +++ src/json_config.c | |
| @@ -281,12 +281,12 @@ | |
| 281 | blob_reset(&content); |
| 282 | } |
| 283 | db_reset(&qFoci); |
| 284 | } |
| 285 | if( 0==pSrc && g.localOpen ){ |
| 286 | /* Pull value from a checkout-local .fossil-settings/X file, |
| 287 | ** if one exists. */ |
| 288 | Blob versionedPathname; |
| 289 | blob_zero(&versionedPathname); |
| 290 | blob_appendf(&versionedPathname, "%s.fossil-settings/%s", |
| 291 | g.zLocalRoot, pSet->name); |
| 292 | if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){ |
| @@ -297,20 +297,21 @@ | |
| 297 | pVal = json_new_string(blob_str(&content)); |
| 298 | blob_reset(&content); |
| 299 | } |
| 300 | blob_reset(&versionedPathname); |
| 301 | } |
| 302 | } |
| 303 | if( 0==pSrc ){ |
| 304 | /* Setting is not versionable or we had no versioned value, so |
| 305 | ** use the value from localdb.vvar or repository.config (in |
| 306 | ** that order). */ |
| 307 | db_bind_text(&q, ":name", pSet->name); |
| 308 | if( SQLITE_ROW==db_step(&q) ){ |
| 309 | pSrc = json_new_string(db_column_text(&q, 0)); |
| 310 | pVal = json_new_string(db_column_text(&q, 1)); |
| 311 | } |
| 312 | db_reset(&q); |
| 313 | } |
| 314 | } |
| 315 | cson_object_set(jSet, "valueSource", pSrc ? pSrc : cson_value_null()); |
| 316 | cson_object_set(jSet, "value", pVal ? pVal : cson_value_null()); |
| 317 | }/*aSetting loop*/ |
| 318 |