Fossil SCM
Use "fossil changes" in tester.tcl to detect a dirty checkout
Commit
825ad77cea5a1c9fd183a9e1575732d445e805acb06fb5e2ead8b5bef4234261
Parent
9879e63575ca2d3…
1 file changed
+11
-3
+11
-3
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -48,12 +48,20 @@ | ||
| 48 | 48 | if {![file isfile $fossilexe]} { |
| 49 | 49 | puts stderr "usage: tclsh [info script] FOSSIL ?OPTIONS? ?TESTFILE ...?" |
| 50 | 50 | exit 1 |
| 51 | 51 | } |
| 52 | 52 | |
| 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 | +} | |
| 55 | 63 | |
| 56 | 64 | set argv [lrange $argv 1 end] |
| 57 | 65 | |
| 58 | 66 | foreach option {keep halt prot verbose quiet strict} { |
| 59 | 67 | set i [lsearch -exact $argv -$option] |
| @@ -107,11 +115,11 @@ | ||
| 107 | 115 | if {$h>0} {puts -nonewline "$h hours "} |
| 108 | 116 | if {$m>0} {puts -nonewline "$m mins "} |
| 109 | 117 | puts [format "%.3f secs" $s] |
| 110 | 118 | } |
| 111 | 119 | |
| 112 | -# write a dict with just enough formatting | |
| 120 | +# write a dict with enough formatting | |
| 113 | 121 | # to make it human readable |
| 114 | 122 | # |
| 115 | 123 | proc protOutDict {dict {pattern *}} { |
| 116 | 124 | set longest [tcl::mathfunc::max 0 {*}[lmap key [dict keys $dict $pattern] {string length $key}]] |
| 117 | 125 | dict for {key value} $dict { |
| 118 | 126 |
| --- 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 |