Differences From:
File
tools/cvs2fossil/lib/c2f_pcollar.tcl
part of check-in
[47740cc1f6]
- Added stub for repository management, added most of pass I, collecting archives in the repository.
by
aku on
2007-10-03 04:18:18.
[view]
To:
File
tools/cvs2fossil/lib/c2f_pcollar.tcl
part of check-in
[52f2254007]
- Continued work on pass I. Filled in the repository management, and basic implementation of project objects. Missing are persistence and the foundation for that (cache database).
by
aku on
2007-10-04 04:34:59.
[view]
@@ -46,10 +46,11 @@
# TODO ... artifact/cache - drop projects/files, create projects/files
}
typemethod run {} {
+ set rbase [repository base?]
foreach project [repository projects] {
- set base [$project base]
+ set base [file join $rbase [$project base]]
log write 1 collar "Scan $base"
set traverse [fileutil::traverse %AUTO% $base]
set n 0
@@ -62,29 +63,36 @@
set usr [UserPath $rcs isattic]
if {[IsSuperceded $base $rcs $usr $isattic]} continue
- log write 1 collar "Found $rcs"
+ log write 4 collar "Found $rcs"
$project add $rcs $usr
incr n
- log progress 0 collar $n {}
+ if {[log verbosity?] < 4} {
+ log progress 0 collar $n {}
+ }
}
$traverse destroy
}
+
+ repository printstatistics
+ repository persist
+
+ log write 1 collar "Scan completed"
return
}
typemethod ignore_conflicting_attics {} {
- set ignore 1
+ set myignore 1
return
}
# # ## ### ##### ######## #############
## Internal methods
- typevariable ignore 0
+ typevariable myignore 0
proc IsRCSArchive {path} {
if {![string match *,v $path]} {return 0}
if {[fileutil::test $path fr msg]} {return 1}
@@ -93,9 +101,9 @@
}
proc IsCVSAdmin {rcs} {
if {![string match CVSROOT/* $rcs]} {return 0}
- log write 2 collar "Ignored $rcs, administrative archive"
+ log write 4 collar "Ignored $rcs, administrative archive"
return 1
}
proc UserPath {rcs iav} {
@@ -134,9 +142,10 @@
# has completed. The user can however force us to ignore it.
# In that case the warning is still printed, but will not
# induce an abort any longer.
- if {$ignore} {
+ upvar 1 myignore myignore
+ if {$myignore} {
log write 2 collar "Ignored $rcs, superceded archive"
} else {
trouble warn "Ignored $rcs, superceded archive"
}