Fossil SCM
Tweaked log output of the topological sorter (revisions) to be tabular (aligned columns), added information (time ranges).
Commit
bcc630d3f5a352d5ed58520044cab357a8d32630
Parent
96167b2a48d198c…
1 file changed
+18
-2
| --- tools/cvs2fossil/lib/c2f_prtopsort.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_prtopsort.tcl | ||
| @@ -72,14 +72,20 @@ | ||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | typemethod run {} { |
| 75 | 75 | # Pass manager interface. Executed to perform the |
| 76 | 76 | # functionality of the pass. |
| 77 | + | |
| 78 | + set len [string length [project::rev num]] | |
| 79 | + set myatfmt %${len}s | |
| 80 | + incr len 6 | |
| 81 | + set mycsfmt %${len}s | |
| 77 | 82 | |
| 78 | 83 | cyclebreaker savecmd [myproc SaveOrder] |
| 84 | + | |
| 79 | 85 | state transaction { |
| 80 | - cyclebreaker run break-rev [myproc Changesets] | |
| 86 | + cyclebreaker run tsort-rev [myproc Changesets] | |
| 81 | 87 | } |
| 82 | 88 | return |
| 83 | 89 | } |
| 84 | 90 | |
| 85 | 91 | typemethod discard {} { |
| @@ -99,20 +105,30 @@ | ||
| 99 | 105 | } |
| 100 | 106 | |
| 101 | 107 | proc IsByRevision {cset} { $cset byrevision } |
| 102 | 108 | |
| 103 | 109 | proc SaveOrder {graph at cset} { |
| 110 | + ::variable myatfmt | |
| 111 | + ::variable mycsfmt | |
| 112 | + | |
| 104 | 113 | set cid [$cset id] |
| 105 | 114 | |
| 106 | - log write 4 rtopsort "Changeset @ $at: [$cset str] <<[$graph node set $cset timerange]>>" | |
| 115 | + log write 4 rtopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] <<[FormatTR $graph $cset]>>" | |
| 107 | 116 | state run { |
| 108 | 117 | INSERT INTO csorder (cid, pos) |
| 109 | 118 | VALUES ($cid, $at) |
| 110 | 119 | } |
| 111 | 120 | return |
| 112 | 121 | } |
| 113 | 122 | |
| 123 | + proc FormatTR {graph cset} { | |
| 124 | + return [join [struct::list map [$graph node set $cset timerange] {clock format}] { -- }] | |
| 125 | + } | |
| 126 | + | |
| 127 | + typevariable myatfmt ; # Format for log output to gain better alignment of the various columns. | |
| 128 | + typevariable mycsfmt ; # Ditto for the changesets. | |
| 129 | + | |
| 114 | 130 | # # ## ### ##### ######## ############# |
| 115 | 131 | ## Configuration |
| 116 | 132 | |
| 117 | 133 | pragma -hasinstances no ; # singleton |
| 118 | 134 | pragma -hastypeinfo no ; # no introspection |
| 119 | 135 |
| --- tools/cvs2fossil/lib/c2f_prtopsort.tcl | |
| +++ tools/cvs2fossil/lib/c2f_prtopsort.tcl | |
| @@ -72,14 +72,20 @@ | |
| 72 | } |
| 73 | |
| 74 | typemethod run {} { |
| 75 | # Pass manager interface. Executed to perform the |
| 76 | # functionality of the pass. |
| 77 | |
| 78 | cyclebreaker savecmd [myproc SaveOrder] |
| 79 | state transaction { |
| 80 | cyclebreaker run break-rev [myproc Changesets] |
| 81 | } |
| 82 | return |
| 83 | } |
| 84 | |
| 85 | typemethod discard {} { |
| @@ -99,20 +105,30 @@ | |
| 99 | } |
| 100 | |
| 101 | proc IsByRevision {cset} { $cset byrevision } |
| 102 | |
| 103 | proc SaveOrder {graph at cset} { |
| 104 | set cid [$cset id] |
| 105 | |
| 106 | log write 4 rtopsort "Changeset @ $at: [$cset str] <<[$graph node set $cset timerange]>>" |
| 107 | state run { |
| 108 | INSERT INTO csorder (cid, pos) |
| 109 | VALUES ($cid, $at) |
| 110 | } |
| 111 | return |
| 112 | } |
| 113 | |
| 114 | # # ## ### ##### ######## ############# |
| 115 | ## Configuration |
| 116 | |
| 117 | pragma -hasinstances no ; # singleton |
| 118 | pragma -hastypeinfo no ; # no introspection |
| 119 |
| --- tools/cvs2fossil/lib/c2f_prtopsort.tcl | |
| +++ tools/cvs2fossil/lib/c2f_prtopsort.tcl | |
| @@ -72,14 +72,20 @@ | |
| 72 | } |
| 73 | |
| 74 | typemethod run {} { |
| 75 | # Pass manager interface. Executed to perform the |
| 76 | # functionality of the pass. |
| 77 | |
| 78 | set len [string length [project::rev num]] |
| 79 | set myatfmt %${len}s |
| 80 | incr len 6 |
| 81 | set mycsfmt %${len}s |
| 82 | |
| 83 | cyclebreaker savecmd [myproc SaveOrder] |
| 84 | |
| 85 | state transaction { |
| 86 | cyclebreaker run tsort-rev [myproc Changesets] |
| 87 | } |
| 88 | return |
| 89 | } |
| 90 | |
| 91 | typemethod discard {} { |
| @@ -99,20 +105,30 @@ | |
| 105 | } |
| 106 | |
| 107 | proc IsByRevision {cset} { $cset byrevision } |
| 108 | |
| 109 | proc SaveOrder {graph at cset} { |
| 110 | ::variable myatfmt |
| 111 | ::variable mycsfmt |
| 112 | |
| 113 | set cid [$cset id] |
| 114 | |
| 115 | log write 4 rtopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]] <<[FormatTR $graph $cset]>>" |
| 116 | state run { |
| 117 | INSERT INTO csorder (cid, pos) |
| 118 | VALUES ($cid, $at) |
| 119 | } |
| 120 | return |
| 121 | } |
| 122 | |
| 123 | proc FormatTR {graph cset} { |
| 124 | return [join [struct::list map [$graph node set $cset timerange] {clock format}] { -- }] |
| 125 | } |
| 126 | |
| 127 | typevariable myatfmt ; # Format for log output to gain better alignment of the various columns. |
| 128 | typevariable mycsfmt ; # Ditto for the changesets. |
| 129 | |
| 130 | # # ## ### ##### ######## ############# |
| 131 | ## Configuration |
| 132 | |
| 133 | pragma -hasinstances no ; # singleton |
| 134 | pragma -hastypeinfo no ; # no introspection |
| 135 |