Fossil SCM

Read the settings to test from the source, and re-enable settings.test

danshearer 2026-11-11 08:29 UTC test-suite-new
Commit c2b55363da1cd693c6c02dbcbac681bb0eb111d7dc0215444af6717ff9e383a0
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -17,10 +17,16 @@
1717
#
1818
# The "settings" and "unset" commands that may modify the repository.
1919
#
2020
2121
set path [file dirname [info script]]
22
+
23
+if {![file isdirectory [get_source_dir]]} {
24
+ puts "The source directory [get_source_dir], which defines the settings\
25
+to test, is not present."
26
+ test_cleanup_then_return
27
+}
2228
2329
require_no_open_checkout
2430
2531
test_setup
2632
2733
2834
ADDED test/settings.test
2935
DELETED test/settings.test.off
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -17,10 +17,16 @@
17 #
18 # The "settings" and "unset" commands that may modify the repository.
19 #
20
21 set path [file dirname [info script]]
 
 
 
 
 
 
22
23 require_no_open_checkout
24
25 test_setup
26
27
28 DDED test/settings.test
29 ELETED test/settings.test.off
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -17,10 +17,16 @@
17 #
18 # The "settings" and "unset" commands that may modify the repository.
19 #
20
21 set path [file dirname [info script]]
22
23 if {![file isdirectory [get_source_dir]]} {
24 puts "The source directory [get_source_dir], which defines the settings\
25 to test, is not present."
26 test_cleanup_then_return
27 }
28
29 require_no_open_checkout
30
31 test_setup
32
33
34 DDED test/settings.test
35 ELETED test/settings.test.off
--- a/test/settings.test
+++ b/test/settings.test
@@ -18,17 +18,27 @@
1818
# The "settings" and "unset" commands.
1919
#
2020
21
-set path [file dirname [info script]]; t (c) 2016 D. Richard Hipp
21
+set path [file dirname [info script]]
22
+
23
+if {![file isdirectputs "The source directory [get_sou settings\
24
+to test, is not present."
25
+ test_cleanup_then_returns to test, is not present."
26
+}
27
+
28
+test_setup
29
+
30
+###############################################################################
2231
#
23
-# This program is free software; you can redistribute it and/or
24
-# modify it under the terms of the Simplified BSD License (also
25
-# known as the "2-Clause License" or "FreeBSD License".)
32
+# Complete syntax as tested:
2633
#
27
-# This program is distributed in the hope that it will be useful,
28
-# but without any warranty; without even the implied warranty of
29
-# merchantability or fitness for a particular purpose.
34
+# fossil settings ?PROPERTY? ?VALUE? ?OPTIONS?
35
+# fossil unset PROPERTY ?OPTIONS?
3036
#
31
-# s the list
37
+# Where the only supported options are "--global" and "--exact".
38
+#
39
+###############################################################################
40
+#
41
+# NOTE: The [get_all_settings] procedure from test/tester.tcl reads the list
3242
# of settings to test from the "SETTING:" comments in the source files,
3343
# so these tests compare the settings of the fossil binary with the
3444
# settings its source defines.
@@ -62,4 +72,5 @@
6272
fossil settings --global
6373
set global_settings [extract_setting_names [normalize_result_no_trim]]
6474
65
-foreach name $all_sett
75
+foreach name $all_settings {
76
+ test settings-have-local-$na
--- a/test/settings.test
+++ b/test/settings.test
@@ -18,17 +18,27 @@
18 # The "settings" and "unset" commands.
19 #
20
21 set path [file dirname [info script]]; t (c) 2016 D. Richard Hipp
 
 
 
 
 
 
 
 
 
22 #
23 # This program is free software; you can redistribute it and/or
24 # modify it under the terms of the Simplified BSD License (also
25 # known as the "2-Clause License" or "FreeBSD License".)
26 #
27 # This program is distributed in the hope that it will be useful,
28 # but without any warranty; without even the implied warranty of
29 # merchantability or fitness for a particular purpose.
30 #
31 # s the list
 
 
 
 
32 # of settings to test from the "SETTING:" comments in the source files,
33 # so these tests compare the settings of the fossil binary with the
34 # settings its source defines.
@@ -62,4 +72,5 @@
62 fossil settings --global
63 set global_settings [extract_setting_names [normalize_result_no_trim]]
64
65 foreach name $all_sett
 
--- a/test/settings.test
+++ b/test/settings.test
@@ -18,17 +18,27 @@
18 # The "settings" and "unset" commands.
19 #
20
21 set path [file dirname [info script]]
22
23 if {![file isdirectputs "The source directory [get_sou settings\
24 to test, is not present."
25 test_cleanup_then_returns to test, is not present."
26 }
27
28 test_setup
29
30 ###############################################################################
31 #
32 # Complete syntax as tested:
 
 
33 #
34 # fossil settings ?PROPERTY? ?VALUE? ?OPTIONS?
35 # fossil unset PROPERTY ?OPTIONS?
 
36 #
37 # Where the only supported options are "--global" and "--exact".
38 #
39 ###############################################################################
40 #
41 # NOTE: The [get_all_settings] procedure from test/tester.tcl reads the list
42 # of settings to test from the "SETTING:" comments in the source files,
43 # so these tests compare the settings of the fossil binary with the
44 # settings its source defines.
@@ -62,4 +72,5 @@
72 fossil settings --global
73 set global_settings [extract_setting_names [normalize_result_no_trim]]
74
75 foreach name $all_settings {
76 test settings-have-local-$na
D test/settings.test.off
-65
--- a/test/settings.test.off
+++ b/test/settings.test.off
@@ -1,65 +0,0 @@
1
-#
2
-# Copyright (c) 2016 D. Richard Hipp
3
-#
4
-# This program is free software; you can redistribute it and/or
5
-# modify it under the terms of the Simplified BSD License (also
6
-# known as the "2-Clause License" or "FreeBSD License".)
7
-#
8
-# This program is distributed in the hope that it will be useful,
9
-# but without any warranty; without even the implied warranty of
10
-# merchantability or fitness for a particular purpose.
11
-#
12
-# Author contact information:
13
-# [email protected]
14
-# http://www.hwaci.com/drh/
15
-#
16
-############################################################################
17
-#
18
-# The "settings" and "unset" commands.
19
-#
20
-
21
-set path [file dirname [info script]]; t (c) 2016 D. Richard Hipp
22
-#
23
-# This program is free software; you can redistribute it and/or
24
-# modify it under the terms of the Simplified BSD License (also
25
-# known as the "2-Clause License" or "FreeBSD License".)
26
-#
27
-# This program is distributed in the hope that it will be useful,
28
-# but without any warranty; without even the implied warranty of
29
-# merchantability or fitness for a particular purpose.
30
-#
31
-# s the list
32
-# of settings to test from the "SETTING:" comments in the source files,
33
-# so these tests compare the settings of the fossil binary with the
34
-# settings its source defines.
35
-#
36
-###############################################################################
37
-#
38
-# NOTE: The [extract_setting_names] procedure extracts the list of setting
39
-# names from the line-ending normalized output of the "fossil settings"
40
-# command. It assumes that a setting name must begin with a lowercase
41
-# letter. It also assumes that any output lines that start with a
42
-# lowercase letter contain a setting name starting at that same point.
43
-#
44
-proc extract_setting_names { data } {
45
- set names [list]
46
-
47
- foreach {dummy name} [regexp \
48
- -all -line -inline -- {^([a-z][a-z0-9\-]*) ?.*$} $data] {
49
- lappend names $name
50
- }
51
-
52
- return $names
53
-}
54
-
55
-###############################################################################
56
-
57
-set all_settings [get_all_settings]
58
-
59
-fossil settings
60
-set local_settings [extract_setting_names [normalize_result_no_trim]]
61
-
62
-fossil settings --global
63
-set global_settings [extract_setting_names [normalize_result_no_trim]]
64
-
65
-foreach name $all_sett
--- a/test/settings.test.off
+++ b/test/settings.test.off
@@ -1,65 +0,0 @@
1 #
2 # Copyright (c) 2016 D. Richard Hipp
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the Simplified BSD License (also
6 # known as the "2-Clause License" or "FreeBSD License".)
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but without any warranty; without even the implied warranty of
10 # merchantability or fitness for a particular purpose.
11 #
12 # Author contact information:
13 # [email protected]
14 # http://www.hwaci.com/drh/
15 #
16 ############################################################################
17 #
18 # The "settings" and "unset" commands.
19 #
20
21 set path [file dirname [info script]]; t (c) 2016 D. Richard Hipp
22 #
23 # This program is free software; you can redistribute it and/or
24 # modify it under the terms of the Simplified BSD License (also
25 # known as the "2-Clause License" or "FreeBSD License".)
26 #
27 # This program is distributed in the hope that it will be useful,
28 # but without any warranty; without even the implied warranty of
29 # merchantability or fitness for a particular purpose.
30 #
31 # s the list
32 # of settings to test from the "SETTING:" comments in the source files,
33 # so these tests compare the settings of the fossil binary with the
34 # settings its source defines.
35 #
36 ###############################################################################
37 #
38 # NOTE: The [extract_setting_names] procedure extracts the list of setting
39 # names from the line-ending normalized output of the "fossil settings"
40 # command. It assumes that a setting name must begin with a lowercase
41 # letter. It also assumes that any output lines that start with a
42 # lowercase letter contain a setting name starting at that same point.
43 #
44 proc extract_setting_names { data } {
45 set names [list]
46
47 foreach {dummy name} [regexp \
48 -all -line -inline -- {^([a-z][a-z0-9\-]*) ?.*$} $data] {
49 lappend names $name
50 }
51
52 return $names
53 }
54
55 ###############################################################################
56
57 set all_settings [get_all_settings]
58
59 fossil settings
60 set local_settings [extract_setting_names [normalize_result_no_trim]]
61
62 fossil settings --global
63 set global_settings [extract_setting_names [normalize_result_no_trim]]
64
65 foreach name $all_sett
--- a/test/settings.test.off
+++ b/test/settings.test.off
@@ -1,65 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
+70 -153
--- test/tester.tcl
+++ test/tester.tcl
@@ -248,172 +248,89 @@
248248
close $out
249249
}
250250
proc write_file_indented {filename txt} {
251251
write_file $filename [string trim [string map [list "\n " \n] $txt]]\n
252252
}
253
+
254
+# Returns the directory of Fossil source files that the settings come
255
+# from: src/, beside the directory of this script.
256
+#
257
+proc get_source_dir {} {
258
+ return [file join [file dirname $::testfiledir] src]
259
+}
260
+
261
+# Returns a dictionary of the settings defined in the source files, with
262
+# the setting name as key and a list {VERSIONABLE CONDITIONAL} as value.
263
+#
264
+# A setting is defined by a "** SETTING: NAME ?FLAGS?" comment, which
265
+# tools/mkindex.c reads to build the table of settings compiled into
266
+# fossil. The setting is versionable if FLAGS include "versionable".
267
+# As in mkindex, a setting is conditional when the last preprocessor
268
+# line before it starts with "#if", and a line starting with "#e", such
269
+# as "#else" or "#endif", ends that condition. A setting defined more
270
+# than once, such as case-sensitive, is defined under alternative
271
+# conditions, so it is not conditional.
272
+#
273
+proc get_source_settings {} {
274
+ set count [dict create]
275
+ set result [dict create]
276
+ foreach fileName [glob -nocomplain -directory [get_source_dir] *.c] {
277
+ set inIf 0
278
+ foreach line [split [read_file $fileName] \n] {
279
+ if {[regexp {^#\s*(\S)(\S)?} $line dummy c1 c2]} {
280
+ if {"$c1$c2" eq "if"} {
281
+ set inIf 1
282
+ } elseif {$c1 eq "e"} {
283
+ set inIf 0
284
+ }
285
+ } elseif {[regexp -- {^\*\* SETTING:\s+(\S+)(.*)$} $line \
286
+ dummy name flags]} {
287
+ set flags [regexp -all -inline {\S+} $flags]
288
+ set versionable [expr {"versionable" in $flags}]
289
+ dict incr count $name
290
+ dict set result $name [list $versionable $inIf]
291
+ }
292
+ }
293
+ }
294
+ if {[dict size $result] == 0} {
295
+ error "No \"** SETTING:\" comments found in [get_source_dir]/*.c"
296
+ }
297
+ dict for {name n} $count {
298
+ if {$n > 1} {
299
+ dict set result $name [list [lindex [dict get $result $name] 0] 0]
300
+ }
301
+ }
302
+ return $result
303
+}
304
+
305
+# Returns the settings defined in the source files that this fossil
306
+# binary has: every unconditional setting, and each conditional setting
307
+# that "fossil settings NAME --exact" accepts. With VERSIONABLE true,
308
+# returns only the versionable ones.
309
+#
310
+proc get_source_settings_in_binary {versionable} {
311
+ set result [list]
312
+ dict for {name info} [get_source_settings] {
313
+ lassign $info isVersionable isConditional
314
+ if {$versionable && !$isVersionable} continue
315
+ if {$isConditional && \
316
+ [catch {exec $::fossilexe settings $name --exact}]} continue
317
+ lappend result $name
318
+ }
319
+ return [lsort -dictionary $result]
320
+}
253321
254322
# Returns the list of all supported versionable settings.
255323
#
256324
proc get_versionable_settings {} {
257
- #
258
- # TODO: If the list of supported versionable settings in "db.c" is modified,
259
- # this list (and procedure) most likely needs to be modified as well.
260
- #
261
- set result [list \
262
- binary-glob \
263
- clean-glob \
264
- crlf-glob \
265
- crnl-glob \
266
- dotfiles \
267
- empty-dirs \
268
- encoding-glob \
269
- ignore-glob \
270
- keep-glob \
271
- manifest]
272
-
273
- return [lsort -dictionary $result]
325
+ return [get_source_settings_in_binary 1]
274326
}
275327
276328
# Returns the list of all supported settings.
277329
#
278330
proc get_all_settings {} {
279
- #
280
- # TODO: If the list of supported settings in "db.c" is modified, this list
281
- # (and procedure) most likely needs to be modified as well.
282
- #
283
- set result [list \
284
- access-log \
285
- admin-log \
286
- allow-symlinks \
287
- auto-captcha \
288
- auto-hyperlink \
289
- auto-hyperlink-delay \
290
- auto-hyperlink-mouseover \
291
- auto-shun \
292
- autosync \
293
- autosync-tries \
294
- backoffice-disable \
295
- backoffice-logfile \
296
- backoffice-nodelay \
297
- binary-glob \
298
- case-sensitive \
299
- chat-alert-sound \
300
- chat-initial-history \
301
- chat-inline-images \
302
- chat-keep-count \
303
- chat-keep-days \
304
- chat-poll-timeout \
305
- chat-timeline-user \
306
- clean-glob \
307
- clearsign \
308
- comment-format \
309
- crlf-glob \
310
- crnl-glob \
311
- default-csp \
312
- default-perms \
313
- default-skin \
314
- diff-binary \
315
- diff-command \
316
- dont-commit \
317
- dont-push \
318
- dotfiles \
319
- editor \
320
- email-admin \
321
- email-listid \
322
- email-renew-interval \
323
- email-self \
324
- email-send-command \
325
- email-send-db \
326
- email-send-dir \
327
- email-send-method \
328
- email-send-relayhost \
329
- email-subname \
330
- email-url \
331
- empty-dirs \
332
- encoding-glob \
333
- exec-rel-paths \
334
- fileedit-glob \
335
- forbid-delta-manifests \
336
- forum-close-policy \
337
- forum-title \
338
- gdiff-command \
339
- gmerge-command \
340
- hash-digits \
341
- hooks \
342
- http-port \
343
- https-login \
344
- ignore-glob \
345
- keep-glob \
346
- large-file-size \
347
- localauth \
348
- lock-timeout \
349
- main-branch \
350
- mainmenu \
351
- manifest \
352
- max-cache-entry \
353
- max-loadavg \
354
- max-upload \
355
- mimetypes \
356
- mtime-changes \
357
- mv-rm-files \
358
- pgp-command \
359
- preferred-diff-type \
360
- proxy \
361
- raw-bgcolor \
362
- redirect-to-https \
363
- relative-paths \
364
- repo-cksum \
365
- repolist-skin \
366
- robot-restrict \
367
- robots-txt \
368
- safe-html \
369
- self-pw-reset \
370
- self-register \
371
- sitemap-extra \
372
- ssh-command \
373
- ssl-ca-location \
374
- ssl-identity \
375
- tclsh \
376
- th1-setup \
377
- th1-uri-regexp \
378
- ticket-default-report \
379
- timeline-hard-newlines \
380
- timeline-plaintext \
381
- timeline-truncate-at-blank \
382
- timeline-tslink-info \
383
- timeline-utc \
384
- user-color-map \
385
- verify-comments \
386
- uv-sync \
387
- vuln-report \
388
- web-browser]
389
-
390
- fossil test-th-eval "hasfeature legacyMvRm"
391
-
392
- if {[normalize_result] eq "1"} {
393
- lappend result mv-rm-files
394
- }
395
-
396
- fossil test-th-eval "hasfeature tcl"
397
-
398
- if {[normalize_result] eq "1"} {
399
- lappend result tcl tcl-setup
400
- }
401
-
402
- fossil test-th-eval "hasfeature th1Docs"
403
-
404
- if {[normalize_result] eq "1"} {
405
- lappend result th1-docs
406
- }
407
-
408
- fossil test-th-eval "hasfeature th1Hooks"
409
-
410
- if {[normalize_result] eq "1"} {
411
- lappend result th1-hooks
412
- }
413
-
414
- return [lsort -dictionary $result]
331
+ return [get_source_settings_in_binary 0]
415332
}
416333
417334
# Return true if two files are the same
418335
#
419336
proc same_file {a b} {
420337
--- test/tester.tcl
+++ test/tester.tcl
@@ -248,172 +248,89 @@
248 close $out
249 }
250 proc write_file_indented {filename txt} {
251 write_file $filename [string trim [string map [list "\n " \n] $txt]]\n
252 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
254 # Returns the list of all supported versionable settings.
255 #
256 proc get_versionable_settings {} {
257 #
258 # TODO: If the list of supported versionable settings in "db.c" is modified,
259 # this list (and procedure) most likely needs to be modified as well.
260 #
261 set result [list \
262 binary-glob \
263 clean-glob \
264 crlf-glob \
265 crnl-glob \
266 dotfiles \
267 empty-dirs \
268 encoding-glob \
269 ignore-glob \
270 keep-glob \
271 manifest]
272
273 return [lsort -dictionary $result]
274 }
275
276 # Returns the list of all supported settings.
277 #
278 proc get_all_settings {} {
279 #
280 # TODO: If the list of supported settings in "db.c" is modified, this list
281 # (and procedure) most likely needs to be modified as well.
282 #
283 set result [list \
284 access-log \
285 admin-log \
286 allow-symlinks \
287 auto-captcha \
288 auto-hyperlink \
289 auto-hyperlink-delay \
290 auto-hyperlink-mouseover \
291 auto-shun \
292 autosync \
293 autosync-tries \
294 backoffice-disable \
295 backoffice-logfile \
296 backoffice-nodelay \
297 binary-glob \
298 case-sensitive \
299 chat-alert-sound \
300 chat-initial-history \
301 chat-inline-images \
302 chat-keep-count \
303 chat-keep-days \
304 chat-poll-timeout \
305 chat-timeline-user \
306 clean-glob \
307 clearsign \
308 comment-format \
309 crlf-glob \
310 crnl-glob \
311 default-csp \
312 default-perms \
313 default-skin \
314 diff-binary \
315 diff-command \
316 dont-commit \
317 dont-push \
318 dotfiles \
319 editor \
320 email-admin \
321 email-listid \
322 email-renew-interval \
323 email-self \
324 email-send-command \
325 email-send-db \
326 email-send-dir \
327 email-send-method \
328 email-send-relayhost \
329 email-subname \
330 email-url \
331 empty-dirs \
332 encoding-glob \
333 exec-rel-paths \
334 fileedit-glob \
335 forbid-delta-manifests \
336 forum-close-policy \
337 forum-title \
338 gdiff-command \
339 gmerge-command \
340 hash-digits \
341 hooks \
342 http-port \
343 https-login \
344 ignore-glob \
345 keep-glob \
346 large-file-size \
347 localauth \
348 lock-timeout \
349 main-branch \
350 mainmenu \
351 manifest \
352 max-cache-entry \
353 max-loadavg \
354 max-upload \
355 mimetypes \
356 mtime-changes \
357 mv-rm-files \
358 pgp-command \
359 preferred-diff-type \
360 proxy \
361 raw-bgcolor \
362 redirect-to-https \
363 relative-paths \
364 repo-cksum \
365 repolist-skin \
366 robot-restrict \
367 robots-txt \
368 safe-html \
369 self-pw-reset \
370 self-register \
371 sitemap-extra \
372 ssh-command \
373 ssl-ca-location \
374 ssl-identity \
375 tclsh \
376 th1-setup \
377 th1-uri-regexp \
378 ticket-default-report \
379 timeline-hard-newlines \
380 timeline-plaintext \
381 timeline-truncate-at-blank \
382 timeline-tslink-info \
383 timeline-utc \
384 user-color-map \
385 verify-comments \
386 uv-sync \
387 vuln-report \
388 web-browser]
389
390 fossil test-th-eval "hasfeature legacyMvRm"
391
392 if {[normalize_result] eq "1"} {
393 lappend result mv-rm-files
394 }
395
396 fossil test-th-eval "hasfeature tcl"
397
398 if {[normalize_result] eq "1"} {
399 lappend result tcl tcl-setup
400 }
401
402 fossil test-th-eval "hasfeature th1Docs"
403
404 if {[normalize_result] eq "1"} {
405 lappend result th1-docs
406 }
407
408 fossil test-th-eval "hasfeature th1Hooks"
409
410 if {[normalize_result] eq "1"} {
411 lappend result th1-hooks
412 }
413
414 return [lsort -dictionary $result]
415 }
416
417 # Return true if two files are the same
418 #
419 proc same_file {a b} {
420
--- test/tester.tcl
+++ test/tester.tcl
@@ -248,172 +248,89 @@
248 close $out
249 }
250 proc write_file_indented {filename txt} {
251 write_file $filename [string trim [string map [list "\n " \n] $txt]]\n
252 }
253
254 # Returns the directory of Fossil source files that the settings come
255 # from: src/, beside the directory of this script.
256 #
257 proc get_source_dir {} {
258 return [file join [file dirname $::testfiledir] src]
259 }
260
261 # Returns a dictionary of the settings defined in the source files, with
262 # the setting name as key and a list {VERSIONABLE CONDITIONAL} as value.
263 #
264 # A setting is defined by a "** SETTING: NAME ?FLAGS?" comment, which
265 # tools/mkindex.c reads to build the table of settings compiled into
266 # fossil. The setting is versionable if FLAGS include "versionable".
267 # As in mkindex, a setting is conditional when the last preprocessor
268 # line before it starts with "#if", and a line starting with "#e", such
269 # as "#else" or "#endif", ends that condition. A setting defined more
270 # than once, such as case-sensitive, is defined under alternative
271 # conditions, so it is not conditional.
272 #
273 proc get_source_settings {} {
274 set count [dict create]
275 set result [dict create]
276 foreach fileName [glob -nocomplain -directory [get_source_dir] *.c] {
277 set inIf 0
278 foreach line [split [read_file $fileName] \n] {
279 if {[regexp {^#\s*(\S)(\S)?} $line dummy c1 c2]} {
280 if {"$c1$c2" eq "if"} {
281 set inIf 1
282 } elseif {$c1 eq "e"} {
283 set inIf 0
284 }
285 } elseif {[regexp -- {^\*\* SETTING:\s+(\S+)(.*)$} $line \
286 dummy name flags]} {
287 set flags [regexp -all -inline {\S+} $flags]
288 set versionable [expr {"versionable" in $flags}]
289 dict incr count $name
290 dict set result $name [list $versionable $inIf]
291 }
292 }
293 }
294 if {[dict size $result] == 0} {
295 error "No \"** SETTING:\" comments found in [get_source_dir]/*.c"
296 }
297 dict for {name n} $count {
298 if {$n > 1} {
299 dict set result $name [list [lindex [dict get $result $name] 0] 0]
300 }
301 }
302 return $result
303 }
304
305 # Returns the settings defined in the source files that this fossil
306 # binary has: every unconditional setting, and each conditional setting
307 # that "fossil settings NAME --exact" accepts. With VERSIONABLE true,
308 # returns only the versionable ones.
309 #
310 proc get_source_settings_in_binary {versionable} {
311 set result [list]
312 dict for {name info} [get_source_settings] {
313 lassign $info isVersionable isConditional
314 if {$versionable && !$isVersionable} continue
315 if {$isConditional && \
316 [catch {exec $::fossilexe settings $name --exact}]} continue
317 lappend result $name
318 }
319 return [lsort -dictionary $result]
320 }
321
322 # Returns the list of all supported versionable settings.
323 #
324 proc get_versionable_settings {} {
325 return [get_source_settings_in_binary 1]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326 }
327
328 # Returns the list of all supported settings.
329 #
330 proc get_all_settings {} {
331 return [get_source_settings_in_binary 0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332 }
333
334 # Return true if two files are the same
335 #
336 proc same_file {a b} {
337

Keyboard Shortcuts

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