Fossil SCM

Merge trunk. Make it work on Windows too. Variable width output on more commands.

jan.nijtmans 2014-06-16 09:05 autoadjust merge
Commit 40710b7a05492679b6dd515afcb844a652852c20
+23
--- auto.def
+++ auto.def
@@ -4,17 +4,19 @@
44
55
options {
66
with-openssl:path|auto|none
77
=> {Look for openssl in the given path, or auto or none}
88
with-zlib:path => {Look for zlib in the given path}
9
+ with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
910
with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
1011
with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
1112
with-tcl-private-stubs=0
1213
=> {Enable Tcl integration via private stubs mechanism}
1314
internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
1415
static=0 => {Link a static executable}
1516
lineedit=1 => {Disable line editing}
17
+ fusefs=1 => {Disable the Fuse Filesystem}
1618
fossil-debug=0 => {Build with fossil debugging enabled}
1719
json=0 => {Build with fossil JSON API enabled}
1820
}
1921
2022
# sqlite wants these types if possible
@@ -69,28 +71,38 @@
6971
define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500
7072
}
7173
7274
if {[opt-bool fossil-debug]} {
7375
define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
76
+ msg-result "Debugging support enabled"
7477
}
7578
7679
if {[opt-bool json]} {
7780
# Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
7881
# is required in the CFLAGS because json*.c
7982
# have #ifdef guards around the whole file without
8083
# reading config.h first.
8184
define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
8285
define FOSSIL_ENABLE_JSON
86
+ msg-result "JSON support enabled"
87
+}
88
+
89
+if {[opt-bool with-th1-hooks]} {
90
+ define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
91
+ define FOSSIL_ENABLE_TH1_HOOKS
92
+ msg-result "TH1 hooks support enabled"
8393
}
8494
8595
#if {[opt-bool markdown]} {
8696
# # no-op. Markdown is now enabled by default.
97
+# msg-result "Markdown support enabled"
8798
#}
8899
89100
if {[opt-bool static]} {
90101
# XXX: This will not work on all systems.
91102
define-append EXTRA_LDFLAGS -static
103
+ msg-result "Trying to link statically"
92104
}
93105
94106
set tclpath [opt-val with-tcl]
95107
if {$tclpath ne ""} {
96108
set tclprivatestubs [opt-bool with-tcl-private-stubs]
@@ -222,10 +234,11 @@
222234
set zlibpath [opt-val with-zlib]
223235
if {$zlibpath ne ""} {
224236
cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
225237
define-append EXTRA_CFLAGS -I$zlibpath
226238
define-append EXTRA_LDFLAGS -L$zlibpath
239
+ msg-result "Using zlib from $zlibpath"
227240
}
228241
if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
229242
user-error "zlib not found please install it or specify the location with --with-zlib"
230243
}
231244
@@ -252,16 +265,26 @@
252265
cc-check-function-in-lib iconv iconv
253266
254267
# Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
255268
if {![cc-check-functions getloadavg]} {
256269
define FOSSIL_OMIT_LOAD_AVERAGE 1
270
+ msg-result "Load average support unavailable"
257271
}
258272
259273
# Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
260274
if {![cc-check-functions getpassphrase]} {
261275
# Haiku needs this
262276
cc-check-function-in-lib getpass bsd
263277
}
264278
cc-check-function-in-lib dlopen dl
279
+
280
+# Check for the FuseFS library
281
+if {[opt-bool fusefs]} {
282
+ if {[cc-check-function-in-lib fuse_mount fuse]} {
283
+ define FOSSIL_HAVE_FUSEFS 1
284
+ define-append LIBS -lfuse
285
+ msg-result "FuseFS support enabled"
286
+ }
287
+}
265288
266289
make-template Makefile.in
267290
make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
268291
--- auto.def
+++ auto.def
@@ -4,17 +4,19 @@
4
5 options {
6 with-openssl:path|auto|none
7 => {Look for openssl in the given path, or auto or none}
8 with-zlib:path => {Look for zlib in the given path}
 
9 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
10 with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
11 with-tcl-private-stubs=0
12 => {Enable Tcl integration via private stubs mechanism}
13 internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
14 static=0 => {Link a static executable}
15 lineedit=1 => {Disable line editing}
 
16 fossil-debug=0 => {Build with fossil debugging enabled}
17 json=0 => {Build with fossil JSON API enabled}
18 }
19
20 # sqlite wants these types if possible
@@ -69,28 +71,38 @@
69 define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500
70 }
71
72 if {[opt-bool fossil-debug]} {
73 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
 
74 }
75
76 if {[opt-bool json]} {
77 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
78 # is required in the CFLAGS because json*.c
79 # have #ifdef guards around the whole file without
80 # reading config.h first.
81 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
82 define FOSSIL_ENABLE_JSON
 
 
 
 
 
 
 
83 }
84
85 #if {[opt-bool markdown]} {
86 # # no-op. Markdown is now enabled by default.
 
87 #}
88
89 if {[opt-bool static]} {
90 # XXX: This will not work on all systems.
91 define-append EXTRA_LDFLAGS -static
 
92 }
93
94 set tclpath [opt-val with-tcl]
95 if {$tclpath ne ""} {
96 set tclprivatestubs [opt-bool with-tcl-private-stubs]
@@ -222,10 +234,11 @@
222 set zlibpath [opt-val with-zlib]
223 if {$zlibpath ne ""} {
224 cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
225 define-append EXTRA_CFLAGS -I$zlibpath
226 define-append EXTRA_LDFLAGS -L$zlibpath
 
227 }
228 if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
229 user-error "zlib not found please install it or specify the location with --with-zlib"
230 }
231
@@ -252,16 +265,26 @@
252 cc-check-function-in-lib iconv iconv
253
254 # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
255 if {![cc-check-functions getloadavg]} {
256 define FOSSIL_OMIT_LOAD_AVERAGE 1
 
257 }
258
259 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
260 if {![cc-check-functions getpassphrase]} {
261 # Haiku needs this
262 cc-check-function-in-lib getpass bsd
263 }
264 cc-check-function-in-lib dlopen dl
 
 
 
 
 
 
 
 
 
265
266 make-template Makefile.in
267 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
268
--- auto.def
+++ auto.def
@@ -4,17 +4,19 @@
4
5 options {
6 with-openssl:path|auto|none
7 => {Look for openssl in the given path, or auto or none}
8 with-zlib:path => {Look for zlib in the given path}
9 with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
10 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
11 with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
12 with-tcl-private-stubs=0
13 => {Enable Tcl integration via private stubs mechanism}
14 internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
15 static=0 => {Link a static executable}
16 lineedit=1 => {Disable line editing}
17 fusefs=1 => {Disable the Fuse Filesystem}
18 fossil-debug=0 => {Build with fossil debugging enabled}
19 json=0 => {Build with fossil JSON API enabled}
20 }
21
22 # sqlite wants these types if possible
@@ -69,28 +71,38 @@
71 define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500
72 }
73
74 if {[opt-bool fossil-debug]} {
75 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
76 msg-result "Debugging support enabled"
77 }
78
79 if {[opt-bool json]} {
80 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
81 # is required in the CFLAGS because json*.c
82 # have #ifdef guards around the whole file without
83 # reading config.h first.
84 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON
85 define FOSSIL_ENABLE_JSON
86 msg-result "JSON support enabled"
87 }
88
89 if {[opt-bool with-th1-hooks]} {
90 define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS
91 define FOSSIL_ENABLE_TH1_HOOKS
92 msg-result "TH1 hooks support enabled"
93 }
94
95 #if {[opt-bool markdown]} {
96 # # no-op. Markdown is now enabled by default.
97 # msg-result "Markdown support enabled"
98 #}
99
100 if {[opt-bool static]} {
101 # XXX: This will not work on all systems.
102 define-append EXTRA_LDFLAGS -static
103 msg-result "Trying to link statically"
104 }
105
106 set tclpath [opt-val with-tcl]
107 if {$tclpath ne ""} {
108 set tclprivatestubs [opt-bool with-tcl-private-stubs]
@@ -222,10 +234,11 @@
234 set zlibpath [opt-val with-zlib]
235 if {$zlibpath ne ""} {
236 cc-with [list -cflags "-I$zlibpath -L$zlibpath"]
237 define-append EXTRA_CFLAGS -I$zlibpath
238 define-append EXTRA_LDFLAGS -L$zlibpath
239 msg-result "Using zlib from $zlibpath"
240 }
241 if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} {
242 user-error "zlib not found please install it or specify the location with --with-zlib"
243 }
244
@@ -252,16 +265,26 @@
265 cc-check-function-in-lib iconv iconv
266
267 # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE
268 if {![cc-check-functions getloadavg]} {
269 define FOSSIL_OMIT_LOAD_AVERAGE 1
270 msg-result "Load average support unavailable"
271 }
272
273 # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars
274 if {![cc-check-functions getpassphrase]} {
275 # Haiku needs this
276 cc-check-function-in-lib getpass bsd
277 }
278 cc-check-function-in-lib dlopen dl
279
280 # Check for the FuseFS library
281 if {[opt-bool fusefs]} {
282 if {[cc-check-function-in-lib fuse_mount fuse]} {
283 define FOSSIL_HAVE_FUSEFS 1
284 define-append LIBS -lfuse
285 msg-result "FuseFS support enabled"
286 }
287 }
288
289 make-template Makefile.in
290 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
291
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -925,11 +925,11 @@
925925
}
926926
927927
# Load module source in the global scope by executing the given command
928928
proc automf_load {args} {
929929
if {[catch [list uplevel #0 $args] msg opts] ni {0 2 3}} {
930
- autosetup-full-error [error-dump $msg $opts]
930
+ autosetup-full-error [error-dump $msg $opts $::autosetup(debug)]
931931
}
932932
}
933933
934934
# Initial settings
935935
set autosetup(exe) $::argv0
@@ -1706,18 +1706,35 @@
17061706
return $msg
17071707
}
17081708
17091709
# Given the return from [catch {...} msg opts], returns an appropriate
17101710
# error message. A nice one for Jim and a less-nice one for Tcl.
1711
+# If 'fulltrace' is set, a full stack trace is provided.
1712
+# Otherwise a simple message is provided.
17111713
#
1712
-# This is designed for developer errors, e.g. in module code
1714
+# This is designed for developer errors, e.g. in module code or auto.def code
1715
+#
17131716
#
1714
-proc error-dump {msg opts} {
1717
+proc error-dump {msg opts fulltrace} {
17151718
if {$::autosetup(istcl)} {
1716
- return "Error: [dict get $opts -errorinfo]"
1719
+ if {$fulltrace} {
1720
+ return "Error: [dict get $opts -errorinfo]"
1721
+ } else {
1722
+ return "Error: $msg"
1723
+ }
17171724
} else {
1718
- return "Error: $msg\n[stackdump $opts(-errorinfo)]"
1725
+ lassign $opts(-errorinfo) p f l
1726
+ if {$f ne ""} {
1727
+ set result "$f:$l: Error: "
1728
+ }
1729
+ append result "$msg\n"
1730
+ if {$fulltrace} {
1731
+ append result [stackdump $opts(-errorinfo)]
1732
+ }
1733
+
1734
+ # Remove the trailing newline
1735
+ string trim $result
17191736
}
17201737
}
17211738
}
17221739
17231740
# ----- module text-formatting -----
@@ -1886,13 +1903,13 @@
18861903
# Entry/Exit
18871904
#
18881905
if {$autosetup(debug)} {
18891906
main $argv
18901907
}
1891
-if {[catch {main $argv} msg] == 1} {
1908
+if {[catch {main $argv} msg opts] == 1} {
18921909
show-notices
1893
- puts stderr [error-stacktrace $msg]
1894
- if {!$autosetup(debug) && !$autosetup(istcl)} {
1910
+ autosetup-full-error [error-dump $msg $opts $::autosetup(debug)]
1911
+ if {!$autosetup(debug)} {
18951912
puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace"
18961913
}
18971914
exit 1
18981915
}
18991916
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -925,11 +925,11 @@
925 }
926
927 # Load module source in the global scope by executing the given command
928 proc automf_load {args} {
929 if {[catch [list uplevel #0 $args] msg opts] ni {0 2 3}} {
930 autosetup-full-error [error-dump $msg $opts]
931 }
932 }
933
934 # Initial settings
935 set autosetup(exe) $::argv0
@@ -1706,18 +1706,35 @@
1706 return $msg
1707 }
1708
1709 # Given the return from [catch {...} msg opts], returns an appropriate
1710 # error message. A nice one for Jim and a less-nice one for Tcl.
 
 
1711 #
1712 # This is designed for developer errors, e.g. in module code
 
1713 #
1714 proc error-dump {msg opts} {
1715 if {$::autosetup(istcl)} {
1716 return "Error: [dict get $opts -errorinfo]"
 
 
 
 
1717 } else {
1718 return "Error: $msg\n[stackdump $opts(-errorinfo)]"
 
 
 
 
 
 
 
 
 
 
1719 }
1720 }
1721 }
1722
1723 # ----- module text-formatting -----
@@ -1886,13 +1903,13 @@
1886 # Entry/Exit
1887 #
1888 if {$autosetup(debug)} {
1889 main $argv
1890 }
1891 if {[catch {main $argv} msg] == 1} {
1892 show-notices
1893 puts stderr [error-stacktrace $msg]
1894 if {!$autosetup(debug) && !$autosetup(istcl)} {
1895 puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace"
1896 }
1897 exit 1
1898 }
1899
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -925,11 +925,11 @@
925 }
926
927 # Load module source in the global scope by executing the given command
928 proc automf_load {args} {
929 if {[catch [list uplevel #0 $args] msg opts] ni {0 2 3}} {
930 autosetup-full-error [error-dump $msg $opts $::autosetup(debug)]
931 }
932 }
933
934 # Initial settings
935 set autosetup(exe) $::argv0
@@ -1706,18 +1706,35 @@
1706 return $msg
1707 }
1708
1709 # Given the return from [catch {...} msg opts], returns an appropriate
1710 # error message. A nice one for Jim and a less-nice one for Tcl.
1711 # If 'fulltrace' is set, a full stack trace is provided.
1712 # Otherwise a simple message is provided.
1713 #
1714 # This is designed for developer errors, e.g. in module code or auto.def code
1715 #
1716 #
1717 proc error-dump {msg opts fulltrace} {
1718 if {$::autosetup(istcl)} {
1719 if {$fulltrace} {
1720 return "Error: [dict get $opts -errorinfo]"
1721 } else {
1722 return "Error: $msg"
1723 }
1724 } else {
1725 lassign $opts(-errorinfo) p f l
1726 if {$f ne ""} {
1727 set result "$f:$l: Error: "
1728 }
1729 append result "$msg\n"
1730 if {$fulltrace} {
1731 append result [stackdump $opts(-errorinfo)]
1732 }
1733
1734 # Remove the trailing newline
1735 string trim $result
1736 }
1737 }
1738 }
1739
1740 # ----- module text-formatting -----
@@ -1886,13 +1903,13 @@
1903 # Entry/Exit
1904 #
1905 if {$autosetup(debug)} {
1906 main $argv
1907 }
1908 if {[catch {main $argv} msg opts] == 1} {
1909 show-notices
1910 autosetup-full-error [error-dump $msg $opts $::autosetup(debug)]
1911 if {!$autosetup(debug)} {
1912 puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace"
1913 }
1914 exit 1
1915 }
1916
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -94,10 +94,19 @@
9494
define SHOBJ_LDFLAGS -b
9595
define SH_CFLAGS +z
9696
define SH_LINKFLAGS -Wl,+s
9797
define LD_LIBRARY_PATH SHLIB_PATH
9898
}
99
+ *-*-haiku {
100
+ define SHOBJ_CFLAGS ""
101
+ define SHOBJ_LDFLAGS -shared
102
+ define SH_CFLAGS ""
103
+ define SH_LDFLAGS -shared
104
+ define SH_LINKFLAGS ""
105
+ define SH_SOPREFIX ""
106
+ define LD_LIBRARY_PATH LIBRARY_PATH
107
+ }
99108
}
100109
101110
if {![is-defined SHOBJ_LDFLAGS_R]} {
102111
define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS]
103112
}
104113
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -94,10 +94,19 @@
94 define SHOBJ_LDFLAGS -b
95 define SH_CFLAGS +z
96 define SH_LINKFLAGS -Wl,+s
97 define LD_LIBRARY_PATH SHLIB_PATH
98 }
 
 
 
 
 
 
 
 
 
99 }
100
101 if {![is-defined SHOBJ_LDFLAGS_R]} {
102 define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS]
103 }
104
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -94,10 +94,19 @@
94 define SHOBJ_LDFLAGS -b
95 define SH_CFLAGS +z
96 define SH_LINKFLAGS -Wl,+s
97 define LD_LIBRARY_PATH SHLIB_PATH
98 }
99 *-*-haiku {
100 define SHOBJ_CFLAGS ""
101 define SHOBJ_LDFLAGS -shared
102 define SH_CFLAGS ""
103 define SH_LDFLAGS -shared
104 define SH_LINKFLAGS ""
105 define SH_SOPREFIX ""
106 define LD_LIBRARY_PATH LIBRARY_PATH
107 }
108 }
109
110 if {![is-defined SHOBJ_LDFLAGS_R]} {
111 define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS]
112 }
113
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -333,11 +333,11 @@
333333
}
334334
-libs {
335335
# Note that new libraries are added before previous libraries
336336
set new($name) [list {*}$value {*}$new($name)]
337337
}
338
- -link - -lang {
338
+ -link - -lang - -nooutput {
339339
set new($name) $value
340340
}
341341
-source - -sourcefile - -code {
342342
# XXX: These probably are only valid directly from cctest
343343
set new($name) $value
@@ -428,10 +428,11 @@
428428
## -lang c|c++ Use the C (default) or C++ compiler
429429
## -libs liblist List of libraries to link, e.g. {-ldl -lm}
430430
## -code code Code to compile in the body of main()
431431
## -source code Compile a complete program. Ignore -includes, -declare and -code
432432
## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file]
433
+## -nooutput 1 Treat any compiler output (e.g. a warning) as an error
433434
#
434435
# Unless -source or -sourcefile is specified, the C program looks like:
435436
#
436437
## #include <firstinclude> /* same for remaining includes in the list */
437438
##
@@ -521,11 +522,12 @@
521522
}
522523
523524
writefile $src $lines\n
524525
525526
set ok 1
526
- if {[catch {exec-with-stderr {*}$cmdline} result errinfo]} {
527
+ set err [catch {exec-with-stderr {*}$cmdline} result errinfo]
528
+ if {$err || ($opts(-nooutput) && [string length $result])} {
527529
configlog "Failed: [join $cmdline]"
528530
configlog $result
529531
configlog "============"
530532
configlog "The failed code was:"
531533
configlog $lines
@@ -671,27 +673,27 @@
671673
}
672674
673675
define CCACHE [find-an-executable [get-env CCACHE ccache]]
674676
675677
# Initial cctest settings
676
-cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {}}
678
+cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {} -nooutput 0}
677679
set autosetup(cc-include-deps) {}
678680
679681
msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]"
680682
if {[get-define CXX] ne "false"} {
681683
msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]"
682684
}
683685
msg-result "Build C compiler...[get-define CC_FOR_BUILD]"
684686
685
-# On Darwin, we prefer to use -gstabs to avoid creating .dSYM directories
686
-# but some compilers don't support -gstabs, so test for it here.
687
+# On Darwin, we prefer to use -g0 to avoid creating .dSYM directories
688
+# but some compilers may not support it, so test here.
687689
switch -glob -- [get-define host] {
688690
*-*-darwin* {
689
- if {[cctest -cflags {-gstabs}]} {
690
- define cc-default-debug -gstabs
691
+ if {[cctest -cflags {-g0}]} {
692
+ define cc-default-debug -g0
691693
}
692694
}
693695
}
694696
695697
if {![cc-check-includes stdlib.h]} {
696698
user-error "Compiler does not work. See config.log"
697699
}
698700
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -333,11 +333,11 @@
333 }
334 -libs {
335 # Note that new libraries are added before previous libraries
336 set new($name) [list {*}$value {*}$new($name)]
337 }
338 -link - -lang {
339 set new($name) $value
340 }
341 -source - -sourcefile - -code {
342 # XXX: These probably are only valid directly from cctest
343 set new($name) $value
@@ -428,10 +428,11 @@
428 ## -lang c|c++ Use the C (default) or C++ compiler
429 ## -libs liblist List of libraries to link, e.g. {-ldl -lm}
430 ## -code code Code to compile in the body of main()
431 ## -source code Compile a complete program. Ignore -includes, -declare and -code
432 ## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file]
 
433 #
434 # Unless -source or -sourcefile is specified, the C program looks like:
435 #
436 ## #include <firstinclude> /* same for remaining includes in the list */
437 ##
@@ -521,11 +522,12 @@
521 }
522
523 writefile $src $lines\n
524
525 set ok 1
526 if {[catch {exec-with-stderr {*}$cmdline} result errinfo]} {
 
527 configlog "Failed: [join $cmdline]"
528 configlog $result
529 configlog "============"
530 configlog "The failed code was:"
531 configlog $lines
@@ -671,27 +673,27 @@
671 }
672
673 define CCACHE [find-an-executable [get-env CCACHE ccache]]
674
675 # Initial cctest settings
676 cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {}}
677 set autosetup(cc-include-deps) {}
678
679 msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]"
680 if {[get-define CXX] ne "false"} {
681 msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]"
682 }
683 msg-result "Build C compiler...[get-define CC_FOR_BUILD]"
684
685 # On Darwin, we prefer to use -gstabs to avoid creating .dSYM directories
686 # but some compilers don't support -gstabs, so test for it here.
687 switch -glob -- [get-define host] {
688 *-*-darwin* {
689 if {[cctest -cflags {-gstabs}]} {
690 define cc-default-debug -gstabs
691 }
692 }
693 }
694
695 if {![cc-check-includes stdlib.h]} {
696 user-error "Compiler does not work. See config.log"
697 }
698
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -333,11 +333,11 @@
333 }
334 -libs {
335 # Note that new libraries are added before previous libraries
336 set new($name) [list {*}$value {*}$new($name)]
337 }
338 -link - -lang - -nooutput {
339 set new($name) $value
340 }
341 -source - -sourcefile - -code {
342 # XXX: These probably are only valid directly from cctest
343 set new($name) $value
@@ -428,10 +428,11 @@
428 ## -lang c|c++ Use the C (default) or C++ compiler
429 ## -libs liblist List of libraries to link, e.g. {-ldl -lm}
430 ## -code code Code to compile in the body of main()
431 ## -source code Compile a complete program. Ignore -includes, -declare and -code
432 ## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file]
433 ## -nooutput 1 Treat any compiler output (e.g. a warning) as an error
434 #
435 # Unless -source or -sourcefile is specified, the C program looks like:
436 #
437 ## #include <firstinclude> /* same for remaining includes in the list */
438 ##
@@ -521,11 +522,12 @@
522 }
523
524 writefile $src $lines\n
525
526 set ok 1
527 set err [catch {exec-with-stderr {*}$cmdline} result errinfo]
528 if {$err || ($opts(-nooutput) && [string length $result])} {
529 configlog "Failed: [join $cmdline]"
530 configlog $result
531 configlog "============"
532 configlog "The failed code was:"
533 configlog $lines
@@ -671,27 +673,27 @@
673 }
674
675 define CCACHE [find-an-executable [get-env CCACHE ccache]]
676
677 # Initial cctest settings
678 cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {} -nooutput 0}
679 set autosetup(cc-include-deps) {}
680
681 msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]"
682 if {[get-define CXX] ne "false"} {
683 msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]"
684 }
685 msg-result "Build C compiler...[get-define CC_FOR_BUILD]"
686
687 # On Darwin, we prefer to use -g0 to avoid creating .dSYM directories
688 # but some compilers may not support it, so test here.
689 switch -glob -- [get-define host] {
690 *-*-darwin* {
691 if {[cctest -cflags {-g0}]} {
692 define cc-default-debug -g0
693 }
694 }
695 }
696
697 if {![cc-check-includes stdlib.h]} {
698 user-error "Compiler does not work. See config.log"
699 }
700
+53 -53
--- autosetup/jimsh0.c
+++ autosetup/jimsh0.c
@@ -42,10 +42,11 @@
4242
#define HAVE_ISATTY
4343
#define HAVE_SYS_TIME_H
4444
#define HAVE_DIRENT_H
4545
#define HAVE_UNISTD_H
4646
#endif
47
+#define JIM_VERSION 75
4748
#ifndef JIM_WIN32COMPAT_H
4849
#define JIM_WIN32COMPAT_H
4950
5051
5152
@@ -185,12 +186,10 @@
185186
#endif
186187
187188
#define UCHAR(c) ((unsigned char)(c))
188189
189190
190
-#define JIM_VERSION 74
191
-
192191
#define JIM_OK 0
193192
#define JIM_ERR 1
194193
#define JIM_RETURN 2
195194
#define JIM_BREAK 3
196195
#define JIM_CONTINUE 4
@@ -832,16 +831,10 @@
832831
double *doublePtr);
833832
JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr,
834833
double doubleValue);
835834
JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue);
836835
837
-
838
-JIM_EXPORT const char * Jim_GetSharedString (Jim_Interp *interp,
839
- const char *str);
840
-JIM_EXPORT void Jim_ReleaseSharedString (Jim_Interp *interp,
841
- const char *str);
842
-
843836
844837
JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc,
845838
Jim_Obj *const *argv, const char *msg);
846839
JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr,
847840
const char * const *tablePtr, int *indexPtr, const char *name, int flags);
@@ -875,11 +868,11 @@
875868
JIM_EXPORT void Jim_HistoryShow(void);
876869
877870
878871
JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp);
879872
JIM_EXPORT int Jim_StringToWide(const char *str, jim_wide *widePtr, int base);
880
-JIM_EXPORT int Jim_CheckSignal(Jim_Interp *interp);
873
+JIM_EXPORT int Jim_IsBigEndian(void);
881874
#define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask)
882875
883876
884877
JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName);
885878
JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp);
@@ -1775,19 +1768,11 @@
17751768
17761769
Jim_DecrRefCount(interp, af->filename);
17771770
17781771
#ifdef jim_ext_eventloop
17791772
1780
- if (af->rEvent) {
1781
- Jim_DeleteFileHandler(interp, af->fp);
1782
- }
1783
- if (af->wEvent) {
1784
- Jim_DeleteFileHandler(interp, af->fp);
1785
- }
1786
- if (af->eEvent) {
1787
- Jim_DeleteFileHandler(interp, af->fp);
1788
- }
1773
+ Jim_DeleteFileHandler(interp, af->fp, JIM_EVENT_READABLE | JIM_EVENT_WRITABLE | JIM_EVENT_EXCEPTION);
17891774
#endif
17901775
Jim_Free(af);
17911776
}
17921777
17931778
static int JimCheckStreamError(Jim_Interp *interp, AioFile *af)
@@ -2147,27 +2132,26 @@
21472132
}
21482133
21492134
#ifdef jim_ext_eventloop
21502135
static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData)
21512136
{
2152
- Jim_Obj *objPtr = clientData;
2137
+ Jim_Obj **objPtrPtr = clientData;
21532138
2154
- Jim_DecrRefCount(interp, objPtr);
2139
+ Jim_DecrRefCount(interp, *objPtrPtr);
2140
+ *objPtrPtr = NULL;
21552141
}
21562142
21572143
static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask)
21582144
{
2159
- Jim_Obj *objPtr = clientData;
2145
+ Jim_Obj **objPtrPtr = clientData;
21602146
2161
- return Jim_EvalObjBackground(interp, objPtr);
2147
+ return Jim_EvalObjBackground(interp, *objPtrPtr);
21622148
}
21632149
21642150
static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj,
21652151
int argc, Jim_Obj * const *argv)
21662152
{
2167
- int scriptlen = 0;
2168
-
21692153
if (argc == 0) {
21702154
21712155
if (*scriptHandlerObj) {
21722156
Jim_SetResult(interp, *scriptHandlerObj);
21732157
}
@@ -2174,27 +2158,25 @@
21742158
return JIM_OK;
21752159
}
21762160
21772161
if (*scriptHandlerObj) {
21782162
2179
- Jim_DeleteFileHandler(interp, af->fp);
2180
- *scriptHandlerObj = NULL;
2163
+ Jim_DeleteFileHandler(interp, af->fp, mask);
21812164
}
21822165
21832166
2184
- Jim_GetString(argv[0], &scriptlen);
2185
- if (scriptlen == 0) {
2167
+ if (Jim_Length(argv[0]) == 0) {
21862168
21872169
return JIM_OK;
21882170
}
21892171
21902172
21912173
Jim_IncrRefCount(argv[0]);
21922174
*scriptHandlerObj = argv[0];
21932175
21942176
Jim_CreateFileHandler(interp, af->fp, mask,
2195
- JimAioFileEventHandler, *scriptHandlerObj, JimAioFileEventFinalizer);
2177
+ JimAioFileEventHandler, scriptHandlerObj, JimAioFileEventFinalizer);
21962178
21972179
return JIM_OK;
21982180
}
21992181
22002182
static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -4005,11 +3987,11 @@
40053987
static void JimRestoreEnv(char **env);
40063988
static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv,
40073989
pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr);
40083990
static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr);
40093991
static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, fdtype errorId);
4010
-static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents);
3992
+static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents, int len);
40113993
static fdtype JimOpenForWrite(const char *filename, int append);
40123994
static int JimRewindFd(fdtype fd);
40133995
40143996
static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg)
40153997
{
@@ -4347,10 +4329,11 @@
43474329
int cmdCount; /* Count of number of distinct commands
43484330
* found in argc/argv. */
43494331
const char *input = NULL; /* Describes input for pipeline, depending
43504332
* on "inputFile". NULL means take input
43514333
* from stdin/pipe. */
4334
+ int input_len = 0;
43524335
43534336
#define FILE_NAME 0
43544337
#define FILE_APPEND 1
43554338
#define FILE_HANDLE 2
43564339
#define FILE_TEXT 3
@@ -4412,19 +4395,20 @@
44124395
if (arg[0] == '<') {
44134396
inputFile = FILE_NAME;
44144397
input = arg + 1;
44154398
if (*input == '<') {
44164399
inputFile = FILE_TEXT;
4400
+ input_len = Jim_Length(argv[i]) - 2;
44174401
input++;
44184402
}
44194403
else if (*input == '@') {
44204404
inputFile = FILE_HANDLE;
44214405
input++;
44224406
}
44234407
44244408
if (!*input && ++i < argc) {
4425
- input = Jim_String(argv[i]);
4409
+ input = Jim_GetString(argv[i], &input_len);
44264410
}
44274411
}
44284412
else if (arg[0] == '>') {
44294413
int dup_error = 0;
44304414
@@ -4498,11 +4482,11 @@
44984482
44994483
save_environ = JimSaveEnv(JimBuildEnv(interp));
45004484
45014485
if (input != NULL) {
45024486
if (inputFile == FILE_TEXT) {
4503
- inputId = JimCreateTemp(interp, input);
4487
+ inputId = JimCreateTemp(interp, input, input_len);
45044488
if (inputId == JIM_BAD_FD) {
45054489
goto error;
45064490
}
45074491
}
45084492
else if (inputFile == FILE_HANDLE) {
@@ -4587,11 +4571,11 @@
45874571
goto error;
45884572
}
45894573
}
45904574
}
45914575
else if (errFilePtr != NULL) {
4592
- errorId = JimCreateTemp(interp, NULL);
4576
+ errorId = JimCreateTemp(interp, NULL, 0);
45934577
if (errorId == JIM_BAD_FD) {
45944578
goto error;
45954579
}
45964580
*errFilePtr = JimDupFd(errorId);
45974581
}
@@ -4953,11 +4937,11 @@
49534937
*status = ret;
49544938
CloseHandle(pid);
49554939
return pid;
49564940
}
49574941
4958
-static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents)
4942
+static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents, int len)
49594943
{
49604944
char name[MAX_PATH];
49614945
HANDLE handle;
49624946
49634947
if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) {
@@ -4977,11 +4961,11 @@
49774961
FILE *fh = JimFdOpenForWrite(JimDupFd(handle));
49784962
if (fh == NULL) {
49794963
goto error;
49804964
}
49814965
4982
- if (fwrite(contents, strlen(contents), 1, fh) != 1) {
4966
+ if (fwrite(contents, len, 1, fh) != 1) {
49834967
fclose(fh);
49844968
goto error;
49854969
}
49864970
fseek(fh, 0, SEEK_SET);
49874971
fclose(fh);
@@ -5196,11 +5180,11 @@
51965180
static int JimRewindFd(int fd)
51975181
{
51985182
return lseek(fd, 0L, SEEK_SET);
51995183
}
52005184
5201
-static int JimCreateTemp(Jim_Interp *interp, const char *contents)
5185
+static int JimCreateTemp(Jim_Interp *interp, const char *contents, int len)
52025186
{
52035187
char inName[] = "/tmp/tcl.tmp.XXXXXX";
52045188
52055189
int fd = mkstemp(inName);
52065190
if (fd == JIM_BAD_FD) {
@@ -5207,12 +5191,11 @@
52075191
Jim_SetResultErrno(interp, "couldn't create temp file");
52085192
return -1;
52095193
}
52105194
unlink(inName);
52115195
if (contents) {
5212
- int length = strlen(contents);
5213
- if (write(fd, contents, length) != length) {
5196
+ if (write(fd, contents, len) != len) {
52145197
Jim_SetResultErrno(interp, "couldn't write temp file");
52155198
close(fd);
52165199
return -1;
52175200
}
52185201
lseek(fd, 0L, SEEK_SET);
@@ -5671,10 +5654,11 @@
56715654
#ifdef JIM_MAINTAINER
56725655
#define JIM_DEBUG_COMMAND
56735656
#define JIM_DEBUG_PANIC
56745657
#endif
56755658
5659
+
56765660
56775661
#define JIM_INTEGER_SPACE 24
56785662
56795663
const char *jim_tt_name(int type);
56805664
@@ -6029,11 +6013,12 @@
60296013
if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) {
60306014
60316015
return i;
60326016
}
60336017
6034
- return 10;
6018
+ *base = 10;
6019
+ return 0;
60356020
}
60366021
60376022
static long jim_strtol(const char *str, char **endptr)
60386023
{
60396024
int sign;
@@ -6109,10 +6094,12 @@
61096094
return len;
61106095
}
61116096
61126097
if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') {
61136098
buf[i] = toupper(UCHAR(buf[i]));
6099
+ if (buf[i] == 'n' || buf[i] == 'N')
6100
+ buf[i+2] = toupper(UCHAR(buf[i+2]));
61146101
buf[i + 3] = 0;
61156102
return i + 3;
61166103
}
61176104
}
61186105
@@ -7581,17 +7568,21 @@
75817568
objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr;
75827569
if (objPtr->nextObjPtr)
75837570
objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr;
75847571
if (interp->liveList == objPtr)
75857572
interp->liveList = objPtr->nextObjPtr;
7573
+#ifdef JIM_DISABLE_OBJECT_POOL
7574
+ Jim_Free(objPtr);
7575
+#else
75867576
75877577
objPtr->prevObjPtr = NULL;
75887578
objPtr->nextObjPtr = interp->freeList;
75897579
if (interp->freeList)
75907580
interp->freeList->prevObjPtr = objPtr;
75917581
interp->freeList = objPtr;
75927582
objPtr->refCount = -1;
7583
+#endif
75937584
}
75947585
75957586
75967587
void Jim_InvalidateStringRep(Jim_Obj *objPtr)
75977588
{
@@ -8244,10 +8235,19 @@
82448235
}
82458236
82468237
return strObjPtr;
82478238
}
82488239
8240
+
8241
+#ifdef HAVE_ISASCII
8242
+#define jim_isascii isascii
8243
+#else
8244
+static int jim_isascii(int c)
8245
+{
8246
+ return !(c & ~0x7f);
8247
+}
8248
+#endif
82498249
82508250
static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict)
82518251
{
82528252
static const char * const strclassnames[] = {
82538253
"integer", "alpha", "alnum", "ascii", "digit",
@@ -8291,11 +8291,11 @@
82918291
return JIM_OK;
82928292
}
82938293
82948294
case STR_IS_ALPHA: isclassfunc = isalpha; break;
82958295
case STR_IS_ALNUM: isclassfunc = isalnum; break;
8296
- case STR_IS_ASCII: isclassfunc = isascii; break;
8296
+ case STR_IS_ASCII: isclassfunc = jim_isascii; break;
82978297
case STR_IS_DIGIT: isclassfunc = isdigit; break;
82988298
case STR_IS_LOWER: isclassfunc = islower; break;
82998299
case STR_IS_UPPER: isclassfunc = isupper; break;
83008300
case STR_IS_SPACE: isclassfunc = isspace; break;
83018301
case STR_IS_XDIGIT: isclassfunc = isxdigit; break;
@@ -10213,11 +10213,11 @@
1021310213
Jim_Collect(interp);
1021410214
}
1021510215
}
1021610216
#endif
1021710217
10218
-static int JimIsBigEndian(void)
10218
+int Jim_IsBigEndian(void)
1021910219
{
1022010220
union {
1022110221
unsigned short s;
1022210222
unsigned char c[2];
1022310223
} uval = {0x0102};
@@ -10269,11 +10269,11 @@
1026910269
Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0");
1027010270
1027110271
Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS);
1027210272
Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM);
1027310273
Jim_SetVariableStrWithStr(i, "tcl_platform(pathSeparator)", TCL_PLATFORM_PATH_SEPARATOR);
10274
- Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", JimIsBigEndian() ? "bigEndian" : "littleEndian");
10274
+ Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", Jim_IsBigEndian() ? "bigEndian" : "littleEndian");
1027510275
Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0");
1027610276
Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *)));
1027710277
Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide)));
1027810278
1027910279
return i;
@@ -10449,17 +10449,11 @@
1044910449
interp->stackTrace = stackTraceObj;
1045010450
interp->errorFlag = 1;
1045110451
1045210452
len = Jim_ListLength(interp, interp->stackTrace);
1045310453
if (len >= 3) {
10454
- Jim_Obj *filenameObj;
10455
-
10456
- Jim_ListIndex(interp, interp->stackTrace, len - 2, &filenameObj, JIM_NONE);
10457
-
10458
- Jim_GetString(filenameObj, &len);
10459
-
10460
- if (!Jim_Length(filenameObj)) {
10454
+ if (Jim_Length(Jim_ListGetIndex(interp, interp->stackTrace, len - 2)) == 0) {
1046110455
interp->addStackTrace = 1;
1046210456
}
1046310457
}
1046410458
}
1046510459
@@ -10485,14 +10479,15 @@
1048510479
if (!*procname && Jim_Length(fileNameObj)) {
1048610480
1048710481
int len = Jim_ListLength(interp, interp->stackTrace);
1048810482
1048910483
if (len >= 3) {
10490
- Jim_Obj *objPtr;
10491
- if (Jim_ListIndex(interp, interp->stackTrace, len - 3, &objPtr, JIM_NONE) == JIM_OK && Jim_Length(objPtr)) {
10484
+ Jim_Obj *objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 3);
10485
+ if (Jim_Length(objPtr)) {
1049210486
10493
- if (Jim_ListIndex(interp, interp->stackTrace, len - 2, &objPtr, JIM_NONE) == JIM_OK && !Jim_Length(objPtr)) {
10487
+ objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 2);
10488
+ if (Jim_Length(objPtr) == 0) {
1049410489
1049510490
ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0);
1049610491
ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0);
1049710492
return;
1049810493
}
@@ -17159,10 +17154,15 @@
1715917154
1716017155
static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
1716117156
{
1716217157
int retcode;
1716317158
17159
+ if (argc < 2) {
17160
+ Jim_WrongNumArgs(interp, 1, argv, "cmd ?args ...?");
17161
+ return JIM_ERR;
17162
+ }
17163
+
1716417164
1716517165
interp->local++;
1716617166
retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1);
1716717167
interp->local--;
1716817168
@@ -19552,11 +19552,11 @@
1955219552
char *num_buffer = NULL;
1955319553
int num_buffer_size = 0;
1955419554
1955519555
span = format = Jim_GetString(fmtObjPtr, &formatLen);
1955619556
formatEnd = format + formatLen;
19557
- resultPtr = Jim_NewStringObj(interp, "", 0);
19557
+ resultPtr = Jim_NewEmptyStringObj(interp);
1955819558
1955919559
while (format != formatEnd) {
1956019560
char *end;
1956119561
int gotMinus, sawFlag;
1956219562
int gotPrecision, useShort;
1956319563
--- autosetup/jimsh0.c
+++ autosetup/jimsh0.c
@@ -42,10 +42,11 @@
42 #define HAVE_ISATTY
43 #define HAVE_SYS_TIME_H
44 #define HAVE_DIRENT_H
45 #define HAVE_UNISTD_H
46 #endif
 
47 #ifndef JIM_WIN32COMPAT_H
48 #define JIM_WIN32COMPAT_H
49
50
51
@@ -185,12 +186,10 @@
185 #endif
186
187 #define UCHAR(c) ((unsigned char)(c))
188
189
190 #define JIM_VERSION 74
191
192 #define JIM_OK 0
193 #define JIM_ERR 1
194 #define JIM_RETURN 2
195 #define JIM_BREAK 3
196 #define JIM_CONTINUE 4
@@ -832,16 +831,10 @@
832 double *doublePtr);
833 JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr,
834 double doubleValue);
835 JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue);
836
837
838 JIM_EXPORT const char * Jim_GetSharedString (Jim_Interp *interp,
839 const char *str);
840 JIM_EXPORT void Jim_ReleaseSharedString (Jim_Interp *interp,
841 const char *str);
842
843
844 JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc,
845 Jim_Obj *const *argv, const char *msg);
846 JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr,
847 const char * const *tablePtr, int *indexPtr, const char *name, int flags);
@@ -875,11 +868,11 @@
875 JIM_EXPORT void Jim_HistoryShow(void);
876
877
878 JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp);
879 JIM_EXPORT int Jim_StringToWide(const char *str, jim_wide *widePtr, int base);
880 JIM_EXPORT int Jim_CheckSignal(Jim_Interp *interp);
881 #define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask)
882
883
884 JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName);
885 JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp);
@@ -1775,19 +1768,11 @@
1775
1776 Jim_DecrRefCount(interp, af->filename);
1777
1778 #ifdef jim_ext_eventloop
1779
1780 if (af->rEvent) {
1781 Jim_DeleteFileHandler(interp, af->fp);
1782 }
1783 if (af->wEvent) {
1784 Jim_DeleteFileHandler(interp, af->fp);
1785 }
1786 if (af->eEvent) {
1787 Jim_DeleteFileHandler(interp, af->fp);
1788 }
1789 #endif
1790 Jim_Free(af);
1791 }
1792
1793 static int JimCheckStreamError(Jim_Interp *interp, AioFile *af)
@@ -2147,27 +2132,26 @@
2147 }
2148
2149 #ifdef jim_ext_eventloop
2150 static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData)
2151 {
2152 Jim_Obj *objPtr = clientData;
2153
2154 Jim_DecrRefCount(interp, objPtr);
 
2155 }
2156
2157 static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask)
2158 {
2159 Jim_Obj *objPtr = clientData;
2160
2161 return Jim_EvalObjBackground(interp, objPtr);
2162 }
2163
2164 static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj,
2165 int argc, Jim_Obj * const *argv)
2166 {
2167 int scriptlen = 0;
2168
2169 if (argc == 0) {
2170
2171 if (*scriptHandlerObj) {
2172 Jim_SetResult(interp, *scriptHandlerObj);
2173 }
@@ -2174,27 +2158,25 @@
2174 return JIM_OK;
2175 }
2176
2177 if (*scriptHandlerObj) {
2178
2179 Jim_DeleteFileHandler(interp, af->fp);
2180 *scriptHandlerObj = NULL;
2181 }
2182
2183
2184 Jim_GetString(argv[0], &scriptlen);
2185 if (scriptlen == 0) {
2186
2187 return JIM_OK;
2188 }
2189
2190
2191 Jim_IncrRefCount(argv[0]);
2192 *scriptHandlerObj = argv[0];
2193
2194 Jim_CreateFileHandler(interp, af->fp, mask,
2195 JimAioFileEventHandler, *scriptHandlerObj, JimAioFileEventFinalizer);
2196
2197 return JIM_OK;
2198 }
2199
2200 static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -4005,11 +3987,11 @@
4005 static void JimRestoreEnv(char **env);
4006 static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv,
4007 pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr);
4008 static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr);
4009 static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, fdtype errorId);
4010 static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents);
4011 static fdtype JimOpenForWrite(const char *filename, int append);
4012 static int JimRewindFd(fdtype fd);
4013
4014 static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg)
4015 {
@@ -4347,10 +4329,11 @@
4347 int cmdCount; /* Count of number of distinct commands
4348 * found in argc/argv. */
4349 const char *input = NULL; /* Describes input for pipeline, depending
4350 * on "inputFile". NULL means take input
4351 * from stdin/pipe. */
 
4352
4353 #define FILE_NAME 0
4354 #define FILE_APPEND 1
4355 #define FILE_HANDLE 2
4356 #define FILE_TEXT 3
@@ -4412,19 +4395,20 @@
4412 if (arg[0] == '<') {
4413 inputFile = FILE_NAME;
4414 input = arg + 1;
4415 if (*input == '<') {
4416 inputFile = FILE_TEXT;
 
4417 input++;
4418 }
4419 else if (*input == '@') {
4420 inputFile = FILE_HANDLE;
4421 input++;
4422 }
4423
4424 if (!*input && ++i < argc) {
4425 input = Jim_String(argv[i]);
4426 }
4427 }
4428 else if (arg[0] == '>') {
4429 int dup_error = 0;
4430
@@ -4498,11 +4482,11 @@
4498
4499 save_environ = JimSaveEnv(JimBuildEnv(interp));
4500
4501 if (input != NULL) {
4502 if (inputFile == FILE_TEXT) {
4503 inputId = JimCreateTemp(interp, input);
4504 if (inputId == JIM_BAD_FD) {
4505 goto error;
4506 }
4507 }
4508 else if (inputFile == FILE_HANDLE) {
@@ -4587,11 +4571,11 @@
4587 goto error;
4588 }
4589 }
4590 }
4591 else if (errFilePtr != NULL) {
4592 errorId = JimCreateTemp(interp, NULL);
4593 if (errorId == JIM_BAD_FD) {
4594 goto error;
4595 }
4596 *errFilePtr = JimDupFd(errorId);
4597 }
@@ -4953,11 +4937,11 @@
4953 *status = ret;
4954 CloseHandle(pid);
4955 return pid;
4956 }
4957
4958 static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents)
4959 {
4960 char name[MAX_PATH];
4961 HANDLE handle;
4962
4963 if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) {
@@ -4977,11 +4961,11 @@
4977 FILE *fh = JimFdOpenForWrite(JimDupFd(handle));
4978 if (fh == NULL) {
4979 goto error;
4980 }
4981
4982 if (fwrite(contents, strlen(contents), 1, fh) != 1) {
4983 fclose(fh);
4984 goto error;
4985 }
4986 fseek(fh, 0, SEEK_SET);
4987 fclose(fh);
@@ -5196,11 +5180,11 @@
5196 static int JimRewindFd(int fd)
5197 {
5198 return lseek(fd, 0L, SEEK_SET);
5199 }
5200
5201 static int JimCreateTemp(Jim_Interp *interp, const char *contents)
5202 {
5203 char inName[] = "/tmp/tcl.tmp.XXXXXX";
5204
5205 int fd = mkstemp(inName);
5206 if (fd == JIM_BAD_FD) {
@@ -5207,12 +5191,11 @@
5207 Jim_SetResultErrno(interp, "couldn't create temp file");
5208 return -1;
5209 }
5210 unlink(inName);
5211 if (contents) {
5212 int length = strlen(contents);
5213 if (write(fd, contents, length) != length) {
5214 Jim_SetResultErrno(interp, "couldn't write temp file");
5215 close(fd);
5216 return -1;
5217 }
5218 lseek(fd, 0L, SEEK_SET);
@@ -5671,10 +5654,11 @@
5671 #ifdef JIM_MAINTAINER
5672 #define JIM_DEBUG_COMMAND
5673 #define JIM_DEBUG_PANIC
5674 #endif
5675
 
5676
5677 #define JIM_INTEGER_SPACE 24
5678
5679 const char *jim_tt_name(int type);
5680
@@ -6029,11 +6013,12 @@
6029 if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) {
6030
6031 return i;
6032 }
6033
6034 return 10;
 
6035 }
6036
6037 static long jim_strtol(const char *str, char **endptr)
6038 {
6039 int sign;
@@ -6109,10 +6094,12 @@
6109 return len;
6110 }
6111
6112 if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') {
6113 buf[i] = toupper(UCHAR(buf[i]));
 
 
6114 buf[i + 3] = 0;
6115 return i + 3;
6116 }
6117 }
6118
@@ -7581,17 +7568,21 @@
7581 objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr;
7582 if (objPtr->nextObjPtr)
7583 objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr;
7584 if (interp->liveList == objPtr)
7585 interp->liveList = objPtr->nextObjPtr;
 
 
 
7586
7587 objPtr->prevObjPtr = NULL;
7588 objPtr->nextObjPtr = interp->freeList;
7589 if (interp->freeList)
7590 interp->freeList->prevObjPtr = objPtr;
7591 interp->freeList = objPtr;
7592 objPtr->refCount = -1;
 
7593 }
7594
7595
7596 void Jim_InvalidateStringRep(Jim_Obj *objPtr)
7597 {
@@ -8244,10 +8235,19 @@
8244 }
8245
8246 return strObjPtr;
8247 }
8248
 
 
 
 
 
 
 
 
 
8249
8250 static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict)
8251 {
8252 static const char * const strclassnames[] = {
8253 "integer", "alpha", "alnum", "ascii", "digit",
@@ -8291,11 +8291,11 @@
8291 return JIM_OK;
8292 }
8293
8294 case STR_IS_ALPHA: isclassfunc = isalpha; break;
8295 case STR_IS_ALNUM: isclassfunc = isalnum; break;
8296 case STR_IS_ASCII: isclassfunc = isascii; break;
8297 case STR_IS_DIGIT: isclassfunc = isdigit; break;
8298 case STR_IS_LOWER: isclassfunc = islower; break;
8299 case STR_IS_UPPER: isclassfunc = isupper; break;
8300 case STR_IS_SPACE: isclassfunc = isspace; break;
8301 case STR_IS_XDIGIT: isclassfunc = isxdigit; break;
@@ -10213,11 +10213,11 @@
10213 Jim_Collect(interp);
10214 }
10215 }
10216 #endif
10217
10218 static int JimIsBigEndian(void)
10219 {
10220 union {
10221 unsigned short s;
10222 unsigned char c[2];
10223 } uval = {0x0102};
@@ -10269,11 +10269,11 @@
10269 Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0");
10270
10271 Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS);
10272 Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM);
10273 Jim_SetVariableStrWithStr(i, "tcl_platform(pathSeparator)", TCL_PLATFORM_PATH_SEPARATOR);
10274 Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", JimIsBigEndian() ? "bigEndian" : "littleEndian");
10275 Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0");
10276 Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *)));
10277 Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide)));
10278
10279 return i;
@@ -10449,17 +10449,11 @@
10449 interp->stackTrace = stackTraceObj;
10450 interp->errorFlag = 1;
10451
10452 len = Jim_ListLength(interp, interp->stackTrace);
10453 if (len >= 3) {
10454 Jim_Obj *filenameObj;
10455
10456 Jim_ListIndex(interp, interp->stackTrace, len - 2, &filenameObj, JIM_NONE);
10457
10458 Jim_GetString(filenameObj, &len);
10459
10460 if (!Jim_Length(filenameObj)) {
10461 interp->addStackTrace = 1;
10462 }
10463 }
10464 }
10465
@@ -10485,14 +10479,15 @@
10485 if (!*procname && Jim_Length(fileNameObj)) {
10486
10487 int len = Jim_ListLength(interp, interp->stackTrace);
10488
10489 if (len >= 3) {
10490 Jim_Obj *objPtr;
10491 if (Jim_ListIndex(interp, interp->stackTrace, len - 3, &objPtr, JIM_NONE) == JIM_OK && Jim_Length(objPtr)) {
10492
10493 if (Jim_ListIndex(interp, interp->stackTrace, len - 2, &objPtr, JIM_NONE) == JIM_OK && !Jim_Length(objPtr)) {
 
10494
10495 ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0);
10496 ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0);
10497 return;
10498 }
@@ -17159,10 +17154,15 @@
17159
17160 static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
17161 {
17162 int retcode;
17163
 
 
 
 
 
17164
17165 interp->local++;
17166 retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1);
17167 interp->local--;
17168
@@ -19552,11 +19552,11 @@
19552 char *num_buffer = NULL;
19553 int num_buffer_size = 0;
19554
19555 span = format = Jim_GetString(fmtObjPtr, &formatLen);
19556 formatEnd = format + formatLen;
19557 resultPtr = Jim_NewStringObj(interp, "", 0);
19558
19559 while (format != formatEnd) {
19560 char *end;
19561 int gotMinus, sawFlag;
19562 int gotPrecision, useShort;
19563
--- autosetup/jimsh0.c
+++ autosetup/jimsh0.c
@@ -42,10 +42,11 @@
42 #define HAVE_ISATTY
43 #define HAVE_SYS_TIME_H
44 #define HAVE_DIRENT_H
45 #define HAVE_UNISTD_H
46 #endif
47 #define JIM_VERSION 75
48 #ifndef JIM_WIN32COMPAT_H
49 #define JIM_WIN32COMPAT_H
50
51
52
@@ -185,12 +186,10 @@
186 #endif
187
188 #define UCHAR(c) ((unsigned char)(c))
189
190
 
 
191 #define JIM_OK 0
192 #define JIM_ERR 1
193 #define JIM_RETURN 2
194 #define JIM_BREAK 3
195 #define JIM_CONTINUE 4
@@ -832,16 +831,10 @@
831 double *doublePtr);
832 JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr,
833 double doubleValue);
834 JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue);
835
 
 
 
 
 
 
836
837 JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc,
838 Jim_Obj *const *argv, const char *msg);
839 JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr,
840 const char * const *tablePtr, int *indexPtr, const char *name, int flags);
@@ -875,11 +868,11 @@
868 JIM_EXPORT void Jim_HistoryShow(void);
869
870
871 JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp);
872 JIM_EXPORT int Jim_StringToWide(const char *str, jim_wide *widePtr, int base);
873 JIM_EXPORT int Jim_IsBigEndian(void);
874 #define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask)
875
876
877 JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName);
878 JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp);
@@ -1775,19 +1768,11 @@
1768
1769 Jim_DecrRefCount(interp, af->filename);
1770
1771 #ifdef jim_ext_eventloop
1772
1773 Jim_DeleteFileHandler(interp, af->fp, JIM_EVENT_READABLE | JIM_EVENT_WRITABLE | JIM_EVENT_EXCEPTION);
 
 
 
 
 
 
 
 
1774 #endif
1775 Jim_Free(af);
1776 }
1777
1778 static int JimCheckStreamError(Jim_Interp *interp, AioFile *af)
@@ -2147,27 +2132,26 @@
2132 }
2133
2134 #ifdef jim_ext_eventloop
2135 static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData)
2136 {
2137 Jim_Obj **objPtrPtr = clientData;
2138
2139 Jim_DecrRefCount(interp, *objPtrPtr);
2140 *objPtrPtr = NULL;
2141 }
2142
2143 static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask)
2144 {
2145 Jim_Obj **objPtrPtr = clientData;
2146
2147 return Jim_EvalObjBackground(interp, *objPtrPtr);
2148 }
2149
2150 static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj,
2151 int argc, Jim_Obj * const *argv)
2152 {
 
 
2153 if (argc == 0) {
2154
2155 if (*scriptHandlerObj) {
2156 Jim_SetResult(interp, *scriptHandlerObj);
2157 }
@@ -2174,27 +2158,25 @@
2158 return JIM_OK;
2159 }
2160
2161 if (*scriptHandlerObj) {
2162
2163 Jim_DeleteFileHandler(interp, af->fp, mask);
 
2164 }
2165
2166
2167 if (Jim_Length(argv[0]) == 0) {
 
2168
2169 return JIM_OK;
2170 }
2171
2172
2173 Jim_IncrRefCount(argv[0]);
2174 *scriptHandlerObj = argv[0];
2175
2176 Jim_CreateFileHandler(interp, af->fp, mask,
2177 JimAioFileEventHandler, scriptHandlerObj, JimAioFileEventFinalizer);
2178
2179 return JIM_OK;
2180 }
2181
2182 static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -4005,11 +3987,11 @@
3987 static void JimRestoreEnv(char **env);
3988 static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv,
3989 pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr);
3990 static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr);
3991 static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, fdtype errorId);
3992 static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents, int len);
3993 static fdtype JimOpenForWrite(const char *filename, int append);
3994 static int JimRewindFd(fdtype fd);
3995
3996 static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg)
3997 {
@@ -4347,10 +4329,11 @@
4329 int cmdCount; /* Count of number of distinct commands
4330 * found in argc/argv. */
4331 const char *input = NULL; /* Describes input for pipeline, depending
4332 * on "inputFile". NULL means take input
4333 * from stdin/pipe. */
4334 int input_len = 0;
4335
4336 #define FILE_NAME 0
4337 #define FILE_APPEND 1
4338 #define FILE_HANDLE 2
4339 #define FILE_TEXT 3
@@ -4412,19 +4395,20 @@
4395 if (arg[0] == '<') {
4396 inputFile = FILE_NAME;
4397 input = arg + 1;
4398 if (*input == '<') {
4399 inputFile = FILE_TEXT;
4400 input_len = Jim_Length(argv[i]) - 2;
4401 input++;
4402 }
4403 else if (*input == '@') {
4404 inputFile = FILE_HANDLE;
4405 input++;
4406 }
4407
4408 if (!*input && ++i < argc) {
4409 input = Jim_GetString(argv[i], &input_len);
4410 }
4411 }
4412 else if (arg[0] == '>') {
4413 int dup_error = 0;
4414
@@ -4498,11 +4482,11 @@
4482
4483 save_environ = JimSaveEnv(JimBuildEnv(interp));
4484
4485 if (input != NULL) {
4486 if (inputFile == FILE_TEXT) {
4487 inputId = JimCreateTemp(interp, input, input_len);
4488 if (inputId == JIM_BAD_FD) {
4489 goto error;
4490 }
4491 }
4492 else if (inputFile == FILE_HANDLE) {
@@ -4587,11 +4571,11 @@
4571 goto error;
4572 }
4573 }
4574 }
4575 else if (errFilePtr != NULL) {
4576 errorId = JimCreateTemp(interp, NULL, 0);
4577 if (errorId == JIM_BAD_FD) {
4578 goto error;
4579 }
4580 *errFilePtr = JimDupFd(errorId);
4581 }
@@ -4953,11 +4937,11 @@
4937 *status = ret;
4938 CloseHandle(pid);
4939 return pid;
4940 }
4941
4942 static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents, int len)
4943 {
4944 char name[MAX_PATH];
4945 HANDLE handle;
4946
4947 if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) {
@@ -4977,11 +4961,11 @@
4961 FILE *fh = JimFdOpenForWrite(JimDupFd(handle));
4962 if (fh == NULL) {
4963 goto error;
4964 }
4965
4966 if (fwrite(contents, len, 1, fh) != 1) {
4967 fclose(fh);
4968 goto error;
4969 }
4970 fseek(fh, 0, SEEK_SET);
4971 fclose(fh);
@@ -5196,11 +5180,11 @@
5180 static int JimRewindFd(int fd)
5181 {
5182 return lseek(fd, 0L, SEEK_SET);
5183 }
5184
5185 static int JimCreateTemp(Jim_Interp *interp, const char *contents, int len)
5186 {
5187 char inName[] = "/tmp/tcl.tmp.XXXXXX";
5188
5189 int fd = mkstemp(inName);
5190 if (fd == JIM_BAD_FD) {
@@ -5207,12 +5191,11 @@
5191 Jim_SetResultErrno(interp, "couldn't create temp file");
5192 return -1;
5193 }
5194 unlink(inName);
5195 if (contents) {
5196 if (write(fd, contents, len) != len) {
 
5197 Jim_SetResultErrno(interp, "couldn't write temp file");
5198 close(fd);
5199 return -1;
5200 }
5201 lseek(fd, 0L, SEEK_SET);
@@ -5671,10 +5654,11 @@
5654 #ifdef JIM_MAINTAINER
5655 #define JIM_DEBUG_COMMAND
5656 #define JIM_DEBUG_PANIC
5657 #endif
5658
5659
5660
5661 #define JIM_INTEGER_SPACE 24
5662
5663 const char *jim_tt_name(int type);
5664
@@ -6029,11 +6013,12 @@
6013 if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) {
6014
6015 return i;
6016 }
6017
6018 *base = 10;
6019 return 0;
6020 }
6021
6022 static long jim_strtol(const char *str, char **endptr)
6023 {
6024 int sign;
@@ -6109,10 +6094,12 @@
6094 return len;
6095 }
6096
6097 if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') {
6098 buf[i] = toupper(UCHAR(buf[i]));
6099 if (buf[i] == 'n' || buf[i] == 'N')
6100 buf[i+2] = toupper(UCHAR(buf[i+2]));
6101 buf[i + 3] = 0;
6102 return i + 3;
6103 }
6104 }
6105
@@ -7581,17 +7568,21 @@
7568 objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr;
7569 if (objPtr->nextObjPtr)
7570 objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr;
7571 if (interp->liveList == objPtr)
7572 interp->liveList = objPtr->nextObjPtr;
7573 #ifdef JIM_DISABLE_OBJECT_POOL
7574 Jim_Free(objPtr);
7575 #else
7576
7577 objPtr->prevObjPtr = NULL;
7578 objPtr->nextObjPtr = interp->freeList;
7579 if (interp->freeList)
7580 interp->freeList->prevObjPtr = objPtr;
7581 interp->freeList = objPtr;
7582 objPtr->refCount = -1;
7583 #endif
7584 }
7585
7586
7587 void Jim_InvalidateStringRep(Jim_Obj *objPtr)
7588 {
@@ -8244,10 +8235,19 @@
8235 }
8236
8237 return strObjPtr;
8238 }
8239
8240
8241 #ifdef HAVE_ISASCII
8242 #define jim_isascii isascii
8243 #else
8244 static int jim_isascii(int c)
8245 {
8246 return !(c & ~0x7f);
8247 }
8248 #endif
8249
8250 static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict)
8251 {
8252 static const char * const strclassnames[] = {
8253 "integer", "alpha", "alnum", "ascii", "digit",
@@ -8291,11 +8291,11 @@
8291 return JIM_OK;
8292 }
8293
8294 case STR_IS_ALPHA: isclassfunc = isalpha; break;
8295 case STR_IS_ALNUM: isclassfunc = isalnum; break;
8296 case STR_IS_ASCII: isclassfunc = jim_isascii; break;
8297 case STR_IS_DIGIT: isclassfunc = isdigit; break;
8298 case STR_IS_LOWER: isclassfunc = islower; break;
8299 case STR_IS_UPPER: isclassfunc = isupper; break;
8300 case STR_IS_SPACE: isclassfunc = isspace; break;
8301 case STR_IS_XDIGIT: isclassfunc = isxdigit; break;
@@ -10213,11 +10213,11 @@
10213 Jim_Collect(interp);
10214 }
10215 }
10216 #endif
10217
10218 int Jim_IsBigEndian(void)
10219 {
10220 union {
10221 unsigned short s;
10222 unsigned char c[2];
10223 } uval = {0x0102};
@@ -10269,11 +10269,11 @@
10269 Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0");
10270
10271 Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS);
10272 Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM);
10273 Jim_SetVariableStrWithStr(i, "tcl_platform(pathSeparator)", TCL_PLATFORM_PATH_SEPARATOR);
10274 Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", Jim_IsBigEndian() ? "bigEndian" : "littleEndian");
10275 Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0");
10276 Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *)));
10277 Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide)));
10278
10279 return i;
@@ -10449,17 +10449,11 @@
10449 interp->stackTrace = stackTraceObj;
10450 interp->errorFlag = 1;
10451
10452 len = Jim_ListLength(interp, interp->stackTrace);
10453 if (len >= 3) {
10454 if (Jim_Length(Jim_ListGetIndex(interp, interp->stackTrace, len - 2)) == 0) {
 
 
 
 
 
 
10455 interp->addStackTrace = 1;
10456 }
10457 }
10458 }
10459
@@ -10485,14 +10479,15 @@
10479 if (!*procname && Jim_Length(fileNameObj)) {
10480
10481 int len = Jim_ListLength(interp, interp->stackTrace);
10482
10483 if (len >= 3) {
10484 Jim_Obj *objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 3);
10485 if (Jim_Length(objPtr)) {
10486
10487 objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 2);
10488 if (Jim_Length(objPtr) == 0) {
10489
10490 ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0);
10491 ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0);
10492 return;
10493 }
@@ -17159,10 +17154,15 @@
17154
17155 static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
17156 {
17157 int retcode;
17158
17159 if (argc < 2) {
17160 Jim_WrongNumArgs(interp, 1, argv, "cmd ?args ...?");
17161 return JIM_ERR;
17162 }
17163
17164
17165 interp->local++;
17166 retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1);
17167 interp->local--;
17168
@@ -19552,11 +19552,11 @@
19552 char *num_buffer = NULL;
19553 int num_buffer_size = 0;
19554
19555 span = format = Jim_GetString(fmtObjPtr, &formatLen);
19556 formatEnd = format + formatLen;
19557 resultPtr = Jim_NewEmptyStringObj(interp);
19558
19559 while (format != formatEnd) {
19560 char *end;
19561 int gotMinus, sawFlag;
19562 int gotPrecision, useShort;
19563
--- autosetup/local.tcl
+++ autosetup/local.tcl
@@ -26,5 +26,200 @@
2626
set tclconfig($name) [string trim $value ']
2727
}
2828
}
2929
return [array get tclconfig]
3030
}
31
+
32
+# The complex extension checking is done here.
33
+
34
+global withinfo
35
+global extdb
36
+
37
+# Final determination of module status
38
+dict set extdb status {}
39
+
40
+# Returns 1 if the extension has the attribute
41
+proc ext-has {ext attr} {
42
+ expr {$attr in [dict get $::extdb attrs $ext]}
43
+}
44
+
45
+# Returns an entry from the extension 'info' table, or $default otherwise
46
+proc ext-get {ext key {default {}}} {
47
+ if {[dict exists $::extdb info $ext $key]} {
48
+ return [dict get $::extdb info $ext $key]
49
+ } else {
50
+ return $default
51
+ }
52
+}
53
+
54
+# Set the status of the extension to the given value, and returns the value
55
+proc ext-set-status {ext value} {
56
+ dict set ::extdb status $ext $value
57
+ return $value
58
+}
59
+
60
+# Returns the status of the extension, or ? if unknown
61
+proc ext-get-status {ext} {
62
+ if {[dict exists $::extdb status $ext]} {
63
+ return [dict get $::extdb status $ext]
64
+ }
65
+ return ?
66
+}
67
+
68
+proc check-extension-status {ext required} {
69
+ global withinfo
70
+
71
+ set status [ext-get-status $ext]
72
+
73
+ if {$ext in $withinfo(without)} {
74
+ # Disabled without further ado
75
+ msg-result "Extension $ext...disabled"
76
+ return [ext-set-status $ext n]
77
+ }
78
+
79
+ if {$status in {m y n}} {
80
+ return $status
81
+ }
82
+
83
+ # required is "required" if this extension *must* be enabled
84
+ # required is "wanted" if it is not fatal for this extension
85
+ # not to be enabled
86
+
87
+ array set depinfo {m 0 y 0 n 0}
88
+
89
+ # Check direct dependencies
90
+ if [ext-get $ext check 1] {
91
+ # "check" conditions are met
92
+ } else {
93
+ # not met
94
+ incr depinfo(n)
95
+ }
96
+
97
+ if {$depinfo(n) == 0} {
98
+ # Now extension dependencies
99
+ foreach i [ext-get $ext dep] {
100
+ set status [check-extension-status $i $required]
101
+ #puts "$ext: dep $i $required => $status"
102
+ incr depinfo($status)
103
+ if {$depinfo(n)} {
104
+ break
105
+ }
106
+ }
107
+ }
108
+
109
+ #parray depinfo
110
+
111
+ if {$depinfo(n)} {
112
+ msg-checking "Extension $ext..."
113
+ if {$required eq "required"} {
114
+ user-error "dependencies not met"
115
+ }
116
+ msg-result "disabled (dependencies)"
117
+ return [ext-set-status $ext n]
118
+ }
119
+
120
+ # Selected as a module?
121
+ if {$ext in $withinfo(mod)} {
122
+ if {[ext-has $ext tcl]} {
123
+ # Easy, a Tcl module
124
+ msg-result "Extension $ext...tcl"
125
+ } elseif {[ext-has $ext static]} {
126
+ user-error "Extension $ext can't be a module"
127
+ } else {
128
+ msg-result "Extension $ext...module"
129
+ foreach i [ext-get $ext libdep] {
130
+ define-append LDLIBS_$ext [get-define $i ""]
131
+ }
132
+ }
133
+ return [ext-set-status $ext m]
134
+ }
135
+
136
+ # Selected as a static extension?
137
+ if {[ext-has $ext shared]} {
138
+ user-error "Extension $ext can only be selected as a module"
139
+ } elseif {$ext in $withinfo(ext) || $required eq "$required"} {
140
+ msg-result "Extension $ext...enabled"
141
+ } elseif {$ext in $withinfo(maybe)} {
142
+ msg-result "Extension $ext...enabled (default)"
143
+ } else {
144
+ # Could be selected, but isn't (yet)
145
+ return [ext-set-status $ext x]
146
+ }
147
+ foreach i [ext-get $ext libdep] {
148
+ define-append LDLIBS [get-define $i ""]
149
+ }
150
+ return [ext-set-status $ext y]
151
+}
152
+
153
+# Examines the user options (the $withinfo array)
154
+# and the extension database ($extdb) to determine
155
+# what is selected, and in what way.
156
+#
157
+# The results are available via ext-get-status
158
+# And a dictionary is returned containing four keys:
159
+# static-c extensions which are static C
160
+# static-tcl extensions which are static Tcl
161
+# module-c extensions which are C modules
162
+# module-tcl extensions which are Tcl modules
163
+proc check-extensions {} {
164
+ global extdb withinfo
165
+
166
+ # Check valid extension names
167
+ foreach i [concat $withinfo(ext) $withinfo(mod)] {
168
+ if {![dict exists $extdb attrs $i]} {
169
+ user-error "Unknown extension: $i"
170
+ }
171
+ }
172
+
173
+ set extlist [lsort [dict keys [dict get $extdb attrs]]]
174
+
175
+ set withinfo(maybe) {}
176
+
177
+ # Now work out the default status. We have.
178
+ # normal case, include !optional if possible
179
+ # --without=default, don't include optional
180
+ if {$withinfo(nodefault)} {
181
+ lappend withinfo(maybe) stdlib
182
+ } else {
183
+ foreach i $extlist {
184
+ if {![ext-has $i optional]} {
185
+ lappend withinfo(maybe) $i
186
+ }
187
+ }
188
+ }
189
+
190
+ foreach i $extlist {
191
+ define LDLIBS_$i ""
192
+ }
193
+
194
+ foreach i [concat $withinfo(ext) $withinfo(mod)] {
195
+ check-extension-status $i required
196
+ }
197
+ foreach i $withinfo(maybe) {
198
+ check-extension-status $i wanted
199
+ }
200
+
201
+ array set extinfo {static-c {} static-tcl {} module-c {} module-tcl {}}
202
+
203
+ foreach i $extlist {
204
+ set status [ext-get-status $i]
205
+ set tcl [ext-has $i tcl]
206
+ switch $status,$tcl {
207
+ y,1 {
208
+ define jim_ext_$i
209
+ lappend extinfo(static-tcl) $i
210
+ }
211
+ y,0 {
212
+ define jim_ext_$i
213
+ lappend extinfo(static-c) $i
214
+ # If there are any static C++ extensions, jimsh must be linked using
215
+ # the C++ compiler
216
+ if {[ext-has $i cpp]} {
217
+ define HAVE_CXX_EXTENSIONS
218
+ }
219
+ }
220
+ m,1 { lappend extinfo(module-tcl) $i }
221
+ m,0 { lappend extinfo(module-c) $i }
222
+ }
223
+ }
224
+ return [array get extinfo]
225
+}
31226
32227
ADDED setup/fossil.iss
--- autosetup/local.tcl
+++ autosetup/local.tcl
@@ -26,5 +26,200 @@
26 set tclconfig($name) [string trim $value ']
27 }
28 }
29 return [array get tclconfig]
30 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
32 DDED setup/fossil.iss
--- autosetup/local.tcl
+++ autosetup/local.tcl
@@ -26,5 +26,200 @@
26 set tclconfig($name) [string trim $value ']
27 }
28 }
29 return [array get tclconfig]
30 }
31
32 # The complex extension checking is done here.
33
34 global withinfo
35 global extdb
36
37 # Final determination of module status
38 dict set extdb status {}
39
40 # Returns 1 if the extension has the attribute
41 proc ext-has {ext attr} {
42 expr {$attr in [dict get $::extdb attrs $ext]}
43 }
44
45 # Returns an entry from the extension 'info' table, or $default otherwise
46 proc ext-get {ext key {default {}}} {
47 if {[dict exists $::extdb info $ext $key]} {
48 return [dict get $::extdb info $ext $key]
49 } else {
50 return $default
51 }
52 }
53
54 # Set the status of the extension to the given value, and returns the value
55 proc ext-set-status {ext value} {
56 dict set ::extdb status $ext $value
57 return $value
58 }
59
60 # Returns the status of the extension, or ? if unknown
61 proc ext-get-status {ext} {
62 if {[dict exists $::extdb status $ext]} {
63 return [dict get $::extdb status $ext]
64 }
65 return ?
66 }
67
68 proc check-extension-status {ext required} {
69 global withinfo
70
71 set status [ext-get-status $ext]
72
73 if {$ext in $withinfo(without)} {
74 # Disabled without further ado
75 msg-result "Extension $ext...disabled"
76 return [ext-set-status $ext n]
77 }
78
79 if {$status in {m y n}} {
80 return $status
81 }
82
83 # required is "required" if this extension *must* be enabled
84 # required is "wanted" if it is not fatal for this extension
85 # not to be enabled
86
87 array set depinfo {m 0 y 0 n 0}
88
89 # Check direct dependencies
90 if [ext-get $ext check 1] {
91 # "check" conditions are met
92 } else {
93 # not met
94 incr depinfo(n)
95 }
96
97 if {$depinfo(n) == 0} {
98 # Now extension dependencies
99 foreach i [ext-get $ext dep] {
100 set status [check-extension-status $i $required]
101 #puts "$ext: dep $i $required => $status"
102 incr depinfo($status)
103 if {$depinfo(n)} {
104 break
105 }
106 }
107 }
108
109 #parray depinfo
110
111 if {$depinfo(n)} {
112 msg-checking "Extension $ext..."
113 if {$required eq "required"} {
114 user-error "dependencies not met"
115 }
116 msg-result "disabled (dependencies)"
117 return [ext-set-status $ext n]
118 }
119
120 # Selected as a module?
121 if {$ext in $withinfo(mod)} {
122 if {[ext-has $ext tcl]} {
123 # Easy, a Tcl module
124 msg-result "Extension $ext...tcl"
125 } elseif {[ext-has $ext static]} {
126 user-error "Extension $ext can't be a module"
127 } else {
128 msg-result "Extension $ext...module"
129 foreach i [ext-get $ext libdep] {
130 define-append LDLIBS_$ext [get-define $i ""]
131 }
132 }
133 return [ext-set-status $ext m]
134 }
135
136 # Selected as a static extension?
137 if {[ext-has $ext shared]} {
138 user-error "Extension $ext can only be selected as a module"
139 } elseif {$ext in $withinfo(ext) || $required eq "$required"} {
140 msg-result "Extension $ext...enabled"
141 } elseif {$ext in $withinfo(maybe)} {
142 msg-result "Extension $ext...enabled (default)"
143 } else {
144 # Could be selected, but isn't (yet)
145 return [ext-set-status $ext x]
146 }
147 foreach i [ext-get $ext libdep] {
148 define-append LDLIBS [get-define $i ""]
149 }
150 return [ext-set-status $ext y]
151 }
152
153 # Examines the user options (the $withinfo array)
154 # and the extension database ($extdb) to determine
155 # what is selected, and in what way.
156 #
157 # The results are available via ext-get-status
158 # And a dictionary is returned containing four keys:
159 # static-c extensions which are static C
160 # static-tcl extensions which are static Tcl
161 # module-c extensions which are C modules
162 # module-tcl extensions which are Tcl modules
163 proc check-extensions {} {
164 global extdb withinfo
165
166 # Check valid extension names
167 foreach i [concat $withinfo(ext) $withinfo(mod)] {
168 if {![dict exists $extdb attrs $i]} {
169 user-error "Unknown extension: $i"
170 }
171 }
172
173 set extlist [lsort [dict keys [dict get $extdb attrs]]]
174
175 set withinfo(maybe) {}
176
177 # Now work out the default status. We have.
178 # normal case, include !optional if possible
179 # --without=default, don't include optional
180 if {$withinfo(nodefault)} {
181 lappend withinfo(maybe) stdlib
182 } else {
183 foreach i $extlist {
184 if {![ext-has $i optional]} {
185 lappend withinfo(maybe) $i
186 }
187 }
188 }
189
190 foreach i $extlist {
191 define LDLIBS_$i ""
192 }
193
194 foreach i [concat $withinfo(ext) $withinfo(mod)] {
195 check-extension-status $i required
196 }
197 foreach i $withinfo(maybe) {
198 check-extension-status $i wanted
199 }
200
201 array set extinfo {static-c {} static-tcl {} module-c {} module-tcl {}}
202
203 foreach i $extlist {
204 set status [ext-get-status $i]
205 set tcl [ext-has $i tcl]
206 switch $status,$tcl {
207 y,1 {
208 define jim_ext_$i
209 lappend extinfo(static-tcl) $i
210 }
211 y,0 {
212 define jim_ext_$i
213 lappend extinfo(static-c) $i
214 # If there are any static C++ extensions, jimsh must be linked using
215 # the C++ compiler
216 if {[ext-has $i cpp]} {
217 define HAVE_CXX_EXTENSIONS
218 }
219 }
220 m,1 { lappend extinfo(module-tcl) $i }
221 m,0 { lappend extinfo(module-c) $i }
222 }
223 }
224 return [array get extinfo]
225 }
226
227 DDED setup/fossil.iss
--- a/setup/fossil.iss
+++ b/setup/fossil.iss
@@ -0,0 +1,66 @@
1
+;
2
+; Copyrig
3
+;
4
+ (c) 2014 D. Richard Hipp
5
+;
6
+; This program is free software; you
7
+ can redistribute it and/or
8
+; modify it under the terms of the S
9
+implified BSD License (also
10
+;
11
+;
12
+; This program is distributed in the hope that it will be useful,
13
+ope that it will be useful,
14
+; but without any warranty; without e
15
+ven the implied warranty of
16
+
17
+;
18
+; Author contact information:
19
+; [email protected]
20
+; http://www.hwaci.com/drh/
21
+;
22
+
23
+[Setup]
24
+w.hwaci.com/drh/
25
+;
26
+
27
+[Setup]
28
+A
29
+AlwaysShowComponentsList=false
30
+aysShowComponentsList=false
31
+AppCopyright=Copyright (c) D. Richard
32
+Hipp. All rights r
33
+AppName=Fossil
34
+314c52f057
35
+AppPublisherURL=https://www.fossil-scm.org/
36
+AppSupportURL=https:////www.fossil-scm.org/
37
+X@DC,1:
38
+P@Di,1:
39
+1S@E6,q:
40
+AppReadmeFile=https://www.fossil-scm.org:
41
+R@Gd,Q:
42
+DefaultGroupNameSupportURL=http:
43
+R@Gd,Q:
44
+Defa:
45
+R@Gd,Q:
46
+DefaultGroupNameY@JM,1:
47
+X@Jt,I:
48
+
49
+
50
+[Components]
51
+1S@Kd,e:
52
+
53
+
54
+[Dirs]
55
+Name: {app}\bin
56
+
57
+
58
+[Files]
59
+1i@Mc,G:
60
+
61
+
62
+[Registry]
63
+Q@Mc,2H@Ow,2:
64
+_~AvY;:
65
+R@Gd,Q:
66
+DefaultGrou
--- a/setup/fossil.iss
+++ b/setup/fossil.iss
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/setup/fossil.iss
+++ b/setup/fossil.iss
@@ -0,0 +1,66 @@
1 ;
2 ; Copyrig
3 ;
4 (c) 2014 D. Richard Hipp
5 ;
6 ; This program is free software; you
7 can redistribute it and/or
8 ; modify it under the terms of the S
9 implified BSD License (also
10 ;
11 ;
12 ; This program is distributed in the hope that it will be useful,
13 ope that it will be useful,
14 ; but without any warranty; without e
15 ven the implied warranty of
16
17 ;
18 ; Author contact information:
19 ; [email protected]
20 ; http://www.hwaci.com/drh/
21 ;
22
23 [Setup]
24 w.hwaci.com/drh/
25 ;
26
27 [Setup]
28 A
29 AlwaysShowComponentsList=false
30 aysShowComponentsList=false
31 AppCopyright=Copyright (c) D. Richard
32 Hipp. All rights r
33 AppName=Fossil
34 314c52f057
35 AppPublisherURL=https://www.fossil-scm.org/
36 AppSupportURL=https:////www.fossil-scm.org/
37 X@DC,1:
38 P@Di,1:
39 1S@E6,q:
40 AppReadmeFile=https://www.fossil-scm.org:
41 R@Gd,Q:
42 DefaultGroupNameSupportURL=http:
43 R@Gd,Q:
44 Defa:
45 R@Gd,Q:
46 DefaultGroupNameY@JM,1:
47 X@Jt,I:
48
49
50 [Components]
51 1S@Kd,e:
52
53
54 [Dirs]
55 Name: {app}\bin
56
57
58 [Files]
59 1i@Mc,G:
60
61
62 [Registry]
63 Q@Mc,2H@Ow,2:
64 _~AvY;:
65 R@Gd,Q:
66 DefaultGrou
+1 -1
--- src/bisect.c
+++ src/bisect.c
@@ -390,11 +390,11 @@
390390
for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
391391
char *z = mprintf("bisect-%s", aBisectOption[i].zName);
392392
fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
393393
db_lget(z, (char*)aBisectOption[i].zDefault));
394394
fossil_free(z);
395
- comment_print(aBisectOption[i].zDesc, 27, 79);
395
+ comment_print(aBisectOption[i].zDesc, 27, -1);
396396
}
397397
}else if( g.argc==4 || g.argc==5 ){
398398
unsigned int i;
399399
n = strlen(g.argv[3]);
400400
for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
401401
--- src/bisect.c
+++ src/bisect.c
@@ -390,11 +390,11 @@
390 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
391 char *z = mprintf("bisect-%s", aBisectOption[i].zName);
392 fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
393 db_lget(z, (char*)aBisectOption[i].zDefault));
394 fossil_free(z);
395 comment_print(aBisectOption[i].zDesc, 27, 79);
396 }
397 }else if( g.argc==4 || g.argc==5 ){
398 unsigned int i;
399 n = strlen(g.argv[3]);
400 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
401
--- src/bisect.c
+++ src/bisect.c
@@ -390,11 +390,11 @@
390 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
391 char *z = mprintf("bisect-%s", aBisectOption[i].zName);
392 fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
393 db_lget(z, (char*)aBisectOption[i].zDefault));
394 fossil_free(z);
395 comment_print(aBisectOption[i].zDesc, 27, -1);
396 }
397 }else if( g.argc==4 || g.argc==5 ){
398 unsigned int i;
399 n = strlen(g.argv[3]);
400 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
401
+1 -1
--- src/bisect.c
+++ src/bisect.c
@@ -390,11 +390,11 @@
390390
for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
391391
char *z = mprintf("bisect-%s", aBisectOption[i].zName);
392392
fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
393393
db_lget(z, (char*)aBisectOption[i].zDefault));
394394
fossil_free(z);
395
- comment_print(aBisectOption[i].zDesc, 27, 79);
395
+ comment_print(aBisectOption[i].zDesc, 27, -1);
396396
}
397397
}else if( g.argc==4 || g.argc==5 ){
398398
unsigned int i;
399399
n = strlen(g.argv[3]);
400400
for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
401401
--- src/bisect.c
+++ src/bisect.c
@@ -390,11 +390,11 @@
390 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
391 char *z = mprintf("bisect-%s", aBisectOption[i].zName);
392 fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
393 db_lget(z, (char*)aBisectOption[i].zDefault));
394 fossil_free(z);
395 comment_print(aBisectOption[i].zDesc, 27, 79);
396 }
397 }else if( g.argc==4 || g.argc==5 ){
398 unsigned int i;
399 n = strlen(g.argv[3]);
400 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
401
--- src/bisect.c
+++ src/bisect.c
@@ -390,11 +390,11 @@
390 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
391 char *z = mprintf("bisect-%s", aBisectOption[i].zName);
392 fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
393 db_lget(z, (char*)aBisectOption[i].zDefault));
394 fossil_free(z);
395 comment_print(aBisectOption[i].zDesc, 27, -1);
396 }
397 }else if( g.argc==4 || g.argc==5 ){
398 unsigned int i;
399 n = strlen(g.argv[3]);
400 for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
401
+1 -1
--- src/branch.c
+++ src/branch.c
@@ -176,11 +176,11 @@
176176
177177
/* Commit */
178178
db_end_transaction(0);
179179
180180
/* Do an autosync push, if requested */
181
- if( !isPrivate ) autosync_loop(SYNC_PUSH,db_get_int("autosync-tries", 1));
181
+ if( !isPrivate ) autosync_loop(SYNC_PUSH, db_get_int("autosync-tries", 1));
182182
}
183183
184184
/*
185185
** Prepare a query that will list branches.
186186
**
187187
--- src/branch.c
+++ src/branch.c
@@ -176,11 +176,11 @@
176
177 /* Commit */
178 db_end_transaction(0);
179
180 /* Do an autosync push, if requested */
181 if( !isPrivate ) autosync_loop(SYNC_PUSH,db_get_int("autosync-tries", 1));
182 }
183
184 /*
185 ** Prepare a query that will list branches.
186 **
187
--- src/branch.c
+++ src/branch.c
@@ -176,11 +176,11 @@
176
177 /* Commit */
178 db_end_transaction(0);
179
180 /* Do an autosync push, if requested */
181 if( !isPrivate ) autosync_loop(SYNC_PUSH, db_get_int("autosync-tries", 1));
182 }
183
184 /*
185 ** Prepare a query that will list branches.
186 **
187
+19 -1
--- src/comformat.c
+++ src/comformat.c
@@ -19,10 +19,16 @@
1919
** text on a TTY.
2020
*/
2121
#include "config.h"
2222
#include "comformat.h"
2323
#include <assert.h>
24
+#ifdef _WIN32
25
+# include <windows.h>
26
+# include <wincon.h>
27
+#else
28
+# include <termios.h>
29
+#endif
2430
2531
/*
2632
** Given a comment string zText, format that string for printing
2733
** on a TTY. Assume that the output cursors is indent spaces from
2834
** the left margin and that a single line can contain no more than
@@ -35,11 +41,23 @@
3541
int si, sk, i, k;
3642
int doIndent = 0;
3743
char *zBuf;
3844
char zBuffer[400];
3945
int lineCnt = 0;
40
-
46
+#if defined(_WIN32)
47
+ if ( lineLength<0 ){
48
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
49
+ GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
50
+ tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent + 1;
51
+ }
52
+#elif defined(TIOCGWINSZ)
53
+ if ( lineLength<0 ){
54
+ struct winsize w;
55
+ ioctl(0, TIOCGWINSZ, &w);
56
+ tlen = w.ws_col - indent;
57
+ }
58
+#endif
4159
if( zText==0 ) zText = "(NULL)";
4260
if( tlen<=0 ){
4361
tlen = strlen(zText);
4462
}
4563
if( tlen >= (sizeof(zBuffer)) ){
4664
--- src/comformat.c
+++ src/comformat.c
@@ -19,10 +19,16 @@
19 ** text on a TTY.
20 */
21 #include "config.h"
22 #include "comformat.h"
23 #include <assert.h>
 
 
 
 
 
 
24
25 /*
26 ** Given a comment string zText, format that string for printing
27 ** on a TTY. Assume that the output cursors is indent spaces from
28 ** the left margin and that a single line can contain no more than
@@ -35,11 +41,23 @@
35 int si, sk, i, k;
36 int doIndent = 0;
37 char *zBuf;
38 char zBuffer[400];
39 int lineCnt = 0;
40
 
 
 
 
 
 
 
 
 
 
 
 
41 if( zText==0 ) zText = "(NULL)";
42 if( tlen<=0 ){
43 tlen = strlen(zText);
44 }
45 if( tlen >= (sizeof(zBuffer)) ){
46
--- src/comformat.c
+++ src/comformat.c
@@ -19,10 +19,16 @@
19 ** text on a TTY.
20 */
21 #include "config.h"
22 #include "comformat.h"
23 #include <assert.h>
24 #ifdef _WIN32
25 # include <windows.h>
26 # include <wincon.h>
27 #else
28 # include <termios.h>
29 #endif
30
31 /*
32 ** Given a comment string zText, format that string for printing
33 ** on a TTY. Assume that the output cursors is indent spaces from
34 ** the left margin and that a single line can contain no more than
@@ -35,11 +41,23 @@
41 int si, sk, i, k;
42 int doIndent = 0;
43 char *zBuf;
44 char zBuffer[400];
45 int lineCnt = 0;
46 #if defined(_WIN32)
47 if ( lineLength<0 ){
48 CONSOLE_SCREEN_BUFFER_INFO csbi;
49 GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
50 tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent + 1;
51 }
52 #elif defined(TIOCGWINSZ)
53 if ( lineLength<0 ){
54 struct winsize w;
55 ioctl(0, TIOCGWINSZ, &w);
56 tlen = w.ws_col - indent;
57 }
58 #endif
59 if( zText==0 ) zText = "(NULL)";
60 if( tlen<=0 ){
61 tlen = strlen(zText);
62 }
63 if( tlen >= (sizeof(zBuffer)) ){
64
+19 -1
--- src/comformat.c
+++ src/comformat.c
@@ -19,10 +19,16 @@
1919
** text on a TTY.
2020
*/
2121
#include "config.h"
2222
#include "comformat.h"
2323
#include <assert.h>
24
+#ifdef _WIN32
25
+# include <windows.h>
26
+# include <wincon.h>
27
+#else
28
+# include <termios.h>
29
+#endif
2430
2531
/*
2632
** Given a comment string zText, format that string for printing
2733
** on a TTY. Assume that the output cursors is indent spaces from
2834
** the left margin and that a single line can contain no more than
@@ -35,11 +41,23 @@
3541
int si, sk, i, k;
3642
int doIndent = 0;
3743
char *zBuf;
3844
char zBuffer[400];
3945
int lineCnt = 0;
40
-
46
+#if defined(_WIN32)
47
+ if ( lineLength<0 ){
48
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
49
+ GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
50
+ tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent + 1;
51
+ }
52
+#elif defined(TIOCGWINSZ)
53
+ if ( lineLength<0 ){
54
+ struct winsize w;
55
+ ioctl(0, TIOCGWINSZ, &w);
56
+ tlen = w.ws_col - indent;
57
+ }
58
+#endif
4159
if( zText==0 ) zText = "(NULL)";
4260
if( tlen<=0 ){
4361
tlen = strlen(zText);
4462
}
4563
if( tlen >= (sizeof(zBuffer)) ){
4664
--- src/comformat.c
+++ src/comformat.c
@@ -19,10 +19,16 @@
19 ** text on a TTY.
20 */
21 #include "config.h"
22 #include "comformat.h"
23 #include <assert.h>
 
 
 
 
 
 
24
25 /*
26 ** Given a comment string zText, format that string for printing
27 ** on a TTY. Assume that the output cursors is indent spaces from
28 ** the left margin and that a single line can contain no more than
@@ -35,11 +41,23 @@
35 int si, sk, i, k;
36 int doIndent = 0;
37 char *zBuf;
38 char zBuffer[400];
39 int lineCnt = 0;
40
 
 
 
 
 
 
 
 
 
 
 
 
41 if( zText==0 ) zText = "(NULL)";
42 if( tlen<=0 ){
43 tlen = strlen(zText);
44 }
45 if( tlen >= (sizeof(zBuffer)) ){
46
--- src/comformat.c
+++ src/comformat.c
@@ -19,10 +19,16 @@
19 ** text on a TTY.
20 */
21 #include "config.h"
22 #include "comformat.h"
23 #include <assert.h>
24 #ifdef _WIN32
25 # include <windows.h>
26 # include <wincon.h>
27 #else
28 # include <termios.h>
29 #endif
30
31 /*
32 ** Given a comment string zText, format that string for printing
33 ** on a TTY. Assume that the output cursors is indent spaces from
34 ** the left margin and that a single line can contain no more than
@@ -35,11 +41,23 @@
41 int si, sk, i, k;
42 int doIndent = 0;
43 char *zBuf;
44 char zBuffer[400];
45 int lineCnt = 0;
46 #if defined(_WIN32)
47 if ( lineLength<0 ){
48 CONSOLE_SCREEN_BUFFER_INFO csbi;
49 GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
50 tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent + 1;
51 }
52 #elif defined(TIOCGWINSZ)
53 if ( lineLength<0 ){
54 struct winsize w;
55 ioctl(0, TIOCGWINSZ, &w);
56 tlen = w.ws_col - indent;
57 }
58 #endif
59 if( zText==0 ) zText = "(NULL)";
60 if( tlen<=0 ){
61 tlen = strlen(zText);
62 }
63 if( tlen >= (sizeof(zBuffer)) ){
64
+1 -2
--- src/config.h
+++ src/config.h
@@ -49,20 +49,19 @@
4949
#include <stdarg.h>
5050
#include <assert.h>
5151
5252
#endif
5353
54
-#if defined(__MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
54
+#if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
5555
# if defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
5656
typedef int socklen_t;
5757
# endif
5858
# ifndef _WIN32
5959
# define _WIN32
6060
# endif
6161
#else
6262
# include <sys/types.h>
63
-# include <termios.h>
6463
# include <signal.h>
6564
# include <pwd.h>
6665
#endif
6766
6867
/*
6968
--- src/config.h
+++ src/config.h
@@ -49,20 +49,19 @@
49 #include <stdarg.h>
50 #include <assert.h>
51
52 #endif
53
54 #if defined(__MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
55 # if defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
56 typedef int socklen_t;
57 # endif
58 # ifndef _WIN32
59 # define _WIN32
60 # endif
61 #else
62 # include <sys/types.h>
63 # include <termios.h>
64 # include <signal.h>
65 # include <pwd.h>
66 #endif
67
68 /*
69
--- src/config.h
+++ src/config.h
@@ -49,20 +49,19 @@
49 #include <stdarg.h>
50 #include <assert.h>
51
52 #endif
53
54 #if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
55 # if defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__)
56 typedef int socklen_t;
57 # endif
58 # ifndef _WIN32
59 # define _WIN32
60 # endif
61 #else
62 # include <sys/types.h>
 
63 # include <signal.h>
64 # include <pwd.h>
65 #endif
66
67 /*
68
--- src/configure.c
+++ src/configure.c
@@ -97,10 +97,11 @@
9797
{ "timeline-max-comment", CONFIGSET_SKIN },
9898
{ "timeline-plaintext", CONFIGSET_SKIN },
9999
{ "adunit", CONFIGSET_SKIN },
100100
{ "adunit-omit-if-admin", CONFIGSET_SKIN },
101101
{ "adunit-omit-if-user", CONFIGSET_SKIN },
102
+ { "th1-hooks", CONFIGSET_TH1 },
102103
{ "th1-setup", CONFIGSET_TH1 },
103104
{ "th1-uri-regexp", CONFIGSET_TH1 },
104105
105106
#ifdef FOSSIL_ENABLE_TCL
106107
{ "tcl", CONFIGSET_TH1 },
107108
--- src/configure.c
+++ src/configure.c
@@ -97,10 +97,11 @@
97 { "timeline-max-comment", CONFIGSET_SKIN },
98 { "timeline-plaintext", CONFIGSET_SKIN },
99 { "adunit", CONFIGSET_SKIN },
100 { "adunit-omit-if-admin", CONFIGSET_SKIN },
101 { "adunit-omit-if-user", CONFIGSET_SKIN },
 
102 { "th1-setup", CONFIGSET_TH1 },
103 { "th1-uri-regexp", CONFIGSET_TH1 },
104
105 #ifdef FOSSIL_ENABLE_TCL
106 { "tcl", CONFIGSET_TH1 },
107
--- src/configure.c
+++ src/configure.c
@@ -97,10 +97,11 @@
97 { "timeline-max-comment", CONFIGSET_SKIN },
98 { "timeline-plaintext", CONFIGSET_SKIN },
99 { "adunit", CONFIGSET_SKIN },
100 { "adunit-omit-if-admin", CONFIGSET_SKIN },
101 { "adunit-omit-if-user", CONFIGSET_SKIN },
102 { "th1-hooks", CONFIGSET_TH1 },
103 { "th1-setup", CONFIGSET_TH1 },
104 { "th1-uri-regexp", CONFIGSET_TH1 },
105
106 #ifdef FOSSIL_ENABLE_TCL
107 { "tcl", CONFIGSET_TH1 },
108
+40 -11
--- src/db.c
+++ src/db.c
@@ -785,10 +785,31 @@
785785
assert( g.zMainDbType!=0 );
786786
db_attach(zDbName, zLabel);
787787
if( pWasAttached ) *pWasAttached = 1;
788788
}
789789
}
790
+
791
+/*
792
+** Close the user database.
793
+*/
794
+void db_close_config(){
795
+ if( g.useAttach ){
796
+ db_detach("configdb");
797
+ g.useAttach = 0;
798
+ g.zConfigDbName = 0;
799
+ }else if( g.dbConfig ){
800
+ sqlite3_close(g.dbConfig);
801
+ g.dbConfig = 0;
802
+ g.zConfigDbType = 0;
803
+ g.zConfigDbName = 0;
804
+ }else if( g.db && fossil_strcmp(g.zMainDbType, "configdb")==0 ){
805
+ sqlite3_close(g.db);
806
+ g.db = 0;
807
+ g.zMainDbType = 0;
808
+ g.zConfigDbName = 0;
809
+ }
810
+}
790811
791812
/*
792813
** Open the user database in "~/.fossil". Create the database anew if
793814
** it does not already exist.
794815
**
@@ -801,11 +822,14 @@
801822
** case, invoke this routine with useAttach as 1.
802823
*/
803824
void db_open_config(int useAttach){
804825
char *zDbName;
805826
char *zHome;
806
- if( g.zConfigDbName ) return;
827
+ if( g.zConfigDbName ){
828
+ if( useAttach==g.useAttach ) return;
829
+ db_close_config();
830
+ }
807831
#if defined(_WIN32) || defined(__CYGWIN__)
808832
zHome = fossil_getenv("LOCALAPPDATA");
809833
if( zHome==0 ){
810834
zHome = fossil_getenv("APPDATA");
811835
if( zHome==0 ){
@@ -941,11 +965,11 @@
941965
int db_open_local(const char *zDbName){
942966
int i, n;
943967
char zPwd[2000];
944968
static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" };
945969
946
- if( g.localOpen) return 1;
970
+ if( g.localOpen ) return 1;
947971
file_getcwd(zPwd, sizeof(zPwd)-20);
948972
n = strlen(zPwd);
949973
while( n>0 ){
950974
for(i=0; i<count(aDbName); i++){
951975
sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]);
@@ -1045,11 +1069,11 @@
10451069
** use the repository of the open checkout if there is one.
10461070
**
10471071
** Error out if the repository cannot be opened.
10481072
*/
10491073
void db_find_and_open_repository(int bFlags, int nArgUsed){
1050
- const char *zRep = find_option("repository", "R", 1);
1074
+ const char *zRep = find_repository_option();
10511075
if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){
10521076
zRep = g.argv[nArgUsed];
10531077
}
10541078
if( zRep==0 ){
10551079
if( db_open_local(0)==0 ){
@@ -1920,11 +1944,11 @@
19201944
int rc = 0;
19211945
db_prepare( &q, "PRAGMA table_info(%Q)", zTableName );
19221946
while(SQLITE_ROW == db_step(&q)){
19231947
/* Columns: (cid, name, type, notnull, dflt_value, pk) */
19241948
char const * zCol = db_column_text(&q, 1);
1925
- if(0==fossil_strcmp(zColName, zCol)){
1949
+ if( 0==fossil_strcmp(zColName, zCol) ){
19261950
rc = 1;
19271951
break;
19281952
}
19291953
}
19301954
db_finalize(&q);
@@ -2040,11 +2064,11 @@
20402064
db_lset_int("checkout", 0);
20412065
oldArgv = g.argv;
20422066
oldArgc = g.argc;
20432067
azNewArgv[0] = g.argv[0];
20442068
g.argv = azNewArgv;
2045
- if( !emptyFlag){
2069
+ if( !emptyFlag ){
20462070
g.argc = 3;
20472071
if( oldArgc==4 ){
20482072
azNewArgv[g.argc-1] = oldArgv[3];
20492073
}else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){
20502074
azNewArgv[g.argc-1] = "--latest";
@@ -2169,14 +2193,15 @@
21692193
{ "ssh-command", 0, 40, 0, 0, "" },
21702194
{ "ssl-ca-location", 0, 40, 0, 0, "" },
21712195
{ "ssl-identity", 0, 40, 0, 0, "" },
21722196
#ifdef FOSSIL_ENABLE_TCL
21732197
{ "tcl", 0, 0, 0, 0, "off" },
2174
- { "tcl-setup", 0, 40, 0, 1, "" },
2198
+ { "tcl-setup", 0, 40, 1, 1, "" },
21752199
#endif
2176
- { "th1-setup", 0, 40, 0, 1, "" },
2177
- { "th1-uri-regexp", 0, 40, 0, 0, "" },
2200
+ { "th1-hooks", 0, 0, 0, 0, "off" },
2201
+ { "th1-setup", 0, 40, 1, 1, "" },
2202
+ { "th1-uri-regexp", 0, 40, 1, 0, "" },
21782203
{ "web-browser", 0, 32, 0, 0, "" },
21792204
{ "white-foreground", 0, 0, 0, 0, "off" },
21802205
{ 0,0,0,0,0,0 }
21812206
};
21822207
@@ -2375,19 +2400,23 @@
23752400
** scripts to be evaluated from TH1. Additionally, the Tcl
23762401
** interpreter will be able to evaluate arbitrary TH1
23772402
** expressions and scripts. Default: off.
23782403
**
23792404
** tcl-setup This is the setup script to be evaluated after creating
2380
-** and initializing the Tcl interpreter. By default, this
2405
+** (versionable) and initializing the Tcl interpreter. By default, this
23812406
** is empty and no extra setup is performed.
2407
+**
2408
+** th1-hooks If enabled (and Fossil was compiled with support for TH1
2409
+** hooks), special TH1 commands will be called before and
2410
+** after any Fossil command or web page. Default: off.
23822411
**
23832412
** th1-setup This is the setup script to be evaluated after creating
2384
-** and initializing the TH1 interpreter. By default, this
2413
+** (versionable) and initializing the TH1 interpreter. By default, this
23852414
** is empty and no extra setup is performed.
23862415
**
23872416
** th1-uri-regexp Specify which URI's are allowed in HTTP requests from
2388
-** TH1 scripts. If empty, no HTTP requests are allowed
2417
+** (versionable) TH1 scripts. If empty, no HTTP requests are allowed
23892418
** whatsoever. The default is an empty string.
23902419
**
23912420
** web-browser A shell command used to launch your preferred
23922421
** web browser when given a URL as an argument.
23932422
** Defaults to "start" on windows, "open" on Mac,
23942423
--- src/db.c
+++ src/db.c
@@ -785,10 +785,31 @@
785 assert( g.zMainDbType!=0 );
786 db_attach(zDbName, zLabel);
787 if( pWasAttached ) *pWasAttached = 1;
788 }
789 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
790
791 /*
792 ** Open the user database in "~/.fossil". Create the database anew if
793 ** it does not already exist.
794 **
@@ -801,11 +822,14 @@
801 ** case, invoke this routine with useAttach as 1.
802 */
803 void db_open_config(int useAttach){
804 char *zDbName;
805 char *zHome;
806 if( g.zConfigDbName ) return;
 
 
 
807 #if defined(_WIN32) || defined(__CYGWIN__)
808 zHome = fossil_getenv("LOCALAPPDATA");
809 if( zHome==0 ){
810 zHome = fossil_getenv("APPDATA");
811 if( zHome==0 ){
@@ -941,11 +965,11 @@
941 int db_open_local(const char *zDbName){
942 int i, n;
943 char zPwd[2000];
944 static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" };
945
946 if( g.localOpen) return 1;
947 file_getcwd(zPwd, sizeof(zPwd)-20);
948 n = strlen(zPwd);
949 while( n>0 ){
950 for(i=0; i<count(aDbName); i++){
951 sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]);
@@ -1045,11 +1069,11 @@
1045 ** use the repository of the open checkout if there is one.
1046 **
1047 ** Error out if the repository cannot be opened.
1048 */
1049 void db_find_and_open_repository(int bFlags, int nArgUsed){
1050 const char *zRep = find_option("repository", "R", 1);
1051 if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){
1052 zRep = g.argv[nArgUsed];
1053 }
1054 if( zRep==0 ){
1055 if( db_open_local(0)==0 ){
@@ -1920,11 +1944,11 @@
1920 int rc = 0;
1921 db_prepare( &q, "PRAGMA table_info(%Q)", zTableName );
1922 while(SQLITE_ROW == db_step(&q)){
1923 /* Columns: (cid, name, type, notnull, dflt_value, pk) */
1924 char const * zCol = db_column_text(&q, 1);
1925 if(0==fossil_strcmp(zColName, zCol)){
1926 rc = 1;
1927 break;
1928 }
1929 }
1930 db_finalize(&q);
@@ -2040,11 +2064,11 @@
2040 db_lset_int("checkout", 0);
2041 oldArgv = g.argv;
2042 oldArgc = g.argc;
2043 azNewArgv[0] = g.argv[0];
2044 g.argv = azNewArgv;
2045 if( !emptyFlag){
2046 g.argc = 3;
2047 if( oldArgc==4 ){
2048 azNewArgv[g.argc-1] = oldArgv[3];
2049 }else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){
2050 azNewArgv[g.argc-1] = "--latest";
@@ -2169,14 +2193,15 @@
2169 { "ssh-command", 0, 40, 0, 0, "" },
2170 { "ssl-ca-location", 0, 40, 0, 0, "" },
2171 { "ssl-identity", 0, 40, 0, 0, "" },
2172 #ifdef FOSSIL_ENABLE_TCL
2173 { "tcl", 0, 0, 0, 0, "off" },
2174 { "tcl-setup", 0, 40, 0, 1, "" },
2175 #endif
2176 { "th1-setup", 0, 40, 0, 1, "" },
2177 { "th1-uri-regexp", 0, 40, 0, 0, "" },
 
2178 { "web-browser", 0, 32, 0, 0, "" },
2179 { "white-foreground", 0, 0, 0, 0, "off" },
2180 { 0,0,0,0,0,0 }
2181 };
2182
@@ -2375,19 +2400,23 @@
2375 ** scripts to be evaluated from TH1. Additionally, the Tcl
2376 ** interpreter will be able to evaluate arbitrary TH1
2377 ** expressions and scripts. Default: off.
2378 **
2379 ** tcl-setup This is the setup script to be evaluated after creating
2380 ** and initializing the Tcl interpreter. By default, this
2381 ** is empty and no extra setup is performed.
 
 
 
 
2382 **
2383 ** th1-setup This is the setup script to be evaluated after creating
2384 ** and initializing the TH1 interpreter. By default, this
2385 ** is empty and no extra setup is performed.
2386 **
2387 ** th1-uri-regexp Specify which URI's are allowed in HTTP requests from
2388 ** TH1 scripts. If empty, no HTTP requests are allowed
2389 ** whatsoever. The default is an empty string.
2390 **
2391 ** web-browser A shell command used to launch your preferred
2392 ** web browser when given a URL as an argument.
2393 ** Defaults to "start" on windows, "open" on Mac,
2394
--- src/db.c
+++ src/db.c
@@ -785,10 +785,31 @@
785 assert( g.zMainDbType!=0 );
786 db_attach(zDbName, zLabel);
787 if( pWasAttached ) *pWasAttached = 1;
788 }
789 }
790
791 /*
792 ** Close the user database.
793 */
794 void db_close_config(){
795 if( g.useAttach ){
796 db_detach("configdb");
797 g.useAttach = 0;
798 g.zConfigDbName = 0;
799 }else if( g.dbConfig ){
800 sqlite3_close(g.dbConfig);
801 g.dbConfig = 0;
802 g.zConfigDbType = 0;
803 g.zConfigDbName = 0;
804 }else if( g.db && fossil_strcmp(g.zMainDbType, "configdb")==0 ){
805 sqlite3_close(g.db);
806 g.db = 0;
807 g.zMainDbType = 0;
808 g.zConfigDbName = 0;
809 }
810 }
811
812 /*
813 ** Open the user database in "~/.fossil". Create the database anew if
814 ** it does not already exist.
815 **
@@ -801,11 +822,14 @@
822 ** case, invoke this routine with useAttach as 1.
823 */
824 void db_open_config(int useAttach){
825 char *zDbName;
826 char *zHome;
827 if( g.zConfigDbName ){
828 if( useAttach==g.useAttach ) return;
829 db_close_config();
830 }
831 #if defined(_WIN32) || defined(__CYGWIN__)
832 zHome = fossil_getenv("LOCALAPPDATA");
833 if( zHome==0 ){
834 zHome = fossil_getenv("APPDATA");
835 if( zHome==0 ){
@@ -941,11 +965,11 @@
965 int db_open_local(const char *zDbName){
966 int i, n;
967 char zPwd[2000];
968 static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" };
969
970 if( g.localOpen ) return 1;
971 file_getcwd(zPwd, sizeof(zPwd)-20);
972 n = strlen(zPwd);
973 while( n>0 ){
974 for(i=0; i<count(aDbName); i++){
975 sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]);
@@ -1045,11 +1069,11 @@
1069 ** use the repository of the open checkout if there is one.
1070 **
1071 ** Error out if the repository cannot be opened.
1072 */
1073 void db_find_and_open_repository(int bFlags, int nArgUsed){
1074 const char *zRep = find_repository_option();
1075 if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){
1076 zRep = g.argv[nArgUsed];
1077 }
1078 if( zRep==0 ){
1079 if( db_open_local(0)==0 ){
@@ -1920,11 +1944,11 @@
1944 int rc = 0;
1945 db_prepare( &q, "PRAGMA table_info(%Q)", zTableName );
1946 while(SQLITE_ROW == db_step(&q)){
1947 /* Columns: (cid, name, type, notnull, dflt_value, pk) */
1948 char const * zCol = db_column_text(&q, 1);
1949 if( 0==fossil_strcmp(zColName, zCol) ){
1950 rc = 1;
1951 break;
1952 }
1953 }
1954 db_finalize(&q);
@@ -2040,11 +2064,11 @@
2064 db_lset_int("checkout", 0);
2065 oldArgv = g.argv;
2066 oldArgc = g.argc;
2067 azNewArgv[0] = g.argv[0];
2068 g.argv = azNewArgv;
2069 if( !emptyFlag ){
2070 g.argc = 3;
2071 if( oldArgc==4 ){
2072 azNewArgv[g.argc-1] = oldArgv[3];
2073 }else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){
2074 azNewArgv[g.argc-1] = "--latest";
@@ -2169,14 +2193,15 @@
2193 { "ssh-command", 0, 40, 0, 0, "" },
2194 { "ssl-ca-location", 0, 40, 0, 0, "" },
2195 { "ssl-identity", 0, 40, 0, 0, "" },
2196 #ifdef FOSSIL_ENABLE_TCL
2197 { "tcl", 0, 0, 0, 0, "off" },
2198 { "tcl-setup", 0, 40, 1, 1, "" },
2199 #endif
2200 { "th1-hooks", 0, 0, 0, 0, "off" },
2201 { "th1-setup", 0, 40, 1, 1, "" },
2202 { "th1-uri-regexp", 0, 40, 1, 0, "" },
2203 { "web-browser", 0, 32, 0, 0, "" },
2204 { "white-foreground", 0, 0, 0, 0, "off" },
2205 { 0,0,0,0,0,0 }
2206 };
2207
@@ -2375,19 +2400,23 @@
2400 ** scripts to be evaluated from TH1. Additionally, the Tcl
2401 ** interpreter will be able to evaluate arbitrary TH1
2402 ** expressions and scripts. Default: off.
2403 **
2404 ** tcl-setup This is the setup script to be evaluated after creating
2405 ** (versionable) and initializing the Tcl interpreter. By default, this
2406 ** is empty and no extra setup is performed.
2407 **
2408 ** th1-hooks If enabled (and Fossil was compiled with support for TH1
2409 ** hooks), special TH1 commands will be called before and
2410 ** after any Fossil command or web page. Default: off.
2411 **
2412 ** th1-setup This is the setup script to be evaluated after creating
2413 ** (versionable) and initializing the TH1 interpreter. By default, this
2414 ** is empty and no extra setup is performed.
2415 **
2416 ** th1-uri-regexp Specify which URI's are allowed in HTTP requests from
2417 ** (versionable) TH1 scripts. If empty, no HTTP requests are allowed
2418 ** whatsoever. The default is an empty string.
2419 **
2420 ** web-browser A shell command used to launch your preferred
2421 ** web browser when given a URL as an argument.
2422 ** Defaults to "start" on windows, "open" on Mac,
2423
--- src/descendants.c
+++ src/descendants.c
@@ -356,17 +356,11 @@
356356
width = atoi(zWidth);
357357
if( (width!=0) && (width<=39) ){
358358
fossil_fatal("-W|--width value must be >39 or 0");
359359
}
360360
}else{
361
-#ifdef TIOCGWINSZ
362
- struct winsize w;
363
- ioctl(0, TIOCGWINSZ, &w);
364
- width = w.ws_col;
365
-#else
366
- width = 79;
367
-#endif
361
+ width = -1;
368362
}
369363
db_find_and_open_repository(0,0);
370364
if( recomputeFlag ) leaf_rebuild();
371365
blob_zero(&sql);
372366
blob_append(&sql, timeline_query_for_tty(), -1);
373367
--- src/descendants.c
+++ src/descendants.c
@@ -356,17 +356,11 @@
356 width = atoi(zWidth);
357 if( (width!=0) && (width<=39) ){
358 fossil_fatal("-W|--width value must be >39 or 0");
359 }
360 }else{
361 #ifdef TIOCGWINSZ
362 struct winsize w;
363 ioctl(0, TIOCGWINSZ, &w);
364 width = w.ws_col;
365 #else
366 width = 79;
367 #endif
368 }
369 db_find_and_open_repository(0,0);
370 if( recomputeFlag ) leaf_rebuild();
371 blob_zero(&sql);
372 blob_append(&sql, timeline_query_for_tty(), -1);
373
--- src/descendants.c
+++ src/descendants.c
@@ -356,17 +356,11 @@
356 width = atoi(zWidth);
357 if( (width!=0) && (width<=39) ){
358 fossil_fatal("-W|--width value must be >39 or 0");
359 }
360 }else{
361 width = -1;
 
 
 
 
 
 
362 }
363 db_find_and_open_repository(0,0);
364 if( recomputeFlag ) leaf_rebuild();
365 blob_zero(&sql);
366 blob_append(&sql, timeline_query_for_tty(), -1);
367
--- src/descendants.c
+++ src/descendants.c
@@ -356,17 +356,11 @@
356356
width = atoi(zWidth);
357357
if( (width!=0) && (width<=39) ){
358358
fossil_fatal("-W|--width value must be >39 or 0");
359359
}
360360
}else{
361
-#ifdef TIOCGWINSZ
362
- struct winsize w;
363
- ioctl(0, TIOCGWINSZ, &w);
364
- width = w.ws_col;
365
-#else
366
- width = 79;
367
-#endif
361
+ width = -1;
368362
}
369363
db_find_and_open_repository(0,0);
370364
if( recomputeFlag ) leaf_rebuild();
371365
blob_zero(&sql);
372366
blob_append(&sql, timeline_query_for_tty(), -1);
373367
--- src/descendants.c
+++ src/descendants.c
@@ -356,17 +356,11 @@
356 width = atoi(zWidth);
357 if( (width!=0) && (width<=39) ){
358 fossil_fatal("-W|--width value must be >39 or 0");
359 }
360 }else{
361 #ifdef TIOCGWINSZ
362 struct winsize w;
363 ioctl(0, TIOCGWINSZ, &w);
364 width = w.ws_col;
365 #else
366 width = 79;
367 #endif
368 }
369 db_find_and_open_repository(0,0);
370 if( recomputeFlag ) leaf_rebuild();
371 blob_zero(&sql);
372 blob_append(&sql, timeline_query_for_tty(), -1);
373
--- src/descendants.c
+++ src/descendants.c
@@ -356,17 +356,11 @@
356 width = atoi(zWidth);
357 if( (width!=0) && (width<=39) ){
358 fossil_fatal("-W|--width value must be >39 or 0");
359 }
360 }else{
361 width = -1;
 
 
 
 
 
 
362 }
363 db_find_and_open_repository(0,0);
364 if( recomputeFlag ) leaf_rebuild();
365 blob_zero(&sql);
366 blob_append(&sql, timeline_query_for_tty(), -1);
367
+7 -3
--- src/finfo.c
+++ src/finfo.c
@@ -146,16 +146,20 @@
146146
/* this is the default, no-op */
147147
}
148148
zLimit = find_option("limit","n",1);
149149
zWidth = find_option("width","W",1);
150150
iLimit = zLimit ? atoi(zLimit) : -1;
151
- iWidth = zWidth ? atoi(zWidth) : 79;
152151
zOffset = find_option("offset",0,1);
153152
iOffset = zOffset ? atoi(zOffset) : 0;
154153
iBrief = (find_option("brief","b",0) == 0);
155
- if( (iWidth!=0) && (iWidth<=22) ){
156
- fossil_fatal("-W|--width value must be >22 or 0");
154
+ if( zWidth ){
155
+ iWidth = atoi(zWidth);
156
+ if( (iWidth!=0) && (iWidth<=22) ){
157
+ fossil_fatal("-W|--width value must be >22 or 0");
158
+ }
159
+ }else{
160
+ iWidth = -1;
157161
}
158162
if( g.argc!=3 ){
159163
usage("?-l|--log? ?-b|--brief? FILENAME");
160164
}
161165
file_tree_name(g.argv[2], &fname, 1);
162166
163167
ADDED src/fusefs.c
--- src/finfo.c
+++ src/finfo.c
@@ -146,16 +146,20 @@
146 /* this is the default, no-op */
147 }
148 zLimit = find_option("limit","n",1);
149 zWidth = find_option("width","W",1);
150 iLimit = zLimit ? atoi(zLimit) : -1;
151 iWidth = zWidth ? atoi(zWidth) : 79;
152 zOffset = find_option("offset",0,1);
153 iOffset = zOffset ? atoi(zOffset) : 0;
154 iBrief = (find_option("brief","b",0) == 0);
155 if( (iWidth!=0) && (iWidth<=22) ){
156 fossil_fatal("-W|--width value must be >22 or 0");
 
 
 
 
 
157 }
158 if( g.argc!=3 ){
159 usage("?-l|--log? ?-b|--brief? FILENAME");
160 }
161 file_tree_name(g.argv[2], &fname, 1);
162
163 DDED src/fusefs.c
--- src/finfo.c
+++ src/finfo.c
@@ -146,16 +146,20 @@
146 /* this is the default, no-op */
147 }
148 zLimit = find_option("limit","n",1);
149 zWidth = find_option("width","W",1);
150 iLimit = zLimit ? atoi(zLimit) : -1;
 
151 zOffset = find_option("offset",0,1);
152 iOffset = zOffset ? atoi(zOffset) : 0;
153 iBrief = (find_option("brief","b",0) == 0);
154 if( zWidth ){
155 iWidth = atoi(zWidth);
156 if( (iWidth!=0) && (iWidth<=22) ){
157 fossil_fatal("-W|--width value must be >22 or 0");
158 }
159 }else{
160 iWidth = -1;
161 }
162 if( g.argc!=3 ){
163 usage("?-l|--log? ?-b|--brief? FILENAME");
164 }
165 file_tree_name(g.argv[2], &fname, 1);
166
167 DDED src/fusefs.c
+7 -3
--- src/finfo.c
+++ src/finfo.c
@@ -146,16 +146,20 @@
146146
/* this is the default, no-op */
147147
}
148148
zLimit = find_option("limit","n",1);
149149
zWidth = find_option("width","W",1);
150150
iLimit = zLimit ? atoi(zLimit) : -1;
151
- iWidth = zWidth ? atoi(zWidth) : 79;
152151
zOffset = find_option("offset",0,1);
153152
iOffset = zOffset ? atoi(zOffset) : 0;
154153
iBrief = (find_option("brief","b",0) == 0);
155
- if( (iWidth!=0) && (iWidth<=22) ){
156
- fossil_fatal("-W|--width value must be >22 or 0");
154
+ if( zWidth ){
155
+ iWidth = atoi(zWidth);
156
+ if( (iWidth!=0) && (iWidth<=22) ){
157
+ fossil_fatal("-W|--width value must be >22 or 0");
158
+ }
159
+ }else{
160
+ iWidth = -1;
157161
}
158162
if( g.argc!=3 ){
159163
usage("?-l|--log? ?-b|--brief? FILENAME");
160164
}
161165
file_tree_name(g.argv[2], &fname, 1);
162166
163167
ADDED src/fusefs.c
--- src/finfo.c
+++ src/finfo.c
@@ -146,16 +146,20 @@
146 /* this is the default, no-op */
147 }
148 zLimit = find_option("limit","n",1);
149 zWidth = find_option("width","W",1);
150 iLimit = zLimit ? atoi(zLimit) : -1;
151 iWidth = zWidth ? atoi(zWidth) : 79;
152 zOffset = find_option("offset",0,1);
153 iOffset = zOffset ? atoi(zOffset) : 0;
154 iBrief = (find_option("brief","b",0) == 0);
155 if( (iWidth!=0) && (iWidth<=22) ){
156 fossil_fatal("-W|--width value must be >22 or 0");
 
 
 
 
 
157 }
158 if( g.argc!=3 ){
159 usage("?-l|--log? ?-b|--brief? FILENAME");
160 }
161 file_tree_name(g.argv[2], &fname, 1);
162
163 DDED src/fusefs.c
--- src/finfo.c
+++ src/finfo.c
@@ -146,16 +146,20 @@
146 /* this is the default, no-op */
147 }
148 zLimit = find_option("limit","n",1);
149 zWidth = find_option("width","W",1);
150 iLimit = zLimit ? atoi(zLimit) : -1;
 
151 zOffset = find_option("offset",0,1);
152 iOffset = zOffset ? atoi(zOffset) : 0;
153 iBrief = (find_option("brief","b",0) == 0);
154 if( zWidth ){
155 iWidth = atoi(zWidth);
156 if( (iWidth!=0) && (iWidth<=22) ){
157 fossil_fatal("-W|--width value must be >22 or 0");
158 }
159 }else{
160 iWidth = -1;
161 }
162 if( g.argc!=3 ){
163 usage("?-l|--log? ?-b|--brief? FILENAME");
164 }
165 file_tree_name(g.argv[2], &fname, 1);
166
167 DDED src/fusefs.c
--- a/src/fusefs.c
+++ b/src/fusefs.c
@@ -0,0 +1,8 @@
1
+/*the versiondef
2
+# define STRINGIFY_(X) #X
3
+# define STRINGIFY(X) STRINGIFY_(X)
4
+ return 0;
5
+#endif
6
+}
7
+#ifdef#ifndef
8
+ fossil_fatal("this build of fossil do
--- a/src/fusefs.c
+++ b/src/fusefs.c
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
--- a/src/fusefs.c
+++ b/src/fusefs.c
@@ -0,0 +1,8 @@
1 /*the versiondef
2 # define STRINGIFY_(X) #X
3 # define STRINGIFY(X) STRINGIFY_(X)
4 return 0;
5 #endif
6 }
7 #ifdef#ifndef
8 fossil_fatal("this build of fossil do
+1 -1
--- src/info.c
+++ src/info.c
@@ -132,11 +132,11 @@
132132
fossil_print("tags: %s\n", zTags);
133133
}
134134
free(zTags);
135135
if( zComment ){
136136
fossil_print("comment: ");
137
- comment_print(zComment, 14, 79);
137
+ comment_print(zComment, 14, -1);
138138
free(zComment);
139139
}
140140
}
141141
142142
/*
143143
--- src/info.c
+++ src/info.c
@@ -132,11 +132,11 @@
132 fossil_print("tags: %s\n", zTags);
133 }
134 free(zTags);
135 if( zComment ){
136 fossil_print("comment: ");
137 comment_print(zComment, 14, 79);
138 free(zComment);
139 }
140 }
141
142 /*
143
--- src/info.c
+++ src/info.c
@@ -132,11 +132,11 @@
132 fossil_print("tags: %s\n", zTags);
133 }
134 free(zTags);
135 if( zComment ){
136 fossil_print("comment: ");
137 comment_print(zComment, 14, -1);
138 free(zComment);
139 }
140 }
141
142 /*
143
+1 -1
--- src/info.c
+++ src/info.c
@@ -132,11 +132,11 @@
132132
fossil_print("tags: %s\n", zTags);
133133
}
134134
free(zTags);
135135
if( zComment ){
136136
fossil_print("comment: ");
137
- comment_print(zComment, 14, 79);
137
+ comment_print(zComment, 14, -1);
138138
free(zComment);
139139
}
140140
}
141141
142142
/*
143143
--- src/info.c
+++ src/info.c
@@ -132,11 +132,11 @@
132 fossil_print("tags: %s\n", zTags);
133 }
134 free(zTags);
135 if( zComment ){
136 fossil_print("comment: ");
137 comment_print(zComment, 14, 79);
138 free(zComment);
139 }
140 }
141
142 /*
143
--- src/info.c
+++ src/info.c
@@ -132,11 +132,11 @@
132 fossil_print("tags: %s\n", zTags);
133 }
134 free(zTags);
135 if( zComment ){
136 fossil_print("comment: ");
137 comment_print(zComment, 14, -1);
138 free(zComment);
139 }
140 }
141
142 /*
143
+135 -10
--- src/main.c
+++ src/main.c
@@ -124,10 +124,11 @@
124124
sqlite3 *dbConfig; /* Separate connection for global_config table */
125125
int useAttach; /* True if global_config is attached to repository */
126126
const char *zConfigDbName;/* Path of the config database. NULL if not open */
127127
sqlite3_int64 now; /* Seconds since 1970 */
128128
int repositoryOpen; /* True if the main repository database is open */
129
+ char *zRepositoryOption; /* Most recent cached repository option value */
129130
char *zRepositoryName; /* Name of the repository database */
130131
const char *zMainDbType;/* "configdb", "localdb", or "repository" */
131132
const char *zConfigDbType; /* "configdb", "localdb", or "repository" */
132133
int localOpen; /* True if the local database is open */
133134
char *zLocalRoot; /* The directory holding the local database */
@@ -155,10 +156,11 @@
155156
int cgiOutput; /* Write error and status messages to CGI */
156157
int xferPanic; /* Write error messages in XFER protocol */
157158
int fullHttpReply; /* True for full HTTP reply. False for CGI reply */
158159
Th_Interp *interp; /* The TH1 interpreter */
159160
char *th1Setup; /* The TH1 post-creation setup script, if any */
161
+ int th1Flags; /* The TH1 integration state flags */
160162
FILE *httpIn; /* Accept HTTP input from here */
161163
FILE *httpOut; /* Send HTTP output here */
162164
int xlinkClusterOnly; /* Set when cloning. Only process clusters */
163165
int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */
164166
int *aCommitFile; /* Array of files to be committed */
@@ -194,10 +196,13 @@
194196
char zCsrfToken[12]; /* Value of the anti-CSRF token */
195197
int okCsrf; /* Anti-CSRF token is present and valid */
196198
197199
int parseCnt[10]; /* Counts of artifacts parsed */
198200
FILE *fDebug; /* Write debug information here, if the file exists */
201
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
202
+ int fNoThHook; /* Disable all TH1 command/webpage hooks */
203
+#endif
199204
int thTrace; /* True to enable TH1 debugging output */
200205
Blob thLog; /* Text of the TH1 debugging output */
201206
202207
int isHome; /* True if rendering the "home" page */
203208
@@ -620,10 +625,13 @@
620625
g.fSshClient = 0;
621626
g.zSshCmd = 0;
622627
if( g.fSqlTrace ) g.fSqlStats = 1;
623628
g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
624629
g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
630
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
631
+ g.fNoThHook = find_option("no-th-hook", 0, 0)!=0;
632
+#endif
625633
g.zHttpAuth = 0;
626634
g.zLogin = find_option("user", "U", 1);
627635
g.zSSLIdentity = find_option("ssl-identity", 0, 1);
628636
g.zErrlog = find_option("errorlog", 0, 1);
629637
if( find_option("utc",0,0) ) g.fTimeFormat = 1;
@@ -649,13 +657,30 @@
649657
if( !is_valid_fd(2) ) fossil_panic("file descriptor 2 not open");
650658
/* if( is_valid_fd(3) ) fossil_warning("file descriptor 3 is open"); */
651659
#endif
652660
rc = name_search(zCmdName, aCommand, count(aCommand), &idx);
653661
if( rc==1 ){
654
- fossil_fatal("%s: unknown command: %s\n"
655
- "%s: use \"help\" for more information\n",
656
- g.argv[0], zCmdName, g.argv[0]);
662
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
663
+ if( !g.isHTTP && !g.fNoThHook ){
664
+ rc = Th_CommandHook(zCmdName, 0);
665
+ }else{
666
+ rc = TH_OK;
667
+ }
668
+ if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
669
+ if( rc==TH_OK || rc==TH_RETURN ){
670
+#endif
671
+ fossil_fatal("%s: unknown command: %s\n"
672
+ "%s: use \"help\" for more information\n",
673
+ g.argv[0], zCmdName, g.argv[0]);
674
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
675
+ }
676
+ if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
677
+ Th_CommandNotify(zCmdName, 0);
678
+ }
679
+ }
680
+ fossil_exit(0);
681
+#endif
657682
}else if( rc==2 ){
658683
int i, n;
659684
Blob couldbe;
660685
blob_zero(&couldbe);
661686
n = strlen(zCmdName);
@@ -669,11 +694,44 @@
669694
"%s: use \"help\" for more information\n",
670695
g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]);
671696
fossil_exit(1);
672697
}
673698
atexit( fossil_atexit );
674
- aCommand[idx].xFunc();
699
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
700
+ /*
701
+ ** The TH1 return codes from the hook will be handled as follows:
702
+ **
703
+ ** TH_OK: The xFunc() and the TH1 notification will both be executed.
704
+ **
705
+ ** TH_ERROR: The xFunc() will be executed, the TH1 notification will be
706
+ ** skipped. If the xFunc() is being hooked, the error message
707
+ ** will be emitted.
708
+ **
709
+ ** TH_BREAK: The xFunc() and the TH1 notification will both be skipped.
710
+ **
711
+ ** TH_RETURN: The xFunc() will be executed, the TH1 notification will be
712
+ ** skipped.
713
+ **
714
+ ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be
715
+ ** executed.
716
+ */
717
+ if( !g.isHTTP && !g.fNoThHook ){
718
+ rc = Th_CommandHook(aCommand[idx].zName, aCommand[idx].cmdFlags);
719
+ }else{
720
+ rc = TH_OK;
721
+ }
722
+ if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
723
+ if( rc==TH_OK || rc==TH_RETURN ){
724
+#endif
725
+ aCommand[idx].xFunc();
726
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
727
+ }
728
+ if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
729
+ Th_CommandNotify(aCommand[idx].zName, aCommand[idx].cmdFlags);
730
+ }
731
+ }
732
+#endif
675733
fossil_exit(0);
676734
/*NOT_REACHED*/
677735
return 0;
678736
}
679737
@@ -739,10 +797,24 @@
739797
break;
740798
}
741799
}
742800
return zReturn;
743801
}
802
+
803
+/*
804
+** Look for a repository command-line option. If present, [re-]cache it in
805
+** the global state and return the new pointer, freeing any previous value.
806
+** If absent and there is no cached value, return NULL.
807
+*/
808
+const char *find_repository_option(){
809
+ const char *zRepository = find_option("repository", "R", 1);
810
+ if( zRepository ){
811
+ if( g.zRepositoryOption ) fossil_free(g.zRepositoryOption);
812
+ g.zRepositoryOption = mprintf("%s", zRepository);
813
+ }
814
+ return g.zRepositoryOption;
815
+}
744816
745817
/*
746818
** Verify that there are no unprocessed command-line options. If
747819
** Any remaining command-line argument begins with "-" print
748820
** an error message and quit.
@@ -861,10 +933,13 @@
861933
fossil_print("SQLite %s %.30s\n", sqlite3_libversion(), sqlite3_sourceid());
862934
fossil_print("Schema version %s\n", AUX_SCHEMA);
863935
fossil_print("zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion());
864936
#if defined(FOSSIL_ENABLE_SSL)
865937
fossil_print("SSL (%s)\n", SSLeay_version(SSLEAY_VERSION));
938
+#endif
939
+#if defined(FOSSIL_ENABLE_TH1_HOOKS)
940
+ fossil_print("TH1_HOOKS\n");
866941
#endif
867942
#if defined(FOSSIL_ENABLE_TCL)
868943
Th_FossilInit(TH_INIT_DEFAULT | TH_INIT_FORCE_TCL);
869944
rc = Th_Eval(g.interp, 0, "tclInvoke info patchlevel", -1);
870945
zRc = Th_ReturnCodeName(rc, 0);
@@ -1486,21 +1561,37 @@
14861561
}
14871562
14881563
/* Locate the method specified by the path and execute the function
14891564
** that implements that method.
14901565
*/
1491
- if( name_search(g.zPath, aWebpage, count(aWebpage), &idx) &&
1492
- name_search("not_found", aWebpage, count(aWebpage), &idx) ){
1566
+ if( name_search(g.zPath, aWebpage, count(aWebpage), &idx) ){
14931567
#ifdef FOSSIL_ENABLE_JSON
14941568
if(g.json.isJsonMode){
14951569
json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,0);
14961570
}else
14971571
#endif
14981572
{
1499
- cgi_set_status(404,"Not Found");
1500
- @ <h1>Not Found</h1>
1501
- @ <p>Page not found: %h(g.zPath)</p>
1573
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
1574
+ int rc;
1575
+ if( !g.fNoThHook ){
1576
+ rc = Th_WebpageHook(g.zPath, 0);
1577
+ }else{
1578
+ rc = TH_OK;
1579
+ }
1580
+ if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
1581
+ if( rc==TH_OK || rc==TH_RETURN ){
1582
+#endif
1583
+ cgi_set_status(404,"Not Found");
1584
+ @ <h1>Not Found</h1>
1585
+ @ <p>Page not found: %h(g.zPath)</p>
1586
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
1587
+ }
1588
+ if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
1589
+ Th_WebpageNotify(g.zPath, 0);
1590
+ }
1591
+ }
1592
+#endif
15021593
}
15031594
}else if( aWebpage[idx].xFunc!=page_xfer && db_schema_is_outofdate() ){
15041595
#ifdef FOSSIL_ENABLE_JSON
15051596
if(g.json.isJsonMode){
15061597
json_err(FSL_JSON_E_DB_NEEDS_REBUILD,NULL,0);
@@ -1510,11 +1601,45 @@
15101601
@ <h1>Server Configuration Error</h1>
15111602
@ <p>The database schema on the server is out-of-date. Please ask
15121603
@ the administrator to run <b>fossil rebuild</b>.</p>
15131604
}
15141605
}else{
1515
- aWebpage[idx].xFunc();
1606
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
1607
+ /*
1608
+ ** The TH1 return codes from the hook will be handled as follows:
1609
+ **
1610
+ ** TH_OK: The xFunc() and the TH1 notification will both be executed.
1611
+ **
1612
+ ** TH_ERROR: The xFunc() will be executed, the TH1 notification will be
1613
+ ** skipped. If the xFunc() is being hooked, the error message
1614
+ ** will be emitted.
1615
+ **
1616
+ ** TH_BREAK: The xFunc() and the TH1 notification will both be skipped.
1617
+ **
1618
+ ** TH_RETURN: The xFunc() will be executed, the TH1 notification will be
1619
+ ** skipped.
1620
+ **
1621
+ ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be
1622
+ ** executed.
1623
+ */
1624
+ int rc;
1625
+ if( !g.fNoThHook ){
1626
+ rc = Th_WebpageHook(aWebpage[idx].zName, aWebpage[idx].cmdFlags);
1627
+ }else{
1628
+ rc = TH_OK;
1629
+ }
1630
+ if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
1631
+ if( rc==TH_OK || rc==TH_RETURN ){
1632
+#endif
1633
+ aWebpage[idx].xFunc();
1634
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
1635
+ }
1636
+ if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
1637
+ Th_WebpageNotify(aWebpage[idx].zName, aWebpage[idx].cmdFlags);
1638
+ }
1639
+ }
1640
+#endif
15161641
}
15171642
15181643
/* Return the result.
15191644
*/
15201645
cgi_reply();
15211646
--- src/main.c
+++ src/main.c
@@ -124,10 +124,11 @@
124 sqlite3 *dbConfig; /* Separate connection for global_config table */
125 int useAttach; /* True if global_config is attached to repository */
126 const char *zConfigDbName;/* Path of the config database. NULL if not open */
127 sqlite3_int64 now; /* Seconds since 1970 */
128 int repositoryOpen; /* True if the main repository database is open */
 
129 char *zRepositoryName; /* Name of the repository database */
130 const char *zMainDbType;/* "configdb", "localdb", or "repository" */
131 const char *zConfigDbType; /* "configdb", "localdb", or "repository" */
132 int localOpen; /* True if the local database is open */
133 char *zLocalRoot; /* The directory holding the local database */
@@ -155,10 +156,11 @@
155 int cgiOutput; /* Write error and status messages to CGI */
156 int xferPanic; /* Write error messages in XFER protocol */
157 int fullHttpReply; /* True for full HTTP reply. False for CGI reply */
158 Th_Interp *interp; /* The TH1 interpreter */
159 char *th1Setup; /* The TH1 post-creation setup script, if any */
 
160 FILE *httpIn; /* Accept HTTP input from here */
161 FILE *httpOut; /* Send HTTP output here */
162 int xlinkClusterOnly; /* Set when cloning. Only process clusters */
163 int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */
164 int *aCommitFile; /* Array of files to be committed */
@@ -194,10 +196,13 @@
194 char zCsrfToken[12]; /* Value of the anti-CSRF token */
195 int okCsrf; /* Anti-CSRF token is present and valid */
196
197 int parseCnt[10]; /* Counts of artifacts parsed */
198 FILE *fDebug; /* Write debug information here, if the file exists */
 
 
 
199 int thTrace; /* True to enable TH1 debugging output */
200 Blob thLog; /* Text of the TH1 debugging output */
201
202 int isHome; /* True if rendering the "home" page */
203
@@ -620,10 +625,13 @@
620 g.fSshClient = 0;
621 g.zSshCmd = 0;
622 if( g.fSqlTrace ) g.fSqlStats = 1;
623 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
624 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
 
 
 
625 g.zHttpAuth = 0;
626 g.zLogin = find_option("user", "U", 1);
627 g.zSSLIdentity = find_option("ssl-identity", 0, 1);
628 g.zErrlog = find_option("errorlog", 0, 1);
629 if( find_option("utc",0,0) ) g.fTimeFormat = 1;
@@ -649,13 +657,30 @@
649 if( !is_valid_fd(2) ) fossil_panic("file descriptor 2 not open");
650 /* if( is_valid_fd(3) ) fossil_warning("file descriptor 3 is open"); */
651 #endif
652 rc = name_search(zCmdName, aCommand, count(aCommand), &idx);
653 if( rc==1 ){
654 fossil_fatal("%s: unknown command: %s\n"
655 "%s: use \"help\" for more information\n",
656 g.argv[0], zCmdName, g.argv[0]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657 }else if( rc==2 ){
658 int i, n;
659 Blob couldbe;
660 blob_zero(&couldbe);
661 n = strlen(zCmdName);
@@ -669,11 +694,44 @@
669 "%s: use \"help\" for more information\n",
670 g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]);
671 fossil_exit(1);
672 }
673 atexit( fossil_atexit );
674 aCommand[idx].xFunc();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
675 fossil_exit(0);
676 /*NOT_REACHED*/
677 return 0;
678 }
679
@@ -739,10 +797,24 @@
739 break;
740 }
741 }
742 return zReturn;
743 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
744
745 /*
746 ** Verify that there are no unprocessed command-line options. If
747 ** Any remaining command-line argument begins with "-" print
748 ** an error message and quit.
@@ -861,10 +933,13 @@
861 fossil_print("SQLite %s %.30s\n", sqlite3_libversion(), sqlite3_sourceid());
862 fossil_print("Schema version %s\n", AUX_SCHEMA);
863 fossil_print("zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion());
864 #if defined(FOSSIL_ENABLE_SSL)
865 fossil_print("SSL (%s)\n", SSLeay_version(SSLEAY_VERSION));
 
 
 
866 #endif
867 #if defined(FOSSIL_ENABLE_TCL)
868 Th_FossilInit(TH_INIT_DEFAULT | TH_INIT_FORCE_TCL);
869 rc = Th_Eval(g.interp, 0, "tclInvoke info patchlevel", -1);
870 zRc = Th_ReturnCodeName(rc, 0);
@@ -1486,21 +1561,37 @@
1486 }
1487
1488 /* Locate the method specified by the path and execute the function
1489 ** that implements that method.
1490 */
1491 if( name_search(g.zPath, aWebpage, count(aWebpage), &idx) &&
1492 name_search("not_found", aWebpage, count(aWebpage), &idx) ){
1493 #ifdef FOSSIL_ENABLE_JSON
1494 if(g.json.isJsonMode){
1495 json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,0);
1496 }else
1497 #endif
1498 {
1499 cgi_set_status(404,"Not Found");
1500 @ <h1>Not Found</h1>
1501 @ <p>Page not found: %h(g.zPath)</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1502 }
1503 }else if( aWebpage[idx].xFunc!=page_xfer && db_schema_is_outofdate() ){
1504 #ifdef FOSSIL_ENABLE_JSON
1505 if(g.json.isJsonMode){
1506 json_err(FSL_JSON_E_DB_NEEDS_REBUILD,NULL,0);
@@ -1510,11 +1601,45 @@
1510 @ <h1>Server Configuration Error</h1>
1511 @ <p>The database schema on the server is out-of-date. Please ask
1512 @ the administrator to run <b>fossil rebuild</b>.</p>
1513 }
1514 }else{
1515 aWebpage[idx].xFunc();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1516 }
1517
1518 /* Return the result.
1519 */
1520 cgi_reply();
1521
--- src/main.c
+++ src/main.c
@@ -124,10 +124,11 @@
124 sqlite3 *dbConfig; /* Separate connection for global_config table */
125 int useAttach; /* True if global_config is attached to repository */
126 const char *zConfigDbName;/* Path of the config database. NULL if not open */
127 sqlite3_int64 now; /* Seconds since 1970 */
128 int repositoryOpen; /* True if the main repository database is open */
129 char *zRepositoryOption; /* Most recent cached repository option value */
130 char *zRepositoryName; /* Name of the repository database */
131 const char *zMainDbType;/* "configdb", "localdb", or "repository" */
132 const char *zConfigDbType; /* "configdb", "localdb", or "repository" */
133 int localOpen; /* True if the local database is open */
134 char *zLocalRoot; /* The directory holding the local database */
@@ -155,10 +156,11 @@
156 int cgiOutput; /* Write error and status messages to CGI */
157 int xferPanic; /* Write error messages in XFER protocol */
158 int fullHttpReply; /* True for full HTTP reply. False for CGI reply */
159 Th_Interp *interp; /* The TH1 interpreter */
160 char *th1Setup; /* The TH1 post-creation setup script, if any */
161 int th1Flags; /* The TH1 integration state flags */
162 FILE *httpIn; /* Accept HTTP input from here */
163 FILE *httpOut; /* Send HTTP output here */
164 int xlinkClusterOnly; /* Set when cloning. Only process clusters */
165 int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */
166 int *aCommitFile; /* Array of files to be committed */
@@ -194,10 +196,13 @@
196 char zCsrfToken[12]; /* Value of the anti-CSRF token */
197 int okCsrf; /* Anti-CSRF token is present and valid */
198
199 int parseCnt[10]; /* Counts of artifacts parsed */
200 FILE *fDebug; /* Write debug information here, if the file exists */
201 #ifdef FOSSIL_ENABLE_TH1_HOOKS
202 int fNoThHook; /* Disable all TH1 command/webpage hooks */
203 #endif
204 int thTrace; /* True to enable TH1 debugging output */
205 Blob thLog; /* Text of the TH1 debugging output */
206
207 int isHome; /* True if rendering the "home" page */
208
@@ -620,10 +625,13 @@
625 g.fSshClient = 0;
626 g.zSshCmd = 0;
627 if( g.fSqlTrace ) g.fSqlStats = 1;
628 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
629 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
630 #ifdef FOSSIL_ENABLE_TH1_HOOKS
631 g.fNoThHook = find_option("no-th-hook", 0, 0)!=0;
632 #endif
633 g.zHttpAuth = 0;
634 g.zLogin = find_option("user", "U", 1);
635 g.zSSLIdentity = find_option("ssl-identity", 0, 1);
636 g.zErrlog = find_option("errorlog", 0, 1);
637 if( find_option("utc",0,0) ) g.fTimeFormat = 1;
@@ -649,13 +657,30 @@
657 if( !is_valid_fd(2) ) fossil_panic("file descriptor 2 not open");
658 /* if( is_valid_fd(3) ) fossil_warning("file descriptor 3 is open"); */
659 #endif
660 rc = name_search(zCmdName, aCommand, count(aCommand), &idx);
661 if( rc==1 ){
662 #ifdef FOSSIL_ENABLE_TH1_HOOKS
663 if( !g.isHTTP && !g.fNoThHook ){
664 rc = Th_CommandHook(zCmdName, 0);
665 }else{
666 rc = TH_OK;
667 }
668 if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
669 if( rc==TH_OK || rc==TH_RETURN ){
670 #endif
671 fossil_fatal("%s: unknown command: %s\n"
672 "%s: use \"help\" for more information\n",
673 g.argv[0], zCmdName, g.argv[0]);
674 #ifdef FOSSIL_ENABLE_TH1_HOOKS
675 }
676 if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
677 Th_CommandNotify(zCmdName, 0);
678 }
679 }
680 fossil_exit(0);
681 #endif
682 }else if( rc==2 ){
683 int i, n;
684 Blob couldbe;
685 blob_zero(&couldbe);
686 n = strlen(zCmdName);
@@ -669,11 +694,44 @@
694 "%s: use \"help\" for more information\n",
695 g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]);
696 fossil_exit(1);
697 }
698 atexit( fossil_atexit );
699 #ifdef FOSSIL_ENABLE_TH1_HOOKS
700 /*
701 ** The TH1 return codes from the hook will be handled as follows:
702 **
703 ** TH_OK: The xFunc() and the TH1 notification will both be executed.
704 **
705 ** TH_ERROR: The xFunc() will be executed, the TH1 notification will be
706 ** skipped. If the xFunc() is being hooked, the error message
707 ** will be emitted.
708 **
709 ** TH_BREAK: The xFunc() and the TH1 notification will both be skipped.
710 **
711 ** TH_RETURN: The xFunc() will be executed, the TH1 notification will be
712 ** skipped.
713 **
714 ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be
715 ** executed.
716 */
717 if( !g.isHTTP && !g.fNoThHook ){
718 rc = Th_CommandHook(aCommand[idx].zName, aCommand[idx].cmdFlags);
719 }else{
720 rc = TH_OK;
721 }
722 if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
723 if( rc==TH_OK || rc==TH_RETURN ){
724 #endif
725 aCommand[idx].xFunc();
726 #ifdef FOSSIL_ENABLE_TH1_HOOKS
727 }
728 if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
729 Th_CommandNotify(aCommand[idx].zName, aCommand[idx].cmdFlags);
730 }
731 }
732 #endif
733 fossil_exit(0);
734 /*NOT_REACHED*/
735 return 0;
736 }
737
@@ -739,10 +797,24 @@
797 break;
798 }
799 }
800 return zReturn;
801 }
802
803 /*
804 ** Look for a repository command-line option. If present, [re-]cache it in
805 ** the global state and return the new pointer, freeing any previous value.
806 ** If absent and there is no cached value, return NULL.
807 */
808 const char *find_repository_option(){
809 const char *zRepository = find_option("repository", "R", 1);
810 if( zRepository ){
811 if( g.zRepositoryOption ) fossil_free(g.zRepositoryOption);
812 g.zRepositoryOption = mprintf("%s", zRepository);
813 }
814 return g.zRepositoryOption;
815 }
816
817 /*
818 ** Verify that there are no unprocessed command-line options. If
819 ** Any remaining command-line argument begins with "-" print
820 ** an error message and quit.
@@ -861,10 +933,13 @@
933 fossil_print("SQLite %s %.30s\n", sqlite3_libversion(), sqlite3_sourceid());
934 fossil_print("Schema version %s\n", AUX_SCHEMA);
935 fossil_print("zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion());
936 #if defined(FOSSIL_ENABLE_SSL)
937 fossil_print("SSL (%s)\n", SSLeay_version(SSLEAY_VERSION));
938 #endif
939 #if defined(FOSSIL_ENABLE_TH1_HOOKS)
940 fossil_print("TH1_HOOKS\n");
941 #endif
942 #if defined(FOSSIL_ENABLE_TCL)
943 Th_FossilInit(TH_INIT_DEFAULT | TH_INIT_FORCE_TCL);
944 rc = Th_Eval(g.interp, 0, "tclInvoke info patchlevel", -1);
945 zRc = Th_ReturnCodeName(rc, 0);
@@ -1486,21 +1561,37 @@
1561 }
1562
1563 /* Locate the method specified by the path and execute the function
1564 ** that implements that method.
1565 */
1566 if( name_search(g.zPath, aWebpage, count(aWebpage), &idx) ){
 
1567 #ifdef FOSSIL_ENABLE_JSON
1568 if(g.json.isJsonMode){
1569 json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,0);
1570 }else
1571 #endif
1572 {
1573 #ifdef FOSSIL_ENABLE_TH1_HOOKS
1574 int rc;
1575 if( !g.fNoThHook ){
1576 rc = Th_WebpageHook(g.zPath, 0);
1577 }else{
1578 rc = TH_OK;
1579 }
1580 if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
1581 if( rc==TH_OK || rc==TH_RETURN ){
1582 #endif
1583 cgi_set_status(404,"Not Found");
1584 @ <h1>Not Found</h1>
1585 @ <p>Page not found: %h(g.zPath)</p>
1586 #ifdef FOSSIL_ENABLE_TH1_HOOKS
1587 }
1588 if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
1589 Th_WebpageNotify(g.zPath, 0);
1590 }
1591 }
1592 #endif
1593 }
1594 }else if( aWebpage[idx].xFunc!=page_xfer && db_schema_is_outofdate() ){
1595 #ifdef FOSSIL_ENABLE_JSON
1596 if(g.json.isJsonMode){
1597 json_err(FSL_JSON_E_DB_NEEDS_REBUILD,NULL,0);
@@ -1510,11 +1601,45 @@
1601 @ <h1>Server Configuration Error</h1>
1602 @ <p>The database schema on the server is out-of-date. Please ask
1603 @ the administrator to run <b>fossil rebuild</b>.</p>
1604 }
1605 }else{
1606 #ifdef FOSSIL_ENABLE_TH1_HOOKS
1607 /*
1608 ** The TH1 return codes from the hook will be handled as follows:
1609 **
1610 ** TH_OK: The xFunc() and the TH1 notification will both be executed.
1611 **
1612 ** TH_ERROR: The xFunc() will be executed, the TH1 notification will be
1613 ** skipped. If the xFunc() is being hooked, the error message
1614 ** will be emitted.
1615 **
1616 ** TH_BREAK: The xFunc() and the TH1 notification will both be skipped.
1617 **
1618 ** TH_RETURN: The xFunc() will be executed, the TH1 notification will be
1619 ** skipped.
1620 **
1621 ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be
1622 ** executed.
1623 */
1624 int rc;
1625 if( !g.fNoThHook ){
1626 rc = Th_WebpageHook(aWebpage[idx].zName, aWebpage[idx].cmdFlags);
1627 }else{
1628 rc = TH_OK;
1629 }
1630 if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
1631 if( rc==TH_OK || rc==TH_RETURN ){
1632 #endif
1633 aWebpage[idx].xFunc();
1634 #ifdef FOSSIL_ENABLE_TH1_HOOKS
1635 }
1636 if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
1637 Th_WebpageNotify(aWebpage[idx].zName, aWebpage[idx].cmdFlags);
1638 }
1639 }
1640 #endif
1641 }
1642
1643 /* Return the result.
1644 */
1645 cgi_reply();
1646
+11 -1
--- src/main.mk
+++ src/main.mk
@@ -42,10 +42,11 @@
4242
$(SRCDIR)/encode.c \
4343
$(SRCDIR)/event.c \
4444
$(SRCDIR)/export.c \
4545
$(SRCDIR)/file.c \
4646
$(SRCDIR)/finfo.c \
47
+ $(SRCDIR)/fusefs.c \
4748
$(SRCDIR)/glob.c \
4849
$(SRCDIR)/graph.c \
4950
$(SRCDIR)/gzip.c \
5051
$(SRCDIR)/http.c \
5152
$(SRCDIR)/http_socket.c \
@@ -154,10 +155,11 @@
154155
$(OBJDIR)/encode_.c \
155156
$(OBJDIR)/event_.c \
156157
$(OBJDIR)/export_.c \
157158
$(OBJDIR)/file_.c \
158159
$(OBJDIR)/finfo_.c \
160
+ $(OBJDIR)/fusefs_.c \
159161
$(OBJDIR)/glob_.c \
160162
$(OBJDIR)/graph_.c \
161163
$(OBJDIR)/gzip_.c \
162164
$(OBJDIR)/http_.c \
163165
$(OBJDIR)/http_socket_.c \
@@ -266,10 +268,11 @@
266268
$(OBJDIR)/encode.o \
267269
$(OBJDIR)/event.o \
268270
$(OBJDIR)/export.o \
269271
$(OBJDIR)/file.o \
270272
$(OBJDIR)/finfo.o \
273
+ $(OBJDIR)/fusefs.o \
271274
$(OBJDIR)/glob.o \
272275
$(OBJDIR)/graph.o \
273276
$(OBJDIR)/gzip.o \
274277
$(OBJDIR)/http.o \
275278
$(OBJDIR)/http_socket.o \
@@ -421,11 +424,11 @@
421424
422425
423426
$(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
424427
$(OBJDIR)/mkindex $(TRANS_SRC) >$@
425428
$(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
426
- $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h
429
+ $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h
427430
touch $(OBJDIR)/headers
428431
$(OBJDIR)/headers: Makefile
429432
$(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/json_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_status.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
430433
Makefile:
431434
$(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate
@@ -636,10 +639,17 @@
636639
637640
$(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h
638641
$(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c
639642
640643
$(OBJDIR)/finfo.h: $(OBJDIR)/headers
644
+$(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate
645
+ $(OBJDIR)/translate $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c
646
+
647
+$(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h
648
+ $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c
649
+
650
+$(OBJDIR)/fusefs.h: $(OBJDIR)/headers
641651
$(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate
642652
$(OBJDIR)/translate $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c
643653
644654
$(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h
645655
$(XTCC) -o $(OBJDIR)/glob.o -c $(OBJDIR)/glob_.c
646656
--- src/main.mk
+++ src/main.mk
@@ -42,10 +42,11 @@
42 $(SRCDIR)/encode.c \
43 $(SRCDIR)/event.c \
44 $(SRCDIR)/export.c \
45 $(SRCDIR)/file.c \
46 $(SRCDIR)/finfo.c \
 
47 $(SRCDIR)/glob.c \
48 $(SRCDIR)/graph.c \
49 $(SRCDIR)/gzip.c \
50 $(SRCDIR)/http.c \
51 $(SRCDIR)/http_socket.c \
@@ -154,10 +155,11 @@
154 $(OBJDIR)/encode_.c \
155 $(OBJDIR)/event_.c \
156 $(OBJDIR)/export_.c \
157 $(OBJDIR)/file_.c \
158 $(OBJDIR)/finfo_.c \
 
159 $(OBJDIR)/glob_.c \
160 $(OBJDIR)/graph_.c \
161 $(OBJDIR)/gzip_.c \
162 $(OBJDIR)/http_.c \
163 $(OBJDIR)/http_socket_.c \
@@ -266,10 +268,11 @@
266 $(OBJDIR)/encode.o \
267 $(OBJDIR)/event.o \
268 $(OBJDIR)/export.o \
269 $(OBJDIR)/file.o \
270 $(OBJDIR)/finfo.o \
 
271 $(OBJDIR)/glob.o \
272 $(OBJDIR)/graph.o \
273 $(OBJDIR)/gzip.o \
274 $(OBJDIR)/http.o \
275 $(OBJDIR)/http_socket.o \
@@ -421,11 +424,11 @@
421
422
423 $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
424 $(OBJDIR)/mkindex $(TRANS_SRC) >$@
425 $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
426 $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h
427 touch $(OBJDIR)/headers
428 $(OBJDIR)/headers: Makefile
429 $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/json_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_status.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
430 Makefile:
431 $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate
@@ -636,10 +639,17 @@
636
637 $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h
638 $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c
639
640 $(OBJDIR)/finfo.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
641 $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate
642 $(OBJDIR)/translate $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c
643
644 $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h
645 $(XTCC) -o $(OBJDIR)/glob.o -c $(OBJDIR)/glob_.c
646
--- src/main.mk
+++ src/main.mk
@@ -42,10 +42,11 @@
42 $(SRCDIR)/encode.c \
43 $(SRCDIR)/event.c \
44 $(SRCDIR)/export.c \
45 $(SRCDIR)/file.c \
46 $(SRCDIR)/finfo.c \
47 $(SRCDIR)/fusefs.c \
48 $(SRCDIR)/glob.c \
49 $(SRCDIR)/graph.c \
50 $(SRCDIR)/gzip.c \
51 $(SRCDIR)/http.c \
52 $(SRCDIR)/http_socket.c \
@@ -154,10 +155,11 @@
155 $(OBJDIR)/encode_.c \
156 $(OBJDIR)/event_.c \
157 $(OBJDIR)/export_.c \
158 $(OBJDIR)/file_.c \
159 $(OBJDIR)/finfo_.c \
160 $(OBJDIR)/fusefs_.c \
161 $(OBJDIR)/glob_.c \
162 $(OBJDIR)/graph_.c \
163 $(OBJDIR)/gzip_.c \
164 $(OBJDIR)/http_.c \
165 $(OBJDIR)/http_socket_.c \
@@ -266,10 +268,11 @@
268 $(OBJDIR)/encode.o \
269 $(OBJDIR)/event.o \
270 $(OBJDIR)/export.o \
271 $(OBJDIR)/file.o \
272 $(OBJDIR)/finfo.o \
273 $(OBJDIR)/fusefs.o \
274 $(OBJDIR)/glob.o \
275 $(OBJDIR)/graph.o \
276 $(OBJDIR)/gzip.o \
277 $(OBJDIR)/http.o \
278 $(OBJDIR)/http_socket.o \
@@ -421,11 +424,11 @@
424
425
426 $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
427 $(OBJDIR)/mkindex $(TRANS_SRC) >$@
428 $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
429 $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h
430 touch $(OBJDIR)/headers
431 $(OBJDIR)/headers: Makefile
432 $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/json_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_status.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h
433 Makefile:
434 $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate
@@ -636,10 +639,17 @@
639
640 $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h
641 $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c
642
643 $(OBJDIR)/finfo.h: $(OBJDIR)/headers
644 $(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate
645 $(OBJDIR)/translate $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c
646
647 $(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h
648 $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c
649
650 $(OBJDIR)/fusefs.h: $(OBJDIR)/headers
651 $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate
652 $(OBJDIR)/translate $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c
653
654 $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h
655 $(XTCC) -o $(OBJDIR)/glob.o -c $(OBJDIR)/glob_.c
656
+34 -1
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -46,10 +46,11 @@
4646
encode
4747
event
4848
export
4949
file
5050
finfo
51
+ fusefs
5152
glob
5253
graph
5354
gzip
5455
http
5556
http_socket
@@ -408,10 +409,14 @@
408409
# FOSSIL_ENABLE_JSON = 1
409410
410411
#### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
411412
#
412413
# FOSSIL_ENABLE_SSL = 1
414
+
415
+#### Enable hooks for commands and web pages via TH1
416
+#
417
+# FOSSIL_ENABLE_TH1_HOOKS = 1
413418
414419
#### Enable scripting support via Tcl/Tk
415420
#
416421
# FOSSIL_ENABLE_TCL = 1
417422
@@ -537,10 +542,16 @@
537542
# With HTTPS support
538543
ifdef FOSSIL_ENABLE_SSL
539544
TCC += -DFOSSIL_ENABLE_SSL=1
540545
RCC += -DFOSSIL_ENABLE_SSL=1
541546
endif
547
+
548
+# With TH1 hook support
549
+ifdef FOSSIL_ENABLE_TH1_HOOKS
550
+TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
551
+RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
552
+endif
542553
543554
# With Tcl support
544555
ifdef FOSSIL_ENABLE_TCL
545556
TCC += -DFOSSIL_ENABLE_TCL=1
546557
RCC += -DFOSSIL_ENABLE_TCL=1
@@ -612,11 +623,15 @@
612623
#
613624
TCLSH = tclsh
614625
615626
#### Nullsoft installer MakeNSIS location
616627
#
617
-MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe"
628
+MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe"
629
+
630
+#### Inno Setup executable location
631
+#
632
+INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe"
618633
619634
#### Include a configuration file that can override any one of these settings.
620635
#
621636
-include config.w32
622637
@@ -652,10 +667,11 @@
652667
ifdef USE_WINDOWS
653668
TRANSLATE = $(subst /,\,$(OBJDIR)/translate)
654669
MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders)
655670
MKINDEX = $(subst /,\,$(OBJDIR)/mkindex)
656671
VERSION = $(subst /,\,$(OBJDIR)/version)
672
+CAT = type
657673
CP = copy
658674
MV = copy
659675
RM = del /Q
660676
MKDIR = -mkdir
661677
RMDIR = rmdir /S /Q
@@ -662,10 +678,11 @@
662678
else
663679
TRANSLATE = $(OBJDIR)/translate
664680
MAKEHEADERS = $(OBJDIR)/makeheaders
665681
MKINDEX = $(OBJDIR)/mkindex
666682
VERSION = $(OBJDIR)/version
683
+CAT = cat
667684
CP = cp
668685
MV = mv
669686
RM = rm -f
670687
MKDIR = -mkdir -p
671688
RMDIR = rm -rf
@@ -777,10 +794,13 @@
777794
$(RMDIR) $(OBJDIR)
778795
endif
779796
780797
setup: $(OBJDIR) $(APPNAME)
781798
$(MAKENSIS) ./setup/fossil.nsi
799
+
800
+innosetup: $(OBJDIR) $(APPNAME)
801
+ $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION)
782802
}
783803
784804
set mhargs {}
785805
foreach s [lsort $src] {
786806
if {[string length $mhargs] > 0} {append mhargs " \\\n\t\t"}
@@ -1024,10 +1044,13 @@
10241044
# Uncomment to enable JSON API
10251045
# FOSSIL_ENABLE_JSON = 1
10261046
10271047
# Uncomment to enable SSL support
10281048
# FOSSIL_ENABLE_SSL = 1
1049
+
1050
+# Uncomment to enable TH1 hooks
1051
+# FOSSIL_ENABLE_TH1_HOOKS = 1
10291052
10301053
# Uncomment to enable Tcl support
10311054
# FOSSIL_ENABLE_TCL = 1
10321055
10331056
!ifdef FOSSIL_ENABLE_SSL
@@ -1082,10 +1105,15 @@
10821105
TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1
10831106
RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1
10841107
LIBS = $(LIBS) $(SSLLIB)
10851108
LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR)
10861109
!endif
1110
+
1111
+!ifdef FOSSIL_ENABLE_TH1_HOOKS
1112
+TCC = $(TCC) /DFOSSIL_ENABLE_TH1_HOOKS=1
1113
+RCC = $(RCC) /DFOSSIL_ENABLE_TH1_HOOKS=1
1114
+!endif
10871115
10881116
!ifdef FOSSIL_ENABLE_TCL
10891117
TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1
10901118
RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1
10911119
TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1
@@ -1190,10 +1218,11 @@
11901218
clean:
11911219
-del $(OX)\*.obj
11921220
-del *.obj
11931221
-del *_.c
11941222
-del *.h
1223
+ -del *.ilk
11951224
-del *.map
11961225
-del *.res
11971226
-del headers
11981227
-del linkopts
11991228
-del vc*.pdb
@@ -1200,13 +1229,17 @@
12001229
12011230
realclean: clean
12021231
-del $(APPNAME)
12031232
-del $(PDBNAME)
12041233
-del translate$E
1234
+ -del translate$P
12051235
-del mkindex$E
1236
+ -del mkindex$P
12061237
-del makeheaders$E
1238
+ -del makeheaders$P
12071239
-del mkversion$E
1240
+ -del mkversion$P
12081241
12091242
$(OBJDIR)\json$O : $(SRCDIR)\json_detail.h
12101243
$(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h
12111244
$(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h
12121245
$(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h
12131246
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -46,10 +46,11 @@
46 encode
47 event
48 export
49 file
50 finfo
 
51 glob
52 graph
53 gzip
54 http
55 http_socket
@@ -408,10 +409,14 @@
408 # FOSSIL_ENABLE_JSON = 1
409
410 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
411 #
412 # FOSSIL_ENABLE_SSL = 1
 
 
 
 
413
414 #### Enable scripting support via Tcl/Tk
415 #
416 # FOSSIL_ENABLE_TCL = 1
417
@@ -537,10 +542,16 @@
537 # With HTTPS support
538 ifdef FOSSIL_ENABLE_SSL
539 TCC += -DFOSSIL_ENABLE_SSL=1
540 RCC += -DFOSSIL_ENABLE_SSL=1
541 endif
 
 
 
 
 
 
542
543 # With Tcl support
544 ifdef FOSSIL_ENABLE_TCL
545 TCC += -DFOSSIL_ENABLE_TCL=1
546 RCC += -DFOSSIL_ENABLE_TCL=1
@@ -612,11 +623,15 @@
612 #
613 TCLSH = tclsh
614
615 #### Nullsoft installer MakeNSIS location
616 #
617 MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe"
 
 
 
 
618
619 #### Include a configuration file that can override any one of these settings.
620 #
621 -include config.w32
622
@@ -652,10 +667,11 @@
652 ifdef USE_WINDOWS
653 TRANSLATE = $(subst /,\,$(OBJDIR)/translate)
654 MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders)
655 MKINDEX = $(subst /,\,$(OBJDIR)/mkindex)
656 VERSION = $(subst /,\,$(OBJDIR)/version)
 
657 CP = copy
658 MV = copy
659 RM = del /Q
660 MKDIR = -mkdir
661 RMDIR = rmdir /S /Q
@@ -662,10 +678,11 @@
662 else
663 TRANSLATE = $(OBJDIR)/translate
664 MAKEHEADERS = $(OBJDIR)/makeheaders
665 MKINDEX = $(OBJDIR)/mkindex
666 VERSION = $(OBJDIR)/version
 
667 CP = cp
668 MV = mv
669 RM = rm -f
670 MKDIR = -mkdir -p
671 RMDIR = rm -rf
@@ -777,10 +794,13 @@
777 $(RMDIR) $(OBJDIR)
778 endif
779
780 setup: $(OBJDIR) $(APPNAME)
781 $(MAKENSIS) ./setup/fossil.nsi
 
 
 
782 }
783
784 set mhargs {}
785 foreach s [lsort $src] {
786 if {[string length $mhargs] > 0} {append mhargs " \\\n\t\t"}
@@ -1024,10 +1044,13 @@
1024 # Uncomment to enable JSON API
1025 # FOSSIL_ENABLE_JSON = 1
1026
1027 # Uncomment to enable SSL support
1028 # FOSSIL_ENABLE_SSL = 1
 
 
 
1029
1030 # Uncomment to enable Tcl support
1031 # FOSSIL_ENABLE_TCL = 1
1032
1033 !ifdef FOSSIL_ENABLE_SSL
@@ -1082,10 +1105,15 @@
1082 TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1
1083 RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1
1084 LIBS = $(LIBS) $(SSLLIB)
1085 LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR)
1086 !endif
 
 
 
 
 
1087
1088 !ifdef FOSSIL_ENABLE_TCL
1089 TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1
1090 RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1
1091 TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1
@@ -1190,10 +1218,11 @@
1190 clean:
1191 -del $(OX)\*.obj
1192 -del *.obj
1193 -del *_.c
1194 -del *.h
 
1195 -del *.map
1196 -del *.res
1197 -del headers
1198 -del linkopts
1199 -del vc*.pdb
@@ -1200,13 +1229,17 @@
1200
1201 realclean: clean
1202 -del $(APPNAME)
1203 -del $(PDBNAME)
1204 -del translate$E
 
1205 -del mkindex$E
 
1206 -del makeheaders$E
 
1207 -del mkversion$E
 
1208
1209 $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h
1210 $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h
1211 $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h
1212 $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h
1213
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -46,10 +46,11 @@
46 encode
47 event
48 export
49 file
50 finfo
51 fusefs
52 glob
53 graph
54 gzip
55 http
56 http_socket
@@ -408,10 +409,14 @@
409 # FOSSIL_ENABLE_JSON = 1
410
411 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
412 #
413 # FOSSIL_ENABLE_SSL = 1
414
415 #### Enable hooks for commands and web pages via TH1
416 #
417 # FOSSIL_ENABLE_TH1_HOOKS = 1
418
419 #### Enable scripting support via Tcl/Tk
420 #
421 # FOSSIL_ENABLE_TCL = 1
422
@@ -537,10 +542,16 @@
542 # With HTTPS support
543 ifdef FOSSIL_ENABLE_SSL
544 TCC += -DFOSSIL_ENABLE_SSL=1
545 RCC += -DFOSSIL_ENABLE_SSL=1
546 endif
547
548 # With TH1 hook support
549 ifdef FOSSIL_ENABLE_TH1_HOOKS
550 TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
551 RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
552 endif
553
554 # With Tcl support
555 ifdef FOSSIL_ENABLE_TCL
556 TCC += -DFOSSIL_ENABLE_TCL=1
557 RCC += -DFOSSIL_ENABLE_TCL=1
@@ -612,11 +623,15 @@
623 #
624 TCLSH = tclsh
625
626 #### Nullsoft installer MakeNSIS location
627 #
628 MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe"
629
630 #### Inno Setup executable location
631 #
632 INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe"
633
634 #### Include a configuration file that can override any one of these settings.
635 #
636 -include config.w32
637
@@ -652,10 +667,11 @@
667 ifdef USE_WINDOWS
668 TRANSLATE = $(subst /,\,$(OBJDIR)/translate)
669 MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders)
670 MKINDEX = $(subst /,\,$(OBJDIR)/mkindex)
671 VERSION = $(subst /,\,$(OBJDIR)/version)
672 CAT = type
673 CP = copy
674 MV = copy
675 RM = del /Q
676 MKDIR = -mkdir
677 RMDIR = rmdir /S /Q
@@ -662,10 +678,11 @@
678 else
679 TRANSLATE = $(OBJDIR)/translate
680 MAKEHEADERS = $(OBJDIR)/makeheaders
681 MKINDEX = $(OBJDIR)/mkindex
682 VERSION = $(OBJDIR)/version
683 CAT = cat
684 CP = cp
685 MV = mv
686 RM = rm -f
687 MKDIR = -mkdir -p
688 RMDIR = rm -rf
@@ -777,10 +794,13 @@
794 $(RMDIR) $(OBJDIR)
795 endif
796
797 setup: $(OBJDIR) $(APPNAME)
798 $(MAKENSIS) ./setup/fossil.nsi
799
800 innosetup: $(OBJDIR) $(APPNAME)
801 $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION)
802 }
803
804 set mhargs {}
805 foreach s [lsort $src] {
806 if {[string length $mhargs] > 0} {append mhargs " \\\n\t\t"}
@@ -1024,10 +1044,13 @@
1044 # Uncomment to enable JSON API
1045 # FOSSIL_ENABLE_JSON = 1
1046
1047 # Uncomment to enable SSL support
1048 # FOSSIL_ENABLE_SSL = 1
1049
1050 # Uncomment to enable TH1 hooks
1051 # FOSSIL_ENABLE_TH1_HOOKS = 1
1052
1053 # Uncomment to enable Tcl support
1054 # FOSSIL_ENABLE_TCL = 1
1055
1056 !ifdef FOSSIL_ENABLE_SSL
@@ -1082,10 +1105,15 @@
1105 TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1
1106 RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1
1107 LIBS = $(LIBS) $(SSLLIB)
1108 LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR)
1109 !endif
1110
1111 !ifdef FOSSIL_ENABLE_TH1_HOOKS
1112 TCC = $(TCC) /DFOSSIL_ENABLE_TH1_HOOKS=1
1113 RCC = $(RCC) /DFOSSIL_ENABLE_TH1_HOOKS=1
1114 !endif
1115
1116 !ifdef FOSSIL_ENABLE_TCL
1117 TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1
1118 RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1
1119 TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1
@@ -1190,10 +1218,11 @@
1218 clean:
1219 -del $(OX)\*.obj
1220 -del *.obj
1221 -del *_.c
1222 -del *.h
1223 -del *.ilk
1224 -del *.map
1225 -del *.res
1226 -del headers
1227 -del linkopts
1228 -del vc*.pdb
@@ -1200,13 +1229,17 @@
1229
1230 realclean: clean
1231 -del $(APPNAME)
1232 -del $(PDBNAME)
1233 -del translate$E
1234 -del translate$P
1235 -del mkindex$E
1236 -del mkindex$P
1237 -del makeheaders$E
1238 -del makeheaders$P
1239 -del mkversion$E
1240 -del mkversion$P
1241
1242 $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h
1243 $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h
1244 $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h
1245 $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h
1246
+22 -13
--- src/manifest.c
+++ src/manifest.c
@@ -1161,14 +1161,15 @@
11611161
** of a file.
11621162
*/
11631163
int manifest_file_mperm(ManifestFile *pFile){
11641164
int mperm = PERM_REG;
11651165
if( pFile && pFile->zPerm){
1166
- if( strstr(pFile->zPerm,"x")!=0 )
1166
+ if( strstr(pFile->zPerm,"x")!=0 ){
11671167
mperm = PERM_EXE;
1168
- else if( strstr(pFile->zPerm,"l")!=0 )
1168
+ }else if( strstr(pFile->zPerm,"l")!=0 ){
11691169
mperm = PERM_LNK;
1170
+ }
11701171
}
11711172
return mperm;
11721173
}
11731174
11741175
/*
@@ -1227,11 +1228,15 @@
12271228
** That will usually be the case. If it is not found there, then do the
12281229
** actual binary search.
12291230
**
12301231
** Update p->iFile to be the index of the file that is found.
12311232
*/
1232
-static ManifestFile *manifest_file_seek_base(Manifest *p, const char *zName){
1233
+static ManifestFile *manifest_file_seek_base(
1234
+ Manifest *p, /* Manifest to search */
1235
+ const char *zName, /* Name of the file we are looking for */
1236
+ int bBest /* 0: exact match only. 1: closest match */
1237
+){
12331238
int lwr, upr;
12341239
int c;
12351240
int i;
12361241
lwr = 0;
12371242
upr = p->nFile - 1;
@@ -1255,10 +1260,14 @@
12551260
}else{
12561261
p->iFile = i;
12571262
return &p->aFile[i];
12581263
}
12591264
}
1265
+ if( bBest ){
1266
+ i = (int)strlen(zName);
1267
+ if( strncmp(zName, p->aFile[lwr].zName, i)==0 ) return &p->aFile[lwr];
1268
+ }
12601269
return 0;
12611270
}
12621271
12631272
/*
12641273
** Locate a file named zName in the aFile[] array of the given manifest.
@@ -1268,18 +1277,18 @@
12681277
** This routine works even if p is a delta-manifest. The pointer
12691278
** returned might be to the baseline.
12701279
**
12711280
** We assume that filenames are in sorted order and use a binary search.
12721281
*/
1273
-ManifestFile *manifest_file_seek(Manifest *p, const char *zName){
1282
+ManifestFile *manifest_file_seek(Manifest *p, const char *zName, int bBest){
12741283
ManifestFile *pFile;
12751284
1276
- pFile = manifest_file_seek_base(p, zName);
1285
+ pFile = manifest_file_seek_base(p, zName, p->zBaseline ? 0 : bBest);
12771286
if( pFile && pFile->zUuid==0 ) return 0;
12781287
if( pFile==0 && p->zBaseline ){
12791288
fetch_baseline(p, 1);
1280
- pFile = manifest_file_seek_base(p->pBaseline, zName);
1289
+ pFile = manifest_file_seek_base(p->pBaseline, zName,bBest);
12811290
}
12821291
return pFile;
12831292
}
12841293
12851294
/*
@@ -1289,11 +1298,11 @@
12891298
*/
12901299
ManifestFile *manifest_file_find(Manifest *p, const char *zName){
12911300
int i;
12921301
Manifest *pBase;
12931302
if( filenames_are_case_sensitive() ){
1294
- return manifest_file_seek(p, zName);
1303
+ return manifest_file_seek(p, zName, 0);
12951304
}
12961305
for(i=0; i<p->nFile; i++){
12971306
if( fossil_stricmp(zName, p->aFile[i].zName)==0 ){
12981307
return &p->aFile[i];
12991308
}
@@ -1389,11 +1398,11 @@
13891398
** is where most of the changes will be found.
13901399
*/
13911400
for(i=0, pChildFile=pChild->aFile; i<pChild->nFile; i++, pChildFile++){
13921401
int mperm = manifest_file_mperm(pChildFile);
13931402
if( pChildFile->zPrior ){
1394
- pParentFile = manifest_file_seek(pParent, pChildFile->zPrior);
1403
+ pParentFile = manifest_file_seek(pParent, pChildFile->zPrior, 0);
13951404
if( pParentFile ){
13961405
/* File with name change */
13971406
add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
13981407
pChildFile->zName, pChildFile->zPrior, isPublic, mperm);
13991408
}else{
@@ -1401,11 +1410,11 @@
14011410
** Treat this like a new file. */
14021411
add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
14031412
isPublic, mperm);
14041413
}
14051414
}else{
1406
- pParentFile = manifest_file_seek(pParent, pChildFile->zName);
1415
+ pParentFile = manifest_file_seek(pParent, pChildFile->zName, 0);
14071416
if( pParentFile==0 ){
14081417
if( pChildFile->zUuid ){
14091418
/* A new file */
14101419
add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
14111420
isPublic, mperm);
@@ -1423,22 +1432,22 @@
14231432
** are deleted or modified in the parent but which reappear or revert
14241433
** to baseline in the child and show such files as being added or changed
14251434
** in the child. */
14261435
for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){
14271436
if( pParentFile->zUuid ){
1428
- pChildFile = manifest_file_seek_base(pChild, pParentFile->zName);
1437
+ pChildFile = manifest_file_seek_base(pChild, pParentFile->zName, 0);
14291438
if( pChildFile==0 ){
14301439
/* The child file reverts to baseline. Show this as a change */
1431
- pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1440
+ pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0);
14321441
if( pChildFile ){
14331442
add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
14341443
pChildFile->zName, 0, isPublic,
14351444
manifest_file_mperm(pChildFile));
14361445
}
14371446
}
14381447
}else{
1439
- pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1448
+ pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0);
14401449
if( pChildFile ){
14411450
/* File resurrected in the child after having been deleted in
14421451
** the parent. Show this as an added file. */
14431452
add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
14441453
isPublic, manifest_file_mperm(pChildFile));
@@ -1448,11 +1457,11 @@
14481457
}else if( pChild->zBaseline==0 ){
14491458
/* pChild is a baseline. Look for files that are present in pParent
14501459
** but are missing from pChild and mark them as having been deleted. */
14511460
manifest_file_rewind(pParent);
14521461
while( (pParentFile = manifest_file_next(pParent,0))!=0 ){
1453
- pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1462
+ pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0);
14541463
if( pChildFile==0 && pParentFile->zUuid!=0 ){
14551464
add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0,
14561465
isPublic, 0);
14571466
}
14581467
}
14591468
--- src/manifest.c
+++ src/manifest.c
@@ -1161,14 +1161,15 @@
1161 ** of a file.
1162 */
1163 int manifest_file_mperm(ManifestFile *pFile){
1164 int mperm = PERM_REG;
1165 if( pFile && pFile->zPerm){
1166 if( strstr(pFile->zPerm,"x")!=0 )
1167 mperm = PERM_EXE;
1168 else if( strstr(pFile->zPerm,"l")!=0 )
1169 mperm = PERM_LNK;
 
1170 }
1171 return mperm;
1172 }
1173
1174 /*
@@ -1227,11 +1228,15 @@
1227 ** That will usually be the case. If it is not found there, then do the
1228 ** actual binary search.
1229 **
1230 ** Update p->iFile to be the index of the file that is found.
1231 */
1232 static ManifestFile *manifest_file_seek_base(Manifest *p, const char *zName){
 
 
 
 
1233 int lwr, upr;
1234 int c;
1235 int i;
1236 lwr = 0;
1237 upr = p->nFile - 1;
@@ -1255,10 +1260,14 @@
1255 }else{
1256 p->iFile = i;
1257 return &p->aFile[i];
1258 }
1259 }
 
 
 
 
1260 return 0;
1261 }
1262
1263 /*
1264 ** Locate a file named zName in the aFile[] array of the given manifest.
@@ -1268,18 +1277,18 @@
1268 ** This routine works even if p is a delta-manifest. The pointer
1269 ** returned might be to the baseline.
1270 **
1271 ** We assume that filenames are in sorted order and use a binary search.
1272 */
1273 ManifestFile *manifest_file_seek(Manifest *p, const char *zName){
1274 ManifestFile *pFile;
1275
1276 pFile = manifest_file_seek_base(p, zName);
1277 if( pFile && pFile->zUuid==0 ) return 0;
1278 if( pFile==0 && p->zBaseline ){
1279 fetch_baseline(p, 1);
1280 pFile = manifest_file_seek_base(p->pBaseline, zName);
1281 }
1282 return pFile;
1283 }
1284
1285 /*
@@ -1289,11 +1298,11 @@
1289 */
1290 ManifestFile *manifest_file_find(Manifest *p, const char *zName){
1291 int i;
1292 Manifest *pBase;
1293 if( filenames_are_case_sensitive() ){
1294 return manifest_file_seek(p, zName);
1295 }
1296 for(i=0; i<p->nFile; i++){
1297 if( fossil_stricmp(zName, p->aFile[i].zName)==0 ){
1298 return &p->aFile[i];
1299 }
@@ -1389,11 +1398,11 @@
1389 ** is where most of the changes will be found.
1390 */
1391 for(i=0, pChildFile=pChild->aFile; i<pChild->nFile; i++, pChildFile++){
1392 int mperm = manifest_file_mperm(pChildFile);
1393 if( pChildFile->zPrior ){
1394 pParentFile = manifest_file_seek(pParent, pChildFile->zPrior);
1395 if( pParentFile ){
1396 /* File with name change */
1397 add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1398 pChildFile->zName, pChildFile->zPrior, isPublic, mperm);
1399 }else{
@@ -1401,11 +1410,11 @@
1401 ** Treat this like a new file. */
1402 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1403 isPublic, mperm);
1404 }
1405 }else{
1406 pParentFile = manifest_file_seek(pParent, pChildFile->zName);
1407 if( pParentFile==0 ){
1408 if( pChildFile->zUuid ){
1409 /* A new file */
1410 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1411 isPublic, mperm);
@@ -1423,22 +1432,22 @@
1423 ** are deleted or modified in the parent but which reappear or revert
1424 ** to baseline in the child and show such files as being added or changed
1425 ** in the child. */
1426 for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){
1427 if( pParentFile->zUuid ){
1428 pChildFile = manifest_file_seek_base(pChild, pParentFile->zName);
1429 if( pChildFile==0 ){
1430 /* The child file reverts to baseline. Show this as a change */
1431 pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1432 if( pChildFile ){
1433 add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1434 pChildFile->zName, 0, isPublic,
1435 manifest_file_mperm(pChildFile));
1436 }
1437 }
1438 }else{
1439 pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1440 if( pChildFile ){
1441 /* File resurrected in the child after having been deleted in
1442 ** the parent. Show this as an added file. */
1443 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1444 isPublic, manifest_file_mperm(pChildFile));
@@ -1448,11 +1457,11 @@
1448 }else if( pChild->zBaseline==0 ){
1449 /* pChild is a baseline. Look for files that are present in pParent
1450 ** but are missing from pChild and mark them as having been deleted. */
1451 manifest_file_rewind(pParent);
1452 while( (pParentFile = manifest_file_next(pParent,0))!=0 ){
1453 pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1454 if( pChildFile==0 && pParentFile->zUuid!=0 ){
1455 add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0,
1456 isPublic, 0);
1457 }
1458 }
1459
--- src/manifest.c
+++ src/manifest.c
@@ -1161,14 +1161,15 @@
1161 ** of a file.
1162 */
1163 int manifest_file_mperm(ManifestFile *pFile){
1164 int mperm = PERM_REG;
1165 if( pFile && pFile->zPerm){
1166 if( strstr(pFile->zPerm,"x")!=0 ){
1167 mperm = PERM_EXE;
1168 }else if( strstr(pFile->zPerm,"l")!=0 ){
1169 mperm = PERM_LNK;
1170 }
1171 }
1172 return mperm;
1173 }
1174
1175 /*
@@ -1227,11 +1228,15 @@
1228 ** That will usually be the case. If it is not found there, then do the
1229 ** actual binary search.
1230 **
1231 ** Update p->iFile to be the index of the file that is found.
1232 */
1233 static ManifestFile *manifest_file_seek_base(
1234 Manifest *p, /* Manifest to search */
1235 const char *zName, /* Name of the file we are looking for */
1236 int bBest /* 0: exact match only. 1: closest match */
1237 ){
1238 int lwr, upr;
1239 int c;
1240 int i;
1241 lwr = 0;
1242 upr = p->nFile - 1;
@@ -1255,10 +1260,14 @@
1260 }else{
1261 p->iFile = i;
1262 return &p->aFile[i];
1263 }
1264 }
1265 if( bBest ){
1266 i = (int)strlen(zName);
1267 if( strncmp(zName, p->aFile[lwr].zName, i)==0 ) return &p->aFile[lwr];
1268 }
1269 return 0;
1270 }
1271
1272 /*
1273 ** Locate a file named zName in the aFile[] array of the given manifest.
@@ -1268,18 +1277,18 @@
1277 ** This routine works even if p is a delta-manifest. The pointer
1278 ** returned might be to the baseline.
1279 **
1280 ** We assume that filenames are in sorted order and use a binary search.
1281 */
1282 ManifestFile *manifest_file_seek(Manifest *p, const char *zName, int bBest){
1283 ManifestFile *pFile;
1284
1285 pFile = manifest_file_seek_base(p, zName, p->zBaseline ? 0 : bBest);
1286 if( pFile && pFile->zUuid==0 ) return 0;
1287 if( pFile==0 && p->zBaseline ){
1288 fetch_baseline(p, 1);
1289 pFile = manifest_file_seek_base(p->pBaseline, zName,bBest);
1290 }
1291 return pFile;
1292 }
1293
1294 /*
@@ -1289,11 +1298,11 @@
1298 */
1299 ManifestFile *manifest_file_find(Manifest *p, const char *zName){
1300 int i;
1301 Manifest *pBase;
1302 if( filenames_are_case_sensitive() ){
1303 return manifest_file_seek(p, zName, 0);
1304 }
1305 for(i=0; i<p->nFile; i++){
1306 if( fossil_stricmp(zName, p->aFile[i].zName)==0 ){
1307 return &p->aFile[i];
1308 }
@@ -1389,11 +1398,11 @@
1398 ** is where most of the changes will be found.
1399 */
1400 for(i=0, pChildFile=pChild->aFile; i<pChild->nFile; i++, pChildFile++){
1401 int mperm = manifest_file_mperm(pChildFile);
1402 if( pChildFile->zPrior ){
1403 pParentFile = manifest_file_seek(pParent, pChildFile->zPrior, 0);
1404 if( pParentFile ){
1405 /* File with name change */
1406 add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1407 pChildFile->zName, pChildFile->zPrior, isPublic, mperm);
1408 }else{
@@ -1401,11 +1410,11 @@
1410 ** Treat this like a new file. */
1411 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1412 isPublic, mperm);
1413 }
1414 }else{
1415 pParentFile = manifest_file_seek(pParent, pChildFile->zName, 0);
1416 if( pParentFile==0 ){
1417 if( pChildFile->zUuid ){
1418 /* A new file */
1419 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1420 isPublic, mperm);
@@ -1423,22 +1432,22 @@
1432 ** are deleted or modified in the parent but which reappear or revert
1433 ** to baseline in the child and show such files as being added or changed
1434 ** in the child. */
1435 for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){
1436 if( pParentFile->zUuid ){
1437 pChildFile = manifest_file_seek_base(pChild, pParentFile->zName, 0);
1438 if( pChildFile==0 ){
1439 /* The child file reverts to baseline. Show this as a change */
1440 pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0);
1441 if( pChildFile ){
1442 add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1443 pChildFile->zName, 0, isPublic,
1444 manifest_file_mperm(pChildFile));
1445 }
1446 }
1447 }else{
1448 pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0);
1449 if( pChildFile ){
1450 /* File resurrected in the child after having been deleted in
1451 ** the parent. Show this as an added file. */
1452 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1453 isPublic, manifest_file_mperm(pChildFile));
@@ -1448,11 +1457,11 @@
1457 }else if( pChild->zBaseline==0 ){
1458 /* pChild is a baseline. Look for files that are present in pParent
1459 ** but are missing from pChild and mark them as having been deleted. */
1460 manifest_file_rewind(pParent);
1461 while( (pParentFile = manifest_file_next(pParent,0))!=0 ){
1462 pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0);
1463 if( pChildFile==0 && pParentFile->zUuid!=0 ){
1464 add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0,
1465 isPublic, 0);
1466 }
1467 }
1468
+2 -2
--- src/merge.c
+++ src/merge.c
@@ -47,11 +47,11 @@
4747
indent-1, zLabel,
4848
db_column_text(&q, 3),
4949
db_column_text(&q, 1),
5050
db_column_text(&q, 0),
5151
indent, "");
52
- comment_print(zCom, indent, 78);
52
+ comment_print(zCom, indent, -1);
5353
fossil_free(zCom);
5454
}
5555
db_finalize(&q);
5656
}
5757
@@ -210,11 +210,11 @@
210210
);
211211
if( db_step(&q)==SQLITE_ROW ){
212212
char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"",
213213
db_column_text(&q, 0), db_column_text(&q, 1),
214214
db_column_text(&q, 3), db_column_text(&q, 2));
215
- comment_print(zCom, 0, 79);
215
+ comment_print(zCom, 0, -1);
216216
fossil_free(zCom);
217217
}
218218
db_finalize(&q);
219219
}else{
220220
usage("?OPTIONS? ?VERSION?");
221221
--- src/merge.c
+++ src/merge.c
@@ -47,11 +47,11 @@
47 indent-1, zLabel,
48 db_column_text(&q, 3),
49 db_column_text(&q, 1),
50 db_column_text(&q, 0),
51 indent, "");
52 comment_print(zCom, indent, 78);
53 fossil_free(zCom);
54 }
55 db_finalize(&q);
56 }
57
@@ -210,11 +210,11 @@
210 );
211 if( db_step(&q)==SQLITE_ROW ){
212 char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"",
213 db_column_text(&q, 0), db_column_text(&q, 1),
214 db_column_text(&q, 3), db_column_text(&q, 2));
215 comment_print(zCom, 0, 79);
216 fossil_free(zCom);
217 }
218 db_finalize(&q);
219 }else{
220 usage("?OPTIONS? ?VERSION?");
221
--- src/merge.c
+++ src/merge.c
@@ -47,11 +47,11 @@
47 indent-1, zLabel,
48 db_column_text(&q, 3),
49 db_column_text(&q, 1),
50 db_column_text(&q, 0),
51 indent, "");
52 comment_print(zCom, indent, -1);
53 fossil_free(zCom);
54 }
55 db_finalize(&q);
56 }
57
@@ -210,11 +210,11 @@
210 );
211 if( db_step(&q)==SQLITE_ROW ){
212 char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"",
213 db_column_text(&q, 0), db_column_text(&q, 1),
214 db_column_text(&q, 3), db_column_text(&q, 2));
215 comment_print(zCom, 0, -1);
216 fossil_free(zCom);
217 }
218 db_finalize(&q);
219 }else{
220 usage("?OPTIONS? ?VERSION?");
221
+2 -2
--- src/merge.c
+++ src/merge.c
@@ -47,11 +47,11 @@
4747
indent-1, zLabel,
4848
db_column_text(&q, 3),
4949
db_column_text(&q, 1),
5050
db_column_text(&q, 0),
5151
indent, "");
52
- comment_print(zCom, indent, 78);
52
+ comment_print(zCom, indent, -1);
5353
fossil_free(zCom);
5454
}
5555
db_finalize(&q);
5656
}
5757
@@ -210,11 +210,11 @@
210210
);
211211
if( db_step(&q)==SQLITE_ROW ){
212212
char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"",
213213
db_column_text(&q, 0), db_column_text(&q, 1),
214214
db_column_text(&q, 3), db_column_text(&q, 2));
215
- comment_print(zCom, 0, 79);
215
+ comment_print(zCom, 0, -1);
216216
fossil_free(zCom);
217217
}
218218
db_finalize(&q);
219219
}else{
220220
usage("?OPTIONS? ?VERSION?");
221221
--- src/merge.c
+++ src/merge.c
@@ -47,11 +47,11 @@
47 indent-1, zLabel,
48 db_column_text(&q, 3),
49 db_column_text(&q, 1),
50 db_column_text(&q, 0),
51 indent, "");
52 comment_print(zCom, indent, 78);
53 fossil_free(zCom);
54 }
55 db_finalize(&q);
56 }
57
@@ -210,11 +210,11 @@
210 );
211 if( db_step(&q)==SQLITE_ROW ){
212 char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"",
213 db_column_text(&q, 0), db_column_text(&q, 1),
214 db_column_text(&q, 3), db_column_text(&q, 2));
215 comment_print(zCom, 0, 79);
216 fossil_free(zCom);
217 }
218 db_finalize(&q);
219 }else{
220 usage("?OPTIONS? ?VERSION?");
221
--- src/merge.c
+++ src/merge.c
@@ -47,11 +47,11 @@
47 indent-1, zLabel,
48 db_column_text(&q, 3),
49 db_column_text(&q, 1),
50 db_column_text(&q, 0),
51 indent, "");
52 comment_print(zCom, indent, -1);
53 fossil_free(zCom);
54 }
55 db_finalize(&q);
56 }
57
@@ -210,11 +210,11 @@
210 );
211 if( db_step(&q)==SQLITE_ROW ){
212 char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"",
213 db_column_text(&q, 0), db_column_text(&q, 1),
214 db_column_text(&q, 3), db_column_text(&q, 2));
215 comment_print(zCom, 0, -1);
216 fossil_free(zCom);
217 }
218 db_finalize(&q);
219 }else{
220 usage("?OPTIONS? ?VERSION?");
221
+29 -23
--- src/name.c
+++ src/name.c
@@ -582,11 +582,11 @@
582582
default: zType = "Unknown"; break;
583583
}
584584
fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2),
585585
db_column_text(&q, 1));
586586
fossil_print("comment: ");
587
- comment_print(db_column_text(&q,3), 12, 78);
587
+ comment_print(db_column_text(&q,3), 12, -1);
588588
}
589589
db_finalize(&q);
590590
591591
/* Check to see if this object is used as a file in a check-in */
592592
db_prepare(&q,
@@ -604,11 +604,11 @@
604604
fossil_print(" part of [%.10s] by %s on %s\n",
605605
db_column_text(&q, 1),
606606
db_column_text(&q, 3),
607607
db_column_text(&q, 2));
608608
fossil_print(" ");
609
- comment_print(db_column_text(&q,4), 12, 78);
609
+ comment_print(db_column_text(&q,4), 12, -1);
610610
}
611611
db_finalize(&q);
612612
613613
/* Check to see if this object is used as an attachment */
614614
db_prepare(&q,
@@ -639,11 +639,11 @@
639639
db_column_text(&q,7));
640640
}
641641
fossil_print(" by user %s on %s\n",
642642
db_column_text(&q,2), db_column_text(&q,3));
643643
fossil_print(" ");
644
- comment_print(db_column_text(&q,1), 12, 78);
644
+ comment_print(db_column_text(&q,1), 12, -1);
645645
}
646646
db_finalize(&q);
647647
}
648648
649649
/*
@@ -656,32 +656,38 @@
656656
*/
657657
void whatis_cmd(void){
658658
int rid;
659659
const char *zName;
660660
int verboseFlag;
661
+ int i;
661662
db_find_and_open_repository(0,0);
662663
verboseFlag = find_option("verbose","v",0)!=0;
663
- if( g.argc!=3 ) usage("whatis NAME");
664
- zName = g.argv[2];
665
- rid = symbolic_name_to_rid(zName, 0);
666
- if( rid<0 ){
667
- Stmt q;
668
- int cnt = 0;
669
- fossil_print("Ambiguous artifact name prefix: %s\n", zName);
670
- db_prepare(&q,
671
- "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')",
672
- zName, zName
673
- );
674
- while( db_step(&q)==SQLITE_ROW ){
675
- if( cnt++ ) fossil_print("%.79c\n", '-');
676
- whatis_rid(db_column_int(&q, 0), verboseFlag);
677
- }
678
- db_finalize(&q);
679
- }else if( rid==0 ){
680
- fossil_print("Unknown artifact: %s\n", zName);
681
- }else{
682
- whatis_rid(rid, verboseFlag);
664
+ if( g.argc<3 ) usage("whatis NAME ...");
665
+ for(i=2; i<g.argc; i++){
666
+ zName = g.argv[i];
667
+ if( i>2 ) fossil_print("%.79c\n",'-');
668
+ rid = symbolic_name_to_rid(zName, 0);
669
+ if( rid<0 ){
670
+ Stmt q;
671
+ int cnt = 0;
672
+ fossil_print("name: %s (ambiguous)\n", zName);
673
+ db_prepare(&q,
674
+ "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')",
675
+ zName, zName
676
+ );
677
+ while( db_step(&q)==SQLITE_ROW ){
678
+ if( cnt++ ) fossil_print("%12s---- meaning #%d ----\n", " ", cnt);
679
+ whatis_rid(db_column_int(&q, 0), verboseFlag);
680
+ }
681
+ db_finalize(&q);
682
+ }else if( rid==0 ){
683
+ /* 0123456789 12 */
684
+ fossil_print("unknown: %s\n", zName);
685
+ }else{
686
+ fossil_print("name: %s\n", zName);
687
+ whatis_rid(rid, verboseFlag);
688
+ }
683689
}
684690
}
685691
686692
/*
687693
** COMMAND: test-whatis-all
688694
--- src/name.c
+++ src/name.c
@@ -582,11 +582,11 @@
582 default: zType = "Unknown"; break;
583 }
584 fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2),
585 db_column_text(&q, 1));
586 fossil_print("comment: ");
587 comment_print(db_column_text(&q,3), 12, 78);
588 }
589 db_finalize(&q);
590
591 /* Check to see if this object is used as a file in a check-in */
592 db_prepare(&q,
@@ -604,11 +604,11 @@
604 fossil_print(" part of [%.10s] by %s on %s\n",
605 db_column_text(&q, 1),
606 db_column_text(&q, 3),
607 db_column_text(&q, 2));
608 fossil_print(" ");
609 comment_print(db_column_text(&q,4), 12, 78);
610 }
611 db_finalize(&q);
612
613 /* Check to see if this object is used as an attachment */
614 db_prepare(&q,
@@ -639,11 +639,11 @@
639 db_column_text(&q,7));
640 }
641 fossil_print(" by user %s on %s\n",
642 db_column_text(&q,2), db_column_text(&q,3));
643 fossil_print(" ");
644 comment_print(db_column_text(&q,1), 12, 78);
645 }
646 db_finalize(&q);
647 }
648
649 /*
@@ -656,32 +656,38 @@
656 */
657 void whatis_cmd(void){
658 int rid;
659 const char *zName;
660 int verboseFlag;
 
661 db_find_and_open_repository(0,0);
662 verboseFlag = find_option("verbose","v",0)!=0;
663 if( g.argc!=3 ) usage("whatis NAME");
664 zName = g.argv[2];
665 rid = symbolic_name_to_rid(zName, 0);
666 if( rid<0 ){
667 Stmt q;
668 int cnt = 0;
669 fossil_print("Ambiguous artifact name prefix: %s\n", zName);
670 db_prepare(&q,
671 "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')",
672 zName, zName
673 );
674 while( db_step(&q)==SQLITE_ROW ){
675 if( cnt++ ) fossil_print("%.79c\n", '-');
676 whatis_rid(db_column_int(&q, 0), verboseFlag);
677 }
678 db_finalize(&q);
679 }else if( rid==0 ){
680 fossil_print("Unknown artifact: %s\n", zName);
681 }else{
682 whatis_rid(rid, verboseFlag);
 
 
 
 
 
683 }
684 }
685
686 /*
687 ** COMMAND: test-whatis-all
688
--- src/name.c
+++ src/name.c
@@ -582,11 +582,11 @@
582 default: zType = "Unknown"; break;
583 }
584 fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2),
585 db_column_text(&q, 1));
586 fossil_print("comment: ");
587 comment_print(db_column_text(&q,3), 12, -1);
588 }
589 db_finalize(&q);
590
591 /* Check to see if this object is used as a file in a check-in */
592 db_prepare(&q,
@@ -604,11 +604,11 @@
604 fossil_print(" part of [%.10s] by %s on %s\n",
605 db_column_text(&q, 1),
606 db_column_text(&q, 3),
607 db_column_text(&q, 2));
608 fossil_print(" ");
609 comment_print(db_column_text(&q,4), 12, -1);
610 }
611 db_finalize(&q);
612
613 /* Check to see if this object is used as an attachment */
614 db_prepare(&q,
@@ -639,11 +639,11 @@
639 db_column_text(&q,7));
640 }
641 fossil_print(" by user %s on %s\n",
642 db_column_text(&q,2), db_column_text(&q,3));
643 fossil_print(" ");
644 comment_print(db_column_text(&q,1), 12, -1);
645 }
646 db_finalize(&q);
647 }
648
649 /*
@@ -656,32 +656,38 @@
656 */
657 void whatis_cmd(void){
658 int rid;
659 const char *zName;
660 int verboseFlag;
661 int i;
662 db_find_and_open_repository(0,0);
663 verboseFlag = find_option("verbose","v",0)!=0;
664 if( g.argc<3 ) usage("whatis NAME ...");
665 for(i=2; i<g.argc; i++){
666 zName = g.argv[i];
667 if( i>2 ) fossil_print("%.79c\n",'-');
668 rid = symbolic_name_to_rid(zName, 0);
669 if( rid<0 ){
670 Stmt q;
671 int cnt = 0;
672 fossil_print("name: %s (ambiguous)\n", zName);
673 db_prepare(&q,
674 "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')",
675 zName, zName
676 );
677 while( db_step(&q)==SQLITE_ROW ){
678 if( cnt++ ) fossil_print("%12s---- meaning #%d ----\n", " ", cnt);
679 whatis_rid(db_column_int(&q, 0), verboseFlag);
680 }
681 db_finalize(&q);
682 }else if( rid==0 ){
683 /* 0123456789 12 */
684 fossil_print("unknown: %s\n", zName);
685 }else{
686 fossil_print("name: %s\n", zName);
687 whatis_rid(rid, verboseFlag);
688 }
689 }
690 }
691
692 /*
693 ** COMMAND: test-whatis-all
694
+29 -23
--- src/name.c
+++ src/name.c
@@ -582,11 +582,11 @@
582582
default: zType = "Unknown"; break;
583583
}
584584
fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2),
585585
db_column_text(&q, 1));
586586
fossil_print("comment: ");
587
- comment_print(db_column_text(&q,3), 12, 78);
587
+ comment_print(db_column_text(&q,3), 12, -1);
588588
}
589589
db_finalize(&q);
590590
591591
/* Check to see if this object is used as a file in a check-in */
592592
db_prepare(&q,
@@ -604,11 +604,11 @@
604604
fossil_print(" part of [%.10s] by %s on %s\n",
605605
db_column_text(&q, 1),
606606
db_column_text(&q, 3),
607607
db_column_text(&q, 2));
608608
fossil_print(" ");
609
- comment_print(db_column_text(&q,4), 12, 78);
609
+ comment_print(db_column_text(&q,4), 12, -1);
610610
}
611611
db_finalize(&q);
612612
613613
/* Check to see if this object is used as an attachment */
614614
db_prepare(&q,
@@ -639,11 +639,11 @@
639639
db_column_text(&q,7));
640640
}
641641
fossil_print(" by user %s on %s\n",
642642
db_column_text(&q,2), db_column_text(&q,3));
643643
fossil_print(" ");
644
- comment_print(db_column_text(&q,1), 12, 78);
644
+ comment_print(db_column_text(&q,1), 12, -1);
645645
}
646646
db_finalize(&q);
647647
}
648648
649649
/*
@@ -656,32 +656,38 @@
656656
*/
657657
void whatis_cmd(void){
658658
int rid;
659659
const char *zName;
660660
int verboseFlag;
661
+ int i;
661662
db_find_and_open_repository(0,0);
662663
verboseFlag = find_option("verbose","v",0)!=0;
663
- if( g.argc!=3 ) usage("whatis NAME");
664
- zName = g.argv[2];
665
- rid = symbolic_name_to_rid(zName, 0);
666
- if( rid<0 ){
667
- Stmt q;
668
- int cnt = 0;
669
- fossil_print("Ambiguous artifact name prefix: %s\n", zName);
670
- db_prepare(&q,
671
- "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')",
672
- zName, zName
673
- );
674
- while( db_step(&q)==SQLITE_ROW ){
675
- if( cnt++ ) fossil_print("%.79c\n", '-');
676
- whatis_rid(db_column_int(&q, 0), verboseFlag);
677
- }
678
- db_finalize(&q);
679
- }else if( rid==0 ){
680
- fossil_print("Unknown artifact: %s\n", zName);
681
- }else{
682
- whatis_rid(rid, verboseFlag);
664
+ if( g.argc<3 ) usage("whatis NAME ...");
665
+ for(i=2; i<g.argc; i++){
666
+ zName = g.argv[i];
667
+ if( i>2 ) fossil_print("%.79c\n",'-');
668
+ rid = symbolic_name_to_rid(zName, 0);
669
+ if( rid<0 ){
670
+ Stmt q;
671
+ int cnt = 0;
672
+ fossil_print("name: %s (ambiguous)\n", zName);
673
+ db_prepare(&q,
674
+ "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')",
675
+ zName, zName
676
+ );
677
+ while( db_step(&q)==SQLITE_ROW ){
678
+ if( cnt++ ) fossil_print("%12s---- meaning #%d ----\n", " ", cnt);
679
+ whatis_rid(db_column_int(&q, 0), verboseFlag);
680
+ }
681
+ db_finalize(&q);
682
+ }else if( rid==0 ){
683
+ /* 0123456789 12 */
684
+ fossil_print("unknown: %s\n", zName);
685
+ }else{
686
+ fossil_print("name: %s\n", zName);
687
+ whatis_rid(rid, verboseFlag);
688
+ }
683689
}
684690
}
685691
686692
/*
687693
** COMMAND: test-whatis-all
688694
--- src/name.c
+++ src/name.c
@@ -582,11 +582,11 @@
582 default: zType = "Unknown"; break;
583 }
584 fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2),
585 db_column_text(&q, 1));
586 fossil_print("comment: ");
587 comment_print(db_column_text(&q,3), 12, 78);
588 }
589 db_finalize(&q);
590
591 /* Check to see if this object is used as a file in a check-in */
592 db_prepare(&q,
@@ -604,11 +604,11 @@
604 fossil_print(" part of [%.10s] by %s on %s\n",
605 db_column_text(&q, 1),
606 db_column_text(&q, 3),
607 db_column_text(&q, 2));
608 fossil_print(" ");
609 comment_print(db_column_text(&q,4), 12, 78);
610 }
611 db_finalize(&q);
612
613 /* Check to see if this object is used as an attachment */
614 db_prepare(&q,
@@ -639,11 +639,11 @@
639 db_column_text(&q,7));
640 }
641 fossil_print(" by user %s on %s\n",
642 db_column_text(&q,2), db_column_text(&q,3));
643 fossil_print(" ");
644 comment_print(db_column_text(&q,1), 12, 78);
645 }
646 db_finalize(&q);
647 }
648
649 /*
@@ -656,32 +656,38 @@
656 */
657 void whatis_cmd(void){
658 int rid;
659 const char *zName;
660 int verboseFlag;
 
661 db_find_and_open_repository(0,0);
662 verboseFlag = find_option("verbose","v",0)!=0;
663 if( g.argc!=3 ) usage("whatis NAME");
664 zName = g.argv[2];
665 rid = symbolic_name_to_rid(zName, 0);
666 if( rid<0 ){
667 Stmt q;
668 int cnt = 0;
669 fossil_print("Ambiguous artifact name prefix: %s\n", zName);
670 db_prepare(&q,
671 "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')",
672 zName, zName
673 );
674 while( db_step(&q)==SQLITE_ROW ){
675 if( cnt++ ) fossil_print("%.79c\n", '-');
676 whatis_rid(db_column_int(&q, 0), verboseFlag);
677 }
678 db_finalize(&q);
679 }else if( rid==0 ){
680 fossil_print("Unknown artifact: %s\n", zName);
681 }else{
682 whatis_rid(rid, verboseFlag);
 
 
 
 
 
683 }
684 }
685
686 /*
687 ** COMMAND: test-whatis-all
688
--- src/name.c
+++ src/name.c
@@ -582,11 +582,11 @@
582 default: zType = "Unknown"; break;
583 }
584 fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2),
585 db_column_text(&q, 1));
586 fossil_print("comment: ");
587 comment_print(db_column_text(&q,3), 12, -1);
588 }
589 db_finalize(&q);
590
591 /* Check to see if this object is used as a file in a check-in */
592 db_prepare(&q,
@@ -604,11 +604,11 @@
604 fossil_print(" part of [%.10s] by %s on %s\n",
605 db_column_text(&q, 1),
606 db_column_text(&q, 3),
607 db_column_text(&q, 2));
608 fossil_print(" ");
609 comment_print(db_column_text(&q,4), 12, -1);
610 }
611 db_finalize(&q);
612
613 /* Check to see if this object is used as an attachment */
614 db_prepare(&q,
@@ -639,11 +639,11 @@
639 db_column_text(&q,7));
640 }
641 fossil_print(" by user %s on %s\n",
642 db_column_text(&q,2), db_column_text(&q,3));
643 fossil_print(" ");
644 comment_print(db_column_text(&q,1), 12, -1);
645 }
646 db_finalize(&q);
647 }
648
649 /*
@@ -656,32 +656,38 @@
656 */
657 void whatis_cmd(void){
658 int rid;
659 const char *zName;
660 int verboseFlag;
661 int i;
662 db_find_and_open_repository(0,0);
663 verboseFlag = find_option("verbose","v",0)!=0;
664 if( g.argc<3 ) usage("whatis NAME ...");
665 for(i=2; i<g.argc; i++){
666 zName = g.argv[i];
667 if( i>2 ) fossil_print("%.79c\n",'-');
668 rid = symbolic_name_to_rid(zName, 0);
669 if( rid<0 ){
670 Stmt q;
671 int cnt = 0;
672 fossil_print("name: %s (ambiguous)\n", zName);
673 db_prepare(&q,
674 "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')",
675 zName, zName
676 );
677 while( db_step(&q)==SQLITE_ROW ){
678 if( cnt++ ) fossil_print("%12s---- meaning #%d ----\n", " ", cnt);
679 whatis_rid(db_column_int(&q, 0), verboseFlag);
680 }
681 db_finalize(&q);
682 }else if( rid==0 ){
683 /* 0123456789 12 */
684 fossil_print("unknown: %s\n", zName);
685 }else{
686 fossil_print("name: %s\n", zName);
687 whatis_rid(rid, verboseFlag);
688 }
689 }
690 }
691
692 /*
693 ** COMMAND: test-whatis-all
694
+1 -7
--- src/search.c
+++ src/search.c
@@ -202,17 +202,11 @@
202202
width = atoi(zWidth);
203203
if( (width!=0) && (width<=20) ){
204204
fossil_fatal("-W|--width value must be >20 or 0");
205205
}
206206
}else{
207
-#ifdef TIOCGWINSZ
208
- struct winsize w;
209
- ioctl(0, TIOCGWINSZ, &w);
210
- width = w.ws_col;
211
-#else
212
- width = 79;
213
-#endif
207
+ width = -1;
214208
}
215209
216210
db_must_be_within_tree();
217211
if( g.argc<2 ) return;
218212
blob_init(&pattern, g.argv[2], -1);
219213
--- src/search.c
+++ src/search.c
@@ -202,17 +202,11 @@
202 width = atoi(zWidth);
203 if( (width!=0) && (width<=20) ){
204 fossil_fatal("-W|--width value must be >20 or 0");
205 }
206 }else{
207 #ifdef TIOCGWINSZ
208 struct winsize w;
209 ioctl(0, TIOCGWINSZ, &w);
210 width = w.ws_col;
211 #else
212 width = 79;
213 #endif
214 }
215
216 db_must_be_within_tree();
217 if( g.argc<2 ) return;
218 blob_init(&pattern, g.argv[2], -1);
219
--- src/search.c
+++ src/search.c
@@ -202,17 +202,11 @@
202 width = atoi(zWidth);
203 if( (width!=0) && (width<=20) ){
204 fossil_fatal("-W|--width value must be >20 or 0");
205 }
206 }else{
207 width = -1;
 
 
 
 
 
 
208 }
209
210 db_must_be_within_tree();
211 if( g.argc<2 ) return;
212 blob_init(&pattern, g.argv[2], -1);
213
+1 -7
--- src/search.c
+++ src/search.c
@@ -202,17 +202,11 @@
202202
width = atoi(zWidth);
203203
if( (width!=0) && (width<=20) ){
204204
fossil_fatal("-W|--width value must be >20 or 0");
205205
}
206206
}else{
207
-#ifdef TIOCGWINSZ
208
- struct winsize w;
209
- ioctl(0, TIOCGWINSZ, &w);
210
- width = w.ws_col;
211
-#else
212
- width = 79;
213
-#endif
207
+ width = -1;
214208
}
215209
216210
db_must_be_within_tree();
217211
if( g.argc<2 ) return;
218212
blob_init(&pattern, g.argv[2], -1);
219213
--- src/search.c
+++ src/search.c
@@ -202,17 +202,11 @@
202 width = atoi(zWidth);
203 if( (width!=0) && (width<=20) ){
204 fossil_fatal("-W|--width value must be >20 or 0");
205 }
206 }else{
207 #ifdef TIOCGWINSZ
208 struct winsize w;
209 ioctl(0, TIOCGWINSZ, &w);
210 width = w.ws_col;
211 #else
212 width = 79;
213 #endif
214 }
215
216 db_must_be_within_tree();
217 if( g.argc<2 ) return;
218 blob_init(&pattern, g.argv[2], -1);
219
--- src/search.c
+++ src/search.c
@@ -202,17 +202,11 @@
202 width = atoi(zWidth);
203 if( (width!=0) && (width<=20) ){
204 fossil_fatal("-W|--width value must be >20 or 0");
205 }
206 }else{
207 width = -1;
 
 
 
 
 
 
208 }
209
210 db_must_be_within_tree();
211 if( g.argc<2 ) return;
212 blob_init(&pattern, g.argv[2], -1);
213
+1 -7
--- src/stash.c
+++ src/stash.c
@@ -525,17 +525,11 @@
525525
width = atoi(zWidth);
526526
if( (width!=0) && (width<=46) ){
527527
fossil_fatal("-W|--width value must be >46 or 0");
528528
}
529529
}else{
530
-#ifdef TIOCGWINSZ
531
- struct winsize w;
532
- ioctl(0, TIOCGWINSZ, &w);
533
- width = w.ws_col;
534
-#else
535
- width = 79;
536
-#endif
530
+ width = -1;
537531
}
538532
if( !verboseFlag ){
539533
verboseFlag = find_option("detail","l",0)!=0; /* deprecated */
540534
}
541535
verify_all_options();
542536
--- src/stash.c
+++ src/stash.c
@@ -525,17 +525,11 @@
525 width = atoi(zWidth);
526 if( (width!=0) && (width<=46) ){
527 fossil_fatal("-W|--width value must be >46 or 0");
528 }
529 }else{
530 #ifdef TIOCGWINSZ
531 struct winsize w;
532 ioctl(0, TIOCGWINSZ, &w);
533 width = w.ws_col;
534 #else
535 width = 79;
536 #endif
537 }
538 if( !verboseFlag ){
539 verboseFlag = find_option("detail","l",0)!=0; /* deprecated */
540 }
541 verify_all_options();
542
--- src/stash.c
+++ src/stash.c
@@ -525,17 +525,11 @@
525 width = atoi(zWidth);
526 if( (width!=0) && (width<=46) ){
527 fossil_fatal("-W|--width value must be >46 or 0");
528 }
529 }else{
530 width = -1;
 
 
 
 
 
 
531 }
532 if( !verboseFlag ){
533 verboseFlag = find_option("detail","l",0)!=0; /* deprecated */
534 }
535 verify_all_options();
536
+1 -7
--- src/stash.c
+++ src/stash.c
@@ -525,17 +525,11 @@
525525
width = atoi(zWidth);
526526
if( (width!=0) && (width<=46) ){
527527
fossil_fatal("-W|--width value must be >46 or 0");
528528
}
529529
}else{
530
-#ifdef TIOCGWINSZ
531
- struct winsize w;
532
- ioctl(0, TIOCGWINSZ, &w);
533
- width = w.ws_col;
534
-#else
535
- width = 79;
536
-#endif
530
+ width = -1;
537531
}
538532
if( !verboseFlag ){
539533
verboseFlag = find_option("detail","l",0)!=0; /* deprecated */
540534
}
541535
verify_all_options();
542536
--- src/stash.c
+++ src/stash.c
@@ -525,17 +525,11 @@
525 width = atoi(zWidth);
526 if( (width!=0) && (width<=46) ){
527 fossil_fatal("-W|--width value must be >46 or 0");
528 }
529 }else{
530 #ifdef TIOCGWINSZ
531 struct winsize w;
532 ioctl(0, TIOCGWINSZ, &w);
533 width = w.ws_col;
534 #else
535 width = 79;
536 #endif
537 }
538 if( !verboseFlag ){
539 verboseFlag = find_option("detail","l",0)!=0; /* deprecated */
540 }
541 verify_all_options();
542
--- src/stash.c
+++ src/stash.c
@@ -525,17 +525,11 @@
525 width = atoi(zWidth);
526 if( (width!=0) && (width<=46) ){
527 fossil_fatal("-W|--width value must be >46 or 0");
528 }
529 }else{
530 width = -1;
 
 
 
 
 
 
531 }
532 if( !verboseFlag ){
533 verboseFlag = find_option("detail","l",0)!=0; /* deprecated */
534 }
535 verify_all_options();
536
+10 -5
--- src/sync.c
+++ src/sync.c
@@ -77,19 +77,24 @@
7777
return rc;
7878
}
7979
8080
/*
8181
** This routine will try a number of times to perform autosync with a
82
-** .5 second sleep between attempts; returning the last autosync status.
82
+** 0.5 second sleep between attempts; returning the last autosync status.
8383
*/
8484
int autosync_loop(int flags, int nTries){
8585
int n = 0;
8686
int rc = 0;
87
- while( (n==0 || n < nTries) && (rc = autosync(flags)) ){
88
- if( rc ) fossil_warning("Autosync failed%s",
89
- ++n < nTries ? ", making another attempt." : ".");
90
- if( n < nTries ) sqlite3_sleep(500);
87
+ while( (n==0 || n<nTries) && (rc=autosync(flags)) ){
88
+ if( rc ){
89
+ if( ++n<nTries ){
90
+ fossil_warning("Autosync failed, making another attempt.");
91
+ sqlite3_sleep(500);
92
+ }else{
93
+ fossil_warning("Autosync failed.");
94
+ }
95
+ }
9196
}
9297
return rc;
9398
}
9499
95100
/*
96101
--- src/sync.c
+++ src/sync.c
@@ -77,19 +77,24 @@
77 return rc;
78 }
79
80 /*
81 ** This routine will try a number of times to perform autosync with a
82 ** .5 second sleep between attempts; returning the last autosync status.
83 */
84 int autosync_loop(int flags, int nTries){
85 int n = 0;
86 int rc = 0;
87 while( (n==0 || n < nTries) && (rc = autosync(flags)) ){
88 if( rc ) fossil_warning("Autosync failed%s",
89 ++n < nTries ? ", making another attempt." : ".");
90 if( n < nTries ) sqlite3_sleep(500);
 
 
 
 
 
91 }
92 return rc;
93 }
94
95 /*
96
--- src/sync.c
+++ src/sync.c
@@ -77,19 +77,24 @@
77 return rc;
78 }
79
80 /*
81 ** This routine will try a number of times to perform autosync with a
82 ** 0.5 second sleep between attempts; returning the last autosync status.
83 */
84 int autosync_loop(int flags, int nTries){
85 int n = 0;
86 int rc = 0;
87 while( (n==0 || n<nTries) && (rc=autosync(flags)) ){
88 if( rc ){
89 if( ++n<nTries ){
90 fossil_warning("Autosync failed, making another attempt.");
91 sqlite3_sleep(500);
92 }else{
93 fossil_warning("Autosync failed.");
94 }
95 }
96 }
97 return rc;
98 }
99
100 /*
101
+506 -2
--- src/th_main.c
+++ src/th_main.c
@@ -30,13 +30,41 @@
3030
#define TH_INIT_NONE ((u32)0x00000000) /* No flags. */
3131
#define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */
3232
#define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */
3333
#define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */
3434
#define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */
35
+#define TH_INIT_MASK ((u32)0x0000000F) /* All possible init flags. */
3536
#define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */
37
+#define TH_INIT_HOOK (TH_INIT_NEED_CONFIG | TH_INIT_FORCE_SETUP)
38
+#endif
39
+
40
+/*
41
+** Flags set by functions in this file to keep track of integration state
42
+** information. These flags should not be used outside of this file.
43
+*/
44
+#define TH_STATE_CONFIG ((u32)0x00000010) /* We opened the config. */
45
+#define TH_STATE_REPOSITORY ((u32)0x00000020) /* We opened the repository. */
46
+#define TH_STATE_MASK ((u32)0x00000030) /* All possible state flags. */
47
+
48
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
49
+/*
50
+** These are the "well-known" TH1 error messages that occur when no hook is
51
+** registered to be called prior to executing a command or processing a web
52
+** page, respectively. If one of these errors is seen, it will not be sent
53
+** or displayed to the remote user or local interactive user, respectively.
54
+*/
55
+#define NO_COMMAND_HOOK_ERROR "no such command: command_hook"
56
+#define NO_WEBPAGE_HOOK_ERROR "no such command: webpage_hook"
3657
#endif
3758
59
+/*
60
+** These macros are used within this file to detect if the repository and
61
+** configuration ("user") database are currently open.
62
+*/
63
+#define Th_IsRepositoryOpen() (g.repositoryOpen)
64
+#define Th_IsConfigOpen() (g.zConfigDbName!=0)
65
+
3866
/*
3967
** Global variable counting the number of outstanding calls to malloc()
4068
** made by the th1 implementation. This is used to catch memory leaks
4169
** in the interpreter. Obviously, it also means th1 is not threadsafe.
4270
*/
@@ -74,10 +102,22 @@
74102
va_list ap;
75103
va_start(ap, zFormat);
76104
blob_vappendf(&g.thLog, zFormat, ap);
77105
va_end(ap);
78106
}
107
+
108
+/*
109
+** Forces input and output to be done via the CGI subsystem.
110
+*/
111
+void Th_ForceCgi(int fullHttpReply){
112
+ g.httpOut = stdout;
113
+ g.httpIn = stdin;
114
+ fossil_binary_mode(g.httpOut);
115
+ fossil_binary_mode(g.httpIn);
116
+ g.cgiOutput = 1;
117
+ g.fullHttpReply = fullHttpReply;
118
+}
79119
80120
/*
81121
** Checks if the TH1 trace log needs to be enabled. If so, prepares
82122
** it for use.
83123
*/
@@ -327,10 +367,11 @@
327367
**
328368
** Return true if the fossil binary has the given compile-time feature
329369
** enabled. The set of features includes:
330370
**
331371
** "ssl" = FOSSIL_ENABLE_SSL
372
+** "th1Hooks" = FOSSIL_ENABLE_TH1_HOOKS
332373
** "tcl" = FOSSIL_ENABLE_TCL
333374
** "useTclStubs" = USE_TCL_STUBS
334375
** "tclStubs" = FOSSIL_ENABLE_TCL_STUBS
335376
** "tclPrivateStubs" = FOSSIL_ENABLE_TCL_PRIVATE_STUBS
336377
** "json" = FOSSIL_ENABLE_JSON
@@ -355,10 +396,15 @@
355396
}
356397
#if defined(FOSSIL_ENABLE_SSL)
357398
else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){
358399
rc = 1;
359400
}
401
+#endif
402
+#if defined(FOSSIL_ENABLE_TH1_HOOKS)
403
+ else if( 0 == fossil_strnicmp( zArg, "th1Hooks\0", 9 ) ){
404
+ rc = 1;
405
+ }
360406
#endif
361407
#if defined(FOSSIL_ENABLE_TCL)
362408
else if( 0 == fossil_strnicmp( zArg, "tcl\0", 4 ) ){
363409
rc = 1;
364410
}
@@ -572,10 +618,175 @@
572618
if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0);
573619
}
574620
Th_SetResult(interp, g.zRepositoryName, -1);
575621
return TH_OK;
576622
}
623
+
624
+/*
625
+** TH1 command: checkout ?BOOLEAN?
626
+**
627
+** Return the fully qualified directory name of the current checkout or an
628
+** empty string if it is not available. Optionally, it will attempt to find
629
+** the current checkout, opening the configuration ("user") database and the
630
+** repository as necessary, if the boolean argument is non-zero.
631
+*/
632
+static int checkoutCmd(
633
+ Th_Interp *interp,
634
+ void *p,
635
+ int argc,
636
+ const char **argv,
637
+ int *argl
638
+){
639
+ if( argc!=1 && argc!=2 ){
640
+ return Th_WrongNumArgs(interp, "checkout ?BOOLEAN?");
641
+ }
642
+ if( argc==2 ){
643
+ int openCheckout = 0;
644
+ if( Th_ToInt(interp, argv[1], argl[1], &openCheckout) ){
645
+ return TH_ERROR;
646
+ }
647
+ if( openCheckout ) db_open_local(0);
648
+ }
649
+ Th_SetResult(interp, g.zLocalRoot, -1);
650
+ return TH_OK;
651
+}
652
+
653
+/*
654
+** TH1 command: trace STRING
655
+**
656
+** Generate a TH1 trace message if debugging is enabled.
657
+*/
658
+static int traceCmd(
659
+ Th_Interp *interp,
660
+ void *p,
661
+ int argc,
662
+ const char **argv,
663
+ int *argl
664
+){
665
+ if( argc!=2 ){
666
+ return Th_WrongNumArgs(interp, "trace STRING");
667
+ }
668
+ if( g.thTrace ){
669
+ Th_Trace("%s", argv[1]);
670
+ }
671
+ Th_SetResult(interp, 0, 0);
672
+ return TH_OK;
673
+}
674
+
675
+/*
676
+** TH1 command: getParameter NAME ?DEFAULT?
677
+**
678
+** Return the value of the specified query parameter or the specified default
679
+** value when there is no matching query parameter.
680
+*/
681
+static int getParameterCmd(
682
+ Th_Interp *interp,
683
+ void *p,
684
+ int argc,
685
+ const char **argv,
686
+ int *argl
687
+){
688
+ const char *zDefault = 0;
689
+ if( argc!=2 && argc!=3 ){
690
+ return Th_WrongNumArgs(interp, "getParameter NAME ?DEFAULT?");
691
+ }
692
+ if( argc==3 ){
693
+ zDefault = argv[2];
694
+ }
695
+ Th_SetResult(interp, cgi_parameter(argv[1], zDefault), -1);
696
+ return TH_OK;
697
+}
698
+
699
+/*
700
+** TH1 command: setParameter NAME VALUE
701
+**
702
+** Sets the value of the specified query parameter.
703
+*/
704
+static int setParameterCmd(
705
+ Th_Interp *interp,
706
+ void *p,
707
+ int argc,
708
+ const char **argv,
709
+ int *argl
710
+){
711
+ if( argc!=3 ){
712
+ return Th_WrongNumArgs(interp, "setParameter NAME VALUE");
713
+ }
714
+ cgi_replace_parameter(mprintf("%s", argv[1]), mprintf("%s", argv[2]));
715
+ return TH_OK;
716
+}
717
+
718
+/*
719
+** TH1 command: render STRING
720
+**
721
+** Renders the template and writes the results.
722
+*/
723
+static int renderCmd(
724
+ Th_Interp *interp,
725
+ void *p,
726
+ int argc,
727
+ const char **argv,
728
+ int *argl
729
+){
730
+ int rc;
731
+ if( argc!=2 ){
732
+ return Th_WrongNumArgs(interp, "render STRING");
733
+ }
734
+ rc = Th_Render(argv[1]);
735
+ Th_SetResult(interp, 0, 0);
736
+ return rc;
737
+}
738
+
739
+/*
740
+** TH1 command: styleHeader TITLE
741
+**
742
+** Render the configured style header.
743
+*/
744
+static int styleHeaderCmd(
745
+ Th_Interp *interp,
746
+ void *p,
747
+ int argc,
748
+ const char **argv,
749
+ int *argl
750
+){
751
+ if( argc!=2 ){
752
+ return Th_WrongNumArgs(interp, "styleHeader TITLE");
753
+ }
754
+ if( Th_IsRepositoryOpen() ){
755
+ style_header("%s", argv[1]);
756
+ Th_SetResult(interp, 0, 0);
757
+ return TH_OK;
758
+ }else{
759
+ Th_SetResult(interp, "repository unavailable", -1);
760
+ return TH_ERROR;
761
+ }
762
+}
763
+
764
+/*
765
+** TH1 command: styleFooter
766
+**
767
+** Render the configured style footer.
768
+*/
769
+static int styleFooterCmd(
770
+ Th_Interp *interp,
771
+ void *p,
772
+ int argc,
773
+ const char **argv,
774
+ int *argl
775
+){
776
+ if( argc!=1 ){
777
+ return Th_WrongNumArgs(interp, "styleFooter");
778
+ }
779
+ if( Th_IsRepositoryOpen() ){
780
+ style_footer();
781
+ Th_SetResult(interp, 0, 0);
782
+ return TH_OK;
783
+ }else{
784
+ Th_SetResult(interp, "repository unavailable", -1);
785
+ return TH_ERROR;
786
+ }
787
+}
577788
578789
#ifdef _WIN32
579790
# include <windows.h>
580791
#else
581792
# include <sys/time.h>
@@ -979,14 +1190,43 @@
9791190
** attempts to try to find the repository and open it.
9801191
*/
9811192
void Th_OpenConfig(
9821193
int openRepository
9831194
){
984
- if( openRepository ){
1195
+ if( openRepository && !Th_IsRepositoryOpen() ){
9851196
db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0);
1197
+ if( Th_IsRepositoryOpen() ){
1198
+ g.th1Flags |= TH_STATE_REPOSITORY;
1199
+ }else{
1200
+ g.th1Flags &= ~TH_STATE_REPOSITORY;
1201
+ }
1202
+ }
1203
+ if( !Th_IsConfigOpen() ){
1204
+ db_open_config(0);
1205
+ if( Th_IsConfigOpen() ){
1206
+ g.th1Flags |= TH_STATE_CONFIG;
1207
+ }else{
1208
+ g.th1Flags &= ~TH_STATE_CONFIG;
1209
+ }
1210
+ }
1211
+}
1212
+
1213
+/*
1214
+** Attempts to close the configuration ("user") database. Optionally, also
1215
+** attempts to close the repository.
1216
+*/
1217
+void Th_CloseConfig(
1218
+ int closeRepository
1219
+){
1220
+ if( g.th1Flags & TH_STATE_CONFIG ){
1221
+ db_close_config();
1222
+ g.th1Flags &= ~TH_STATE_CONFIG;
9861223
}
987
- db_open_config(0);
1224
+ if( closeRepository && (g.th1Flags & TH_STATE_REPOSITORY) ){
1225
+ db_close(1);
1226
+ g.th1Flags &= ~TH_STATE_REPOSITORY;
1227
+ }
9881228
}
9891229
9901230
/*
9911231
** Make sure the interpreter has been initialized. Initialize it if
9921232
** it has not been already.
@@ -1004,14 +1244,16 @@
10041244
const char *zName;
10051245
Th_CommandProc xProc;
10061246
void *pContext;
10071247
} aCommand[] = {
10081248
{"anycap", anycapCmd, 0},
1249
+ {"checkout", checkoutCmd, 0},
10091250
{"combobox", comboboxCmd, 0},
10101251
{"date", dateCmd, 0},
10111252
{"decorate", wikiCmd, (void*)&aFlags[2]},
10121253
{"enable_output", enableOutputCmd, 0},
1254
+ {"getParameter", getParameterCmd, 0},
10131255
{"httpize", httpizeCmd, 0},
10141256
{"hascap", hascapCmd, 0},
10151257
{"hasfeature", hasfeatureCmd, 0},
10161258
{"html", putsCmd, (void*)&aFlags[0]},
10171259
{"htmlize", htmlizeCmd, 0},
@@ -1019,13 +1261,18 @@
10191261
{"linecount", linecntCmd, 0},
10201262
{"puts", putsCmd, (void*)&aFlags[1]},
10211263
{"query", queryCmd, 0},
10221264
{"randhex", randhexCmd, 0},
10231265
{"regexp", regexpCmd, 0},
1266
+ {"render", renderCmd, 0},
10241267
{"repository", repositoryCmd, 0},
1268
+ {"setParameter", setParameterCmd, 0},
10251269
{"setting", settingCmd, 0},
1270
+ {"styleHeader", styleHeaderCmd, 0},
1271
+ {"styleFooter", styleFooterCmd, 0},
10261272
{"tclReady", tclReadyCmd, 0},
1273
+ {"trace", traceCmd, 0},
10271274
{"stime", stimeCmd, 0},
10281275
{"utime", utimeCmd, 0},
10291276
{"wiki", wikiCmd, (void*)&aFlags[0]},
10301277
{0, 0, 0}
10311278
};
@@ -1081,10 +1328,12 @@
10811328
if( g.thTrace ){
10821329
Th_Trace("th1-setup {%h} => %h<br />\n", g.th1Setup,
10831330
Th_ReturnCodeName(rc, 0));
10841331
}
10851332
}
1333
+ g.th1Flags &= ~TH_INIT_MASK;
1334
+ g.th1Flags |= (flags & TH_INIT_MASK);
10861335
}
10871336
10881337
/*
10891338
** Store a string value in a variable in the interpreter.
10901339
*/
@@ -1095,10 +1344,34 @@
10951344
Th_Trace("set %h {%h}<br />\n", zName, zValue);
10961345
}
10971346
Th_SetVar(g.interp, zName, -1, zValue, strlen(zValue));
10981347
}
10991348
}
1349
+
1350
+/*
1351
+** Store a list value in a variable in the interpreter.
1352
+*/
1353
+void Th_StoreList(
1354
+ const char *zName,
1355
+ char **pzList,
1356
+ int nList
1357
+){
1358
+ Th_FossilInit(TH_INIT_DEFAULT);
1359
+ if( pzList ){
1360
+ char *zValue = 0;
1361
+ int nValue = 0;
1362
+ int i;
1363
+ for(i=0; i<nList; i++){
1364
+ Th_ListAppend(g.interp, &zValue, &nValue, pzList[i], -1);
1365
+ }
1366
+ if( g.thTrace ){
1367
+ Th_Trace("set %h {%h}<br />\n", zName, zValue);
1368
+ }
1369
+ Th_SetVar(g.interp, zName, -1, zValue, nValue);
1370
+ Th_Free(g.interp, zValue);
1371
+ }
1372
+}
11001373
11011374
/*
11021375
** Store an integer value in a variable in the interpreter.
11031376
*/
11041377
void Th_StoreInt(const char *zName, int iValue){
@@ -1193,10 +1466,193 @@
11931466
i += 2;
11941467
}
11951468
return i;
11961469
}
11971470
1471
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
1472
+/*
1473
+** This function determines if TH1 hooks are enabled for the repository. It
1474
+** may be necessary to open the repository and/or the configuration ("user")
1475
+** database from within this function. Before this function returns, any
1476
+** database opened will be closed again. This is very important because some
1477
+** commands do not expect the repository and/or the configuration ("user")
1478
+** database to be open prior to their own code doing so.
1479
+*/
1480
+int Th_AreHooksEnabled(void){
1481
+ int rc;
1482
+ if( fossil_getenv("TH1_ENABLE_HOOKS")!=0 ){
1483
+ return 1;
1484
+ }
1485
+ Th_OpenConfig(1);
1486
+ rc = db_get_boolean("th1-hooks", 0);
1487
+ Th_CloseConfig(1);
1488
+ return rc;
1489
+}
1490
+
1491
+/*
1492
+** This function is called by Fossil just prior to dispatching a command.
1493
+** Returning a value other than TH_OK from this function (i.e. via an
1494
+** evaluated script raising an error or calling [break]/[continue]) will
1495
+** cause the actual command execution to be skipped.
1496
+*/
1497
+int Th_CommandHook(
1498
+ const char *zName,
1499
+ char cmdFlags
1500
+){
1501
+ int rc = TH_OK;
1502
+ if( !Th_AreHooksEnabled() ) return rc;
1503
+ Th_FossilInit(TH_INIT_HOOK);
1504
+ Th_Store("cmd_name", zName);
1505
+ Th_StoreList("cmd_args", g.argv, g.argc);
1506
+ Th_StoreInt("cmd_flags", cmdFlags);
1507
+ rc = Th_Eval(g.interp, 0, "command_hook", -1);
1508
+ if( rc==TH_ERROR ){
1509
+ int nResult = 0;
1510
+ char *zResult = (char*)Th_GetResult(g.interp, &nResult);
1511
+ /*
1512
+ ** Make sure that the TH1 script error was not caused by a "missing"
1513
+ ** command hook handler as that is not actually an error condition.
1514
+ */
1515
+ if( memcmp(zResult, NO_COMMAND_HOOK_ERROR, nResult)!=0 ){
1516
+ sendError(zResult, nResult, 0);
1517
+ }
1518
+ }
1519
+ /*
1520
+ ** If the script returned TH_ERROR (e.g. the "command_hook" TH1 command does
1521
+ ** not exist because commands are not being hooked), return TH_OK because we
1522
+ ** do not want to skip executing essential commands unless the called command
1523
+ ** (i.e. "command_hook") explicitly forbids this by successfully returning
1524
+ ** TH_BREAK or TH_CONTINUE.
1525
+ */
1526
+ if( g.thTrace ){
1527
+ Th_Trace("[command_hook {%h}] => %h<br />\n", zName,
1528
+ Th_ReturnCodeName(rc, 0));
1529
+ }
1530
+ /*
1531
+ ** Does our call to Th_FossilInit() result in opening a database? If so,
1532
+ ** clean it up now. This is very important because some commands do not
1533
+ ** expect the repository and/or the configuration ("user") database to be
1534
+ ** open prior to their own code doing so.
1535
+ */
1536
+ if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1);
1537
+ return (rc != TH_ERROR) ? rc : TH_OK;
1538
+}
1539
+
1540
+/*
1541
+** This function is called by Fossil just after dispatching a command.
1542
+** Returning a value other than TH_OK from this function (i.e. via an
1543
+** evaluated script raising an error or calling [break]/[continue]) may
1544
+** cause an error message to be displayed to the local interactive user.
1545
+** Currently, TH1 error messages generated by this function are ignored.
1546
+*/
1547
+int Th_CommandNotify(
1548
+ const char *zName,
1549
+ char cmdFlags
1550
+){
1551
+ int rc = TH_OK;
1552
+ if( !Th_AreHooksEnabled() ) return rc;
1553
+ Th_FossilInit(TH_INIT_HOOK);
1554
+ Th_Store("cmd_name", zName);
1555
+ Th_StoreList("cmd_args", g.argv, g.argc);
1556
+ Th_StoreInt("cmd_flags", cmdFlags);
1557
+ rc = Th_Eval(g.interp, 0, "command_notify", -1);
1558
+ if( g.thTrace ){
1559
+ Th_Trace("[command_notify {%h}] => %h<br />\n", zName,
1560
+ Th_ReturnCodeName(rc, 0));
1561
+ }
1562
+ /*
1563
+ ** Does our call to Th_FossilInit() result in opening a database? If so,
1564
+ ** clean it up now. This is very important because some commands do not
1565
+ ** expect the repository and/or the configuration ("user") database to be
1566
+ ** open prior to their own code doing so.
1567
+ */
1568
+ if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1);
1569
+ return rc;
1570
+}
1571
+
1572
+/*
1573
+** This function is called by Fossil just prior to processing a web page.
1574
+** Returning a value other than TH_OK from this function (i.e. via an
1575
+** evaluated script raising an error or calling [break]/[continue]) will
1576
+** cause the actual web page processing to be skipped.
1577
+*/
1578
+int Th_WebpageHook(
1579
+ const char *zName,
1580
+ char cmdFlags
1581
+){
1582
+ int rc = TH_OK;
1583
+ if( !Th_AreHooksEnabled() ) return rc;
1584
+ Th_FossilInit(TH_INIT_HOOK);
1585
+ Th_Store("web_name", zName);
1586
+ Th_StoreList("web_args", g.argv, g.argc);
1587
+ Th_StoreInt("web_flags", cmdFlags);
1588
+ rc = Th_Eval(g.interp, 0, "webpage_hook", -1);
1589
+ if( rc==TH_ERROR ){
1590
+ int nResult = 0;
1591
+ char *zResult = (char*)Th_GetResult(g.interp, &nResult);
1592
+ /*
1593
+ ** Make sure that the TH1 script error was not caused by a "missing"
1594
+ ** webpage hook handler as that is not actually an error condition.
1595
+ */
1596
+ if( memcmp(zResult, NO_WEBPAGE_HOOK_ERROR, nResult)!=0 ){
1597
+ sendError(zResult, nResult, 1);
1598
+ }
1599
+ }
1600
+ /*
1601
+ ** If the script returned TH_ERROR (e.g. the "webpage_hook" TH1 command does
1602
+ ** not exist because commands are not being hooked), return TH_OK because we
1603
+ ** do not want to skip processing essential web pages unless the called
1604
+ ** command (i.e. "webpage_hook") explicitly forbids this by successfully
1605
+ ** returning TH_BREAK or TH_CONTINUE.
1606
+ */
1607
+ if( g.thTrace ){
1608
+ Th_Trace("[webpage_hook {%h}] => %h<br />\n", zName,
1609
+ Th_ReturnCodeName(rc, 0));
1610
+ }
1611
+ /*
1612
+ ** Does our call to Th_FossilInit() result in opening a database? If so,
1613
+ ** clean it up now. This is very important because some commands do not
1614
+ ** expect the repository and/or the configuration ("user") database to be
1615
+ ** open prior to their own code doing so.
1616
+ */
1617
+ if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1);
1618
+ return (rc != TH_ERROR) ? rc : TH_OK;
1619
+}
1620
+
1621
+/*
1622
+** This function is called by Fossil just after processing a web page.
1623
+** Returning a value other than TH_OK from this function (i.e. via an
1624
+** evaluated script raising an error or calling [break]/[continue]) may
1625
+** cause an error message to be displayed to the remote user.
1626
+** Currently, TH1 error messages generated by this function are ignored.
1627
+*/
1628
+int Th_WebpageNotify(
1629
+ const char *zName,
1630
+ char cmdFlags
1631
+){
1632
+ int rc = TH_OK;
1633
+ if( !Th_AreHooksEnabled() ) return rc;
1634
+ Th_FossilInit(TH_INIT_HOOK);
1635
+ Th_Store("web_name", zName);
1636
+ Th_StoreList("web_args", g.argv, g.argc);
1637
+ Th_StoreInt("web_flags", cmdFlags);
1638
+ rc = Th_Eval(g.interp, 0, "webpage_notify", -1);
1639
+ if( g.thTrace ){
1640
+ Th_Trace("[webpage_notify {%h}] => %h<br />\n", zName,
1641
+ Th_ReturnCodeName(rc, 0));
1642
+ }
1643
+ /*
1644
+ ** Does our call to Th_FossilInit() result in opening a database? If so,
1645
+ ** clean it up now. This is very important because some commands do not
1646
+ ** expect the repository and/or the configuration ("user") database to be
1647
+ ** open prior to their own code doing so.
1648
+ */
1649
+ if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1);
1650
+ return rc;
1651
+}
1652
+#endif
1653
+
11981654
/*
11991655
** The z[] input contains text mixed with TH1 scripts.
12001656
** The TH1 scripts are contained within <th1>...</th1>.
12011657
** TH1 variables are $aaa or $<aaa>. The first form of
12021658
** variable is literal. The second is run through htmlize
@@ -1259,12 +1715,16 @@
12591715
12601716
/*
12611717
** COMMAND: test-th-render
12621718
*/
12631719
void test_th_render(void){
1720
+ int forceCgi, fullHttpReply;
12641721
Blob in;
12651722
Th_InitTraceLog();
1723
+ forceCgi = find_option("th-force-cgi", 0, 0)!=0;
1724
+ fullHttpReply = find_option("th-full-http", 0, 0)!=0;
1725
+ if( forceCgi ) Th_ForceCgi(fullHttpReply);
12661726
if( find_option("th-open-config", 0, 0)!=0 ){
12671727
Th_OpenConfig(1);
12681728
}
12691729
if( g.argc<3 ){
12701730
usage("FILE");
@@ -1271,19 +1731,24 @@
12711731
}
12721732
blob_zero(&in);
12731733
blob_read_from_file(&in, g.argv[2]);
12741734
Th_Render(blob_str(&in));
12751735
Th_PrintTraceLog();
1736
+ if( forceCgi ) cgi_reply();
12761737
}
12771738
12781739
/*
12791740
** COMMAND: test-th-eval
12801741
*/
12811742
void test_th_eval(void){
12821743
int rc;
12831744
const char *zRc;
1745
+ int forceCgi, fullHttpReply;
12841746
Th_InitTraceLog();
1747
+ forceCgi = find_option("th-force-cgi", 0, 0)!=0;
1748
+ fullHttpReply = find_option("th-full-http", 0, 0)!=0;
1749
+ if( forceCgi ) Th_ForceCgi(fullHttpReply);
12851750
if( find_option("th-open-config", 0, 0)!=0 ){
12861751
Th_OpenConfig(1);
12871752
}
12881753
if( g.argc!=3 ){
12891754
usage("script");
@@ -1291,6 +1756,45 @@
12911756
Th_FossilInit(TH_INIT_DEFAULT);
12921757
rc = Th_Eval(g.interp, 0, g.argv[2], -1);
12931758
zRc = Th_ReturnCodeName(rc, 1);
12941759
fossil_print("%s%s%s\n", zRc, zRc ? ": " : "", Th_GetResult(g.interp, 0));
12951760
Th_PrintTraceLog();
1761
+ if( forceCgi ) cgi_reply();
1762
+}
1763
+
1764
+#ifdef FOSSIL_ENABLE_TH1_HOOKS
1765
+/*
1766
+** COMMAND: test-th-hook
1767
+*/
1768
+void test_th_hook(void){
1769
+ int rc = TH_OK;
1770
+ int nResult = 0;
1771
+ char *zResult;
1772
+ int forceCgi, fullHttpReply;
1773
+ Th_InitTraceLog();
1774
+ forceCgi = find_option("th-force-cgi", 0, 0)!=0;
1775
+ fullHttpReply = find_option("th-full-http", 0, 0)!=0;
1776
+ if( forceCgi ) Th_ForceCgi(fullHttpReply);
1777
+ if( g.argc<5 ){
1778
+ usage("TYPE NAME FLAGS");
1779
+ }
1780
+ if( fossil_stricmp(g.argv[2], "cmdhook")==0 ){
1781
+ rc = Th_CommandHook(g.argv[3], (char)atoi(g.argv[4]));
1782
+ }else if( fossil_stricmp(g.argv[2], "cmdnotify")==0 ){
1783
+ rc = Th_CommandNotify(g.argv[3], (char)atoi(g.argv[4]));
1784
+ }else if( fossil_stricmp(g.argv[2], "webhook")==0 ){
1785
+ rc = Th_WebpageHook(g.argv[3], (char)atoi(g.argv[4]));
1786
+ }else if( fossil_stricmp(g.argv[2], "webnotify")==0 ){
1787
+ rc = Th_WebpageNotify(g.argv[3], (char)atoi(g.argv[4]));
1788
+ }else{
1789
+ fossil_fatal("Unknown TH1 hook %s\n", g.argv[2]);
1790
+ }
1791
+ zResult = (char*)Th_GetResult(g.interp, &nResult);
1792
+ sendText("RESULT (", -1, 0);
1793
+ sendText(Th_ReturnCodeName(rc, 0), -1, 0);
1794
+ sendText("): ", -1, 0);
1795
+ sendText(zResult, nResult, 0);
1796
+ sendText("\n", -1, 0);
1797
+ Th_PrintTraceLog();
1798
+ if( forceCgi ) cgi_reply();
12961799
}
1800
+#endif
12971801
--- src/th_main.c
+++ src/th_main.c
@@ -30,13 +30,41 @@
30 #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */
31 #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */
32 #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */
33 #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */
34 #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */
 
35 #define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36 #endif
37
 
 
 
 
 
 
 
38 /*
39 ** Global variable counting the number of outstanding calls to malloc()
40 ** made by the th1 implementation. This is used to catch memory leaks
41 ** in the interpreter. Obviously, it also means th1 is not threadsafe.
42 */
@@ -74,10 +102,22 @@
74 va_list ap;
75 va_start(ap, zFormat);
76 blob_vappendf(&g.thLog, zFormat, ap);
77 va_end(ap);
78 }
 
 
 
 
 
 
 
 
 
 
 
 
79
80 /*
81 ** Checks if the TH1 trace log needs to be enabled. If so, prepares
82 ** it for use.
83 */
@@ -327,10 +367,11 @@
327 **
328 ** Return true if the fossil binary has the given compile-time feature
329 ** enabled. The set of features includes:
330 **
331 ** "ssl" = FOSSIL_ENABLE_SSL
 
332 ** "tcl" = FOSSIL_ENABLE_TCL
333 ** "useTclStubs" = USE_TCL_STUBS
334 ** "tclStubs" = FOSSIL_ENABLE_TCL_STUBS
335 ** "tclPrivateStubs" = FOSSIL_ENABLE_TCL_PRIVATE_STUBS
336 ** "json" = FOSSIL_ENABLE_JSON
@@ -355,10 +396,15 @@
355 }
356 #if defined(FOSSIL_ENABLE_SSL)
357 else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){
358 rc = 1;
359 }
 
 
 
 
 
360 #endif
361 #if defined(FOSSIL_ENABLE_TCL)
362 else if( 0 == fossil_strnicmp( zArg, "tcl\0", 4 ) ){
363 rc = 1;
364 }
@@ -572,10 +618,175 @@
572 if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0);
573 }
574 Th_SetResult(interp, g.zRepositoryName, -1);
575 return TH_OK;
576 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
577
578 #ifdef _WIN32
579 # include <windows.h>
580 #else
581 # include <sys/time.h>
@@ -979,14 +1190,43 @@
979 ** attempts to try to find the repository and open it.
980 */
981 void Th_OpenConfig(
982 int openRepository
983 ){
984 if( openRepository ){
985 db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
986 }
987 db_open_config(0);
 
 
 
988 }
989
990 /*
991 ** Make sure the interpreter has been initialized. Initialize it if
992 ** it has not been already.
@@ -1004,14 +1244,16 @@
1004 const char *zName;
1005 Th_CommandProc xProc;
1006 void *pContext;
1007 } aCommand[] = {
1008 {"anycap", anycapCmd, 0},
 
1009 {"combobox", comboboxCmd, 0},
1010 {"date", dateCmd, 0},
1011 {"decorate", wikiCmd, (void*)&aFlags[2]},
1012 {"enable_output", enableOutputCmd, 0},
 
1013 {"httpize", httpizeCmd, 0},
1014 {"hascap", hascapCmd, 0},
1015 {"hasfeature", hasfeatureCmd, 0},
1016 {"html", putsCmd, (void*)&aFlags[0]},
1017 {"htmlize", htmlizeCmd, 0},
@@ -1019,13 +1261,18 @@
1019 {"linecount", linecntCmd, 0},
1020 {"puts", putsCmd, (void*)&aFlags[1]},
1021 {"query", queryCmd, 0},
1022 {"randhex", randhexCmd, 0},
1023 {"regexp", regexpCmd, 0},
 
1024 {"repository", repositoryCmd, 0},
 
1025 {"setting", settingCmd, 0},
 
 
1026 {"tclReady", tclReadyCmd, 0},
 
1027 {"stime", stimeCmd, 0},
1028 {"utime", utimeCmd, 0},
1029 {"wiki", wikiCmd, (void*)&aFlags[0]},
1030 {0, 0, 0}
1031 };
@@ -1081,10 +1328,12 @@
1081 if( g.thTrace ){
1082 Th_Trace("th1-setup {%h} => %h<br />\n", g.th1Setup,
1083 Th_ReturnCodeName(rc, 0));
1084 }
1085 }
 
 
1086 }
1087
1088 /*
1089 ** Store a string value in a variable in the interpreter.
1090 */
@@ -1095,10 +1344,34 @@
1095 Th_Trace("set %h {%h}<br />\n", zName, zValue);
1096 }
1097 Th_SetVar(g.interp, zName, -1, zValue, strlen(zValue));
1098 }
1099 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1100
1101 /*
1102 ** Store an integer value in a variable in the interpreter.
1103 */
1104 void Th_StoreInt(const char *zName, int iValue){
@@ -1193,10 +1466,193 @@
1193 i += 2;
1194 }
1195 return i;
1196 }
1197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1198 /*
1199 ** The z[] input contains text mixed with TH1 scripts.
1200 ** The TH1 scripts are contained within <th1>...</th1>.
1201 ** TH1 variables are $aaa or $<aaa>. The first form of
1202 ** variable is literal. The second is run through htmlize
@@ -1259,12 +1715,16 @@
1259
1260 /*
1261 ** COMMAND: test-th-render
1262 */
1263 void test_th_render(void){
 
1264 Blob in;
1265 Th_InitTraceLog();
 
 
 
1266 if( find_option("th-open-config", 0, 0)!=0 ){
1267 Th_OpenConfig(1);
1268 }
1269 if( g.argc<3 ){
1270 usage("FILE");
@@ -1271,19 +1731,24 @@
1271 }
1272 blob_zero(&in);
1273 blob_read_from_file(&in, g.argv[2]);
1274 Th_Render(blob_str(&in));
1275 Th_PrintTraceLog();
 
1276 }
1277
1278 /*
1279 ** COMMAND: test-th-eval
1280 */
1281 void test_th_eval(void){
1282 int rc;
1283 const char *zRc;
 
1284 Th_InitTraceLog();
 
 
 
1285 if( find_option("th-open-config", 0, 0)!=0 ){
1286 Th_OpenConfig(1);
1287 }
1288 if( g.argc!=3 ){
1289 usage("script");
@@ -1291,6 +1756,45 @@
1291 Th_FossilInit(TH_INIT_DEFAULT);
1292 rc = Th_Eval(g.interp, 0, g.argv[2], -1);
1293 zRc = Th_ReturnCodeName(rc, 1);
1294 fossil_print("%s%s%s\n", zRc, zRc ? ": " : "", Th_GetResult(g.interp, 0));
1295 Th_PrintTraceLog();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1296 }
 
1297
--- src/th_main.c
+++ src/th_main.c
@@ -30,13 +30,41 @@
30 #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */
31 #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */
32 #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */
33 #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */
34 #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */
35 #define TH_INIT_MASK ((u32)0x0000000F) /* All possible init flags. */
36 #define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */
37 #define TH_INIT_HOOK (TH_INIT_NEED_CONFIG | TH_INIT_FORCE_SETUP)
38 #endif
39
40 /*
41 ** Flags set by functions in this file to keep track of integration state
42 ** information. These flags should not be used outside of this file.
43 */
44 #define TH_STATE_CONFIG ((u32)0x00000010) /* We opened the config. */
45 #define TH_STATE_REPOSITORY ((u32)0x00000020) /* We opened the repository. */
46 #define TH_STATE_MASK ((u32)0x00000030) /* All possible state flags. */
47
48 #ifdef FOSSIL_ENABLE_TH1_HOOKS
49 /*
50 ** These are the "well-known" TH1 error messages that occur when no hook is
51 ** registered to be called prior to executing a command or processing a web
52 ** page, respectively. If one of these errors is seen, it will not be sent
53 ** or displayed to the remote user or local interactive user, respectively.
54 */
55 #define NO_COMMAND_HOOK_ERROR "no such command: command_hook"
56 #define NO_WEBPAGE_HOOK_ERROR "no such command: webpage_hook"
57 #endif
58
59 /*
60 ** These macros are used within this file to detect if the repository and
61 ** configuration ("user") database are currently open.
62 */
63 #define Th_IsRepositoryOpen() (g.repositoryOpen)
64 #define Th_IsConfigOpen() (g.zConfigDbName!=0)
65
66 /*
67 ** Global variable counting the number of outstanding calls to malloc()
68 ** made by the th1 implementation. This is used to catch memory leaks
69 ** in the interpreter. Obviously, it also means th1 is not threadsafe.
70 */
@@ -74,10 +102,22 @@
102 va_list ap;
103 va_start(ap, zFormat);
104 blob_vappendf(&g.thLog, zFormat, ap);
105 va_end(ap);
106 }
107
108 /*
109 ** Forces input and output to be done via the CGI subsystem.
110 */
111 void Th_ForceCgi(int fullHttpReply){
112 g.httpOut = stdout;
113 g.httpIn = stdin;
114 fossil_binary_mode(g.httpOut);
115 fossil_binary_mode(g.httpIn);
116 g.cgiOutput = 1;
117 g.fullHttpReply = fullHttpReply;
118 }
119
120 /*
121 ** Checks if the TH1 trace log needs to be enabled. If so, prepares
122 ** it for use.
123 */
@@ -327,10 +367,11 @@
367 **
368 ** Return true if the fossil binary has the given compile-time feature
369 ** enabled. The set of features includes:
370 **
371 ** "ssl" = FOSSIL_ENABLE_SSL
372 ** "th1Hooks" = FOSSIL_ENABLE_TH1_HOOKS
373 ** "tcl" = FOSSIL_ENABLE_TCL
374 ** "useTclStubs" = USE_TCL_STUBS
375 ** "tclStubs" = FOSSIL_ENABLE_TCL_STUBS
376 ** "tclPrivateStubs" = FOSSIL_ENABLE_TCL_PRIVATE_STUBS
377 ** "json" = FOSSIL_ENABLE_JSON
@@ -355,10 +396,15 @@
396 }
397 #if defined(FOSSIL_ENABLE_SSL)
398 else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){
399 rc = 1;
400 }
401 #endif
402 #if defined(FOSSIL_ENABLE_TH1_HOOKS)
403 else if( 0 == fossil_strnicmp( zArg, "th1Hooks\0", 9 ) ){
404 rc = 1;
405 }
406 #endif
407 #if defined(FOSSIL_ENABLE_TCL)
408 else if( 0 == fossil_strnicmp( zArg, "tcl\0", 4 ) ){
409 rc = 1;
410 }
@@ -572,10 +618,175 @@
618 if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0);
619 }
620 Th_SetResult(interp, g.zRepositoryName, -1);
621 return TH_OK;
622 }
623
624 /*
625 ** TH1 command: checkout ?BOOLEAN?
626 **
627 ** Return the fully qualified directory name of the current checkout or an
628 ** empty string if it is not available. Optionally, it will attempt to find
629 ** the current checkout, opening the configuration ("user") database and the
630 ** repository as necessary, if the boolean argument is non-zero.
631 */
632 static int checkoutCmd(
633 Th_Interp *interp,
634 void *p,
635 int argc,
636 const char **argv,
637 int *argl
638 ){
639 if( argc!=1 && argc!=2 ){
640 return Th_WrongNumArgs(interp, "checkout ?BOOLEAN?");
641 }
642 if( argc==2 ){
643 int openCheckout = 0;
644 if( Th_ToInt(interp, argv[1], argl[1], &openCheckout) ){
645 return TH_ERROR;
646 }
647 if( openCheckout ) db_open_local(0);
648 }
649 Th_SetResult(interp, g.zLocalRoot, -1);
650 return TH_OK;
651 }
652
653 /*
654 ** TH1 command: trace STRING
655 **
656 ** Generate a TH1 trace message if debugging is enabled.
657 */
658 static int traceCmd(
659 Th_Interp *interp,
660 void *p,
661 int argc,
662 const char **argv,
663 int *argl
664 ){
665 if( argc!=2 ){
666 return Th_WrongNumArgs(interp, "trace STRING");
667 }
668 if( g.thTrace ){
669 Th_Trace("%s", argv[1]);
670 }
671 Th_SetResult(interp, 0, 0);
672 return TH_OK;
673 }
674
675 /*
676 ** TH1 command: getParameter NAME ?DEFAULT?
677 **
678 ** Return the value of the specified query parameter or the specified default
679 ** value when there is no matching query parameter.
680 */
681 static int getParameterCmd(
682 Th_Interp *interp,
683 void *p,
684 int argc,
685 const char **argv,
686 int *argl
687 ){
688 const char *zDefault = 0;
689 if( argc!=2 && argc!=3 ){
690 return Th_WrongNumArgs(interp, "getParameter NAME ?DEFAULT?");
691 }
692 if( argc==3 ){
693 zDefault = argv[2];
694 }
695 Th_SetResult(interp, cgi_parameter(argv[1], zDefault), -1);
696 return TH_OK;
697 }
698
699 /*
700 ** TH1 command: setParameter NAME VALUE
701 **
702 ** Sets the value of the specified query parameter.
703 */
704 static int setParameterCmd(
705 Th_Interp *interp,
706 void *p,
707 int argc,
708 const char **argv,
709 int *argl
710 ){
711 if( argc!=3 ){
712 return Th_WrongNumArgs(interp, "setParameter NAME VALUE");
713 }
714 cgi_replace_parameter(mprintf("%s", argv[1]), mprintf("%s", argv[2]));
715 return TH_OK;
716 }
717
718 /*
719 ** TH1 command: render STRING
720 **
721 ** Renders the template and writes the results.
722 */
723 static int renderCmd(
724 Th_Interp *interp,
725 void *p,
726 int argc,
727 const char **argv,
728 int *argl
729 ){
730 int rc;
731 if( argc!=2 ){
732 return Th_WrongNumArgs(interp, "render STRING");
733 }
734 rc = Th_Render(argv[1]);
735 Th_SetResult(interp, 0, 0);
736 return rc;
737 }
738
739 /*
740 ** TH1 command: styleHeader TITLE
741 **
742 ** Render the configured style header.
743 */
744 static int styleHeaderCmd(
745 Th_Interp *interp,
746 void *p,
747 int argc,
748 const char **argv,
749 int *argl
750 ){
751 if( argc!=2 ){
752 return Th_WrongNumArgs(interp, "styleHeader TITLE");
753 }
754 if( Th_IsRepositoryOpen() ){
755 style_header("%s", argv[1]);
756 Th_SetResult(interp, 0, 0);
757 return TH_OK;
758 }else{
759 Th_SetResult(interp, "repository unavailable", -1);
760 return TH_ERROR;
761 }
762 }
763
764 /*
765 ** TH1 command: styleFooter
766 **
767 ** Render the configured style footer.
768 */
769 static int styleFooterCmd(
770 Th_Interp *interp,
771 void *p,
772 int argc,
773 const char **argv,
774 int *argl
775 ){
776 if( argc!=1 ){
777 return Th_WrongNumArgs(interp, "styleFooter");
778 }
779 if( Th_IsRepositoryOpen() ){
780 style_footer();
781 Th_SetResult(interp, 0, 0);
782 return TH_OK;
783 }else{
784 Th_SetResult(interp, "repository unavailable", -1);
785 return TH_ERROR;
786 }
787 }
788
789 #ifdef _WIN32
790 # include <windows.h>
791 #else
792 # include <sys/time.h>
@@ -979,14 +1190,43 @@
1190 ** attempts to try to find the repository and open it.
1191 */
1192 void Th_OpenConfig(
1193 int openRepository
1194 ){
1195 if( openRepository && !Th_IsRepositoryOpen() ){
1196 db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0);
1197 if( Th_IsRepositoryOpen() ){
1198 g.th1Flags |= TH_STATE_REPOSITORY;
1199 }else{
1200 g.th1Flags &= ~TH_STATE_REPOSITORY;
1201 }
1202 }
1203 if( !Th_IsConfigOpen() ){
1204 db_open_config(0);
1205 if( Th_IsConfigOpen() ){
1206 g.th1Flags |= TH_STATE_CONFIG;
1207 }else{
1208 g.th1Flags &= ~TH_STATE_CONFIG;
1209 }
1210 }
1211 }
1212
1213 /*
1214 ** Attempts to close the configuration ("user") database. Optionally, also
1215 ** attempts to close the repository.
1216 */
1217 void Th_CloseConfig(
1218 int closeRepository
1219 ){
1220 if( g.th1Flags & TH_STATE_CONFIG ){
1221 db_close_config();
1222 g.th1Flags &= ~TH_STATE_CONFIG;
1223 }
1224 if( closeRepository && (g.th1Flags & TH_STATE_REPOSITORY) ){
1225 db_close(1);
1226 g.th1Flags &= ~TH_STATE_REPOSITORY;
1227 }
1228 }
1229
1230 /*
1231 ** Make sure the interpreter has been initialized. Initialize it if
1232 ** it has not been already.
@@ -1004,14 +1244,16 @@
1244 const char *zName;
1245 Th_CommandProc xProc;
1246 void *pContext;
1247 } aCommand[] = {
1248 {"anycap", anycapCmd, 0},
1249 {"checkout", checkoutCmd, 0},
1250 {"combobox", comboboxCmd, 0},
1251 {"date", dateCmd, 0},
1252 {"decorate", wikiCmd, (void*)&aFlags[2]},
1253 {"enable_output", enableOutputCmd, 0},
1254 {"getParameter", getParameterCmd, 0},
1255 {"httpize", httpizeCmd, 0},
1256 {"hascap", hascapCmd, 0},
1257 {"hasfeature", hasfeatureCmd, 0},
1258 {"html", putsCmd, (void*)&aFlags[0]},
1259 {"htmlize", htmlizeCmd, 0},
@@ -1019,13 +1261,18 @@
1261 {"linecount", linecntCmd, 0},
1262 {"puts", putsCmd, (void*)&aFlags[1]},
1263 {"query", queryCmd, 0},
1264 {"randhex", randhexCmd, 0},
1265 {"regexp", regexpCmd, 0},
1266 {"render", renderCmd, 0},
1267 {"repository", repositoryCmd, 0},
1268 {"setParameter", setParameterCmd, 0},
1269 {"setting", settingCmd, 0},
1270 {"styleHeader", styleHeaderCmd, 0},
1271 {"styleFooter", styleFooterCmd, 0},
1272 {"tclReady", tclReadyCmd, 0},
1273 {"trace", traceCmd, 0},
1274 {"stime", stimeCmd, 0},
1275 {"utime", utimeCmd, 0},
1276 {"wiki", wikiCmd, (void*)&aFlags[0]},
1277 {0, 0, 0}
1278 };
@@ -1081,10 +1328,12 @@
1328 if( g.thTrace ){
1329 Th_Trace("th1-setup {%h} => %h<br />\n", g.th1Setup,
1330 Th_ReturnCodeName(rc, 0));
1331 }
1332 }
1333 g.th1Flags &= ~TH_INIT_MASK;
1334 g.th1Flags |= (flags & TH_INIT_MASK);
1335 }
1336
1337 /*
1338 ** Store a string value in a variable in the interpreter.
1339 */
@@ -1095,10 +1344,34 @@
1344 Th_Trace("set %h {%h}<br />\n", zName, zValue);
1345 }
1346 Th_SetVar(g.interp, zName, -1, zValue, strlen(zValue));
1347 }
1348 }
1349
1350 /*
1351 ** Store a list value in a variable in the interpreter.
1352 */
1353 void Th_StoreList(
1354 const char *zName,
1355 char **pzList,
1356 int nList
1357 ){
1358 Th_FossilInit(TH_INIT_DEFAULT);
1359 if( pzList ){
1360 char *zValue = 0;
1361 int nValue = 0;
1362 int i;
1363 for(i=0; i<nList; i++){
1364 Th_ListAppend(g.interp, &zValue, &nValue, pzList[i], -1);
1365 }
1366 if( g.thTrace ){
1367 Th_Trace("set %h {%h}<br />\n", zName, zValue);
1368 }
1369 Th_SetVar(g.interp, zName, -1, zValue, nValue);
1370 Th_Free(g.interp, zValue);
1371 }
1372 }
1373
1374 /*
1375 ** Store an integer value in a variable in the interpreter.
1376 */
1377 void Th_StoreInt(const char *zName, int iValue){
@@ -1193,10 +1466,193 @@
1466 i += 2;
1467 }
1468 return i;
1469 }
1470
1471 #ifdef FOSSIL_ENABLE_TH1_HOOKS
1472 /*
1473 ** This function determines if TH1 hooks are enabled for the repository. It
1474 ** may be necessary to open the repository and/or the configuration ("user")
1475 ** database from within this function. Before this function returns, any
1476 ** database opened will be closed again. This is very important because some
1477 ** commands do not expect the repository and/or the configuration ("user")
1478 ** database to be open prior to their own code doing so.
1479 */
1480 int Th_AreHooksEnabled(void){
1481 int rc;
1482 if( fossil_getenv("TH1_ENABLE_HOOKS")!=0 ){
1483 return 1;
1484 }
1485 Th_OpenConfig(1);
1486 rc = db_get_boolean("th1-hooks", 0);
1487 Th_CloseConfig(1);
1488 return rc;
1489 }
1490
1491 /*
1492 ** This function is called by Fossil just prior to dispatching a command.
1493 ** Returning a value other than TH_OK from this function (i.e. via an
1494 ** evaluated script raising an error or calling [break]/[continue]) will
1495 ** cause the actual command execution to be skipped.
1496 */
1497 int Th_CommandHook(
1498 const char *zName,
1499 char cmdFlags
1500 ){
1501 int rc = TH_OK;
1502 if( !Th_AreHooksEnabled() ) return rc;
1503 Th_FossilInit(TH_INIT_HOOK);
1504 Th_Store("cmd_name", zName);
1505 Th_StoreList("cmd_args", g.argv, g.argc);
1506 Th_StoreInt("cmd_flags", cmdFlags);
1507 rc = Th_Eval(g.interp, 0, "command_hook", -1);
1508 if( rc==TH_ERROR ){
1509 int nResult = 0;
1510 char *zResult = (char*)Th_GetResult(g.interp, &nResult);
1511 /*
1512 ** Make sure that the TH1 script error was not caused by a "missing"
1513 ** command hook handler as that is not actually an error condition.
1514 */
1515 if( memcmp(zResult, NO_COMMAND_HOOK_ERROR, nResult)!=0 ){
1516 sendError(zResult, nResult, 0);
1517 }
1518 }
1519 /*
1520 ** If the script returned TH_ERROR (e.g. the "command_hook" TH1 command does
1521 ** not exist because commands are not being hooked), return TH_OK because we
1522 ** do not want to skip executing essential commands unless the called command
1523 ** (i.e. "command_hook") explicitly forbids this by successfully returning
1524 ** TH_BREAK or TH_CONTINUE.
1525 */
1526 if( g.thTrace ){
1527 Th_Trace("[command_hook {%h}] => %h<br />\n", zName,
1528 Th_ReturnCodeName(rc, 0));
1529 }
1530 /*
1531 ** Does our call to Th_FossilInit() result in opening a database? If so,
1532 ** clean it up now. This is very important because some commands do not
1533 ** expect the repository and/or the configuration ("user") database to be
1534 ** open prior to their own code doing so.
1535 */
1536 if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1);
1537 return (rc != TH_ERROR) ? rc : TH_OK;
1538 }
1539
1540 /*
1541 ** This function is called by Fossil just after dispatching a command.
1542 ** Returning a value other than TH_OK from this function (i.e. via an
1543 ** evaluated script raising an error or calling [break]/[continue]) may
1544 ** cause an error message to be displayed to the local interactive user.
1545 ** Currently, TH1 error messages generated by this function are ignored.
1546 */
1547 int Th_CommandNotify(
1548 const char *zName,
1549 char cmdFlags
1550 ){
1551 int rc = TH_OK;
1552 if( !Th_AreHooksEnabled() ) return rc;
1553 Th_FossilInit(TH_INIT_HOOK);
1554 Th_Store("cmd_name", zName);
1555 Th_StoreList("cmd_args", g.argv, g.argc);
1556 Th_StoreInt("cmd_flags", cmdFlags);
1557 rc = Th_Eval(g.interp, 0, "command_notify", -1);
1558 if( g.thTrace ){
1559 Th_Trace("[command_notify {%h}] => %h<br />\n", zName,
1560 Th_ReturnCodeName(rc, 0));
1561 }
1562 /*
1563 ** Does our call to Th_FossilInit() result in opening a database? If so,
1564 ** clean it up now. This is very important because some commands do not
1565 ** expect the repository and/or the configuration ("user") database to be
1566 ** open prior to their own code doing so.
1567 */
1568 if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1);
1569 return rc;
1570 }
1571
1572 /*
1573 ** This function is called by Fossil just prior to processing a web page.
1574 ** Returning a value other than TH_OK from this function (i.e. via an
1575 ** evaluated script raising an error or calling [break]/[continue]) will
1576 ** cause the actual web page processing to be skipped.
1577 */
1578 int Th_WebpageHook(
1579 const char *zName,
1580 char cmdFlags
1581 ){
1582 int rc = TH_OK;
1583 if( !Th_AreHooksEnabled() ) return rc;
1584 Th_FossilInit(TH_INIT_HOOK);
1585 Th_Store("web_name", zName);
1586 Th_StoreList("web_args", g.argv, g.argc);
1587 Th_StoreInt("web_flags", cmdFlags);
1588 rc = Th_Eval(g.interp, 0, "webpage_hook", -1);
1589 if( rc==TH_ERROR ){
1590 int nResult = 0;
1591 char *zResult = (char*)Th_GetResult(g.interp, &nResult);
1592 /*
1593 ** Make sure that the TH1 script error was not caused by a "missing"
1594 ** webpage hook handler as that is not actually an error condition.
1595 */
1596 if( memcmp(zResult, NO_WEBPAGE_HOOK_ERROR, nResult)!=0 ){
1597 sendError(zResult, nResult, 1);
1598 }
1599 }
1600 /*
1601 ** If the script returned TH_ERROR (e.g. the "webpage_hook" TH1 command does
1602 ** not exist because commands are not being hooked), return TH_OK because we
1603 ** do not want to skip processing essential web pages unless the called
1604 ** command (i.e. "webpage_hook") explicitly forbids this by successfully
1605 ** returning TH_BREAK or TH_CONTINUE.
1606 */
1607 if( g.thTrace ){
1608 Th_Trace("[webpage_hook {%h}] => %h<br />\n", zName,
1609 Th_ReturnCodeName(rc, 0));
1610 }
1611 /*
1612 ** Does our call to Th_FossilInit() result in opening a database? If so,
1613 ** clean it up now. This is very important because some commands do not
1614 ** expect the repository and/or the configuration ("user") database to be
1615 ** open prior to their own code doing so.
1616 */
1617 if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1);
1618 return (rc != TH_ERROR) ? rc : TH_OK;
1619 }
1620
1621 /*
1622 ** This function is called by Fossil just after processing a web page.
1623 ** Returning a value other than TH_OK from this function (i.e. via an
1624 ** evaluated script raising an error or calling [break]/[continue]) may
1625 ** cause an error message to be displayed to the remote user.
1626 ** Currently, TH1 error messages generated by this function are ignored.
1627 */
1628 int Th_WebpageNotify(
1629 const char *zName,
1630 char cmdFlags
1631 ){
1632 int rc = TH_OK;
1633 if( !Th_AreHooksEnabled() ) return rc;
1634 Th_FossilInit(TH_INIT_HOOK);
1635 Th_Store("web_name", zName);
1636 Th_StoreList("web_args", g.argv, g.argc);
1637 Th_StoreInt("web_flags", cmdFlags);
1638 rc = Th_Eval(g.interp, 0, "webpage_notify", -1);
1639 if( g.thTrace ){
1640 Th_Trace("[webpage_notify {%h}] => %h<br />\n", zName,
1641 Th_ReturnCodeName(rc, 0));
1642 }
1643 /*
1644 ** Does our call to Th_FossilInit() result in opening a database? If so,
1645 ** clean it up now. This is very important because some commands do not
1646 ** expect the repository and/or the configuration ("user") database to be
1647 ** open prior to their own code doing so.
1648 */
1649 if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1);
1650 return rc;
1651 }
1652 #endif
1653
1654 /*
1655 ** The z[] input contains text mixed with TH1 scripts.
1656 ** The TH1 scripts are contained within <th1>...</th1>.
1657 ** TH1 variables are $aaa or $<aaa>. The first form of
1658 ** variable is literal. The second is run through htmlize
@@ -1259,12 +1715,16 @@
1715
1716 /*
1717 ** COMMAND: test-th-render
1718 */
1719 void test_th_render(void){
1720 int forceCgi, fullHttpReply;
1721 Blob in;
1722 Th_InitTraceLog();
1723 forceCgi = find_option("th-force-cgi", 0, 0)!=0;
1724 fullHttpReply = find_option("th-full-http", 0, 0)!=0;
1725 if( forceCgi ) Th_ForceCgi(fullHttpReply);
1726 if( find_option("th-open-config", 0, 0)!=0 ){
1727 Th_OpenConfig(1);
1728 }
1729 if( g.argc<3 ){
1730 usage("FILE");
@@ -1271,19 +1731,24 @@
1731 }
1732 blob_zero(&in);
1733 blob_read_from_file(&in, g.argv[2]);
1734 Th_Render(blob_str(&in));
1735 Th_PrintTraceLog();
1736 if( forceCgi ) cgi_reply();
1737 }
1738
1739 /*
1740 ** COMMAND: test-th-eval
1741 */
1742 void test_th_eval(void){
1743 int rc;
1744 const char *zRc;
1745 int forceCgi, fullHttpReply;
1746 Th_InitTraceLog();
1747 forceCgi = find_option("th-force-cgi", 0, 0)!=0;
1748 fullHttpReply = find_option("th-full-http", 0, 0)!=0;
1749 if( forceCgi ) Th_ForceCgi(fullHttpReply);
1750 if( find_option("th-open-config", 0, 0)!=0 ){
1751 Th_OpenConfig(1);
1752 }
1753 if( g.argc!=3 ){
1754 usage("script");
@@ -1291,6 +1756,45 @@
1756 Th_FossilInit(TH_INIT_DEFAULT);
1757 rc = Th_Eval(g.interp, 0, g.argv[2], -1);
1758 zRc = Th_ReturnCodeName(rc, 1);
1759 fossil_print("%s%s%s\n", zRc, zRc ? ": " : "", Th_GetResult(g.interp, 0));
1760 Th_PrintTraceLog();
1761 if( forceCgi ) cgi_reply();
1762 }
1763
1764 #ifdef FOSSIL_ENABLE_TH1_HOOKS
1765 /*
1766 ** COMMAND: test-th-hook
1767 */
1768 void test_th_hook(void){
1769 int rc = TH_OK;
1770 int nResult = 0;
1771 char *zResult;
1772 int forceCgi, fullHttpReply;
1773 Th_InitTraceLog();
1774 forceCgi = find_option("th-force-cgi", 0, 0)!=0;
1775 fullHttpReply = find_option("th-full-http", 0, 0)!=0;
1776 if( forceCgi ) Th_ForceCgi(fullHttpReply);
1777 if( g.argc<5 ){
1778 usage("TYPE NAME FLAGS");
1779 }
1780 if( fossil_stricmp(g.argv[2], "cmdhook")==0 ){
1781 rc = Th_CommandHook(g.argv[3], (char)atoi(g.argv[4]));
1782 }else if( fossil_stricmp(g.argv[2], "cmdnotify")==0 ){
1783 rc = Th_CommandNotify(g.argv[3], (char)atoi(g.argv[4]));
1784 }else if( fossil_stricmp(g.argv[2], "webhook")==0 ){
1785 rc = Th_WebpageHook(g.argv[3], (char)atoi(g.argv[4]));
1786 }else if( fossil_stricmp(g.argv[2], "webnotify")==0 ){
1787 rc = Th_WebpageNotify(g.argv[3], (char)atoi(g.argv[4]));
1788 }else{
1789 fossil_fatal("Unknown TH1 hook %s\n", g.argv[2]);
1790 }
1791 zResult = (char*)Th_GetResult(g.interp, &nResult);
1792 sendText("RESULT (", -1, 0);
1793 sendText(Th_ReturnCodeName(rc, 0), -1, 0);
1794 sendText("): ", -1, 0);
1795 sendText(zResult, nResult, 0);
1796 sendText("\n", -1, 0);
1797 Th_PrintTraceLog();
1798 if( forceCgi ) cgi_reply();
1799 }
1800 #endif
1801
+1 -7
--- src/timeline.c
+++ src/timeline.c
@@ -1780,17 +1780,11 @@
17801780
width = atoi(zWidth);
17811781
if( (width!=0) && (width<=20) ){
17821782
fossil_fatal("-W|--width value must be >20 or 0");
17831783
}
17841784
}else{
1785
-#ifdef TIOCGWINSZ
1786
- struct winsize w;
1787
- ioctl(0, TIOCGWINSZ, &w);
1788
- width = w.ws_col;
1789
-#else
1790
- width = 79;
1791
-#endif
1785
+ width = -1;
17921786
}
17931787
zOffset = find_option("offset",0,1);
17941788
iOffset = zOffset ? atoi(zOffset) : 0;
17951789
if( g.argc>=4 ){
17961790
k = strlen(g.argv[2]);
17971791
--- src/timeline.c
+++ src/timeline.c
@@ -1780,17 +1780,11 @@
1780 width = atoi(zWidth);
1781 if( (width!=0) && (width<=20) ){
1782 fossil_fatal("-W|--width value must be >20 or 0");
1783 }
1784 }else{
1785 #ifdef TIOCGWINSZ
1786 struct winsize w;
1787 ioctl(0, TIOCGWINSZ, &w);
1788 width = w.ws_col;
1789 #else
1790 width = 79;
1791 #endif
1792 }
1793 zOffset = find_option("offset",0,1);
1794 iOffset = zOffset ? atoi(zOffset) : 0;
1795 if( g.argc>=4 ){
1796 k = strlen(g.argv[2]);
1797
--- src/timeline.c
+++ src/timeline.c
@@ -1780,17 +1780,11 @@
1780 width = atoi(zWidth);
1781 if( (width!=0) && (width<=20) ){
1782 fossil_fatal("-W|--width value must be >20 or 0");
1783 }
1784 }else{
1785 width = -1;
 
 
 
 
 
 
1786 }
1787 zOffset = find_option("offset",0,1);
1788 iOffset = zOffset ? atoi(zOffset) : 0;
1789 if( g.argc>=4 ){
1790 k = strlen(g.argv[2]);
1791
+1 -7
--- src/timeline.c
+++ src/timeline.c
@@ -1780,17 +1780,11 @@
17801780
width = atoi(zWidth);
17811781
if( (width!=0) && (width<=20) ){
17821782
fossil_fatal("-W|--width value must be >20 or 0");
17831783
}
17841784
}else{
1785
-#ifdef TIOCGWINSZ
1786
- struct winsize w;
1787
- ioctl(0, TIOCGWINSZ, &w);
1788
- width = w.ws_col;
1789
-#else
1790
- width = 79;
1791
-#endif
1785
+ width = -1;
17921786
}
17931787
zOffset = find_option("offset",0,1);
17941788
iOffset = zOffset ? atoi(zOffset) : 0;
17951789
if( g.argc>=4 ){
17961790
k = strlen(g.argv[2]);
17971791
--- src/timeline.c
+++ src/timeline.c
@@ -1780,17 +1780,11 @@
1780 width = atoi(zWidth);
1781 if( (width!=0) && (width<=20) ){
1782 fossil_fatal("-W|--width value must be >20 or 0");
1783 }
1784 }else{
1785 #ifdef TIOCGWINSZ
1786 struct winsize w;
1787 ioctl(0, TIOCGWINSZ, &w);
1788 width = w.ws_col;
1789 #else
1790 width = 79;
1791 #endif
1792 }
1793 zOffset = find_option("offset",0,1);
1794 iOffset = zOffset ? atoi(zOffset) : 0;
1795 if( g.argc>=4 ){
1796 k = strlen(g.argv[2]);
1797
--- src/timeline.c
+++ src/timeline.c
@@ -1780,17 +1780,11 @@
1780 width = atoi(zWidth);
1781 if( (width!=0) && (width<=20) ){
1782 fossil_fatal("-W|--width value must be >20 or 0");
1783 }
1784 }else{
1785 width = -1;
 
 
 
 
 
 
1786 }
1787 zOffset = find_option("offset",0,1);
1788 iOffset = zOffset ? atoi(zOffset) : 0;
1789 if( g.argc>=4 ){
1790 k = strlen(g.argv[2]);
1791
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -1264,11 +1264,11 @@
12641264
fossil_print(" Change ");
12651265
}
12661266
fossil_print("%h: ",z);
12671267
if( blob_size(&val)>50 || contains_newline(&val)) {
12681268
fossil_print("\n ",blob_str(&val));
1269
- comment_print(blob_str(&val),4,79);
1269
+ comment_print(blob_str(&val),4,-1);
12701270
}else{
12711271
fossil_print("%s\n",blob_str(&val));
12721272
}
12731273
blob_reset(&val);
12741274
}
12751275
--- src/tkt.c
+++ src/tkt.c
@@ -1264,11 +1264,11 @@
1264 fossil_print(" Change ");
1265 }
1266 fossil_print("%h: ",z);
1267 if( blob_size(&val)>50 || contains_newline(&val)) {
1268 fossil_print("\n ",blob_str(&val));
1269 comment_print(blob_str(&val),4,79);
1270 }else{
1271 fossil_print("%s\n",blob_str(&val));
1272 }
1273 blob_reset(&val);
1274 }
1275
--- src/tkt.c
+++ src/tkt.c
@@ -1264,11 +1264,11 @@
1264 fossil_print(" Change ");
1265 }
1266 fossil_print("%h: ",z);
1267 if( blob_size(&val)>50 || contains_newline(&val)) {
1268 fossil_print("\n ",blob_str(&val));
1269 comment_print(blob_str(&val),4,-1);
1270 }else{
1271 fossil_print("%s\n",blob_str(&val));
1272 }
1273 blob_reset(&val);
1274 }
1275
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -1264,11 +1264,11 @@
12641264
fossil_print(" Change ");
12651265
}
12661266
fossil_print("%h: ",z);
12671267
if( blob_size(&val)>50 || contains_newline(&val)) {
12681268
fossil_print("\n ",blob_str(&val));
1269
- comment_print(blob_str(&val),4,79);
1269
+ comment_print(blob_str(&val),4,-1);
12701270
}else{
12711271
fossil_print("%s\n",blob_str(&val));
12721272
}
12731273
blob_reset(&val);
12741274
}
12751275
--- src/tkt.c
+++ src/tkt.c
@@ -1264,11 +1264,11 @@
1264 fossil_print(" Change ");
1265 }
1266 fossil_print("%h: ",z);
1267 if( blob_size(&val)>50 || contains_newline(&val)) {
1268 fossil_print("\n ",blob_str(&val));
1269 comment_print(blob_str(&val),4,79);
1270 }else{
1271 fossil_print("%s\n",blob_str(&val));
1272 }
1273 blob_reset(&val);
1274 }
1275
--- src/tkt.c
+++ src/tkt.c
@@ -1264,11 +1264,11 @@
1264 fossil_print(" Change ");
1265 }
1266 fossil_print("%h: ",z);
1267 if( blob_size(&val)>50 || contains_newline(&val)) {
1268 fossil_print("\n ",blob_str(&val));
1269 comment_print(blob_str(&val),4,-1);
1270 }else{
1271 fossil_print("%s\n",blob_str(&val));
1272 }
1273 blob_reset(&val);
1274 }
1275
+1 -1
--- src/update.c
+++ src/update.c
@@ -130,11 +130,11 @@
130130
capture_case_sensitive_option();
131131
db_must_be_within_tree();
132132
vid = db_lget_int("checkout", 0);
133133
user_select();
134134
if( !dryRunFlag && !internalUpdate ){
135
- if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag,
135
+ if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag,
136136
db_get_int("autosync-tries", 1)) ){
137137
fossil_fatal("Cannot proceed with update");
138138
}
139139
}
140140
141141
--- src/update.c
+++ src/update.c
@@ -130,11 +130,11 @@
130 capture_case_sensitive_option();
131 db_must_be_within_tree();
132 vid = db_lget_int("checkout", 0);
133 user_select();
134 if( !dryRunFlag && !internalUpdate ){
135 if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag,
136 db_get_int("autosync-tries", 1)) ){
137 fossil_fatal("Cannot proceed with update");
138 }
139 }
140
141
--- src/update.c
+++ src/update.c
@@ -130,11 +130,11 @@
130 capture_case_sensitive_option();
131 db_must_be_within_tree();
132 vid = db_lget_int("checkout", 0);
133 user_select();
134 if( !dryRunFlag && !internalUpdate ){
135 if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag,
136 db_get_int("autosync-tries", 1)) ){
137 fossil_fatal("Cannot proceed with update");
138 }
139 }
140
141
+1 -1
--- src/winhttp.c
+++ src/winhttp.c
@@ -674,11 +674,11 @@
674674
const char *zPassword = find_option("password", "W", 1);
675675
const char *zPort = find_option("port", "P", 1);
676676
const char *zNotFound = find_option("notfound", 0, 1);
677677
const char *zFileGlob = find_option("files", 0, 1);
678678
const char *zLocalAuth = find_option("localauth", 0, 0);
679
- const char *zRepository = find_option("repository", "R", 1);
679
+ const char *zRepository = find_repository_option();
680680
int useSCGI = find_option("scgi", 0, 0)!=0;
681681
Blob binPath;
682682
683683
verify_all_options();
684684
if( g.argc==4 ){
685685
686686
ADDED test/subdir-b/readme.txt
687687
ADDED test/subdir/one/two/three/four/five/six/readme.txt
--- src/winhttp.c
+++ src/winhttp.c
@@ -674,11 +674,11 @@
674 const char *zPassword = find_option("password", "W", 1);
675 const char *zPort = find_option("port", "P", 1);
676 const char *zNotFound = find_option("notfound", 0, 1);
677 const char *zFileGlob = find_option("files", 0, 1);
678 const char *zLocalAuth = find_option("localauth", 0, 0);
679 const char *zRepository = find_option("repository", "R", 1);
680 int useSCGI = find_option("scgi", 0, 0)!=0;
681 Blob binPath;
682
683 verify_all_options();
684 if( g.argc==4 ){
685
686 DDED test/subdir-b/readme.txt
687 DDED test/subdir/one/two/three/four/five/six/readme.txt
--- src/winhttp.c
+++ src/winhttp.c
@@ -674,11 +674,11 @@
674 const char *zPassword = find_option("password", "W", 1);
675 const char *zPort = find_option("port", "P", 1);
676 const char *zNotFound = find_option("notfound", 0, 1);
677 const char *zFileGlob = find_option("files", 0, 1);
678 const char *zLocalAuth = find_option("localauth", 0, 0);
679 const char *zRepository = find_repository_option();
680 int useSCGI = find_option("scgi", 0, 0)!=0;
681 Blob binPath;
682
683 verify_all_options();
684 if( g.argc==4 ){
685
686 DDED test/subdir-b/readme.txt
687 DDED test/subdir/one/two/three/four/five/six/readme.txt
--- a/test/subdir-b/readme.txt
+++ b/test/subdir-b/readme.txt
@@ -0,0 +1,3 @@
1
+This file exists in order to create the "subdir-b" subdirectory. There is
2
+exists sibling directory "subdir" that is a prefix of this subdirectory.
3
+This file exists for self-testing.
--- a/test/subdir-b/readme.txt
+++ b/test/subdir-b/readme.txt
@@ -0,0 +1,3 @@
 
 
 
--- a/test/subdir-b/readme.txt
+++ b/test/subdir-b/readme.txt
@@ -0,0 +1,3 @@
1 This file exists in order to create the "subdir-b" subdirectory. There is
2 exists sibling directory "subdir" that is a prefix of this subdirectory.
3 This file exists for self-testing.
--- a/test/subdir/one/two/three/four/five/six/readme.txt
+++ b/test/subdir/one/two/three/four/five/six/readme.txt
@@ -0,0 +1,2 @@
1
+This file exists in order to provide Fossil with a test case of a file
2
+that is deeply nested below many subdirectories.
--- a/test/subdir/one/two/three/four/five/six/readme.txt
+++ b/test/subdir/one/two/three/four/five/six/readme.txt
@@ -0,0 +1,2 @@
 
 
--- a/test/subdir/one/two/three/four/five/six/readme.txt
+++ b/test/subdir/one/two/three/four/five/six/readme.txt
@@ -0,0 +1,2 @@
1 This file exists in order to provide Fossil with a test case of a file
2 that is deeply nested below many subdirectories.
--- test/tester.tcl
+++ test/tester.tcl
@@ -181,10 +181,69 @@
181181
# Append all arguments into a single value and then returns it.
182182
#
183183
proc appendArgs {args} {
184184
eval append result $args
185185
}
186
+
187
+# Return the name of the versioned settings file containing the TH1
188
+# setup script.
189
+#
190
+proc getTh1SetupFileName {} {
191
+ #
192
+ # NOTE: This uses the "testdir" global variable provided by the
193
+ # test suite; alternatively, the root of the source tree
194
+ # could be obtained directly from Fossil.
195
+ #
196
+ return [file normalize [file join [file dirname $::testdir] \
197
+ .fossil-settings th1-setup]]
198
+}
199
+
200
+# Return the saved name of the versioned settings file containing
201
+# the TH1 setup script.
202
+#
203
+proc getSavedTh1SetupFileName {} {
204
+ return [appendArgs [getTh1SetupFileName] . [pid]]
205
+}
206
+
207
+# Sets the TH1 setup script to the one provided. Prior to calling
208
+# this, the [saveTh1SetupFile] procedure should be called in order to
209
+# preserve the existing TH1 setup script. Prior to completing the test,
210
+# the [restoreTh1SetupFile] procedure should be called to restore the
211
+# original TH1 setup script.
212
+#
213
+proc writeTh1SetupFile { data } {
214
+ return [write_file [getTh1SetupFileName] $data]
215
+}
216
+
217
+# Saves the TH1 setup script file by renaming it, based on the current
218
+# process ID.
219
+#
220
+proc saveTh1SetupFile {} {
221
+ set oldFileName [getTh1SetupFileName]
222
+ if {[file exists $oldFileName]} then {
223
+ set newFileName [getSavedTh1SetupFileName]
224
+ catch {file delete $newFileName}
225
+ file rename $oldFileName $newFileName
226
+ }
227
+}
228
+
229
+# Restores the original TH1 setup script file by renaming it back, based
230
+# on the current process ID.
231
+#
232
+proc restoreTh1SetupFile {} {
233
+ set oldFileName [getSavedTh1SetupFileName]
234
+ set newFileName [getTh1SetupFileName]
235
+ if {[file exists $oldFileName]} then {
236
+ catch {file delete $newFileName}
237
+ file rename $oldFileName $newFileName
238
+ } else {
239
+ #
240
+ # NOTE: There was no TH1 setup script file, delete the test one.
241
+ #
242
+ file delete $newFileName
243
+ }
244
+}
186245
187246
# Perform a test
188247
#
189248
set test_count 0
190249
proc test {name expr} {
191250
192251
ADDED test/th1-hooks-input.txt
193252
ADDED test/th1-hooks.test
--- test/tester.tcl
+++ test/tester.tcl
@@ -181,10 +181,69 @@
181 # Append all arguments into a single value and then returns it.
182 #
183 proc appendArgs {args} {
184 eval append result $args
185 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
187 # Perform a test
188 #
189 set test_count 0
190 proc test {name expr} {
191
192 DDED test/th1-hooks-input.txt
193 DDED test/th1-hooks.test
--- test/tester.tcl
+++ test/tester.tcl
@@ -181,10 +181,69 @@
181 # Append all arguments into a single value and then returns it.
182 #
183 proc appendArgs {args} {
184 eval append result $args
185 }
186
187 # Return the name of the versioned settings file containing the TH1
188 # setup script.
189 #
190 proc getTh1SetupFileName {} {
191 #
192 # NOTE: This uses the "testdir" global variable provided by the
193 # test suite; alternatively, the root of the source tree
194 # could be obtained directly from Fossil.
195 #
196 return [file normalize [file join [file dirname $::testdir] \
197 .fossil-settings th1-setup]]
198 }
199
200 # Return the saved name of the versioned settings file containing
201 # the TH1 setup script.
202 #
203 proc getSavedTh1SetupFileName {} {
204 return [appendArgs [getTh1SetupFileName] . [pid]]
205 }
206
207 # Sets the TH1 setup script to the one provided. Prior to calling
208 # this, the [saveTh1SetupFile] procedure should be called in order to
209 # preserve the existing TH1 setup script. Prior to completing the test,
210 # the [restoreTh1SetupFile] procedure should be called to restore the
211 # original TH1 setup script.
212 #
213 proc writeTh1SetupFile { data } {
214 return [write_file [getTh1SetupFileName] $data]
215 }
216
217 # Saves the TH1 setup script file by renaming it, based on the current
218 # process ID.
219 #
220 proc saveTh1SetupFile {} {
221 set oldFileName [getTh1SetupFileName]
222 if {[file exists $oldFileName]} then {
223 set newFileName [getSavedTh1SetupFileName]
224 catch {file delete $newFileName}
225 file rename $oldFileName $newFileName
226 }
227 }
228
229 # Restores the original TH1 setup script file by renaming it back, based
230 # on the current process ID.
231 #
232 proc restoreTh1SetupFile {} {
233 set oldFileName [getSavedTh1SetupFileName]
234 set newFileName [getTh1SetupFileName]
235 if {[file exists $oldFileName]} then {
236 catch {file delete $newFileName}
237 file rename $oldFileName $newFileName
238 } else {
239 #
240 # NOTE: There was no TH1 setup script file, delete the test one.
241 #
242 file delete $newFileName
243 }
244 }
245
246 # Perform a test
247 #
248 set test_count 0
249 proc test {name expr} {
250
251 DDED test/th1-hooks-input.txt
252 DDED test/th1-hooks.test
--- a/test/th1-hooks-input.txt
+++ b/test/th1-hooks-input.txt
@@ -0,0 +1,4 @@
1
+GET ${url} HTTP/1.1
2
+Host: localhost
3
+User-Agent: Fossil
4
+
--- a/test/th1-hooks-input.txt
+++ b/test/th1-hooks-input.txt
@@ -0,0 +1,4 @@
 
 
 
 
--- a/test/th1-hooks-input.txt
+++ b/test/th1-hooks-input.txt
@@ -0,0 +1,4 @@
1 GET ${url} HTTP/1.1
2 Host: localhost
3 User-Agent: Fossil
4
--- a/test/th1-hooks.test
+++ b/test/th1-hooks.test
@@ -0,0 +1,88 @@
1
+#
2
+# Co#
3
+# Copyright (c) 2011 D. Richard Hipp
4
+#
5
+# This program is free software; you can redistribute i1 D. Richard Hipp
6
+#
7
+# This program is free software; you can redistribute it and/or
8
+# modify it under the terms of the Simplified BSD License (also
9
+# known as the "2-Clause License" or "FreeBSD License".)
10
+#
11
+# This program is distributed in the hope that it will be useful,
12
+# but without any warranty; without even the implied warranty of
13
+# merchantability or fitness for a particular purpose.
14
+#
15
+# Author contact information:
16
+# [email protected]
17
+# http://www.hwaci.com/drh/
18
+#
19
+#################################$::RESULT
20
+# TH1 Hooks
21
+#
22
+
23
+fossil test-th-eval then "hasfeature th1Hooks"
24
+
25
+if {[normalize_result] ne "1"} {
26
+ ; compiled with TH1 hooks support."
27
+ test_cleanup_then_return
28
+}
29
+
30
+#########################
31
+
32
+set env(TH1_ustom"} {
33
+ append {$::cmd_name eq "test4"} {
34
+ then{<title>Fossilproc fossil_th1_hook_http { repository url } {
35
+ set suffix [appendArgs [pid] - [getSeqNo] - [clmpPath [appendArgs test-hmpPath [appendArgs test-http-ou set data [subst [read_fil]]
36
+
37
+ write_file $inFileName $data
38
+ fossil http $inFileName $outFileName 127.0.0.1 $repository
39
+ set result [expr {[file exists $outFileName] ? [read_file $outFileName] : ""}]
40
+
41
+ if {1} then {
42
+ catch {file delete $inFileName}
43
+ catch {frepository }
44
+
45
+ return $result
46
+}
47
+
48
+proc normat
49
+}
50
+
51
+proc normalize_result {} {
52
+ return [string map [list \r\n \n] [string trim $::RESULT]]
53
+}
54
+
55
+proc first_data_line {}\n] 0]
56
+}
57
+
58
+proc second_data_line {}\n] 1]
59
+}
60
+
61
+proc third_data_line {}\n] 2]
62
+}
63
+
64
+proc lD. Richard Hipp
65
+#\nlit \n] end-1]
66
+}
67
+
68
+proc \rlit \n] end-1]
69
+}
70
+
71
+proc \rlit \n] end-1]
72
+}
73
+
74
+proc \rlit \n] end-1]
75
+}
76
+
77
+proc \rlit \n] end-1]
78
+}
79
+
80
+proc \r\n] end-1]
81
+if {$::cmd_argsc {} {
82
+ return [lindex [split \n] end-1]
83
+}
84
+
85
+proc #
86
+# Co#
87
+# Copyright (c)ght (c) 2lit \n] end-1RESULT]] eq
88
+timeline}}2b {[secondtimeline}}2cthird_data_line]]}2dest3est4web-hooks-1b {[regexp
--- a/test/th1-hooks.test
+++ b/test/th1-hooks.test
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/test/th1-hooks.test
+++ b/test/th1-hooks.test
@@ -0,0 +1,88 @@
1 #
2 # Co#
3 # Copyright (c) 2011 D. Richard Hipp
4 #
5 # This program is free software; you can redistribute i1 D. Richard Hipp
6 #
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the Simplified BSD License (also
9 # known as the "2-Clause License" or "FreeBSD License".)
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but without any warranty; without even the implied warranty of
13 # merchantability or fitness for a particular purpose.
14 #
15 # Author contact information:
16 # [email protected]
17 # http://www.hwaci.com/drh/
18 #
19 #################################$::RESULT
20 # TH1 Hooks
21 #
22
23 fossil test-th-eval then "hasfeature th1Hooks"
24
25 if {[normalize_result] ne "1"} {
26 ; compiled with TH1 hooks support."
27 test_cleanup_then_return
28 }
29
30 #########################
31
32 set env(TH1_ustom"} {
33 append {$::cmd_name eq "test4"} {
34 then{<title>Fossilproc fossil_th1_hook_http { repository url } {
35 set suffix [appendArgs [pid] - [getSeqNo] - [clmpPath [appendArgs test-hmpPath [appendArgs test-http-ou set data [subst [read_fil]]
36
37 write_file $inFileName $data
38 fossil http $inFileName $outFileName 127.0.0.1 $repository
39 set result [expr {[file exists $outFileName] ? [read_file $outFileName] : ""}]
40
41 if {1} then {
42 catch {file delete $inFileName}
43 catch {frepository }
44
45 return $result
46 }
47
48 proc normat
49 }
50
51 proc normalize_result {} {
52 return [string map [list \r\n \n] [string trim $::RESULT]]
53 }
54
55 proc first_data_line {}\n] 0]
56 }
57
58 proc second_data_line {}\n] 1]
59 }
60
61 proc third_data_line {}\n] 2]
62 }
63
64 proc lD. Richard Hipp
65 #\nlit \n] end-1]
66 }
67
68 proc \rlit \n] end-1]
69 }
70
71 proc \rlit \n] end-1]
72 }
73
74 proc \rlit \n] end-1]
75 }
76
77 proc \rlit \n] end-1]
78 }
79
80 proc \r\n] end-1]
81 if {$::cmd_argsc {} {
82 return [lindex [split \n] end-1]
83 }
84
85 proc #
86 # Co#
87 # Copyright (c)ght (c) 2lit \n] end-1RESULT]] eq
88 timeline}}2b {[secondtimeline}}2cthird_data_line]]}2dest3est4web-hooks-1b {[regexp
+158
--- test/th1.test
+++ test/th1.test
@@ -16,10 +16,15 @@
1616
############################################################################
1717
#
1818
# TH1 Commands
1919
#
2020
21
+fossil test-th-eval --th-open-config "setting th1-hooks"
22
+set th1Hooks [expr {$RESULT eq "1"}]
23
+
24
+###############################################################################
25
+
2126
fossil test-th-eval --th-open-config "setting abc"
2227
test th1-setting-1 {$RESULT eq ""}
2328
2429
###############################################################################
2530
@@ -472,5 +477,158 @@
472477
473478
###############################################################################
474479
475480
fossil test-th-eval "expr 0+0b"
476481
test th1-expr-35 {$RESULT eq {TH_ERROR: expected number, got: "0b"}}
482
+
483
+###############################################################################
484
+
485
+fossil test-th-eval "checkout 1"; # NOTE: Assumes running "in tree".
486
+test th1-checkout-1 {[string length $RESULT] > 0}
487
+
488
+###############################################################################
489
+
490
+fossil test-th-eval "checkout"; # NOTE: Assumes running "in tree".
491
+test th1-checkout-2 {[string length $RESULT] > 0}
492
+
493
+###############################################################################
494
+
495
+set savedPwd [pwd]; cd /
496
+fossil test-th-eval "checkout 1"
497
+cd $savedPwd; unset savedPwd
498
+test th1-checkout-3 {[string length $RESULT] == 0}
499
+
500
+###############################################################################
501
+
502
+set savedPwd [pwd]; cd /
503
+fossil test-th-eval "checkout"
504
+cd $savedPwd; unset savedPwd
505
+test th1-checkout-4 {[string length $RESULT] == 0}
506
+
507
+###############################################################################
508
+
509
+fossil test-th-eval "render {}"
510
+test th1-render-1 {$RESULT eq {}}
511
+
512
+###############################################################################
513
+
514
+fossil test-th-eval "render {$<x> before <th1>set x 123</th1> after $<x> }"
515
+test th1-render-2 {$RESULT eq {no such variable: x before after 123 }}
516
+
517
+###############################################################################
518
+
519
+fossil test-th-eval "trace {}"
520
+test th1-trace-1 {$RESULT eq {}}
521
+
522
+###############################################################################
523
+
524
+fossil test-th-eval --th-trace "trace {}"
525
+if {$th1Hooks} {
526
+ test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \
527
+{------------------ BEGIN TRACE LOG ------------------
528
+
529
+------------------- END TRACE LOG -------------------}}
530
+} else {
531
+ test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \
532
+ {------------------ BEGIN TRACE LOG ------------------
533
+th1-setup {} => TH_OK<br />
534
+
535
+------------------- END TRACE LOG -------------------}}
536
+}
537
+
538
+###############################################################################
539
+
540
+fossil test-th-eval "trace {this is a trace message.}"
541
+test th1-trace-3 {$RESULT eq {}}
542
+
543
+###############################################################################
544
+
545
+fossil test-th-eval --th-trace "trace {this is a trace message.}"
546
+if {$th1Hooks} {
547
+ test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \
548
+ {------------------ BEGIN TRACE LOG ------------------
549
+this is a trace message.
550
+------------------- END TRACE LOG -------------------}}
551
+} else {
552
+ test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \
553
+ {------------------ BEGIN TRACE LOG ------------------
554
+th1-setup {} => TH_OK<br />
555
+this is a trace message.
556
+------------------- END TRACE LOG -------------------}}
557
+}
558
+
559
+###############################################################################
560
+
561
+fossil test-th-eval "styleHeader {Page Title Here}"
562
+test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
563
+
564
+###############################################################################
565
+
566
+fossil test-th-eval --th-open-config "styleHeader {Page Title Here}"
567
+test th1-header-2 {[regexp -- {<title>Fossil: Page Title Here</title>} $RESULT]}
568
+
569
+###############################################################################
570
+
571
+fossil test-th-eval "styleFooter"
572
+test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}}
573
+
574
+###############################################################################
575
+
576
+fossil test-th-eval --th-open-config "styleFooter"
577
+test th1-footer-2 {$RESULT eq {}}
578
+
579
+###############################################################################
580
+
581
+fossil test-th-eval --th-open-config --th-force-cgi "styleHeader {}; styleFooter"
582
+test th1-footer-3 {[regexp -- {</body></html>} $RESULT]}
583
+
584
+###############################################################################
585
+
586
+fossil test-th-eval "getParameter"
587
+test th1-get-parameter-1 {$RESULT eq \
588
+ {TH_ERROR: wrong # args: should be "getParameter NAME ?DEFAULT?"}}
589
+
590
+###############################################################################
591
+
592
+fossil test-th-eval "getParameter test1"
593
+test th1-get-parameter-2 {$RESULT eq {}}
594
+
595
+###############################################################################
596
+
597
+fossil test-th-eval "getParameter test1 defValue1"
598
+test th1-get-parameter-3 {$RESULT eq {defValue1}}
599
+
600
+###############################################################################
601
+
602
+fossil test-th-eval "setParameter"
603
+test th1-set-parameter-1 {$RESULT eq \
604
+ {TH_ERROR: wrong # args: should be "setParameter NAME VALUE"}}
605
+
606
+###############################################################################
607
+
608
+fossil test-th-eval "setParameter test1 value1; getParameter test1"
609
+test th1-set-parameter-2 {$RESULT eq {value1}}
610
+
611
+###############################################################################
612
+
613
+fossil test-th-eval "setParameter test2 value2; getParameter test1"
614
+test th1-set-parameter-3 {$RESULT eq {}}
615
+
616
+###############################################################################
617
+
618
+fossil test-th-eval "setParameter test3 value3; getParameter test3"
619
+test th1-set-parameter-4 {$RESULT eq {value3}}
620
+
621
+###############################################################################
622
+
623
+fossil test-th-eval "setParameter test3 value3; getParameter test3 defValue3"
624
+test th1-set-parameter-5 {$RESULT eq {value3}}
625
+
626
+###############################################################################
627
+
628
+fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4"
629
+test th1-set-parameter-6 {$RESULT eq {value5}}
630
+
631
+###############################################################################
632
+
633
+fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4 defValue4"
634
+test th1-set-parameter-7 {$RESULT eq {value5}}
477635
--- test/th1.test
+++ test/th1.test
@@ -16,10 +16,15 @@
16 ############################################################################
17 #
18 # TH1 Commands
19 #
20
 
 
 
 
 
21 fossil test-th-eval --th-open-config "setting abc"
22 test th1-setting-1 {$RESULT eq ""}
23
24 ###############################################################################
25
@@ -472,5 +477,158 @@
472
473 ###############################################################################
474
475 fossil test-th-eval "expr 0+0b"
476 test th1-expr-35 {$RESULT eq {TH_ERROR: expected number, got: "0b"}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
--- test/th1.test
+++ test/th1.test
@@ -16,10 +16,15 @@
16 ############################################################################
17 #
18 # TH1 Commands
19 #
20
21 fossil test-th-eval --th-open-config "setting th1-hooks"
22 set th1Hooks [expr {$RESULT eq "1"}]
23
24 ###############################################################################
25
26 fossil test-th-eval --th-open-config "setting abc"
27 test th1-setting-1 {$RESULT eq ""}
28
29 ###############################################################################
30
@@ -472,5 +477,158 @@
477
478 ###############################################################################
479
480 fossil test-th-eval "expr 0+0b"
481 test th1-expr-35 {$RESULT eq {TH_ERROR: expected number, got: "0b"}}
482
483 ###############################################################################
484
485 fossil test-th-eval "checkout 1"; # NOTE: Assumes running "in tree".
486 test th1-checkout-1 {[string length $RESULT] > 0}
487
488 ###############################################################################
489
490 fossil test-th-eval "checkout"; # NOTE: Assumes running "in tree".
491 test th1-checkout-2 {[string length $RESULT] > 0}
492
493 ###############################################################################
494
495 set savedPwd [pwd]; cd /
496 fossil test-th-eval "checkout 1"
497 cd $savedPwd; unset savedPwd
498 test th1-checkout-3 {[string length $RESULT] == 0}
499
500 ###############################################################################
501
502 set savedPwd [pwd]; cd /
503 fossil test-th-eval "checkout"
504 cd $savedPwd; unset savedPwd
505 test th1-checkout-4 {[string length $RESULT] == 0}
506
507 ###############################################################################
508
509 fossil test-th-eval "render {}"
510 test th1-render-1 {$RESULT eq {}}
511
512 ###############################################################################
513
514 fossil test-th-eval "render {$<x> before <th1>set x 123</th1> after $<x> }"
515 test th1-render-2 {$RESULT eq {no such variable: x before after 123 }}
516
517 ###############################################################################
518
519 fossil test-th-eval "trace {}"
520 test th1-trace-1 {$RESULT eq {}}
521
522 ###############################################################################
523
524 fossil test-th-eval --th-trace "trace {}"
525 if {$th1Hooks} {
526 test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \
527 {------------------ BEGIN TRACE LOG ------------------
528
529 ------------------- END TRACE LOG -------------------}}
530 } else {
531 test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \
532 {------------------ BEGIN TRACE LOG ------------------
533 th1-setup {} => TH_OK<br />
534
535 ------------------- END TRACE LOG -------------------}}
536 }
537
538 ###############################################################################
539
540 fossil test-th-eval "trace {this is a trace message.}"
541 test th1-trace-3 {$RESULT eq {}}
542
543 ###############################################################################
544
545 fossil test-th-eval --th-trace "trace {this is a trace message.}"
546 if {$th1Hooks} {
547 test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \
548 {------------------ BEGIN TRACE LOG ------------------
549 this is a trace message.
550 ------------------- END TRACE LOG -------------------}}
551 } else {
552 test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \
553 {------------------ BEGIN TRACE LOG ------------------
554 th1-setup {} => TH_OK<br />
555 this is a trace message.
556 ------------------- END TRACE LOG -------------------}}
557 }
558
559 ###############################################################################
560
561 fossil test-th-eval "styleHeader {Page Title Here}"
562 test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
563
564 ###############################################################################
565
566 fossil test-th-eval --th-open-config "styleHeader {Page Title Here}"
567 test th1-header-2 {[regexp -- {<title>Fossil: Page Title Here</title>} $RESULT]}
568
569 ###############################################################################
570
571 fossil test-th-eval "styleFooter"
572 test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}}
573
574 ###############################################################################
575
576 fossil test-th-eval --th-open-config "styleFooter"
577 test th1-footer-2 {$RESULT eq {}}
578
579 ###############################################################################
580
581 fossil test-th-eval --th-open-config --th-force-cgi "styleHeader {}; styleFooter"
582 test th1-footer-3 {[regexp -- {</body></html>} $RESULT]}
583
584 ###############################################################################
585
586 fossil test-th-eval "getParameter"
587 test th1-get-parameter-1 {$RESULT eq \
588 {TH_ERROR: wrong # args: should be "getParameter NAME ?DEFAULT?"}}
589
590 ###############################################################################
591
592 fossil test-th-eval "getParameter test1"
593 test th1-get-parameter-2 {$RESULT eq {}}
594
595 ###############################################################################
596
597 fossil test-th-eval "getParameter test1 defValue1"
598 test th1-get-parameter-3 {$RESULT eq {defValue1}}
599
600 ###############################################################################
601
602 fossil test-th-eval "setParameter"
603 test th1-set-parameter-1 {$RESULT eq \
604 {TH_ERROR: wrong # args: should be "setParameter NAME VALUE"}}
605
606 ###############################################################################
607
608 fossil test-th-eval "setParameter test1 value1; getParameter test1"
609 test th1-set-parameter-2 {$RESULT eq {value1}}
610
611 ###############################################################################
612
613 fossil test-th-eval "setParameter test2 value2; getParameter test1"
614 test th1-set-parameter-3 {$RESULT eq {}}
615
616 ###############################################################################
617
618 fossil test-th-eval "setParameter test3 value3; getParameter test3"
619 test th1-set-parameter-4 {$RESULT eq {value3}}
620
621 ###############################################################################
622
623 fossil test-th-eval "setParameter test3 value3; getParameter test3 defValue3"
624 test th1-set-parameter-5 {$RESULT eq {value3}}
625
626 ###############################################################################
627
628 fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4"
629 test th1-set-parameter-6 {$RESULT eq {value5}}
630
631 ###############################################################################
632
633 fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4 defValue4"
634 test th1-set-parameter-7 {$RESULT eq {value5}}
635
+10 -4
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -28,13 +28,13 @@
2828
2929
SQLITE_OPTIONS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS
3030
3131
SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
3232
33
-SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
33
+SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c fusefs_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
3434
35
-OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
35
+OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\fusefs$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
3636
3737
3838
RC=$(DMDIR)\bin\rcc
3939
RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
4040
@@ -48,11 +48,11 @@
4848
4949
$(OBJDIR)\fossil.res: $B\win\fossil.rc
5050
$(RC) $(RCFLAGS) -o$@ $**
5151
5252
$(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
53
- +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
53
+ +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo fusefs glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
5454
+echo fossil >> $@
5555
+echo fossil >> $@
5656
+echo $(LIBS) >> $@
5757
+echo. >> $@
5858
+echo fossil >> $@
@@ -292,10 +292,16 @@
292292
$(OBJDIR)\finfo$O : finfo_.c finfo.h
293293
$(TCC) -o$@ -c finfo_.c
294294
295295
finfo_.c : $(SRCDIR)\finfo.c
296296
+translate$E $** > $@
297
+
298
+$(OBJDIR)\fusefs$O : fusefs_.c fusefs.h
299
+ $(TCC) -o$@ -c fusefs_.c
300
+
301
+fusefs_.c : $(SRCDIR)\fusefs.c
302
+ +translate$E $** > $@
297303
298304
$(OBJDIR)\glob$O : glob_.c glob.h
299305
$(TCC) -o$@ -c glob_.c
300306
301307
glob_.c : $(SRCDIR)\glob.c
@@ -774,7 +780,7 @@
774780
775781
zip_.c : $(SRCDIR)\zip.c
776782
+translate$E $** > $@
777783
778784
headers: makeheaders$E page_index.h VERSION.h
779
- +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
785
+ +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h fusefs_.c:fusefs.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
780786
@copy /Y nul: headers
781787
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -28,13 +28,13 @@
28
29 SQLITE_OPTIONS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS
30
31 SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
38 RC=$(DMDIR)\bin\rcc
39 RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
40
@@ -48,11 +48,11 @@
48
49 $(OBJDIR)\fossil.res: $B\win\fossil.rc
50 $(RC) $(RCFLAGS) -o$@ $**
51
52 $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
53 +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
54 +echo fossil >> $@
55 +echo fossil >> $@
56 +echo $(LIBS) >> $@
57 +echo. >> $@
58 +echo fossil >> $@
@@ -292,10 +292,16 @@
292 $(OBJDIR)\finfo$O : finfo_.c finfo.h
293 $(TCC) -o$@ -c finfo_.c
294
295 finfo_.c : $(SRCDIR)\finfo.c
296 +translate$E $** > $@
 
 
 
 
 
 
297
298 $(OBJDIR)\glob$O : glob_.c glob.h
299 $(TCC) -o$@ -c glob_.c
300
301 glob_.c : $(SRCDIR)\glob.c
@@ -774,7 +780,7 @@
774
775 zip_.c : $(SRCDIR)\zip.c
776 +translate$E $** > $@
777
778 headers: makeheaders$E page_index.h VERSION.h
779 +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
780 @copy /Y nul: headers
781
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -28,13 +28,13 @@
28
29 SQLITE_OPTIONS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS
30
31 SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c fusefs_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\fusefs$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
38 RC=$(DMDIR)\bin\rcc
39 RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__
40
@@ -48,11 +48,11 @@
48
49 $(OBJDIR)\fossil.res: $B\win\fossil.rc
50 $(RC) $(RCFLAGS) -o$@ $**
51
52 $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res
53 +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo fusefs glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@
54 +echo fossil >> $@
55 +echo fossil >> $@
56 +echo $(LIBS) >> $@
57 +echo. >> $@
58 +echo fossil >> $@
@@ -292,10 +292,16 @@
292 $(OBJDIR)\finfo$O : finfo_.c finfo.h
293 $(TCC) -o$@ -c finfo_.c
294
295 finfo_.c : $(SRCDIR)\finfo.c
296 +translate$E $** > $@
297
298 $(OBJDIR)\fusefs$O : fusefs_.c fusefs.h
299 $(TCC) -o$@ -c fusefs_.c
300
301 fusefs_.c : $(SRCDIR)\fusefs.c
302 +translate$E $** > $@
303
304 $(OBJDIR)\glob$O : glob_.c glob.h
305 $(TCC) -o$@ -c glob_.c
306
307 glob_.c : $(SRCDIR)\glob.c
@@ -774,7 +780,7 @@
780
781 zip_.c : $(SRCDIR)\zip.c
782 +translate$E $** > $@
783
784 headers: makeheaders$E page_index.h VERSION.h
785 +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h fusefs_.c:fusefs.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h
786 @copy /Y nul: headers
787
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -47,10 +47,14 @@
4747
# FOSSIL_ENABLE_JSON = 1
4848
4949
#### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
5050
#
5151
# FOSSIL_ENABLE_SSL = 1
52
+
53
+#### Enable hooks for commands and web pages via TH1
54
+#
55
+# FOSSIL_ENABLE_TH1_HOOKS = 1
5256
5357
#### Enable scripting support via Tcl/Tk
5458
#
5559
# FOSSIL_ENABLE_TCL = 1
5660
@@ -176,10 +180,16 @@
176180
# With HTTPS support
177181
ifdef FOSSIL_ENABLE_SSL
178182
TCC += -DFOSSIL_ENABLE_SSL=1
179183
RCC += -DFOSSIL_ENABLE_SSL=1
180184
endif
185
+
186
+# With TH1 hook support
187
+ifdef FOSSIL_ENABLE_TH1_HOOKS
188
+TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
189
+RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
190
+endif
181191
182192
# With Tcl support
183193
ifdef FOSSIL_ENABLE_TCL
184194
TCC += -DFOSSIL_ENABLE_TCL=1
185195
RCC += -DFOSSIL_ENABLE_TCL=1
@@ -251,11 +261,15 @@
251261
#
252262
TCLSH = tclsh
253263
254264
#### Nullsoft installer MakeNSIS location
255265
#
256
-MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe"
266
+MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe"
267
+
268
+#### Inno Setup executable location
269
+#
270
+INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe"
257271
258272
#### Include a configuration file that can override any one of these settings.
259273
#
260274
-include config.w32
261275
@@ -293,10 +307,11 @@
293307
$(SRCDIR)/encode.c \
294308
$(SRCDIR)/event.c \
295309
$(SRCDIR)/export.c \
296310
$(SRCDIR)/file.c \
297311
$(SRCDIR)/finfo.c \
312
+ $(SRCDIR)/fusefs.c \
298313
$(SRCDIR)/glob.c \
299314
$(SRCDIR)/graph.c \
300315
$(SRCDIR)/gzip.c \
301316
$(SRCDIR)/http.c \
302317
$(SRCDIR)/http_socket.c \
@@ -405,10 +420,11 @@
405420
$(OBJDIR)/encode_.c \
406421
$(OBJDIR)/event_.c \
407422
$(OBJDIR)/export_.c \
408423
$(OBJDIR)/file_.c \
409424
$(OBJDIR)/finfo_.c \
425
+ $(OBJDIR)/fusefs_.c \
410426
$(OBJDIR)/glob_.c \
411427
$(OBJDIR)/graph_.c \
412428
$(OBJDIR)/gzip_.c \
413429
$(OBJDIR)/http_.c \
414430
$(OBJDIR)/http_socket_.c \
@@ -517,10 +533,11 @@
517533
$(OBJDIR)/encode.o \
518534
$(OBJDIR)/event.o \
519535
$(OBJDIR)/export.o \
520536
$(OBJDIR)/file.o \
521537
$(OBJDIR)/finfo.o \
538
+ $(OBJDIR)/fusefs.o \
522539
$(OBJDIR)/glob.o \
523540
$(OBJDIR)/graph.o \
524541
$(OBJDIR)/gzip.o \
525542
$(OBJDIR)/http.o \
526543
$(OBJDIR)/http_socket.o \
@@ -612,10 +629,11 @@
612629
ifdef USE_WINDOWS
613630
TRANSLATE = $(subst /,\,$(OBJDIR)/translate)
614631
MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders)
615632
MKINDEX = $(subst /,\,$(OBJDIR)/mkindex)
616633
VERSION = $(subst /,\,$(OBJDIR)/version)
634
+CAT = type
617635
CP = copy
618636
MV = copy
619637
RM = del /Q
620638
MKDIR = -mkdir
621639
RMDIR = rmdir /S /Q
@@ -622,10 +640,11 @@
622640
else
623641
TRANSLATE = $(OBJDIR)/translate
624642
MAKEHEADERS = $(OBJDIR)/makeheaders
625643
MKINDEX = $(OBJDIR)/mkindex
626644
VERSION = $(OBJDIR)/version
645
+CAT = cat
627646
CP = cp
628647
MV = mv
629648
RM = rm -f
630649
MKDIR = -mkdir -p
631650
RMDIR = rm -rf
@@ -731,10 +750,13 @@
731750
endif
732751
733752
setup: $(OBJDIR) $(APPNAME)
734753
$(MAKENSIS) ./setup/fossil.nsi
735754
755
+innosetup: $(OBJDIR) $(APPNAME)
756
+ $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION)
757
+
736758
$(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
737759
$(MKINDEX) $(TRANS_SRC) >$@
738760
739761
$(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
740762
$(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \
@@ -765,10 +787,11 @@
765787
$(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \
766788
$(OBJDIR)/event_.c:$(OBJDIR)/event.h \
767789
$(OBJDIR)/export_.c:$(OBJDIR)/export.h \
768790
$(OBJDIR)/file_.c:$(OBJDIR)/file.h \
769791
$(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \
792
+ $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \
770793
$(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \
771794
$(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \
772795
$(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \
773796
$(OBJDIR)/http_.c:$(OBJDIR)/http.h \
774797
$(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \
@@ -1093,10 +1116,18 @@
10931116
10941117
$(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h
10951118
$(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c
10961119
10971120
$(OBJDIR)/finfo.h: $(OBJDIR)/headers
1121
+
1122
+$(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate
1123
+ $(TRANSLATE) $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c
1124
+
1125
+$(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h
1126
+ $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c
1127
+
1128
+$(OBJDIR)/fusefs.h: $(OBJDIR)/headers
10981129
10991130
$(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate
11001131
$(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c
11011132
11021133
$(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h
11031134
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -47,10 +47,14 @@
47 # FOSSIL_ENABLE_JSON = 1
48
49 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
50 #
51 # FOSSIL_ENABLE_SSL = 1
 
 
 
 
52
53 #### Enable scripting support via Tcl/Tk
54 #
55 # FOSSIL_ENABLE_TCL = 1
56
@@ -176,10 +180,16 @@
176 # With HTTPS support
177 ifdef FOSSIL_ENABLE_SSL
178 TCC += -DFOSSIL_ENABLE_SSL=1
179 RCC += -DFOSSIL_ENABLE_SSL=1
180 endif
 
 
 
 
 
 
181
182 # With Tcl support
183 ifdef FOSSIL_ENABLE_TCL
184 TCC += -DFOSSIL_ENABLE_TCL=1
185 RCC += -DFOSSIL_ENABLE_TCL=1
@@ -251,11 +261,15 @@
251 #
252 TCLSH = tclsh
253
254 #### Nullsoft installer MakeNSIS location
255 #
256 MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe"
 
 
 
 
257
258 #### Include a configuration file that can override any one of these settings.
259 #
260 -include config.w32
261
@@ -293,10 +307,11 @@
293 $(SRCDIR)/encode.c \
294 $(SRCDIR)/event.c \
295 $(SRCDIR)/export.c \
296 $(SRCDIR)/file.c \
297 $(SRCDIR)/finfo.c \
 
298 $(SRCDIR)/glob.c \
299 $(SRCDIR)/graph.c \
300 $(SRCDIR)/gzip.c \
301 $(SRCDIR)/http.c \
302 $(SRCDIR)/http_socket.c \
@@ -405,10 +420,11 @@
405 $(OBJDIR)/encode_.c \
406 $(OBJDIR)/event_.c \
407 $(OBJDIR)/export_.c \
408 $(OBJDIR)/file_.c \
409 $(OBJDIR)/finfo_.c \
 
410 $(OBJDIR)/glob_.c \
411 $(OBJDIR)/graph_.c \
412 $(OBJDIR)/gzip_.c \
413 $(OBJDIR)/http_.c \
414 $(OBJDIR)/http_socket_.c \
@@ -517,10 +533,11 @@
517 $(OBJDIR)/encode.o \
518 $(OBJDIR)/event.o \
519 $(OBJDIR)/export.o \
520 $(OBJDIR)/file.o \
521 $(OBJDIR)/finfo.o \
 
522 $(OBJDIR)/glob.o \
523 $(OBJDIR)/graph.o \
524 $(OBJDIR)/gzip.o \
525 $(OBJDIR)/http.o \
526 $(OBJDIR)/http_socket.o \
@@ -612,10 +629,11 @@
612 ifdef USE_WINDOWS
613 TRANSLATE = $(subst /,\,$(OBJDIR)/translate)
614 MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders)
615 MKINDEX = $(subst /,\,$(OBJDIR)/mkindex)
616 VERSION = $(subst /,\,$(OBJDIR)/version)
 
617 CP = copy
618 MV = copy
619 RM = del /Q
620 MKDIR = -mkdir
621 RMDIR = rmdir /S /Q
@@ -622,10 +640,11 @@
622 else
623 TRANSLATE = $(OBJDIR)/translate
624 MAKEHEADERS = $(OBJDIR)/makeheaders
625 MKINDEX = $(OBJDIR)/mkindex
626 VERSION = $(OBJDIR)/version
 
627 CP = cp
628 MV = mv
629 RM = rm -f
630 MKDIR = -mkdir -p
631 RMDIR = rm -rf
@@ -731,10 +750,13 @@
731 endif
732
733 setup: $(OBJDIR) $(APPNAME)
734 $(MAKENSIS) ./setup/fossil.nsi
735
 
 
 
736 $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
737 $(MKINDEX) $(TRANS_SRC) >$@
738
739 $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
740 $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \
@@ -765,10 +787,11 @@
765 $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \
766 $(OBJDIR)/event_.c:$(OBJDIR)/event.h \
767 $(OBJDIR)/export_.c:$(OBJDIR)/export.h \
768 $(OBJDIR)/file_.c:$(OBJDIR)/file.h \
769 $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \
 
770 $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \
771 $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \
772 $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \
773 $(OBJDIR)/http_.c:$(OBJDIR)/http.h \
774 $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \
@@ -1093,10 +1116,18 @@
1093
1094 $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h
1095 $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c
1096
1097 $(OBJDIR)/finfo.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
1098
1099 $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate
1100 $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c
1101
1102 $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h
1103
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -47,10 +47,14 @@
47 # FOSSIL_ENABLE_JSON = 1
48
49 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
50 #
51 # FOSSIL_ENABLE_SSL = 1
52
53 #### Enable hooks for commands and web pages via TH1
54 #
55 # FOSSIL_ENABLE_TH1_HOOKS = 1
56
57 #### Enable scripting support via Tcl/Tk
58 #
59 # FOSSIL_ENABLE_TCL = 1
60
@@ -176,10 +180,16 @@
180 # With HTTPS support
181 ifdef FOSSIL_ENABLE_SSL
182 TCC += -DFOSSIL_ENABLE_SSL=1
183 RCC += -DFOSSIL_ENABLE_SSL=1
184 endif
185
186 # With TH1 hook support
187 ifdef FOSSIL_ENABLE_TH1_HOOKS
188 TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
189 RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
190 endif
191
192 # With Tcl support
193 ifdef FOSSIL_ENABLE_TCL
194 TCC += -DFOSSIL_ENABLE_TCL=1
195 RCC += -DFOSSIL_ENABLE_TCL=1
@@ -251,11 +261,15 @@
261 #
262 TCLSH = tclsh
263
264 #### Nullsoft installer MakeNSIS location
265 #
266 MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe"
267
268 #### Inno Setup executable location
269 #
270 INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe"
271
272 #### Include a configuration file that can override any one of these settings.
273 #
274 -include config.w32
275
@@ -293,10 +307,11 @@
307 $(SRCDIR)/encode.c \
308 $(SRCDIR)/event.c \
309 $(SRCDIR)/export.c \
310 $(SRCDIR)/file.c \
311 $(SRCDIR)/finfo.c \
312 $(SRCDIR)/fusefs.c \
313 $(SRCDIR)/glob.c \
314 $(SRCDIR)/graph.c \
315 $(SRCDIR)/gzip.c \
316 $(SRCDIR)/http.c \
317 $(SRCDIR)/http_socket.c \
@@ -405,10 +420,11 @@
420 $(OBJDIR)/encode_.c \
421 $(OBJDIR)/event_.c \
422 $(OBJDIR)/export_.c \
423 $(OBJDIR)/file_.c \
424 $(OBJDIR)/finfo_.c \
425 $(OBJDIR)/fusefs_.c \
426 $(OBJDIR)/glob_.c \
427 $(OBJDIR)/graph_.c \
428 $(OBJDIR)/gzip_.c \
429 $(OBJDIR)/http_.c \
430 $(OBJDIR)/http_socket_.c \
@@ -517,10 +533,11 @@
533 $(OBJDIR)/encode.o \
534 $(OBJDIR)/event.o \
535 $(OBJDIR)/export.o \
536 $(OBJDIR)/file.o \
537 $(OBJDIR)/finfo.o \
538 $(OBJDIR)/fusefs.o \
539 $(OBJDIR)/glob.o \
540 $(OBJDIR)/graph.o \
541 $(OBJDIR)/gzip.o \
542 $(OBJDIR)/http.o \
543 $(OBJDIR)/http_socket.o \
@@ -612,10 +629,11 @@
629 ifdef USE_WINDOWS
630 TRANSLATE = $(subst /,\,$(OBJDIR)/translate)
631 MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders)
632 MKINDEX = $(subst /,\,$(OBJDIR)/mkindex)
633 VERSION = $(subst /,\,$(OBJDIR)/version)
634 CAT = type
635 CP = copy
636 MV = copy
637 RM = del /Q
638 MKDIR = -mkdir
639 RMDIR = rmdir /S /Q
@@ -622,10 +640,11 @@
640 else
641 TRANSLATE = $(OBJDIR)/translate
642 MAKEHEADERS = $(OBJDIR)/makeheaders
643 MKINDEX = $(OBJDIR)/mkindex
644 VERSION = $(OBJDIR)/version
645 CAT = cat
646 CP = cp
647 MV = mv
648 RM = rm -f
649 MKDIR = -mkdir -p
650 RMDIR = rm -rf
@@ -731,10 +750,13 @@
750 endif
751
752 setup: $(OBJDIR) $(APPNAME)
753 $(MAKENSIS) ./setup/fossil.nsi
754
755 innosetup: $(OBJDIR) $(APPNAME)
756 $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION)
757
758 $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
759 $(MKINDEX) $(TRANS_SRC) >$@
760
761 $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
762 $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \
@@ -765,10 +787,11 @@
787 $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \
788 $(OBJDIR)/event_.c:$(OBJDIR)/event.h \
789 $(OBJDIR)/export_.c:$(OBJDIR)/export.h \
790 $(OBJDIR)/file_.c:$(OBJDIR)/file.h \
791 $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \
792 $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \
793 $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \
794 $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \
795 $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \
796 $(OBJDIR)/http_.c:$(OBJDIR)/http.h \
797 $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \
@@ -1093,10 +1116,18 @@
1116
1117 $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h
1118 $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c
1119
1120 $(OBJDIR)/finfo.h: $(OBJDIR)/headers
1121
1122 $(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate
1123 $(TRANSLATE) $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c
1124
1125 $(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h
1126 $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c
1127
1128 $(OBJDIR)/fusefs.h: $(OBJDIR)/headers
1129
1130 $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate
1131 $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c
1132
1133 $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h
1134
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -47,10 +47,14 @@
4747
FOSSIL_ENABLE_JSON = 1
4848
4949
#### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
5050
#
5151
FOSSIL_ENABLE_SSL = 1
52
+
53
+#### Enable hooks for commands and web pages via TH1
54
+#
55
+FOSSIL_ENABLE_TH1_HOOKS = 1
5256
5357
#### Enable scripting support via Tcl/Tk
5458
#
5559
FOSSIL_ENABLE_TCL = 1
5660
@@ -176,10 +180,16 @@
176180
# With HTTPS support
177181
ifdef FOSSIL_ENABLE_SSL
178182
TCC += -DFOSSIL_ENABLE_SSL=1
179183
RCC += -DFOSSIL_ENABLE_SSL=1
180184
endif
185
+
186
+# With TH1 hook support
187
+ifdef FOSSIL_ENABLE_TH1_HOOKS
188
+TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
189
+RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
190
+endif
181191
182192
# With Tcl support
183193
ifdef FOSSIL_ENABLE_TCL
184194
TCC += -DFOSSIL_ENABLE_TCL=1
185195
RCC += -DFOSSIL_ENABLE_TCL=1
@@ -251,11 +261,15 @@
251261
#
252262
TCLSH = tclsh
253263
254264
#### Nullsoft installer MakeNSIS location
255265
#
256
-MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe"
266
+MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe"
267
+
268
+#### Inno Setup executable location
269
+#
270
+INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe"
257271
258272
#### Include a configuration file that can override any one of these settings.
259273
#
260274
-include config.w32
261275
@@ -293,10 +307,11 @@
293307
$(SRCDIR)/encode.c \
294308
$(SRCDIR)/event.c \
295309
$(SRCDIR)/export.c \
296310
$(SRCDIR)/file.c \
297311
$(SRCDIR)/finfo.c \
312
+ $(SRCDIR)/fusefs.c \
298313
$(SRCDIR)/glob.c \
299314
$(SRCDIR)/graph.c \
300315
$(SRCDIR)/gzip.c \
301316
$(SRCDIR)/http.c \
302317
$(SRCDIR)/http_socket.c \
@@ -405,10 +420,11 @@
405420
$(OBJDIR)/encode_.c \
406421
$(OBJDIR)/event_.c \
407422
$(OBJDIR)/export_.c \
408423
$(OBJDIR)/file_.c \
409424
$(OBJDIR)/finfo_.c \
425
+ $(OBJDIR)/fusefs_.c \
410426
$(OBJDIR)/glob_.c \
411427
$(OBJDIR)/graph_.c \
412428
$(OBJDIR)/gzip_.c \
413429
$(OBJDIR)/http_.c \
414430
$(OBJDIR)/http_socket_.c \
@@ -517,10 +533,11 @@
517533
$(OBJDIR)/encode.o \
518534
$(OBJDIR)/event.o \
519535
$(OBJDIR)/export.o \
520536
$(OBJDIR)/file.o \
521537
$(OBJDIR)/finfo.o \
538
+ $(OBJDIR)/fusefs.o \
522539
$(OBJDIR)/glob.o \
523540
$(OBJDIR)/graph.o \
524541
$(OBJDIR)/gzip.o \
525542
$(OBJDIR)/http.o \
526543
$(OBJDIR)/http_socket.o \
@@ -612,10 +629,11 @@
612629
ifdef USE_WINDOWS
613630
TRANSLATE = $(subst /,\,$(OBJDIR)/translate)
614631
MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders)
615632
MKINDEX = $(subst /,\,$(OBJDIR)/mkindex)
616633
VERSION = $(subst /,\,$(OBJDIR)/version)
634
+CAT = type
617635
CP = copy
618636
MV = copy
619637
RM = del /Q
620638
MKDIR = -mkdir
621639
RMDIR = rmdir /S /Q
@@ -622,10 +640,11 @@
622640
else
623641
TRANSLATE = $(OBJDIR)/translate
624642
MAKEHEADERS = $(OBJDIR)/makeheaders
625643
MKINDEX = $(OBJDIR)/mkindex
626644
VERSION = $(OBJDIR)/version
645
+CAT = cat
627646
CP = cp
628647
MV = mv
629648
RM = rm -f
630649
MKDIR = -mkdir -p
631650
RMDIR = rm -rf
@@ -731,10 +750,13 @@
731750
endif
732751
733752
setup: $(OBJDIR) $(APPNAME)
734753
$(MAKENSIS) ./setup/fossil.nsi
735754
755
+innosetup: $(OBJDIR) $(APPNAME)
756
+ $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION)
757
+
736758
$(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
737759
$(MKINDEX) $(TRANS_SRC) >$@
738760
739761
$(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
740762
$(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \
@@ -765,10 +787,11 @@
765787
$(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \
766788
$(OBJDIR)/event_.c:$(OBJDIR)/event.h \
767789
$(OBJDIR)/export_.c:$(OBJDIR)/export.h \
768790
$(OBJDIR)/file_.c:$(OBJDIR)/file.h \
769791
$(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \
792
+ $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \
770793
$(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \
771794
$(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \
772795
$(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \
773796
$(OBJDIR)/http_.c:$(OBJDIR)/http.h \
774797
$(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \
@@ -1093,10 +1116,18 @@
10931116
10941117
$(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h
10951118
$(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c
10961119
10971120
$(OBJDIR)/finfo.h: $(OBJDIR)/headers
1121
+
1122
+$(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate
1123
+ $(TRANSLATE) $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c
1124
+
1125
+$(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h
1126
+ $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c
1127
+
1128
+$(OBJDIR)/fusefs.h: $(OBJDIR)/headers
10981129
10991130
$(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate
11001131
$(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c
11011132
11021133
$(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h
11031134
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -47,10 +47,14 @@
47 FOSSIL_ENABLE_JSON = 1
48
49 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
50 #
51 FOSSIL_ENABLE_SSL = 1
 
 
 
 
52
53 #### Enable scripting support via Tcl/Tk
54 #
55 FOSSIL_ENABLE_TCL = 1
56
@@ -176,10 +180,16 @@
176 # With HTTPS support
177 ifdef FOSSIL_ENABLE_SSL
178 TCC += -DFOSSIL_ENABLE_SSL=1
179 RCC += -DFOSSIL_ENABLE_SSL=1
180 endif
 
 
 
 
 
 
181
182 # With Tcl support
183 ifdef FOSSIL_ENABLE_TCL
184 TCC += -DFOSSIL_ENABLE_TCL=1
185 RCC += -DFOSSIL_ENABLE_TCL=1
@@ -251,11 +261,15 @@
251 #
252 TCLSH = tclsh
253
254 #### Nullsoft installer MakeNSIS location
255 #
256 MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe"
 
 
 
 
257
258 #### Include a configuration file that can override any one of these settings.
259 #
260 -include config.w32
261
@@ -293,10 +307,11 @@
293 $(SRCDIR)/encode.c \
294 $(SRCDIR)/event.c \
295 $(SRCDIR)/export.c \
296 $(SRCDIR)/file.c \
297 $(SRCDIR)/finfo.c \
 
298 $(SRCDIR)/glob.c \
299 $(SRCDIR)/graph.c \
300 $(SRCDIR)/gzip.c \
301 $(SRCDIR)/http.c \
302 $(SRCDIR)/http_socket.c \
@@ -405,10 +420,11 @@
405 $(OBJDIR)/encode_.c \
406 $(OBJDIR)/event_.c \
407 $(OBJDIR)/export_.c \
408 $(OBJDIR)/file_.c \
409 $(OBJDIR)/finfo_.c \
 
410 $(OBJDIR)/glob_.c \
411 $(OBJDIR)/graph_.c \
412 $(OBJDIR)/gzip_.c \
413 $(OBJDIR)/http_.c \
414 $(OBJDIR)/http_socket_.c \
@@ -517,10 +533,11 @@
517 $(OBJDIR)/encode.o \
518 $(OBJDIR)/event.o \
519 $(OBJDIR)/export.o \
520 $(OBJDIR)/file.o \
521 $(OBJDIR)/finfo.o \
 
522 $(OBJDIR)/glob.o \
523 $(OBJDIR)/graph.o \
524 $(OBJDIR)/gzip.o \
525 $(OBJDIR)/http.o \
526 $(OBJDIR)/http_socket.o \
@@ -612,10 +629,11 @@
612 ifdef USE_WINDOWS
613 TRANSLATE = $(subst /,\,$(OBJDIR)/translate)
614 MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders)
615 MKINDEX = $(subst /,\,$(OBJDIR)/mkindex)
616 VERSION = $(subst /,\,$(OBJDIR)/version)
 
617 CP = copy
618 MV = copy
619 RM = del /Q
620 MKDIR = -mkdir
621 RMDIR = rmdir /S /Q
@@ -622,10 +640,11 @@
622 else
623 TRANSLATE = $(OBJDIR)/translate
624 MAKEHEADERS = $(OBJDIR)/makeheaders
625 MKINDEX = $(OBJDIR)/mkindex
626 VERSION = $(OBJDIR)/version
 
627 CP = cp
628 MV = mv
629 RM = rm -f
630 MKDIR = -mkdir -p
631 RMDIR = rm -rf
@@ -731,10 +750,13 @@
731 endif
732
733 setup: $(OBJDIR) $(APPNAME)
734 $(MAKENSIS) ./setup/fossil.nsi
735
 
 
 
736 $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
737 $(MKINDEX) $(TRANS_SRC) >$@
738
739 $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
740 $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \
@@ -765,10 +787,11 @@
765 $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \
766 $(OBJDIR)/event_.c:$(OBJDIR)/event.h \
767 $(OBJDIR)/export_.c:$(OBJDIR)/export.h \
768 $(OBJDIR)/file_.c:$(OBJDIR)/file.h \
769 $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \
 
770 $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \
771 $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \
772 $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \
773 $(OBJDIR)/http_.c:$(OBJDIR)/http.h \
774 $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \
@@ -1093,10 +1116,18 @@
1093
1094 $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h
1095 $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c
1096
1097 $(OBJDIR)/finfo.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
1098
1099 $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate
1100 $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c
1101
1102 $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h
1103
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -47,10 +47,14 @@
47 FOSSIL_ENABLE_JSON = 1
48
49 #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto)
50 #
51 FOSSIL_ENABLE_SSL = 1
52
53 #### Enable hooks for commands and web pages via TH1
54 #
55 FOSSIL_ENABLE_TH1_HOOKS = 1
56
57 #### Enable scripting support via Tcl/Tk
58 #
59 FOSSIL_ENABLE_TCL = 1
60
@@ -176,10 +180,16 @@
180 # With HTTPS support
181 ifdef FOSSIL_ENABLE_SSL
182 TCC += -DFOSSIL_ENABLE_SSL=1
183 RCC += -DFOSSIL_ENABLE_SSL=1
184 endif
185
186 # With TH1 hook support
187 ifdef FOSSIL_ENABLE_TH1_HOOKS
188 TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
189 RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1
190 endif
191
192 # With Tcl support
193 ifdef FOSSIL_ENABLE_TCL
194 TCC += -DFOSSIL_ENABLE_TCL=1
195 RCC += -DFOSSIL_ENABLE_TCL=1
@@ -251,11 +261,15 @@
261 #
262 TCLSH = tclsh
263
264 #### Nullsoft installer MakeNSIS location
265 #
266 MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe"
267
268 #### Inno Setup executable location
269 #
270 INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe"
271
272 #### Include a configuration file that can override any one of these settings.
273 #
274 -include config.w32
275
@@ -293,10 +307,11 @@
307 $(SRCDIR)/encode.c \
308 $(SRCDIR)/event.c \
309 $(SRCDIR)/export.c \
310 $(SRCDIR)/file.c \
311 $(SRCDIR)/finfo.c \
312 $(SRCDIR)/fusefs.c \
313 $(SRCDIR)/glob.c \
314 $(SRCDIR)/graph.c \
315 $(SRCDIR)/gzip.c \
316 $(SRCDIR)/http.c \
317 $(SRCDIR)/http_socket.c \
@@ -405,10 +420,11 @@
420 $(OBJDIR)/encode_.c \
421 $(OBJDIR)/event_.c \
422 $(OBJDIR)/export_.c \
423 $(OBJDIR)/file_.c \
424 $(OBJDIR)/finfo_.c \
425 $(OBJDIR)/fusefs_.c \
426 $(OBJDIR)/glob_.c \
427 $(OBJDIR)/graph_.c \
428 $(OBJDIR)/gzip_.c \
429 $(OBJDIR)/http_.c \
430 $(OBJDIR)/http_socket_.c \
@@ -517,10 +533,11 @@
533 $(OBJDIR)/encode.o \
534 $(OBJDIR)/event.o \
535 $(OBJDIR)/export.o \
536 $(OBJDIR)/file.o \
537 $(OBJDIR)/finfo.o \
538 $(OBJDIR)/fusefs.o \
539 $(OBJDIR)/glob.o \
540 $(OBJDIR)/graph.o \
541 $(OBJDIR)/gzip.o \
542 $(OBJDIR)/http.o \
543 $(OBJDIR)/http_socket.o \
@@ -612,10 +629,11 @@
629 ifdef USE_WINDOWS
630 TRANSLATE = $(subst /,\,$(OBJDIR)/translate)
631 MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders)
632 MKINDEX = $(subst /,\,$(OBJDIR)/mkindex)
633 VERSION = $(subst /,\,$(OBJDIR)/version)
634 CAT = type
635 CP = copy
636 MV = copy
637 RM = del /Q
638 MKDIR = -mkdir
639 RMDIR = rmdir /S /Q
@@ -622,10 +640,11 @@
640 else
641 TRANSLATE = $(OBJDIR)/translate
642 MAKEHEADERS = $(OBJDIR)/makeheaders
643 MKINDEX = $(OBJDIR)/mkindex
644 VERSION = $(OBJDIR)/version
645 CAT = cat
646 CP = cp
647 MV = mv
648 RM = rm -f
649 MKDIR = -mkdir -p
650 RMDIR = rm -rf
@@ -731,10 +750,13 @@
750 endif
751
752 setup: $(OBJDIR) $(APPNAME)
753 $(MAKENSIS) ./setup/fossil.nsi
754
755 innosetup: $(OBJDIR) $(APPNAME)
756 $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION)
757
758 $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
759 $(MKINDEX) $(TRANS_SRC) >$@
760
761 $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h
762 $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \
@@ -765,10 +787,11 @@
787 $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \
788 $(OBJDIR)/event_.c:$(OBJDIR)/event.h \
789 $(OBJDIR)/export_.c:$(OBJDIR)/export.h \
790 $(OBJDIR)/file_.c:$(OBJDIR)/file.h \
791 $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \
792 $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \
793 $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \
794 $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \
795 $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \
796 $(OBJDIR)/http_.c:$(OBJDIR)/http.h \
797 $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \
@@ -1093,10 +1116,18 @@
1116
1117 $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h
1118 $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c
1119
1120 $(OBJDIR)/finfo.h: $(OBJDIR)/headers
1121
1122 $(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate
1123 $(TRANSLATE) $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c
1124
1125 $(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h
1126 $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c
1127
1128 $(OBJDIR)/fusefs.h: $(OBJDIR)/headers
1129
1130 $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate
1131 $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c
1132
1133 $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h
1134
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -21,10 +21,13 @@
2121
# Uncomment to enable JSON API
2222
# FOSSIL_ENABLE_JSON = 1
2323
2424
# Uncomment to enable SSL support
2525
# FOSSIL_ENABLE_SSL = 1
26
+
27
+# Uncomment to enable TH1 hooks
28
+# FOSSIL_ENABLE_TH1_HOOKS = 1
2629
2730
# Uncomment to enable Tcl support
2831
# FOSSIL_ENABLE_TCL = 1
2932
3033
!ifdef FOSSIL_ENABLE_SSL
@@ -79,10 +82,15 @@
7982
TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1
8083
RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1
8184
LIBS = $(LIBS) $(SSLLIB)
8285
LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR)
8386
!endif
87
+
88
+!ifdef FOSSIL_ENABLE_TH1_HOOKS
89
+TCC = $(TCC) /DFOSSIL_ENABLE_TH1_HOOKS=1
90
+RCC = $(RCC) /DFOSSIL_ENABLE_TH1_HOOKS=1
91
+!endif
8492
8593
!ifdef FOSSIL_ENABLE_TCL
8694
TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1
8795
RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1
8896
TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1
@@ -136,10 +144,11 @@
136144
encode_.c \
137145
event_.c \
138146
export_.c \
139147
file_.c \
140148
finfo_.c \
149
+ fusefs_.c \
141150
glob_.c \
142151
graph_.c \
143152
gzip_.c \
144153
http_.c \
145154
http_socket_.c \
@@ -248,10 +257,11 @@
248257
$(OX)\encode$O \
249258
$(OX)\event$O \
250259
$(OX)\export$O \
251260
$(OX)\file$O \
252261
$(OX)\finfo$O \
262
+ $(OX)\fusefs$O \
253263
$(OX)\glob$O \
254264
$(OX)\graph$O \
255265
$(OX)\gzip$O \
256266
$(OX)\http$O \
257267
$(OX)\http_socket$O \
@@ -381,10 +391,11 @@
381391
echo $(OX)\encode.obj >> $@
382392
echo $(OX)\event.obj >> $@
383393
echo $(OX)\export.obj >> $@
384394
echo $(OX)\file.obj >> $@
385395
echo $(OX)\finfo.obj >> $@
396
+ echo $(OX)\fusefs.obj >> $@
386397
echo $(OX)\glob.obj >> $@
387398
echo $(OX)\graph.obj >> $@
388399
echo $(OX)\gzip.obj >> $@
389400
echo $(OX)\http.obj >> $@
390401
echo $(OX)\http_socket.obj >> $@
@@ -511,10 +522,11 @@
511522
clean:
512523
-del $(OX)\*.obj
513524
-del *.obj
514525
-del *_.c
515526
-del *.h
527
+ -del *.ilk
516528
-del *.map
517529
-del *.res
518530
-del headers
519531
-del linkopts
520532
-del vc*.pdb
@@ -521,13 +533,17 @@
521533
522534
realclean: clean
523535
-del $(APPNAME)
524536
-del $(PDBNAME)
525537
-del translate$E
538
+ -del translate$P
526539
-del mkindex$E
540
+ -del mkindex$P
527541
-del makeheaders$E
542
+ -del makeheaders$P
528543
-del mkversion$E
544
+ -del mkversion$P
529545
530546
$(OBJDIR)\json$O : $(SRCDIR)\json_detail.h
531547
$(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h
532548
$(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h
533549
$(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h
@@ -720,10 +736,16 @@
720736
$(OX)\finfo$O : finfo_.c finfo.h
721737
$(TCC) /Fo$@ -c finfo_.c
722738
723739
finfo_.c : $(SRCDIR)\finfo.c
724740
translate$E $** > $@
741
+
742
+$(OX)\fusefs$O : fusefs_.c fusefs.h
743
+ $(TCC) /Fo$@ -c fusefs_.c
744
+
745
+fusefs_.c : $(SRCDIR)\fusefs.c
746
+ translate$E $** > $@
725747
726748
$(OX)\glob$O : glob_.c glob.h
727749
$(TCC) /Fo$@ -c glob_.c
728750
729751
glob_.c : $(SRCDIR)\glob.c
@@ -1235,10 +1257,11 @@
12351257
encode_.c:encode.h \
12361258
event_.c:event.h \
12371259
export_.c:export.h \
12381260
file_.c:file.h \
12391261
finfo_.c:finfo.h \
1262
+ fusefs_.c:fusefs.h \
12401263
glob_.c:glob.h \
12411264
graph_.c:graph.h \
12421265
gzip_.c:gzip.h \
12431266
http_.c:http.h \
12441267
http_socket_.c:http_socket.h \
12451268
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -21,10 +21,13 @@
21 # Uncomment to enable JSON API
22 # FOSSIL_ENABLE_JSON = 1
23
24 # Uncomment to enable SSL support
25 # FOSSIL_ENABLE_SSL = 1
 
 
 
26
27 # Uncomment to enable Tcl support
28 # FOSSIL_ENABLE_TCL = 1
29
30 !ifdef FOSSIL_ENABLE_SSL
@@ -79,10 +82,15 @@
79 TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1
80 RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1
81 LIBS = $(LIBS) $(SSLLIB)
82 LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR)
83 !endif
 
 
 
 
 
84
85 !ifdef FOSSIL_ENABLE_TCL
86 TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1
87 RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1
88 TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1
@@ -136,10 +144,11 @@
136 encode_.c \
137 event_.c \
138 export_.c \
139 file_.c \
140 finfo_.c \
 
141 glob_.c \
142 graph_.c \
143 gzip_.c \
144 http_.c \
145 http_socket_.c \
@@ -248,10 +257,11 @@
248 $(OX)\encode$O \
249 $(OX)\event$O \
250 $(OX)\export$O \
251 $(OX)\file$O \
252 $(OX)\finfo$O \
 
253 $(OX)\glob$O \
254 $(OX)\graph$O \
255 $(OX)\gzip$O \
256 $(OX)\http$O \
257 $(OX)\http_socket$O \
@@ -381,10 +391,11 @@
381 echo $(OX)\encode.obj >> $@
382 echo $(OX)\event.obj >> $@
383 echo $(OX)\export.obj >> $@
384 echo $(OX)\file.obj >> $@
385 echo $(OX)\finfo.obj >> $@
 
386 echo $(OX)\glob.obj >> $@
387 echo $(OX)\graph.obj >> $@
388 echo $(OX)\gzip.obj >> $@
389 echo $(OX)\http.obj >> $@
390 echo $(OX)\http_socket.obj >> $@
@@ -511,10 +522,11 @@
511 clean:
512 -del $(OX)\*.obj
513 -del *.obj
514 -del *_.c
515 -del *.h
 
516 -del *.map
517 -del *.res
518 -del headers
519 -del linkopts
520 -del vc*.pdb
@@ -521,13 +533,17 @@
521
522 realclean: clean
523 -del $(APPNAME)
524 -del $(PDBNAME)
525 -del translate$E
 
526 -del mkindex$E
 
527 -del makeheaders$E
 
528 -del mkversion$E
 
529
530 $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h
531 $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h
532 $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h
533 $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h
@@ -720,10 +736,16 @@
720 $(OX)\finfo$O : finfo_.c finfo.h
721 $(TCC) /Fo$@ -c finfo_.c
722
723 finfo_.c : $(SRCDIR)\finfo.c
724 translate$E $** > $@
 
 
 
 
 
 
725
726 $(OX)\glob$O : glob_.c glob.h
727 $(TCC) /Fo$@ -c glob_.c
728
729 glob_.c : $(SRCDIR)\glob.c
@@ -1235,10 +1257,11 @@
1235 encode_.c:encode.h \
1236 event_.c:event.h \
1237 export_.c:export.h \
1238 file_.c:file.h \
1239 finfo_.c:finfo.h \
 
1240 glob_.c:glob.h \
1241 graph_.c:graph.h \
1242 gzip_.c:gzip.h \
1243 http_.c:http.h \
1244 http_socket_.c:http_socket.h \
1245
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -21,10 +21,13 @@
21 # Uncomment to enable JSON API
22 # FOSSIL_ENABLE_JSON = 1
23
24 # Uncomment to enable SSL support
25 # FOSSIL_ENABLE_SSL = 1
26
27 # Uncomment to enable TH1 hooks
28 # FOSSIL_ENABLE_TH1_HOOKS = 1
29
30 # Uncomment to enable Tcl support
31 # FOSSIL_ENABLE_TCL = 1
32
33 !ifdef FOSSIL_ENABLE_SSL
@@ -79,10 +82,15 @@
82 TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1
83 RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1
84 LIBS = $(LIBS) $(SSLLIB)
85 LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR)
86 !endif
87
88 !ifdef FOSSIL_ENABLE_TH1_HOOKS
89 TCC = $(TCC) /DFOSSIL_ENABLE_TH1_HOOKS=1
90 RCC = $(RCC) /DFOSSIL_ENABLE_TH1_HOOKS=1
91 !endif
92
93 !ifdef FOSSIL_ENABLE_TCL
94 TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1
95 RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1
96 TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1
@@ -136,10 +144,11 @@
144 encode_.c \
145 event_.c \
146 export_.c \
147 file_.c \
148 finfo_.c \
149 fusefs_.c \
150 glob_.c \
151 graph_.c \
152 gzip_.c \
153 http_.c \
154 http_socket_.c \
@@ -248,10 +257,11 @@
257 $(OX)\encode$O \
258 $(OX)\event$O \
259 $(OX)\export$O \
260 $(OX)\file$O \
261 $(OX)\finfo$O \
262 $(OX)\fusefs$O \
263 $(OX)\glob$O \
264 $(OX)\graph$O \
265 $(OX)\gzip$O \
266 $(OX)\http$O \
267 $(OX)\http_socket$O \
@@ -381,10 +391,11 @@
391 echo $(OX)\encode.obj >> $@
392 echo $(OX)\event.obj >> $@
393 echo $(OX)\export.obj >> $@
394 echo $(OX)\file.obj >> $@
395 echo $(OX)\finfo.obj >> $@
396 echo $(OX)\fusefs.obj >> $@
397 echo $(OX)\glob.obj >> $@
398 echo $(OX)\graph.obj >> $@
399 echo $(OX)\gzip.obj >> $@
400 echo $(OX)\http.obj >> $@
401 echo $(OX)\http_socket.obj >> $@
@@ -511,10 +522,11 @@
522 clean:
523 -del $(OX)\*.obj
524 -del *.obj
525 -del *_.c
526 -del *.h
527 -del *.ilk
528 -del *.map
529 -del *.res
530 -del headers
531 -del linkopts
532 -del vc*.pdb
@@ -521,13 +533,17 @@
533
534 realclean: clean
535 -del $(APPNAME)
536 -del $(PDBNAME)
537 -del translate$E
538 -del translate$P
539 -del mkindex$E
540 -del mkindex$P
541 -del makeheaders$E
542 -del makeheaders$P
543 -del mkversion$E
544 -del mkversion$P
545
546 $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h
547 $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h
548 $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h
549 $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h
@@ -720,10 +736,16 @@
736 $(OX)\finfo$O : finfo_.c finfo.h
737 $(TCC) /Fo$@ -c finfo_.c
738
739 finfo_.c : $(SRCDIR)\finfo.c
740 translate$E $** > $@
741
742 $(OX)\fusefs$O : fusefs_.c fusefs.h
743 $(TCC) /Fo$@ -c fusefs_.c
744
745 fusefs_.c : $(SRCDIR)\fusefs.c
746 translate$E $** > $@
747
748 $(OX)\glob$O : glob_.c glob.h
749 $(TCC) /Fo$@ -c glob_.c
750
751 glob_.c : $(SRCDIR)\glob.c
@@ -1235,10 +1257,11 @@
1257 encode_.c:encode.h \
1258 event_.c:event.h \
1259 export_.c:export.h \
1260 file_.c:file.h \
1261 finfo_.c:finfo.h \
1262 fusefs_.c:fusefs.h \
1263 glob_.c:glob.h \
1264 graph_.c:graph.h \
1265 gzip_.c:gzip.h \
1266 http_.c:http.h \
1267 http_socket_.c:http_socket.h \
1268
--- win/fossil.rc
+++ win/fossil.rc
@@ -101,10 +101,15 @@
101101
VALUE "CommandLineIsUnicode", "Yes\0"
102102
#endif /* defined(BROKEN_MINGW_CMDLINE) */
103103
#if defined(FOSSIL_ENABLE_SSL)
104104
VALUE "SslEnabled", "Yes, " OPENSSL_VERSION_TEXT "\0"
105105
#endif /* defined(FOSSIL_ENABLE_SSL) */
106
+#if defined(FOSSIL_ENABLE_TH1_HOOKS)
107
+ VALUE "Th1Hooks", "Yes\0"
108
+#else
109
+ VALUE "Th1Hooks", "No\0"
110
+#endif
106111
#if defined(FOSSIL_ENABLE_TCL)
107112
VALUE "TclEnabled", "Yes, Tcl " TCL_PATCH_LEVEL "\0"
108113
#if defined(USE_TCL_STUBS)
109114
VALUE "UseTclStubsEnabled", "Yes\0"
110115
#else
111116
--- win/fossil.rc
+++ win/fossil.rc
@@ -101,10 +101,15 @@
101 VALUE "CommandLineIsUnicode", "Yes\0"
102 #endif /* defined(BROKEN_MINGW_CMDLINE) */
103 #if defined(FOSSIL_ENABLE_SSL)
104 VALUE "SslEnabled", "Yes, " OPENSSL_VERSION_TEXT "\0"
105 #endif /* defined(FOSSIL_ENABLE_SSL) */
 
 
 
 
 
106 #if defined(FOSSIL_ENABLE_TCL)
107 VALUE "TclEnabled", "Yes, Tcl " TCL_PATCH_LEVEL "\0"
108 #if defined(USE_TCL_STUBS)
109 VALUE "UseTclStubsEnabled", "Yes\0"
110 #else
111
--- win/fossil.rc
+++ win/fossil.rc
@@ -101,10 +101,15 @@
101 VALUE "CommandLineIsUnicode", "Yes\0"
102 #endif /* defined(BROKEN_MINGW_CMDLINE) */
103 #if defined(FOSSIL_ENABLE_SSL)
104 VALUE "SslEnabled", "Yes, " OPENSSL_VERSION_TEXT "\0"
105 #endif /* defined(FOSSIL_ENABLE_SSL) */
106 #if defined(FOSSIL_ENABLE_TH1_HOOKS)
107 VALUE "Th1Hooks", "Yes\0"
108 #else
109 VALUE "Th1Hooks", "No\0"
110 #endif
111 #if defined(FOSSIL_ENABLE_TCL)
112 VALUE "TclEnabled", "Yes, Tcl " TCL_PATCH_LEVEL "\0"
113 #if defined(USE_TCL_STUBS)
114 VALUE "UseTclStubsEnabled", "Yes\0"
115 #else
116
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,7 +1,14 @@
11
<title>Change Log</title>
22
3
+<h2>Changes For Version 1.30 (as yet unreleased)</h2>
4
+ * Add setting to control the number of times autosync will be tried before
5
+ returning an error.
6
+ * Add the "fossil fusefs DIRECTORY" command that mounts a Fuse Filesystem
7
+ at the given DIRECTORY and populates it with read-only copies of all
8
+ historical check-ins. This only works on systems that support FuseFS.
9
+
310
<h2>Changes For Version 1.29 (2014-06-12)</h2>
411
* Add the ability to display content, diffs and annotations for UTF16
512
text files in the web interface.
613
* Add the "SaveAs..." and "Invert" buttons
714
to the graphical diff display that results
815
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,7 +1,14 @@
1 <title>Change Log</title>
2
 
 
 
 
 
 
 
3 <h2>Changes For Version 1.29 (2014-06-12)</h2>
4 * Add the ability to display content, diffs and annotations for UTF16
5 text files in the web interface.
6 * Add the "SaveAs..." and "Invert" buttons
7 to the graphical diff display that results
8
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,7 +1,14 @@
1 <title>Change Log</title>
2
3 <h2>Changes For Version 1.30 (as yet unreleased)</h2>
4 * Add setting to control the number of times autosync will be tried before
5 returning an error.
6 * Add the "fossil fusefs DIRECTORY" command that mounts a Fuse Filesystem
7 at the given DIRECTORY and populates it with read-only copies of all
8 historical check-ins. This only works on systems that support FuseFS.
9
10 <h2>Changes For Version 1.29 (2014-06-12)</h2>
11 * Add the ability to display content, diffs and annotations for UTF16
12 text files in the web interface.
13 * Add the "SaveAs..." and "Invert" buttons
14 to the graphical diff display that results
15

Keyboard Shortcuts

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