Fossil SCM

Refactoring, fixes to the previous check-in, etc.

mistachkin 2016-03-02 07:13 UTC testerCleanup
Commit cda4cc8b805bccc94f4880b5b88187af0a1fc181
1 file changed +17 -12
+17 -12
--- test/tester.tcl
+++ test/tester.tcl
@@ -223,19 +223,23 @@
223223
error "Temporary repository path has wrong parent during cleanup."
224224
}
225225
if {[info exists ::tempSavedPwd]} {
226226
cd $::tempSavedPwd; unset ::tempSavedPwd
227227
}
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]]
232231
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.
234236
}
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.
237241
if {$::tcl_platform(platform) eq "windows"} {
238242
catch {file delete [file join $::tempHomePath _fossil]}
239243
} else {
240244
catch {file delete [file join $::tempHomePath .fossil]}
241245
}
@@ -260,20 +264,21 @@
260264
# Create and open a new Fossil repository and clean the checkout
261265
#
262266
proc repo_init {{filename ".rep.fossil"}} {
263267
set_home_to_elsewhere
264268
set repoSeed [string trim [clock seconds] -]
269
+ set ::tempRepoPath [file join $::tempPath repo_[pid]]
265270
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]]]
268273
if {[catch {
269
- file mkdir $::tempRepoPath
274
+ file mkdir $repoPath
270275
} error] != 0} {
271
- error "could not make directory \"$::tempRepoPath\",\
276
+ error "could not make directory \"$repoPath\",\
272277
please set TEMP variable in environment: $error"
273278
}
274
- set ::tempSavedPwd [pwd]; cd $::tempRepoPath
279
+ set ::tempSavedPwd [pwd]; cd $repoPath
275280
exec $::fossilexe new $filename
276281
exec $::fossilexe open $filename
277282
exec $::fossilexe set mtime-changes off
278283
}
279284
280285
--- 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

Keyboard Shortcuts

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