Fossil SCM

Extended rcs parser to tag errors which are syntax errors in the RCS archive. Extended pass handling to capture trouble and distinguish between internal problems and syntax errors.

aku 2007-10-12 05:57 trunk
Commit be891232a20c3ba2c6d2ae50ffc620323ce286dd
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -190,11 +190,21 @@
190190
log write 1 collrev "Processing $base"
191191
192192
foreach file [$project files] {
193193
set path [$file path]
194194
log write 2 collrev "Parsing $path"
195
- parser process [file join $base $path] $file
195
+ if {[catch {
196
+ parser process [file join $base $path] $file
197
+ } msg]} {
198
+ global errorCode
199
+ if {$errorCode eq "vc::rcs::parser"} {
200
+ trouble fatal "$path is not a valid RCS archive ($msg)"
201
+ } else {
202
+ global errorInfo
203
+ trouble internal $errorInfo
204
+ }
205
+ }
196206
}
197207
}
198208
199209
repository printrevstatistics
200210
repository persistrev
201211
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -190,11 +190,21 @@
190 log write 1 collrev "Processing $base"
191
192 foreach file [$project files] {
193 set path [$file path]
194 log write 2 collrev "Parsing $path"
195 parser process [file join $base $path] $file
 
 
 
 
 
 
 
 
 
 
196 }
197 }
198
199 repository printrevstatistics
200 repository persistrev
201
--- tools/cvs2fossil/lib/c2f_pcollrev.tcl
+++ tools/cvs2fossil/lib/c2f_pcollrev.tcl
@@ -190,11 +190,21 @@
190 log write 1 collrev "Processing $base"
191
192 foreach file [$project files] {
193 set path [$file path]
194 log write 2 collrev "Parsing $path"
195 if {[catch {
196 parser process [file join $base $path] $file
197 } msg]} {
198 global errorCode
199 if {$errorCode eq "vc::rcs::parser"} {
200 trouble fatal "$path is not a valid RCS archive ($msg)"
201 } else {
202 global errorInfo
203 trouble internal $errorInfo
204 }
205 }
206 }
207 }
208
209 repository printrevstatistics
210 repository persistrev
211
--- tools/cvs2fossil/lib/rcsparser.tcl
+++ tools/cvs2fossil/lib/rcsparser.tcl
@@ -366,11 +366,12 @@
366366
367367
proc Expected {x} {
368368
::variable mydata
369369
::variable mypos
370370
set e $mypos ; incr e 30
371
- return -code error "Expected $x @ '[string range $mydata $mypos $e]...'"
371
+ return -code error -errorcode vc::rcs::parser \
372
+ "Expected $x @ '[string range $mydata $mypos $e]...'"
372373
}
373374
374375
# # ## ### ##### ######## #############
375376
## Setup, callbacks.
376377
377378
--- tools/cvs2fossil/lib/rcsparser.tcl
+++ tools/cvs2fossil/lib/rcsparser.tcl
@@ -366,11 +366,12 @@
366
367 proc Expected {x} {
368 ::variable mydata
369 ::variable mypos
370 set e $mypos ; incr e 30
371 return -code error "Expected $x @ '[string range $mydata $mypos $e]...'"
 
372 }
373
374 # # ## ### ##### ######## #############
375 ## Setup, callbacks.
376
377
--- tools/cvs2fossil/lib/rcsparser.tcl
+++ tools/cvs2fossil/lib/rcsparser.tcl
@@ -366,11 +366,12 @@
366
367 proc Expected {x} {
368 ::variable mydata
369 ::variable mypos
370 set e $mypos ; incr e 30
371 return -code error -errorcode vc::rcs::parser \
372 "Expected $x @ '[string range $mydata $mypos $e]...'"
373 }
374
375 # # ## ### ##### ######## #############
376 ## Setup, callbacks.
377
378

Keyboard Shortcuts

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