Fossil SCM

Tweaked log output of the topological sorter (revisions) to be tabular (aligned columns), added information (time ranges).

aku 2007-11-25 07:41 trunk
Commit bcc630d3f5a352d5ed58520044cab357a8d32630
--- tools/cvs2fossil/lib/c2f_prtopsort.tcl
+++ tools/cvs2fossil/lib/c2f_prtopsort.tcl
@@ -72,14 +72,20 @@
7272
}
7373
7474
typemethod run {} {
7575
# Pass manager interface. Executed to perform the
7676
# 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
7782
7883
cyclebreaker savecmd [myproc SaveOrder]
84
+
7985
state transaction {
80
- cyclebreaker run break-rev [myproc Changesets]
86
+ cyclebreaker run tsort-rev [myproc Changesets]
8187
}
8288
return
8389
}
8490
8591
typemethod discard {} {
@@ -99,20 +105,30 @@
99105
}
100106
101107
proc IsByRevision {cset} { $cset byrevision }
102108
103109
proc SaveOrder {graph at cset} {
110
+ ::variable myatfmt
111
+ ::variable mycsfmt
112
+
104113
set cid [$cset id]
105114
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]>>"
107116
state run {
108117
INSERT INTO csorder (cid, pos)
109118
VALUES ($cid, $at)
110119
}
111120
return
112121
}
113122
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
+
114130
# # ## ### ##### ######## #############
115131
## Configuration
116132
117133
pragma -hasinstances no ; # singleton
118134
pragma -hastypeinfo no ; # no introspection
119135
--- 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

Keyboard Shortcuts

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