Fossil SCM

Changed the printing of the symbol tree to be based on table 'preferedparent', and introduced two procs to shorten the fomratting code.

aku 2008-03-02 01:09 trunk
Commit ae53becda49638f2f84ea03ecb64f4f9871204a3
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -532,48 +532,41 @@
532532
533533
array set sym {}
534534
set n 0
535535
set t 0
536536
set c 0
537
+ set p 0
537538
538539
state foreachrow {
539540
SELECT S.name AS xs,
540541
A.name AS stype,
541542
S.commit_count AS cc,
542543
P.name AS xp,
543544
B.name AS ptype
544
- FROM tag T, symbol S, symbol P, symtype A, symtype B
545
- WHERE S.sid = T.sid
546
- AND P.sid = T.lod
547
- AND A.tid = S.type
548
- AND B.tid = P.type
549
- UNION
550
- SELECT S.name AS xs,
551
- A.name AS stype,
552
- S.commit_count AS cc,
553
- P.name AS xp,
554
- B.name AS ptype
555
- FROM branch B, symbol S, symbol P, symtype A, symtype B
556
- WHERE S.sid = B.sid
557
- AND P.sid = B.lod
558
- AND A.tid = S.type
559
- AND B.tid = P.type
545
+ FROM symbol S, preferedparent SP, symbol P, symtype A, symtype B
546
+ WHERE SP.sid = S.sid
547
+ AND P.sid = SP.pid
548
+ AND A.tid = S.type
549
+ AND B.tid = P.type
560550
} {
561551
lappend sym($xs) $xp $stype $ptype $cc
562552
maxlen n $xs
563553
maxlen t $stype
564554
maxlen t $ptype
565555
maxlen c $cc
556
+ maxlen p $xp
566557
}
567558
568
- foreach s [lsort -dict [array names sym]] {
569
- struct::list assign $sym($s) p stype ptype cc
570
-
571
- log write 9 filtersym {Tree: [format %-${t}s $stype] ([format %-${c}d $cc]) [format %-${n}s $s] <-- [format %-${t}s $ptype] $p}
559
+ foreach xs [lsort -dict [array names sym]] {
560
+ struct::list assign $sym($xs) xp stype ptype cc
561
+ log write 9 filtersym {Tree: [lj $t $stype] ([dj $c $cc]) [lj $n $xs] <-- [lj $t $ptype] $xp}
572562
}
573563
return
574564
}
565
+
566
+ proc lj {n s} { ::format %-${n}s $s }
567
+ proc dj {n s} { ::format %-${n}d $s }
575568
576569
# # ## ### ##### ######## #############
577570
## Configuration
578571
579572
pragma -hasinstances no ; # singleton
580573
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -532,48 +532,41 @@
532
533 array set sym {}
534 set n 0
535 set t 0
536 set c 0
 
537
538 state foreachrow {
539 SELECT S.name AS xs,
540 A.name AS stype,
541 S.commit_count AS cc,
542 P.name AS xp,
543 B.name AS ptype
544 FROM tag T, symbol S, symbol P, symtype A, symtype B
545 WHERE S.sid = T.sid
546 AND P.sid = T.lod
547 AND A.tid = S.type
548 AND B.tid = P.type
549 UNION
550 SELECT S.name AS xs,
551 A.name AS stype,
552 S.commit_count AS cc,
553 P.name AS xp,
554 B.name AS ptype
555 FROM branch B, symbol S, symbol P, symtype A, symtype B
556 WHERE S.sid = B.sid
557 AND P.sid = B.lod
558 AND A.tid = S.type
559 AND B.tid = P.type
560 } {
561 lappend sym($xs) $xp $stype $ptype $cc
562 maxlen n $xs
563 maxlen t $stype
564 maxlen t $ptype
565 maxlen c $cc
 
566 }
567
568 foreach s [lsort -dict [array names sym]] {
569 struct::list assign $sym($s) p stype ptype cc
570
571 log write 9 filtersym {Tree: [format %-${t}s $stype] ([format %-${c}d $cc]) [format %-${n}s $s] <-- [format %-${t}s $ptype] $p}
572 }
573 return
574 }
 
 
 
575
576 # # ## ### ##### ######## #############
577 ## Configuration
578
579 pragma -hasinstances no ; # singleton
580
--- tools/cvs2fossil/lib/c2f_pfiltersym.tcl
+++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl
@@ -532,48 +532,41 @@
532
533 array set sym {}
534 set n 0
535 set t 0
536 set c 0
537 set p 0
538
539 state foreachrow {
540 SELECT S.name AS xs,
541 A.name AS stype,
542 S.commit_count AS cc,
543 P.name AS xp,
544 B.name AS ptype
545 FROM symbol S, preferedparent SP, symbol P, symtype A, symtype B
546 WHERE SP.sid = S.sid
547 AND P.sid = SP.pid
548 AND A.tid = S.type
549 AND B.tid = P.type
 
 
 
 
 
 
 
 
 
 
 
550 } {
551 lappend sym($xs) $xp $stype $ptype $cc
552 maxlen n $xs
553 maxlen t $stype
554 maxlen t $ptype
555 maxlen c $cc
556 maxlen p $xp
557 }
558
559 foreach xs [lsort -dict [array names sym]] {
560 struct::list assign $sym($xs) xp stype ptype cc
561 log write 9 filtersym {Tree: [lj $t $stype] ([dj $c $cc]) [lj $n $xs] <-- [lj $t $ptype] $xp}
 
562 }
563 return
564 }
565
566 proc lj {n s} { ::format %-${n}s $s }
567 proc dj {n s} { ::format %-${n}d $s }
568
569 # # ## ### ##### ######## #############
570 ## Configuration
571
572 pragma -hasinstances no ; # singleton
573

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button