Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pfiltersym.tcl part of check-in [66235f2430] - Updated the copyright information of all files touched in the new year. by aku on 2008-02-06 05:04:12. Also file tools/cvs2fossil/lib/c2f_pfiltersym.tcl part of check-in [6b78df3861] - Merge in changes from Andreas's branch. by drh on 2008-02-08 21:52:21. [view]

To:

File tools/cvs2fossil/lib/c2f_pfiltersym.tcl part of check-in [f637d42206] - Updated my notes regarding memory usage. Converted more locations to incremental query processing via 'state foreachrow', now throughout the importer. by aku on 2008-02-24 18:01:40. [view]

@@ -148,18 +148,20 @@
 
 	array set ntdb {}
 	array set link {}
 
-	foreach {id parent transfer} [state run {
-	    SELECT R.rid, R.parent, R.dbchild
+	state foreachrow {
+	    SELECT R.rid     AS xid,
+	           R.parent  AS xparent,
+	           R.dbchild AS transfer
 	    FROM  revision R, symbol S
 	    WHERE R.lod = S.sid            -- Get symbol of line-of-development of all revisions
 	    AND   S.sid IN excludedsymbols -- Restrict to the excluded symbols
 	    AND   R.isdefault              -- Restrict to NTDB revisions
-	}] {
-	    set ntdb($id) $parent
+	} {
+	    set ntdb($xid) $xparent
 	    if {$transfer eq ""} continue
-	    set link($id) $transfer
+	    set link($xid) $transfer
 	}
 
 	foreach joint [array names link] {
 	    # The joints are the highest NTDB revisions which are
@@ -309,13 +311,13 @@
 	# Symbol names ...
 	array set sx [state run { SELECT L.sid, L.name FROM symbol L }]
 	# Files and projects.
 	array set fpn {}
-	foreach {id fn pn} [state run {
-		SELECT F.fid, F.name, P.name
+	state foreachrow {
+		SELECT F.fid AS id, F.name AS fn, P.name AS pn
 		FROM   file F, project P
 		WHERE  F.pid = P.pid
-	}] { set fpn($id) [list $fn $pn] }
+	} { set fpn($id) [list $fn $pn] }
 
 	set tagstoadjust [state run {
 	    SELECT T.tid, T.fid, T.lod, P.pid, S.name, R.rev, R.rid
 	    FROM tag T, preferedparent P, symbol S, revision R
@@ -532,25 +534,33 @@
 	set n 0
 	set t 0
 	set c 0
 
-	foreach {s stype cc p ptype} [state run {
-	    SELECT S.name, A.name, S.commit_count, P.name, B.name
+	state foreachrow {
+	    SELECT S.name         AS xs,
+	           A.name         AS stype,
+	           S.commit_count AS cc,
+	           P.name         AS xp,
+	           B.name         AS ptype
 	    FROM   tag T, symbol S, symbol P, symtype A, symtype B
 	    WHERE  S.sid = T.sid
 	    AND    P.sid = T.lod
 	    AND    A.tid = S.type
 	    AND    B.tid = P.type
 	    UNION
-	    SELECT S.name, A.name, S.commit_count, P.name, B.name
+	    SELECT S.name         AS xs,
+	           A.name         AS stype,
+	           S.commit_count AS cc,
+	           P.name         AS xp,
+	           B.name         AS ptype
 	    FROM   branch B, symbol S, symbol P, symtype A, symtype B
 	    WHERE  S.sid = B.sid
 	    AND    P.sid = B.lod
 	    AND    A.tid = S.type
 	    AND    B.tid = P.type
-	}] {
-	    lappend sym($s) $p $stype $ptype $cc
-	    maxlen n $s
+	} {
+	    lappend sym($xs) $xp $stype $ptype $cc
+	    maxlen n $xs
 	    maxlen t $stype
 	    maxlen t $ptype
 	    maxlen c $cc
 	}