Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/dot.tcl part of check-in [7f15be9078] - Added the ability to export the changeset graphs processed by the passes 6 to 8 using GraphViz's dot-format. This is activated by using the switch '--dots'. Bugfixes in the cycle breaker. First corrected variable names, I forgot to use the standard 'myXXX' format for the typevariables. Second, fixed a bug uncovered by looking at the exported graphs, which caused the system to loose arcs, possibly breaking cycles without actually breaking them, leaving them in the dependencies. by aku on 2007-11-20 06:59:03. [view]

To:

File tools/cvs2fossil/lib/dot.tcl part of check-in [f284847134] - Reworked the dot export internals a bit to be more general regarding labeling and attribute writing. Updated the cycle breaker to define proper labels. by aku on 2007-11-22 07:22:38. [view]

@@ -30,19 +30,29 @@
     typemethod format {g name} {
 	lappend lines "digraph \"$name\" \{"
 
 	foreach n [$g nodes] {
-	    set    cmd "[$n id] \["
-	    append cmd " label=\"<[$n id]>\""
-
-	    if {[$g node keyexists $n shape]} {
-		append cmd  " shape=[$g node get $n shape]"
+	    set cmd "\"$n\""
+	    set sep " "
+	    set head " \["
+	    set tail ""
+	    foreach {gattr nodekey} {
+		label label
+		shape shape
+	    } {
+		if {![$g node keyexists $n $nodekey]} continue
+		append cmd "$head$sep${gattr}=\"[$g node get $n $nodekey]\""
+
+		set sep ", "
+		set head ""
+		set tail " \]"
 	    }
-	    append cmd " \];"
+
+	    append cmd ${tail} ";"
 	    lappend lines $cmd
 	}
 	foreach a [$g arcs] {
-	    lappend lines "[[$g arc source $a] id] -> [[$g arc target $a] id];"
+	    lappend lines "\"[$g arc source $a]\" -> \"[$g arc target $a]\";"
 	}
 
 	lappend lines "\}"
 	return [join $lines \n]