Differences From:
File
tools/cvs2fossil/lib/c2f_pfiltersym.tcl
part of check-in
[2516f4a56d]
- Bugfix. When I introduced the 'revisionbranchchildren' table to pass 2 I forgot to update pass 4 as well. Added code to drop the excluded revisons from this table as well, as either parent of branches, or branch child of some other revision.
by
aku on
2007-11-16 03:54:54.
[view]
To:
File
tools/cvs2fossil/lib/c2f_pfiltersym.tcl
part of check-in
[38b967dcf5]
- Merge aku's CVS import changes into the main line. Fix a small bug in diff.c.
by
drh on
2007-11-17 00:29:42.
Also file
tools/cvs2fossil/lib/c2f_pfiltersym.tcl
part of check-in
[96b7bfb834]
- Added convenience command to the state package when the sql returns a single row. Added more statistics about revisions, tags, branches, symbols, changesets to various passes.
by
aku on
2007-11-16 08:32:40.
[view]
@@ -20,8 +20,9 @@
package require Tcl 8.4 ; # Required runtime.
package require snit ; # OO system.
package require vc::tools::misc ; # Text formatting.
package require vc::tools::log ; # User feedback.
+package require vc::fossil::import::cvs::repository ; # Repository management.
package require vc::fossil::import::cvs::state ; # State storage.
package require vc::fossil::import::cvs::integrity ; # State storage integrity checks.
package require vc::fossil::import::cvs::project::sym ; # Project level symbols
@@ -82,8 +83,10 @@
MutateSymbols
AdjustParents
RefineSymbols
+ repository printrevstatistics
+
# Strict integrity enforces that all meta entries are in
# the same LOD as the revision using them. At this point
# this may not be true any longer. If a NTDB was excluded
# then all revisions it shared with the trunk were moved
@@ -112,9 +115,9 @@
# # ## ### ##### ######## #############
## Internal methods
proc FilterExcludedSymbols {} {
- log write 3 filtersym "Filter out excluded symbols and users"
+ log write 3 filtersym "Remove the excluded symbols and their users"
# We pull all the excluded symbols together into a table for
# easy reference by the upcoming DELETE and other statements.
# ('x IN table' clauses).
@@ -160,11 +163,11 @@
# instead. All parents of the joints are moved to the
# trunk as well.
set tjoint $link($joint)
- set tlod [lindex [state run {
+ set tlod [state one {
SELECT lod FROM revision WHERE rid = $tjoint
- }] 0]
+ }]
# Covnert db/parent/child into regular parent/child links.
state run {
UPDATE revision SET dbparent = NULL, parent = $joint WHERE rid = $tjoint ;
@@ -350,14 +353,14 @@
# ... AND P.pid IN (SELECT B.sid
# FROM branch B
# WHERE B.root = R.rid)
- if {![lindex [state run {
+ if {![state one {
SELECT COUNT(*)
FROM branch B
WHERE B.sid = $pid
AND B.root = $rid
- }] 0]} {
+ }]} {
incr tmax -1
set mxs [format $fmt $tmax]
continue
}
@@ -407,15 +410,15 @@
# FROM branch BX
# WHERE BX.root = R.rid
# AND BX.pos > B.pos)
- if {![lindex [state run {
+ if {![state one {
SELECT COUNT(*)
FROM branch B
WHERE B.sid = $pid
AND B.root = $rid
AND B.pos > $pos
- }] 0]} {
+ }]} {
incr bmax -1
set mxs [format $fmt $bmax]
continue
}
@@ -499,8 +502,9 @@
namespace eval ::vc::fossil::import::cvs::pass {
namespace export filtersym
namespace eval filtersym {
+ namespace import ::vc::fossil::import::cvs::repository
namespace import ::vc::fossil::import::cvs::state
namespace import ::vc::fossil::import::cvs::integrity
namespace eval project {
namespace import ::vc::fossil::import::cvs::project::sym