Fossil SCM
Attempt to make sure that multiple calls to 'repo_init' get properly cleaned up.
Commit
c464935bcd5717ad49e2fbb19f72ae60f335900a
Parent
ee5214b7edc7951…
1 file changed
+6
-3
+6
-3
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -227,11 +227,13 @@ | ||
| 227 | 227 | } |
| 228 | 228 | # First, attempt to forcibly delete the specific temporary repository |
| 229 | 229 | # directory. |
| 230 | 230 | catch {file delete -force $::tempRepoPath} |
| 231 | 231 | # Next, attempt to gracefully delete the temporary repository directories. |
| 232 | - catch {file delete [file join $::tempPath repo_[pid] $::tempRepoSeed]} | |
| 232 | + foreach repoSeed $::tempRepoSeeds { | |
| 233 | + catch {file delete [file join $::tempPath repo_[pid] $repoSeed]} | |
| 234 | + } | |
| 233 | 235 | catch {file delete [file join $::tempPath repo_[pid]]} |
| 234 | 236 | # Finally, attempt to gracefully delete the temporary home. |
| 235 | 237 | if {$::tcl_platform(platform) eq "windows"} { |
| 236 | 238 | catch {file delete [file join $::tempHomePath _fossil]} |
| 237 | 239 | } else { |
| @@ -257,13 +259,14 @@ | ||
| 257 | 259 | # |
| 258 | 260 | # Create and open a new Fossil repository and clean the checkout |
| 259 | 261 | # |
| 260 | 262 | proc repo_init {{filename ".rep.fossil"}} { |
| 261 | 263 | set_home_to_elsewhere |
| 262 | - set ::tempRepoSeed [string trim [clock seconds] -] | |
| 264 | + set repoSeed [string trim [clock seconds] -] | |
| 265 | + lappend ::tempRepoSeeds $repoSeed | |
| 263 | 266 | set ::tempRepoPath [file join \ |
| 264 | - $::tempPath repo_[pid] $::tempRepoSeed [file tail [get_script_or_fail]]] | |
| 267 | + $::tempPath repo_[pid] $repoSeed [file tail [get_script_or_fail]]] | |
| 265 | 268 | if {[catch { |
| 266 | 269 | file mkdir $::tempRepoPath |
| 267 | 270 | } error] != 0} { |
| 268 | 271 | error "could not make directory \"$::tempRepoPath\",\ |
| 269 | 272 | please set TEMP variable in environment: $error" |
| 270 | 273 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -227,11 +227,13 @@ | |
| 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 | catch {file delete [file join $::tempPath repo_[pid] $::tempRepoSeed]} |
| 233 | catch {file delete [file join $::tempPath repo_[pid]]} |
| 234 | # Finally, attempt to gracefully delete the temporary home. |
| 235 | if {$::tcl_platform(platform) eq "windows"} { |
| 236 | catch {file delete [file join $::tempHomePath _fossil]} |
| 237 | } else { |
| @@ -257,13 +259,14 @@ | |
| 257 | # |
| 258 | # Create and open a new Fossil repository and clean the checkout |
| 259 | # |
| 260 | proc repo_init {{filename ".rep.fossil"}} { |
| 261 | set_home_to_elsewhere |
| 262 | set ::tempRepoSeed [string trim [clock seconds] -] |
| 263 | set ::tempRepoPath [file join \ |
| 264 | $::tempPath repo_[pid] $::tempRepoSeed [file tail [get_script_or_fail]]] |
| 265 | if {[catch { |
| 266 | file mkdir $::tempRepoPath |
| 267 | } error] != 0} { |
| 268 | error "could not make directory \"$::tempRepoPath\",\ |
| 269 | please set TEMP variable in environment: $error" |
| 270 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -227,11 +227,13 @@ | |
| 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 { |
| @@ -257,13 +259,14 @@ | |
| 259 | # |
| 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 |