Fossil SCM
Changes to cvs2fossil to import tcllib CVS into fossil on Win32 * using [::file] instead of [file] in snit methods to get the core file command * taking care of files that only differ in case in the Attic and the repo on case insensitive FS * passing platform specific
Commit
7208c7ac4d1562657ecad27e7bc3e6e81405d460
Parent
7aa9a2e206454f9…
8 files changed
+2
-2
+6
-6
+1
-1
+7
-4
+2
-2
+4
-2
+1
-1
+1
-1
| --- tools/cvs2fossil/lib/c2f_file.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_file.tcl | ||
| @@ -264,11 +264,11 @@ | ||
| 264 | 264 | # revmap = dict (path -> rid) |
| 265 | 265 | |
| 266 | 266 | array set idmap [$repository importfiles $filemap] |
| 267 | 267 | |
| 268 | 268 | # Wipe workspace clean of the imported files. |
| 269 | - foreach x [glob -directory $ws r*] { file delete $x } | |
| 269 | + foreach x [glob -directory $ws r*] { ::file delete $x } | |
| 270 | 270 | |
| 271 | 271 | foreach {path rid} $revmap { |
| 272 | 272 | set uuid $idmap($path) |
| 273 | 273 | state run { |
| 274 | 274 | INSERT INTO revuuid (rid, uuid) |
| @@ -337,11 +337,11 @@ | ||
| 337 | 337 | foreach {from to} $zarcs { $zp arc insert $from $to } |
| 338 | 338 | |
| 339 | 339 | # Phase III: Traverse the graphs, expand the file, and |
| 340 | 340 | # generate import instructions. |
| 341 | 341 | |
| 342 | - set archive [file join [$myproject fullpath] $mypath] | |
| 342 | + set archive [::file join [$myproject fullpath] $mypath] | |
| 343 | 343 | set ac [open $archive r] |
| 344 | 344 | fconfigure $ac -translation binary |
| 345 | 345 | |
| 346 | 346 | # First traverse the expansion graph, this gives us the |
| 347 | 347 | # revisions in the order we have to expand them, which we do. |
| 348 | 348 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -264,11 +264,11 @@ | |
| 264 | # revmap = dict (path -> rid) |
| 265 | |
| 266 | array set idmap [$repository importfiles $filemap] |
| 267 | |
| 268 | # Wipe workspace clean of the imported files. |
| 269 | foreach x [glob -directory $ws r*] { file delete $x } |
| 270 | |
| 271 | foreach {path rid} $revmap { |
| 272 | set uuid $idmap($path) |
| 273 | state run { |
| 274 | INSERT INTO revuuid (rid, uuid) |
| @@ -337,11 +337,11 @@ | |
| 337 | foreach {from to} $zarcs { $zp arc insert $from $to } |
| 338 | |
| 339 | # Phase III: Traverse the graphs, expand the file, and |
| 340 | # generate import instructions. |
| 341 | |
| 342 | set archive [file join [$myproject fullpath] $mypath] |
| 343 | set ac [open $archive r] |
| 344 | fconfigure $ac -translation binary |
| 345 | |
| 346 | # First traverse the expansion graph, this gives us the |
| 347 | # revisions in the order we have to expand them, which we do. |
| 348 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -264,11 +264,11 @@ | |
| 264 | # revmap = dict (path -> rid) |
| 265 | |
| 266 | array set idmap [$repository importfiles $filemap] |
| 267 | |
| 268 | # Wipe workspace clean of the imported files. |
| 269 | foreach x [glob -directory $ws r*] { ::file delete $x } |
| 270 | |
| 271 | foreach {path rid} $revmap { |
| 272 | set uuid $idmap($path) |
| 273 | state run { |
| 274 | INSERT INTO revuuid (rid, uuid) |
| @@ -337,11 +337,11 @@ | |
| 337 | foreach {from to} $zarcs { $zp arc insert $from $to } |
| 338 | |
| 339 | # Phase III: Traverse the graphs, expand the file, and |
| 340 | # generate import instructions. |
| 341 | |
| 342 | set archive [::file join [$myproject fullpath] $mypath] |
| 343 | set ac [open $archive r] |
| 344 | fconfigure $ac -translation binary |
| 345 | |
| 346 | # First traverse the expansion graph, this gives us the |
| 347 | # revisions in the order we have to expand them, which we do. |
| 348 |
| --- tools/cvs2fossil/lib/c2f_fossil.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_fossil.tcl | ||
| @@ -30,15 +30,15 @@ | ||
| 30 | 30 | ## Public API |
| 31 | 31 | |
| 32 | 32 | constructor {} { |
| 33 | 33 | set myrepository [fileutil::tempfile cvs2fossil_repo_] |
| 34 | 34 | set myworkspace [fileutil::tempfile cvs2fossil_wspc_] |
| 35 | - file delete $myworkspace | |
| 36 | - file mkdir $myworkspace | |
| 35 | + ::file delete $myworkspace | |
| 36 | + ::file mkdir $myworkspace | |
| 37 | 37 | |
| 38 | - Do new $myrepository | |
| 39 | - $self InWorkspace ; Do open $myrepository | |
| 38 | + Do new [::file nativename $myrepository] | |
| 39 | + $self InWorkspace ; Do open [::file nativename $myrepository] | |
| 40 | 40 | $self RestorePwd |
| 41 | 41 | return |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | # # ## ### ##### ######## ############# |
| @@ -94,12 +94,12 @@ | ||
| 94 | 94 | log write 3 fossil Done. |
| 95 | 95 | return [array get id] |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | method finalize {destination} { |
| 99 | - file rename -force $myrepository $destination | |
| 100 | - file delete -force $myworkspace | |
| 99 | + ::file rename -force $myrepository $destination | |
| 100 | + ::file delete -force $myworkspace | |
| 101 | 101 | $self destroy |
| 102 | 102 | return |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | # # ## ### ##### ######## ############# |
| 106 | 106 |
| --- tools/cvs2fossil/lib/c2f_fossil.tcl | |
| +++ tools/cvs2fossil/lib/c2f_fossil.tcl | |
| @@ -30,15 +30,15 @@ | |
| 30 | ## Public API |
| 31 | |
| 32 | constructor {} { |
| 33 | set myrepository [fileutil::tempfile cvs2fossil_repo_] |
| 34 | set myworkspace [fileutil::tempfile cvs2fossil_wspc_] |
| 35 | file delete $myworkspace |
| 36 | file mkdir $myworkspace |
| 37 | |
| 38 | Do new $myrepository |
| 39 | $self InWorkspace ; Do open $myrepository |
| 40 | $self RestorePwd |
| 41 | return |
| 42 | } |
| 43 | |
| 44 | # # ## ### ##### ######## ############# |
| @@ -94,12 +94,12 @@ | |
| 94 | log write 3 fossil Done. |
| 95 | return [array get id] |
| 96 | } |
| 97 | |
| 98 | method finalize {destination} { |
| 99 | file rename -force $myrepository $destination |
| 100 | file delete -force $myworkspace |
| 101 | $self destroy |
| 102 | return |
| 103 | } |
| 104 | |
| 105 | # # ## ### ##### ######## ############# |
| 106 |
| --- tools/cvs2fossil/lib/c2f_fossil.tcl | |
| +++ tools/cvs2fossil/lib/c2f_fossil.tcl | |
| @@ -30,15 +30,15 @@ | |
| 30 | ## Public API |
| 31 | |
| 32 | constructor {} { |
| 33 | set myrepository [fileutil::tempfile cvs2fossil_repo_] |
| 34 | set myworkspace [fileutil::tempfile cvs2fossil_wspc_] |
| 35 | ::file delete $myworkspace |
| 36 | ::file mkdir $myworkspace |
| 37 | |
| 38 | Do new [::file nativename $myrepository] |
| 39 | $self InWorkspace ; Do open [::file nativename $myrepository] |
| 40 | $self RestorePwd |
| 41 | return |
| 42 | } |
| 43 | |
| 44 | # # ## ### ##### ######## ############# |
| @@ -94,12 +94,12 @@ | |
| 94 | log write 3 fossil Done. |
| 95 | return [array get id] |
| 96 | } |
| 97 | |
| 98 | method finalize {destination} { |
| 99 | ::file rename -force $myrepository $destination |
| 100 | ::file delete -force $myworkspace |
| 101 | $self destroy |
| 102 | return |
| 103 | } |
| 104 | |
| 105 | # # ## ### ##### ######## ############# |
| 106 |
| --- tools/cvs2fossil/lib/c2f_patopsort.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_patopsort.tcl | ||
| @@ -117,11 +117,11 @@ | ||
| 117 | 117 | |
| 118 | 118 | proc SaveTimestamps {graph at cset} { |
| 119 | 119 | set cid [$cset id] |
| 120 | 120 | |
| 121 | 121 | set date [GetTime [lindex [$graph node get $cset timerange] 1] \ |
| 122 | - [struct::set contain $mysymchangesets $cset] \ | |
| 122 | + [struct::set contains $mysymchangesets $cset] \ | |
| 123 | 123 | message] |
| 124 | 124 | |
| 125 | 125 | log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]]$message" |
| 126 | 126 | |
| 127 | 127 | state run { |
| 128 | 128 |
| --- tools/cvs2fossil/lib/c2f_patopsort.tcl | |
| +++ tools/cvs2fossil/lib/c2f_patopsort.tcl | |
| @@ -117,11 +117,11 @@ | |
| 117 | |
| 118 | proc SaveTimestamps {graph at cset} { |
| 119 | set cid [$cset id] |
| 120 | |
| 121 | set date [GetTime [lindex [$graph node get $cset timerange] 1] \ |
| 122 | [struct::set contain $mysymchangesets $cset] \ |
| 123 | message] |
| 124 | |
| 125 | log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]]$message" |
| 126 | |
| 127 | state run { |
| 128 |
| --- tools/cvs2fossil/lib/c2f_patopsort.tcl | |
| +++ tools/cvs2fossil/lib/c2f_patopsort.tcl | |
| @@ -117,11 +117,11 @@ | |
| 117 | |
| 118 | proc SaveTimestamps {graph at cset} { |
| 119 | set cid [$cset id] |
| 120 | |
| 121 | set date [GetTime [lindex [$graph node get $cset timerange] 1] \ |
| 122 | [struct::set contains $mysymchangesets $cset] \ |
| 123 | message] |
| 124 | |
| 125 | log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]]$message" |
| 126 | |
| 127 | state run { |
| 128 |
| --- tools/cvs2fossil/lib/c2f_pcollar.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_pcollar.tcl | ||
| @@ -96,11 +96,11 @@ | ||
| 96 | 96 | # Pass manager interface. Executed to perform the |
| 97 | 97 | # functionality of the pass. |
| 98 | 98 | |
| 99 | 99 | set rbase [repository base?] |
| 100 | 100 | foreach project [repository projects] { |
| 101 | - set base [file join $rbase [$project base]] | |
| 101 | + set base [::file join $rbase [$project base]] | |
| 102 | 102 | log write 1 collar "Scan $base" |
| 103 | 103 | |
| 104 | 104 | set traverse [fileutil::traverse %AUTO% $base \ |
| 105 | 105 | -prefilter [myproc FilterAtticSubdir $base]] |
| 106 | 106 | set n 0 |
| @@ -112,13 +112,14 @@ | ||
| 112 | 112 | if {![IsRCSArchive $path]} continue |
| 113 | 113 | |
| 114 | 114 | set usr [UserPath $rcs isattic] |
| 115 | 115 | if {[IsSuperceded $base $rcs $usr $isattic]} continue |
| 116 | 116 | |
| 117 | + # XXX Checkme: not sure if this will still fail in the case where a directory does conflict with a file XXX | |
| 117 | 118 | if { |
| 118 | - [file exists $base/$usr] && | |
| 119 | - [file isdirectory $base/$usr] | |
| 119 | + [lsearch [glob -tail -types f -directory $base *] $usr] != -1 && | |
| 120 | + [lsearch [glob -tail -types d -directory $base *] $usr] != -1 | |
| 120 | 121 | } { |
| 121 | 122 | trouble fatal "Directory name conflicts with filename." |
| 122 | 123 | trouble fatal "Please remove or rename one of the following:" |
| 123 | 124 | trouble fatal " $base/$usr" |
| 124 | 125 | trouble fatal " $base/$rcs" |
| @@ -218,11 +219,13 @@ | ||
| 218 | 219 | |
| 219 | 220 | proc IsSuperceded {base rcs usr isattic} { |
| 220 | 221 | ::variable myignore |
| 221 | 222 | |
| 222 | 223 | if {!$isattic} {return 0} |
| 223 | - if {![file exists $base/$usr,v]} {return 0} | |
| 224 | + | |
| 225 | + # use glob to account for case insensitive file systems | |
| 226 | + if {[lsearch [glob -tail -directory $base *] $usr,v] == -1} {return 0} | |
| 224 | 227 | |
| 225 | 228 | # We have a regular archive and an Attic archive refering to |
| 226 | 229 | # the same user visible file. Ignore the file in the Attic. |
| 227 | 230 | # |
| 228 | 231 | # By default this is a problem causing an abort after the pass |
| 229 | 232 |
| --- tools/cvs2fossil/lib/c2f_pcollar.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pcollar.tcl | |
| @@ -96,11 +96,11 @@ | |
| 96 | # Pass manager interface. Executed to perform the |
| 97 | # functionality of the pass. |
| 98 | |
| 99 | set rbase [repository base?] |
| 100 | foreach project [repository projects] { |
| 101 | set base [file join $rbase [$project base]] |
| 102 | log write 1 collar "Scan $base" |
| 103 | |
| 104 | set traverse [fileutil::traverse %AUTO% $base \ |
| 105 | -prefilter [myproc FilterAtticSubdir $base]] |
| 106 | set n 0 |
| @@ -112,13 +112,14 @@ | |
| 112 | if {![IsRCSArchive $path]} continue |
| 113 | |
| 114 | set usr [UserPath $rcs isattic] |
| 115 | if {[IsSuperceded $base $rcs $usr $isattic]} continue |
| 116 | |
| 117 | if { |
| 118 | [file exists $base/$usr] && |
| 119 | [file isdirectory $base/$usr] |
| 120 | } { |
| 121 | trouble fatal "Directory name conflicts with filename." |
| 122 | trouble fatal "Please remove or rename one of the following:" |
| 123 | trouble fatal " $base/$usr" |
| 124 | trouble fatal " $base/$rcs" |
| @@ -218,11 +219,13 @@ | |
| 218 | |
| 219 | proc IsSuperceded {base rcs usr isattic} { |
| 220 | ::variable myignore |
| 221 | |
| 222 | if {!$isattic} {return 0} |
| 223 | if {![file exists $base/$usr,v]} {return 0} |
| 224 | |
| 225 | # We have a regular archive and an Attic archive refering to |
| 226 | # the same user visible file. Ignore the file in the Attic. |
| 227 | # |
| 228 | # By default this is a problem causing an abort after the pass |
| 229 |
| --- tools/cvs2fossil/lib/c2f_pcollar.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pcollar.tcl | |
| @@ -96,11 +96,11 @@ | |
| 96 | # Pass manager interface. Executed to perform the |
| 97 | # functionality of the pass. |
| 98 | |
| 99 | set rbase [repository base?] |
| 100 | foreach project [repository projects] { |
| 101 | set base [::file join $rbase [$project base]] |
| 102 | log write 1 collar "Scan $base" |
| 103 | |
| 104 | set traverse [fileutil::traverse %AUTO% $base \ |
| 105 | -prefilter [myproc FilterAtticSubdir $base]] |
| 106 | set n 0 |
| @@ -112,13 +112,14 @@ | |
| 112 | if {![IsRCSArchive $path]} continue |
| 113 | |
| 114 | set usr [UserPath $rcs isattic] |
| 115 | if {[IsSuperceded $base $rcs $usr $isattic]} continue |
| 116 | |
| 117 | # XXX Checkme: not sure if this will still fail in the case where a directory does conflict with a file XXX |
| 118 | if { |
| 119 | [lsearch [glob -tail -types f -directory $base *] $usr] != -1 && |
| 120 | [lsearch [glob -tail -types d -directory $base *] $usr] != -1 |
| 121 | } { |
| 122 | trouble fatal "Directory name conflicts with filename." |
| 123 | trouble fatal "Please remove or rename one of the following:" |
| 124 | trouble fatal " $base/$usr" |
| 125 | trouble fatal " $base/$rcs" |
| @@ -218,11 +219,13 @@ | |
| 219 | |
| 220 | proc IsSuperceded {base rcs usr isattic} { |
| 221 | ::variable myignore |
| 222 | |
| 223 | if {!$isattic} {return 0} |
| 224 | |
| 225 | # use glob to account for case insensitive file systems |
| 226 | if {[lsearch [glob -tail -directory $base *] $usr,v] == -1} {return 0} |
| 227 | |
| 228 | # We have a regular archive and an Attic archive refering to |
| 229 | # the same user visible file. Ignore the file in the Attic. |
| 230 | # |
| 231 | # By default this is a problem causing an abort after the pass |
| 232 |
| --- tools/cvs2fossil/lib/c2f_pcollrev.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_pcollrev.tcl | ||
| @@ -316,18 +316,18 @@ | ||
| 316 | 316 | # Pass manager interface. Executed to perform the |
| 317 | 317 | # functionality of the pass. |
| 318 | 318 | |
| 319 | 319 | set rbase [repository base?] |
| 320 | 320 | foreach project [repository projects] { |
| 321 | - set base [file join $rbase [$project base]] | |
| 321 | + set base [::file join $rbase [$project base]] | |
| 322 | 322 | log write 1 collrev "Processing $base" |
| 323 | 323 | |
| 324 | 324 | foreach file [$project files] { |
| 325 | 325 | set path [$file path] |
| 326 | 326 | log write 2 collrev "Parsing $path" |
| 327 | 327 | if {[catch { |
| 328 | - parser process [file join $base $path] $file | |
| 328 | + parser process [::file join $base $path] $file | |
| 329 | 329 | } msg]} { |
| 330 | 330 | global errorCode |
| 331 | 331 | if {$errorCode eq "vc::rcs::parser"} { |
| 332 | 332 | trouble fatal "$path is not a valid RCS archive ($msg)" |
| 333 | 333 | } else { |
| 334 | 334 |
| --- tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| @@ -316,18 +316,18 @@ | |
| 316 | # Pass manager interface. Executed to perform the |
| 317 | # functionality of the pass. |
| 318 | |
| 319 | set rbase [repository base?] |
| 320 | foreach project [repository projects] { |
| 321 | set base [file join $rbase [$project base]] |
| 322 | log write 1 collrev "Processing $base" |
| 323 | |
| 324 | foreach file [$project files] { |
| 325 | set path [$file path] |
| 326 | log write 2 collrev "Parsing $path" |
| 327 | if {[catch { |
| 328 | parser process [file join $base $path] $file |
| 329 | } msg]} { |
| 330 | global errorCode |
| 331 | if {$errorCode eq "vc::rcs::parser"} { |
| 332 | trouble fatal "$path is not a valid RCS archive ($msg)" |
| 333 | } else { |
| 334 |
| --- tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| @@ -316,18 +316,18 @@ | |
| 316 | # Pass manager interface. Executed to perform the |
| 317 | # functionality of the pass. |
| 318 | |
| 319 | set rbase [repository base?] |
| 320 | foreach project [repository projects] { |
| 321 | set base [::file join $rbase [$project base]] |
| 322 | log write 1 collrev "Processing $base" |
| 323 | |
| 324 | foreach file [$project files] { |
| 325 | set path [$file path] |
| 326 | log write 2 collrev "Parsing $path" |
| 327 | if {[catch { |
| 328 | parser process [::file join $base $path] $file |
| 329 | } msg]} { |
| 330 | global errorCode |
| 331 | if {$errorCode eq "vc::rcs::parser"} { |
| 332 | trouble fatal "$path is not a valid RCS archive ($msg)" |
| 333 | } else { |
| 334 |
| --- tools/cvs2fossil/lib/c2f_state.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_state.tcl | ||
| @@ -42,19 +42,20 @@ | ||
| 42 | 42 | |
| 43 | 43 | # In the second case we have to be able to create the file, |
| 44 | 44 | # and check that. This is done by opening it, sqlite will then |
| 45 | 45 | # try to create it, and may fail. |
| 46 | 46 | |
| 47 | - if {[file exists $path]} { | |
| 47 | + if {[::file exists $path]} { | |
| 48 | 48 | if {![fileutil::test $path frw msg {cvs2fossil state}]} { |
| 49 | 49 | trouble fatal $msg |
| 50 | 50 | return |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if {[catch { |
| 55 | 55 | sqlite3 ${type}::TEMP $path |
| 56 | + ${type}::TEMP eval {PRAGMA synchronous=OFF;} | |
| 56 | 57 | } res]} { |
| 57 | 58 | trouble fatal $res |
| 58 | 59 | return |
| 59 | 60 | } |
| 60 | 61 | |
| @@ -80,20 +81,21 @@ | ||
| 80 | 81 | if {$mystate ne ""} return |
| 81 | 82 | |
| 82 | 83 | set mypath [fileutil::tempfile cvs2fossil_state_] |
| 83 | 84 | set mystate ${type}::STATE |
| 84 | 85 | sqlite3 $mystate $mypath |
| 86 | + $mystate eval {PRAGMA synchronous=OFF;} | |
| 85 | 87 | |
| 86 | 88 | log write 2 state "using $mypath" |
| 87 | 89 | return |
| 88 | 90 | } |
| 89 | 91 | |
| 90 | 92 | typemethod release {} { |
| 91 | 93 | log write 2 state release |
| 92 | 94 | ${type}::STATE close |
| 93 | 95 | if {$mypath eq ""} return |
| 94 | - file delete $mypath | |
| 96 | + ::file delete $mypath | |
| 95 | 97 | return |
| 96 | 98 | } |
| 97 | 99 | |
| 98 | 100 | # Declare a table needed for the storing of persistent state, and |
| 99 | 101 | # its structure. A possibly previously existing definition is |
| 100 | 102 |
| --- tools/cvs2fossil/lib/c2f_state.tcl | |
| +++ tools/cvs2fossil/lib/c2f_state.tcl | |
| @@ -42,19 +42,20 @@ | |
| 42 | |
| 43 | # In the second case we have to be able to create the file, |
| 44 | # and check that. This is done by opening it, sqlite will then |
| 45 | # try to create it, and may fail. |
| 46 | |
| 47 | if {[file exists $path]} { |
| 48 | if {![fileutil::test $path frw msg {cvs2fossil state}]} { |
| 49 | trouble fatal $msg |
| 50 | return |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | if {[catch { |
| 55 | sqlite3 ${type}::TEMP $path |
| 56 | } res]} { |
| 57 | trouble fatal $res |
| 58 | return |
| 59 | } |
| 60 | |
| @@ -80,20 +81,21 @@ | |
| 80 | if {$mystate ne ""} return |
| 81 | |
| 82 | set mypath [fileutil::tempfile cvs2fossil_state_] |
| 83 | set mystate ${type}::STATE |
| 84 | sqlite3 $mystate $mypath |
| 85 | |
| 86 | log write 2 state "using $mypath" |
| 87 | return |
| 88 | } |
| 89 | |
| 90 | typemethod release {} { |
| 91 | log write 2 state release |
| 92 | ${type}::STATE close |
| 93 | if {$mypath eq ""} return |
| 94 | file delete $mypath |
| 95 | return |
| 96 | } |
| 97 | |
| 98 | # Declare a table needed for the storing of persistent state, and |
| 99 | # its structure. A possibly previously existing definition is |
| 100 |
| --- tools/cvs2fossil/lib/c2f_state.tcl | |
| +++ tools/cvs2fossil/lib/c2f_state.tcl | |
| @@ -42,19 +42,20 @@ | |
| 42 | |
| 43 | # In the second case we have to be able to create the file, |
| 44 | # and check that. This is done by opening it, sqlite will then |
| 45 | # try to create it, and may fail. |
| 46 | |
| 47 | if {[::file exists $path]} { |
| 48 | if {![fileutil::test $path frw msg {cvs2fossil state}]} { |
| 49 | trouble fatal $msg |
| 50 | return |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | if {[catch { |
| 55 | sqlite3 ${type}::TEMP $path |
| 56 | ${type}::TEMP eval {PRAGMA synchronous=OFF;} |
| 57 | } res]} { |
| 58 | trouble fatal $res |
| 59 | return |
| 60 | } |
| 61 | |
| @@ -80,20 +81,21 @@ | |
| 81 | if {$mystate ne ""} return |
| 82 | |
| 83 | set mypath [fileutil::tempfile cvs2fossil_state_] |
| 84 | set mystate ${type}::STATE |
| 85 | sqlite3 $mystate $mypath |
| 86 | $mystate eval {PRAGMA synchronous=OFF;} |
| 87 | |
| 88 | log write 2 state "using $mypath" |
| 89 | return |
| 90 | } |
| 91 | |
| 92 | typemethod release {} { |
| 93 | log write 2 state release |
| 94 | ${type}::STATE close |
| 95 | if {$mypath eq ""} return |
| 96 | ::file delete $mypath |
| 97 | return |
| 98 | } |
| 99 | |
| 100 | # Declare a table needed for the storing of persistent state, and |
| 101 | # its structure. A possibly previously existing definition is |
| 102 |
+1
-1
| --- tools/cvs2fossil/lib/dot.tcl | ||
| +++ tools/cvs2fossil/lib/dot.tcl | ||
| @@ -58,11 +58,11 @@ | ||
| 58 | 58 | |
| 59 | 59 | typemethod layout {format g name file} { |
| 60 | 60 | set f [fileutil::tempfile c2fdot_] |
| 61 | 61 | $type write $g $name $f |
| 62 | 62 | exec dot -T $format -o $file $f |
| 63 | - file delete $f | |
| 63 | + ::file delete $f | |
| 64 | 64 | return |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | # # ## ### ##### ######## ############# |
| 68 | 68 | ## Internal, state |
| 69 | 69 |
| --- tools/cvs2fossil/lib/dot.tcl | |
| +++ tools/cvs2fossil/lib/dot.tcl | |
| @@ -58,11 +58,11 @@ | |
| 58 | |
| 59 | typemethod layout {format g name file} { |
| 60 | set f [fileutil::tempfile c2fdot_] |
| 61 | $type write $g $name $f |
| 62 | exec dot -T $format -o $file $f |
| 63 | file delete $f |
| 64 | return |
| 65 | } |
| 66 | |
| 67 | # # ## ### ##### ######## ############# |
| 68 | ## Internal, state |
| 69 |
| --- tools/cvs2fossil/lib/dot.tcl | |
| +++ tools/cvs2fossil/lib/dot.tcl | |
| @@ -58,11 +58,11 @@ | |
| 58 | |
| 59 | typemethod layout {format g name file} { |
| 60 | set f [fileutil::tempfile c2fdot_] |
| 61 | $type write $g $name $f |
| 62 | exec dot -T $format -o $file $f |
| 63 | ::file delete $f |
| 64 | return |
| 65 | } |
| 66 | |
| 67 | # # ## ### ##### ######## ############# |
| 68 | ## Internal, state |
| 69 |
+1
-1
| --- tools/cvs2fossil/lib/misc.tcl | ||
| +++ tools/cvs2fossil/lib/misc.tcl | ||
| @@ -81,11 +81,11 @@ | ||
| 81 | 81 | |
| 82 | 82 | # Delete item from list by name |
| 83 | 83 | |
| 84 | 84 | proc striptrailingslash {path} { |
| 85 | 85 | # split and rejoin gets rid of a traling / character. |
| 86 | - return [eval [linsert [file split $path] 0 file join]] | |
| 86 | + return [eval [linsert [file split $path] 0 ::file join]] | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | # # ## ### ##### ######## ############# |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 |
| --- tools/cvs2fossil/lib/misc.tcl | |
| +++ tools/cvs2fossil/lib/misc.tcl | |
| @@ -81,11 +81,11 @@ | |
| 81 | |
| 82 | # Delete item from list by name |
| 83 | |
| 84 | proc striptrailingslash {path} { |
| 85 | # split and rejoin gets rid of a traling / character. |
| 86 | return [eval [linsert [file split $path] 0 file join]] |
| 87 | } |
| 88 | |
| 89 | # # ## ### ##### ######## ############# |
| 90 | } |
| 91 | |
| 92 |
| --- tools/cvs2fossil/lib/misc.tcl | |
| +++ tools/cvs2fossil/lib/misc.tcl | |
| @@ -81,11 +81,11 @@ | |
| 81 | |
| 82 | # Delete item from list by name |
| 83 | |
| 84 | proc striptrailingslash {path} { |
| 85 | # split and rejoin gets rid of a traling / character. |
| 86 | return [eval [linsert [file split $path] 0 ::file join]] |
| 87 | } |
| 88 | |
| 89 | # # ## ### ##### ######## ############# |
| 90 | } |
| 91 | |
| 92 |