Check-in [70acbf63ec]
Not logged in
Overview

SHA1 Hash:70acbf63ecb0a70eef3091a6a7d88418c2176c26
Date: 2008-02-06 04:51:51
User: aku
Comment:Print the tree of symbols (i.e. definite parents) at high verbosity levels.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified tools/cvs2fossil/lib/c2f_pfiltersym.tcl from [3f927ba110] to [c7ce4a70d0].

@@ -87,10 +87,11 @@
 	    FilterExcludedSymbols
 	    MutateSymbols
 	    AdjustParents
 	    RefineSymbols
 
+	    PrintSymbolTree
 	    repository printrevstatistics
 
 	    # Strict integrity enforces that all meta entries are in
 	    # the same LOD as the revision using them. At this point
 	    # this may not be true any longer. If a NTDB was excluded
@@ -99,11 +100,11 @@
 	    # refer to the now gone LOD symbol. This is fine however,
 	    # it will not affect our ability to use the meta entries
 	    # to distinguish and group revisions into changesets. It
 	    # should be noted that we cannot simply switch the meta
 	    # entries over to the trunk either, as that may cause the
-	    # modified entries to violate the unique-ness constrain
+	    # modified entries to violate the unique-ness constraint
 	    # set on that table.
 	    integrity metarelaxed
 	}
 
 	log write 1 filtersym "Filtering completed"
@@ -510,10 +511,56 @@
 	    INSERT INTO noop
 	    SELECT B.bid, 1
 	    FROM branch B, revision R
 	    WHERE B.root = R.rid
 	    AND   R.op   = 0 -- nothing
+	}
+	return
+    }
+
+    proc maxlen {v str} {
+	upvar 1 $v n
+	set l [string length $str]
+	if {$l <= $n} return
+	set n $l
+	return
+    }
+
+    proc PrintSymbolTree {} {
+	if {![log visible? 9]} return
+
+	array set sym {}
+	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
+	    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
+	    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
+	    maxlen t $stype
+	    maxlen t $ptype
+	    maxlen c $cc
+	}
+
+	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}
 	}
 	return
     }
 
     # # ## ### ##### ######## #############