Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/c2f_pinitcsets.tcl part of check-in [b3d61d7829] - Fixed bug made in f46458d5bd which prevented the saving of the changesets generated by the breaking of the internal dependencies. by aku on 2008-02-23 06:33:30. Also file tools/cvs2fossil/lib/c2f_pinitcsets.tcl part of check-in [383c10f004] - Merged bugfix b3d61d7829 into this semi-abandoned branch just in case we will work on it again. Do it now instead of forgetting it later. by aku on 2008-02-23 06:37:54. Also file tools/cvs2fossil/lib/c2f_pinitcsets.tcl part of check-in [efec424a19] - Merged bugfix b3d61d7829 into the main branch for optimization of memory usage. by aku on 2008-02-23 06:40:48. [view]

To:

File tools/cvs2fossil/lib/c2f_pinitcsets.tcl part of check-in [6559f3231e] - New command 'state foreachrow' for incremental result processing, using less memory. Converted a number of places in pass InitCSet to this command, and marked a number of othre places for possible future use. by aku on 2008-02-24 04:43:56. [view]

@@ -196,17 +196,20 @@
 	#       less such calls. None, but the creation itself.
 
 	log write 14 initcsets meta_begin
 	mem::mark
-	foreach {mid rid pid} [state run {
-	    SELECT M.mid, R.rid, M.pid
-	    FROM   revision R, meta M   -- R ==> M, using PK index of M.
+	state foreachrow {
+	    SELECT M.mid AS xmid,
+	           R.rid AS xrid,
+	           M.pid AS xpid
+	    FROM   revision R,
+	           meta     M   -- R ==> M, using PK index of M.
 	    WHERE  R.mid = M.mid
 	    ORDER  BY M.mid, R.date
-	}] {
+	} {
 	    log write 14 initcsets meta_next
 
-	    if {$lastmeta != $mid} {
+	    if {$lastmeta != $xmid} {
 		if {[llength $revisions]} {
 		    incr n
 		    set  p [repository projectof $lastproject]
 		    log write 14 initcsets meta_cset_begin
@@ -219,12 +222,12 @@
 		    foreach cset $spawned { $cset persist ; $cset destroy }
 		    mem::mark
 		    set revisions {}
 		}
-		set lastmeta    $mid
-		set lastproject $pid
+		set lastmeta    $xmid
+		set lastproject $xpid
 	    }
-	    lappend revisions $rid
+	    lappend revisions $xrid
 	}
 
 	if {[llength $revisions]} {
 	    incr n
@@ -267,15 +270,18 @@
 	set lastsymbol  {}
 	set lastproject {}
 	set tags        {}
 
-	foreach {sid tid pid} [state run {
-	    SELECT S.sid, T.tid, S.pid
-	    FROM  tag T, symbol S     -- T ==> R/S, using PK indices of R, S.
+	state foreachrow {
+	    SELECT S.sid AS xsid,
+	           T.tid AS xtid,
+	           S.pid AS xpid
+	    FROM  tag    T,
+	          symbol S     -- T ==> R/S, using PK indices of R, S.
 	    WHERE T.sid = S.sid
 	    ORDER BY S.sid, T.tid
-	}] {
-	    if {$lastsymbol != $sid} {
+	} {
+	    if {$lastsymbol != $xsid} {
 		if {[llength $tags]} {
 		    incr n
 		    set  p [repository projectof $lastproject]
 		    set cset [project::rev %AUTO% $p sym::tag $lastsymbol $tags]
@@ -282,12 +288,12 @@
 		    set tags {}
 		    $cset persist
 		    $cset destroy
 		}
-		set lastsymbol  $sid
-		set lastproject $pid
+		set lastsymbol  $xsid
+		set lastproject $xpid
 	    }
-	    lappend tags $tid
+	    lappend tags $xtid
 	}
 
 	if {[llength $tags]} {
 	    incr n
@@ -300,15 +306,18 @@
 	set lastsymbol {}
 	set lasproject {}
 	set branches   {}
 
-	foreach {sid bid pid} [state run {
-	    SELECT S.sid, B.bid, S.pid
-	    FROM  branch B, symbol S  -- B ==> R/S, using PK indices of R, S.
+	state foreachrow {
+	    SELECT S.sid AS xsid,
+	           B.bid AS xbid,
+	           S.pid AS xpid
+	    FROM  branch B,
+	          symbol S  -- B ==> R/S, using PK indices of R, S.
 	    WHERE B.sid  = S.sid
 	    ORDER BY S.sid, B.bid
-	}] {
-	    if {$lastsymbol != $sid} {
+	} {
+	    if {$lastsymbol != $xsid} {
 		if {[llength $branches]} {
 		    incr n
 		    set  p [repository projectof $lastproject]
 		    set cset [project::rev %AUTO% $p sym::branch $lastsymbol $branches]
@@ -315,12 +324,12 @@
 		    set branches {}
 		    $cset persist
 		    $cset destroy
 		}
-		set lastsymbol  $sid
-		set lastproject $pid
+		set lastsymbol  $xsid
+		set lastproject $xpid
 	    }
-	    lappend branches $bid
+	    lappend branches $xbid
 	}
 
 	if {[llength $branches]} {
 	    incr n