Fossil SCM

Roll back a broken part of [f3d3d1be59728b5dde702a] which caused only versioned settings' values to be fetched.

stephan 2023-01-19 23:44 json-settings-command
Commit c7221a2e8c8cc175ccf5f32540af3f6f74ab53aff17ed524004983b7c393fdfc
1 file changed +13 -12
+13 -12
--- src/json_config.c
+++ src/json_config.c
@@ -281,12 +281,12 @@
281281
blob_reset(&content);
282282
}
283283
db_reset(&qFoci);
284284
}
285285
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. */
288288
Blob versionedPathname;
289289
blob_zero(&versionedPathname);
290290
blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
291291
g.zLocalRoot, pSet->name);
292292
if( file_size(blob_str(&versionedPathname), ExtFILE)>=0 ){
@@ -297,20 +297,21 @@
297297
pVal = json_new_string(blob_str(&content));
298298
blob_reset(&content);
299299
}
300300
blob_reset(&versionedPathname);
301301
}
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);
312313
}
313314
}
314315
cson_object_set(jSet, "valueSource", pSrc ? pSrc : cson_value_null());
315316
cson_object_set(jSet, "value", pVal ? pVal : cson_value_null());
316317
}/*aSetting loop*/
317318
--- 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

Keyboard Shortcuts

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