Fossil SCM

Attempt to make sure that multiple calls to 'repo_init' get properly cleaned up.

mistachkin 2016-03-02 07:00 UTC testerCleanup
Commit c464935bcd5717ad49e2fbb19f72ae60f335900a
1 file changed +6 -3
+6 -3
--- test/tester.tcl
+++ test/tester.tcl
@@ -227,11 +227,13 @@
227227
}
228228
# First, attempt to forcibly delete the specific temporary repository
229229
# directory.
230230
catch {file delete -force $::tempRepoPath}
231231
# 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
+ }
233235
catch {file delete [file join $::tempPath repo_[pid]]}
234236
# Finally, attempt to gracefully delete the temporary home.
235237
if {$::tcl_platform(platform) eq "windows"} {
236238
catch {file delete [file join $::tempHomePath _fossil]}
237239
} else {
@@ -257,13 +259,14 @@
257259
#
258260
# Create and open a new Fossil repository and clean the checkout
259261
#
260262
proc repo_init {{filename ".rep.fossil"}} {
261263
set_home_to_elsewhere
262
- set ::tempRepoSeed [string trim [clock seconds] -]
264
+ set repoSeed [string trim [clock seconds] -]
265
+ lappend ::tempRepoSeeds $repoSeed
263266
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]]]
265268
if {[catch {
266269
file mkdir $::tempRepoPath
267270
} error] != 0} {
268271
error "could not make directory \"$::tempRepoPath\",\
269272
please set TEMP variable in environment: $error"
270273
--- 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

Keyboard Shortcuts

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