Fossil SCM
Refactoring, fixes to the previous check-in, etc.
Commit
cda4cc8b805bccc94f4880b5b88187af0a1fc181
Parent
c464935bcd5717a…
1 file changed
+17
-12
+17
-12
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -223,19 +223,23 @@ | ||
| 223 | 223 | error "Temporary repository path has wrong parent during cleanup." |
| 224 | 224 | } |
| 225 | 225 | if {[info exists ::tempSavedPwd]} { |
| 226 | 226 | cd $::tempSavedPwd; unset ::tempSavedPwd |
| 227 | 227 | } |
| 228 | - # First, attempt to forcibly delete the specific temporary repository | |
| 229 | - # directory. | |
| 230 | - catch {file delete -force $::tempRepoPath} | |
| 231 | - # Next, attempt to gracefully delete the temporary repository directories. | |
| 228 | + # First, attempt to delete the specific temporary repository directories | |
| 229 | + # for this test file. | |
| 230 | + set scriptName [file tail [get_script_or_fail]] | |
| 232 | 231 | foreach repoSeed $::tempRepoSeeds { |
| 233 | - catch {file delete [file join $::tempPath repo_[pid] $repoSeed]} | |
| 232 | + set repoPath [file join $::tempRepoPath $repoSeed $scriptName] | |
| 233 | + catch {file delete -force $repoPath}; # FORCE, arbitrary children. | |
| 234 | + set seedPath [file join $::tempRepoPath $repoSeed] | |
| 235 | + catch {file delete $seedPath}; # NO FORCE. | |
| 234 | 236 | } |
| 235 | - catch {file delete [file join $::tempPath repo_[pid]]} | |
| 236 | - # Finally, attempt to gracefully delete the temporary home. | |
| 237 | + # Next, attempt to gracefully delete the temporary repository directory | |
| 238 | + # for this process. | |
| 239 | + catch {file delete $::tempRepoPath} | |
| 240 | + # Finally, attempt to gracefully delete the temporary home directory. | |
| 237 | 241 | if {$::tcl_platform(platform) eq "windows"} { |
| 238 | 242 | catch {file delete [file join $::tempHomePath _fossil]} |
| 239 | 243 | } else { |
| 240 | 244 | catch {file delete [file join $::tempHomePath .fossil]} |
| 241 | 245 | } |
| @@ -260,20 +264,21 @@ | ||
| 260 | 264 | # Create and open a new Fossil repository and clean the checkout |
| 261 | 265 | # |
| 262 | 266 | proc repo_init {{filename ".rep.fossil"}} { |
| 263 | 267 | set_home_to_elsewhere |
| 264 | 268 | set repoSeed [string trim [clock seconds] -] |
| 269 | + set ::tempRepoPath [file join $::tempPath repo_[pid]] | |
| 265 | 270 | lappend ::tempRepoSeeds $repoSeed |
| 266 | - set ::tempRepoPath [file join \ | |
| 267 | - $::tempPath repo_[pid] $repoSeed [file tail [get_script_or_fail]]] | |
| 271 | + set repoPath [file join \ | |
| 272 | + $::tempRepoPath $repoSeed [file tail [get_script_or_fail]]] | |
| 268 | 273 | if {[catch { |
| 269 | - file mkdir $::tempRepoPath | |
| 274 | + file mkdir $repoPath | |
| 270 | 275 | } error] != 0} { |
| 271 | - error "could not make directory \"$::tempRepoPath\",\ | |
| 276 | + error "could not make directory \"$repoPath\",\ | |
| 272 | 277 | please set TEMP variable in environment: $error" |
| 273 | 278 | } |
| 274 | - set ::tempSavedPwd [pwd]; cd $::tempRepoPath | |
| 279 | + set ::tempSavedPwd [pwd]; cd $repoPath | |
| 275 | 280 | exec $::fossilexe new $filename |
| 276 | 281 | exec $::fossilexe open $filename |
| 277 | 282 | exec $::fossilexe set mtime-changes off |
| 278 | 283 | } |
| 279 | 284 | |
| 280 | 285 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -223,19 +223,23 @@ | |
| 223 | error "Temporary repository path has wrong parent during cleanup." |
| 224 | } |
| 225 | if {[info exists ::tempSavedPwd]} { |
| 226 | cd $::tempSavedPwd; unset ::tempSavedPwd |
| 227 | } |
| 228 | # First, attempt to forcibly delete the specific temporary repository |
| 229 | # directory. |
| 230 | catch {file delete -force $::tempRepoPath} |
| 231 | # Next, attempt to gracefully delete the temporary repository directories. |
| 232 | foreach repoSeed $::tempRepoSeeds { |
| 233 | catch {file delete [file join $::tempPath repo_[pid] $repoSeed]} |
| 234 | } |
| 235 | catch {file delete [file join $::tempPath repo_[pid]]} |
| 236 | # Finally, attempt to gracefully delete the temporary home. |
| 237 | if {$::tcl_platform(platform) eq "windows"} { |
| 238 | catch {file delete [file join $::tempHomePath _fossil]} |
| 239 | } else { |
| 240 | catch {file delete [file join $::tempHomePath .fossil]} |
| 241 | } |
| @@ -260,20 +264,21 @@ | |
| 260 | # Create and open a new Fossil repository and clean the checkout |
| 261 | # |
| 262 | proc repo_init {{filename ".rep.fossil"}} { |
| 263 | set_home_to_elsewhere |
| 264 | set repoSeed [string trim [clock seconds] -] |
| 265 | lappend ::tempRepoSeeds $repoSeed |
| 266 | set ::tempRepoPath [file join \ |
| 267 | $::tempPath repo_[pid] $repoSeed [file tail [get_script_or_fail]]] |
| 268 | if {[catch { |
| 269 | file mkdir $::tempRepoPath |
| 270 | } error] != 0} { |
| 271 | error "could not make directory \"$::tempRepoPath\",\ |
| 272 | please set TEMP variable in environment: $error" |
| 273 | } |
| 274 | set ::tempSavedPwd [pwd]; cd $::tempRepoPath |
| 275 | exec $::fossilexe new $filename |
| 276 | exec $::fossilexe open $filename |
| 277 | exec $::fossilexe set mtime-changes off |
| 278 | } |
| 279 | |
| 280 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -223,19 +223,23 @@ | |
| 223 | error "Temporary repository path has wrong parent during cleanup." |
| 224 | } |
| 225 | if {[info exists ::tempSavedPwd]} { |
| 226 | cd $::tempSavedPwd; unset ::tempSavedPwd |
| 227 | } |
| 228 | # First, attempt to delete the specific temporary repository directories |
| 229 | # for this test file. |
| 230 | set scriptName [file tail [get_script_or_fail]] |
| 231 | foreach repoSeed $::tempRepoSeeds { |
| 232 | set repoPath [file join $::tempRepoPath $repoSeed $scriptName] |
| 233 | catch {file delete -force $repoPath}; # FORCE, arbitrary children. |
| 234 | set seedPath [file join $::tempRepoPath $repoSeed] |
| 235 | catch {file delete $seedPath}; # NO FORCE. |
| 236 | } |
| 237 | # Next, attempt to gracefully delete the temporary repository directory |
| 238 | # for this process. |
| 239 | catch {file delete $::tempRepoPath} |
| 240 | # Finally, attempt to gracefully delete the temporary home directory. |
| 241 | if {$::tcl_platform(platform) eq "windows"} { |
| 242 | catch {file delete [file join $::tempHomePath _fossil]} |
| 243 | } else { |
| 244 | catch {file delete [file join $::tempHomePath .fossil]} |
| 245 | } |
| @@ -260,20 +264,21 @@ | |
| 264 | # Create and open a new Fossil repository and clean the checkout |
| 265 | # |
| 266 | proc repo_init {{filename ".rep.fossil"}} { |
| 267 | set_home_to_elsewhere |
| 268 | set repoSeed [string trim [clock seconds] -] |
| 269 | set ::tempRepoPath [file join $::tempPath repo_[pid]] |
| 270 | lappend ::tempRepoSeeds $repoSeed |
| 271 | set repoPath [file join \ |
| 272 | $::tempRepoPath $repoSeed [file tail [get_script_or_fail]]] |
| 273 | if {[catch { |
| 274 | file mkdir $repoPath |
| 275 | } error] != 0} { |
| 276 | error "could not make directory \"$repoPath\",\ |
| 277 | please set TEMP variable in environment: $error" |
| 278 | } |
| 279 | set ::tempSavedPwd [pwd]; cd $repoPath |
| 280 | exec $::fossilexe new $filename |
| 281 | exec $::fossilexe open $filename |
| 282 | exec $::fossilexe set mtime-changes off |
| 283 | } |
| 284 | |
| 285 |