Fossil SCM

Use "fossil changes" in tester.tcl to detect a dirty checkout

danshearer 2026-11-20 12:09 UTC test-suite-new
Commit 825ad77cea5a1c9fd183a9e1575732d445e805acb06fb5e2ead8b5bef4234261
1 file changed +11 -3
+11 -3
--- test/tester.tcl
+++ test/tester.tcl
@@ -48,12 +48,20 @@
4848
if {![file isfile $fossilexe]} {
4949
puts stderr "usage: tclsh [info script] FOSSIL ?OPTIONS? ?TESTFILE ...?"
5050
exit 1
5151
}
5252
53
-catch {exec $::fossilexe changes --changed} res
54
-set dirty_ckout [string length $res]
53
+set dirty_ckout 1
54
+if {!$outside_fossil_repo} {
55
+ set savedPwd [pwd]
56
+ cd $testfiledir
57
+ if {![catch {exec $::fossilexe changes --changed} res]} {
58
+ set dirty_ckout [string length $res]
59
+ }
60
+ cd $savedPwd
61
+ unset savedPwd
62
+}
5563
5664
set argv [lrange $argv 1 end]
5765
5866
foreach option {keep halt prot verbose quiet strict} {
5967
set i [lsearch -exact $argv -$option]
@@ -107,11 +115,11 @@
107115
if {$h>0} {puts -nonewline "$h hours "}
108116
if {$m>0} {puts -nonewline "$m mins "}
109117
puts [format "%.3f secs" $s]
110118
}
111119
112
-# write a dict with just enough formatting
120
+# write a dict with enough formatting
113121
# to make it human readable
114122
#
115123
proc protOutDict {dict {pattern *}} {
116124
set longest [tcl::mathfunc::max 0 {*}[lmap key [dict keys $dict $pattern] {string length $key}]]
117125
dict for {key value} $dict {
118126
--- test/tester.tcl
+++ test/tester.tcl
@@ -48,12 +48,20 @@
48 if {![file isfile $fossilexe]} {
49 puts stderr "usage: tclsh [info script] FOSSIL ?OPTIONS? ?TESTFILE ...?"
50 exit 1
51 }
52
53 catch {exec $::fossilexe changes --changed} res
54 set dirty_ckout [string length $res]
 
 
 
 
 
 
 
 
55
56 set argv [lrange $argv 1 end]
57
58 foreach option {keep halt prot verbose quiet strict} {
59 set i [lsearch -exact $argv -$option]
@@ -107,11 +115,11 @@
107 if {$h>0} {puts -nonewline "$h hours "}
108 if {$m>0} {puts -nonewline "$m mins "}
109 puts [format "%.3f secs" $s]
110 }
111
112 # write a dict with just enough formatting
113 # to make it human readable
114 #
115 proc protOutDict {dict {pattern *}} {
116 set longest [tcl::mathfunc::max 0 {*}[lmap key [dict keys $dict $pattern] {string length $key}]]
117 dict for {key value} $dict {
118
--- test/tester.tcl
+++ test/tester.tcl
@@ -48,12 +48,20 @@
48 if {![file isfile $fossilexe]} {
49 puts stderr "usage: tclsh [info script] FOSSIL ?OPTIONS? ?TESTFILE ...?"
50 exit 1
51 }
52
53 set dirty_ckout 1
54 if {!$outside_fossil_repo} {
55 set savedPwd [pwd]
56 cd $testfiledir
57 if {![catch {exec $::fossilexe changes --changed} res]} {
58 set dirty_ckout [string length $res]
59 }
60 cd $savedPwd
61 unset savedPwd
62 }
63
64 set argv [lrange $argv 1 end]
65
66 foreach option {keep halt prot verbose quiet strict} {
67 set i [lsearch -exact $argv -$option]
@@ -107,11 +115,11 @@
115 if {$h>0} {puts -nonewline "$h hours "}
116 if {$m>0} {puts -nonewline "$m mins "}
117 puts [format "%.3f secs" $s]
118 }
119
120 # write a dict with enough formatting
121 # to make it human readable
122 #
123 proc protOutDict {dict {pattern *}} {
124 set longest [tcl::mathfunc::max 0 {*}[lmap key [dict keys $dict $pattern] {string length $key}]]
125 dict for {key value} $dict {
126

Keyboard Shortcuts

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