Fossil SCM
Changed the printing of the symbol tree to be based on table 'preferedparent', and introduced two procs to shorten the fomratting code.
Commit
ae53becda49638f2f84ea03ecb64f4f9871204a3
Parent
e3e3d301fce6f8c…
1 file changed
+13
-20
+13
-20
| --- tools/cvs2fossil/lib/c2f_pfiltersym.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_pfiltersym.tcl | ||
| @@ -532,48 +532,41 @@ | ||
| 532 | 532 | |
| 533 | 533 | array set sym {} |
| 534 | 534 | set n 0 |
| 535 | 535 | set t 0 |
| 536 | 536 | set c 0 |
| 537 | + set p 0 | |
| 537 | 538 | |
| 538 | 539 | state foreachrow { |
| 539 | 540 | SELECT S.name AS xs, |
| 540 | 541 | A.name AS stype, |
| 541 | 542 | S.commit_count AS cc, |
| 542 | 543 | P.name AS xp, |
| 543 | 544 | 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 | |
| 560 | 550 | } { |
| 561 | 551 | lappend sym($xs) $xp $stype $ptype $cc |
| 562 | 552 | maxlen n $xs |
| 563 | 553 | maxlen t $stype |
| 564 | 554 | maxlen t $ptype |
| 565 | 555 | maxlen c $cc |
| 556 | + maxlen p $xp | |
| 566 | 557 | } |
| 567 | 558 | |
| 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} | |
| 572 | 562 | } |
| 573 | 563 | return |
| 574 | 564 | } |
| 565 | + | |
| 566 | + proc lj {n s} { ::format %-${n}s $s } | |
| 567 | + proc dj {n s} { ::format %-${n}d $s } | |
| 575 | 568 | |
| 576 | 569 | # # ## ### ##### ######## ############# |
| 577 | 570 | ## Configuration |
| 578 | 571 | |
| 579 | 572 | pragma -hasinstances no ; # singleton |
| 580 | 573 |
| --- 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 |