Differences From:
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]
To:
File
tools/cvs2fossil/lib/c2f_pfiltersym.tcl
part of check-in
[ae53becda4]
- Changed the printing of the symbol tree to be based on table 'preferedparent', and introduced two procs to shorten the fomratting code.
by
aku on
2008-03-02 01:09:16.
[view]
@@ -533,46 +533,39 @@
array set sym {}
set n 0
set t 0
set c 0
+ set p 0
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 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
+ FROM symbol S, preferedparent SP, symbol P, symtype A, symtype B
+ WHERE SP.sid = S.sid
+ AND P.sid = SP.pid
+ AND A.tid = S.type
+ AND B.tid = P.type
} {
lappend sym($xs) $xp $stype $ptype $cc
maxlen n $xs
maxlen t $stype
maxlen t $ptype
maxlen c $cc
+ maxlen p $xp
}
- foreach s [lsort -dict [array names sym]] {
- struct::list assign $sym($s) p stype ptype cc
-
- log write 9 filtersym {Tree: [format %-${t}s $stype] ([format %-${c}d $cc]) [format %-${n}s $s] <-- [format %-${t}s $ptype] $p}
+ foreach xs [lsort -dict [array names sym]] {
+ struct::list assign $sym($xs) xp stype ptype cc
+ log write 9 filtersym {Tree: [lj $t $stype] ([dj $c $cc]) [lj $n $xs] <-- [lj $t $ptype] $xp}
}
return
}
+
+ proc lj {n s} { ::format %-${n}s $s }
+ proc dj {n s} { ::format %-${n}d $s }
# # ## ### ##### ######## #############
## Configuration