Fossil SCM

Updated to extended changeset string, and added tabular formatting. Further tweaked output, putting timestamp adjust messages on the same line as the changeset itself.

aku 2007-11-27 09:04 trunk
Commit 1c39e57637d4bfb976b43bebe223381c9dab269d
--- tools/cvs2fossil/lib/c2f_patopsort.tcl
+++ tools/cvs2fossil/lib/c2f_patopsort.tcl
@@ -70,10 +70,15 @@
7070
}
7171
7272
typemethod run {} {
7373
# Pass manager interface. Executed to perform the
7474
# functionality of the pass.
75
+
76
+ set len [string length [project::rev num]]
77
+ set myatfmt %${len}s
78
+ incr len 12
79
+ set mycsfmt %${len}s
7580
7681
cyclebreaker savecmd [myproc SaveTimestamps]
7782
7883
state transaction {
7984
LoadSymbolChangesets
@@ -105,22 +110,26 @@
105110
106111
proc SaveTimestamps {graph at cset} {
107112
set cid [$cset id]
108113
109114
set date [GetTime [lindex [$graph node get $cset timerange] 1] \
110
- [struct::set contain $mysymchangesets $cset]]
115
+ [struct::set contain $mysymchangesets $cset] \
116
+ message]
111117
112
- log write 4 atopsort "Changeset @ $at: [$cset str]"
118
+ log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]]$message"
119
+
113120
state run {
114121
INSERT INTO cstimestamp (cid, pos, date)
115122
VALUES ($cid, $at, $date)
116123
}
117124
return
118125
}
119126
120
- proc GetTime {stamp expectchange} {
127
+ proc GetTime {stamp expectchange mv} {
121128
::variable mylasttimestamp
129
+ upvar 1 $mv message
130
+ set message ""
122131
if {$stamp > $mymaxtimestamp} {
123132
# A timestamp in the future is believed to be bogus and
124133
# shifted backwars in time to prevent it from forcing
125134
# other timestamps to be pushed even further in the
126135
# future.
@@ -133,22 +142,25 @@
133142
# have been committed, even if other changesets with even
134143
# earlier timestamps depend on this one.
135144
136145
incr mylasttimestamp
137146
if {!$expectchange} {
138
- log write 4 atopsort "Timestamp [clock format $stamp] is in the future; shifted back to [clock format $mylasttimestamp]"
147
+ set message " Timestamp [clock format $stamp] is in the future; shifted back to [clock format $mylasttimestamp] ([expr {$mylasttimestamp - $stamp}])"
139148
}
140149
} elseif {$stamp < ($mylasttimestamp)+1} {
141150
incr mylasttimestamp
142151
if {!$expectchange} {
143
- log write 4 atopsort "Timestamp [clock format $stamp] adjusted to [clock format $mylasttimestamp]"
152
+ set message " Timestamp [clock format $stamp] adjusted to [clock format $mylasttimestamp] (+[expr {$mylasttimestamp - $stamp}])"
144153
}
145154
} else {
146155
set mylasttimestamp $stamp
147156
}
148157
return $mylasttimestamp
149158
}
159
+
160
+ typevariable myatfmt ; # Format for log output to gain better alignment of the various columns.
161
+ typevariable mycsfmt ; # Ditto for the changesets.
150162
151163
typevariable mysymchangesets {} ; # Set of the symbol changesets.
152164
typevariable mylasttimestamp 0 ; # Last delivered timestamp.
153165
typevariable mymaxtimestamp
154166
155167
--- tools/cvs2fossil/lib/c2f_patopsort.tcl
+++ tools/cvs2fossil/lib/c2f_patopsort.tcl
@@ -70,10 +70,15 @@
70 }
71
72 typemethod run {} {
73 # Pass manager interface. Executed to perform the
74 # functionality of the pass.
 
 
 
 
 
75
76 cyclebreaker savecmd [myproc SaveTimestamps]
77
78 state transaction {
79 LoadSymbolChangesets
@@ -105,22 +110,26 @@
105
106 proc SaveTimestamps {graph at cset} {
107 set cid [$cset id]
108
109 set date [GetTime [lindex [$graph node get $cset timerange] 1] \
110 [struct::set contain $mysymchangesets $cset]]
 
111
112 log write 4 atopsort "Changeset @ $at: [$cset str]"
 
113 state run {
114 INSERT INTO cstimestamp (cid, pos, date)
115 VALUES ($cid, $at, $date)
116 }
117 return
118 }
119
120 proc GetTime {stamp expectchange} {
121 ::variable mylasttimestamp
 
 
122 if {$stamp > $mymaxtimestamp} {
123 # A timestamp in the future is believed to be bogus and
124 # shifted backwars in time to prevent it from forcing
125 # other timestamps to be pushed even further in the
126 # future.
@@ -133,22 +142,25 @@
133 # have been committed, even if other changesets with even
134 # earlier timestamps depend on this one.
135
136 incr mylasttimestamp
137 if {!$expectchange} {
138 log write 4 atopsort "Timestamp [clock format $stamp] is in the future; shifted back to [clock format $mylasttimestamp]"
139 }
140 } elseif {$stamp < ($mylasttimestamp)+1} {
141 incr mylasttimestamp
142 if {!$expectchange} {
143 log write 4 atopsort "Timestamp [clock format $stamp] adjusted to [clock format $mylasttimestamp]"
144 }
145 } else {
146 set mylasttimestamp $stamp
147 }
148 return $mylasttimestamp
149 }
 
 
 
150
151 typevariable mysymchangesets {} ; # Set of the symbol changesets.
152 typevariable mylasttimestamp 0 ; # Last delivered timestamp.
153 typevariable mymaxtimestamp
154
155
--- tools/cvs2fossil/lib/c2f_patopsort.tcl
+++ tools/cvs2fossil/lib/c2f_patopsort.tcl
@@ -70,10 +70,15 @@
70 }
71
72 typemethod run {} {
73 # Pass manager interface. Executed to perform the
74 # functionality of the pass.
75
76 set len [string length [project::rev num]]
77 set myatfmt %${len}s
78 incr len 12
79 set mycsfmt %${len}s
80
81 cyclebreaker savecmd [myproc SaveTimestamps]
82
83 state transaction {
84 LoadSymbolChangesets
@@ -105,22 +110,26 @@
110
111 proc SaveTimestamps {graph at cset} {
112 set cid [$cset id]
113
114 set date [GetTime [lindex [$graph node get $cset timerange] 1] \
115 [struct::set contain $mysymchangesets $cset] \
116 message]
117
118 log write 4 atopsort "Changeset @ [format $myatfmt $at]: [format $mycsfmt [$cset str]]$message"
119
120 state run {
121 INSERT INTO cstimestamp (cid, pos, date)
122 VALUES ($cid, $at, $date)
123 }
124 return
125 }
126
127 proc GetTime {stamp expectchange mv} {
128 ::variable mylasttimestamp
129 upvar 1 $mv message
130 set message ""
131 if {$stamp > $mymaxtimestamp} {
132 # A timestamp in the future is believed to be bogus and
133 # shifted backwars in time to prevent it from forcing
134 # other timestamps to be pushed even further in the
135 # future.
@@ -133,22 +142,25 @@
142 # have been committed, even if other changesets with even
143 # earlier timestamps depend on this one.
144
145 incr mylasttimestamp
146 if {!$expectchange} {
147 set message " Timestamp [clock format $stamp] is in the future; shifted back to [clock format $mylasttimestamp] ([expr {$mylasttimestamp - $stamp}])"
148 }
149 } elseif {$stamp < ($mylasttimestamp)+1} {
150 incr mylasttimestamp
151 if {!$expectchange} {
152 set message " Timestamp [clock format $stamp] adjusted to [clock format $mylasttimestamp] (+[expr {$mylasttimestamp - $stamp}])"
153 }
154 } else {
155 set mylasttimestamp $stamp
156 }
157 return $mylasttimestamp
158 }
159
160 typevariable myatfmt ; # Format for log output to gain better alignment of the various columns.
161 typevariable mycsfmt ; # Ditto for the changesets.
162
163 typevariable mysymchangesets {} ; # Set of the symbol changesets.
164 typevariable mylasttimestamp 0 ; # Last delivered timestamp.
165 typevariable mymaxtimestamp
166
167
--- tools/cvs2fossil/lib/c2f_prtopsort.tcl
+++ tools/cvs2fossil/lib/c2f_prtopsort.tcl
@@ -75,11 +75,11 @@
7575
# Pass manager interface. Executed to perform the
7676
# functionality of the pass.
7777
7878
set len [string length [project::rev num]]
7979
set myatfmt %${len}s
80
- incr len 6
80
+ incr len 12
8181
set mycsfmt %${len}s
8282
8383
cyclebreaker savecmd [myproc SaveOrder]
8484
8585
state transaction {
8686
--- tools/cvs2fossil/lib/c2f_prtopsort.tcl
+++ tools/cvs2fossil/lib/c2f_prtopsort.tcl
@@ -75,11 +75,11 @@
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
--- tools/cvs2fossil/lib/c2f_prtopsort.tcl
+++ tools/cvs2fossil/lib/c2f_prtopsort.tcl
@@ -75,11 +75,11 @@
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 12
81 set mycsfmt %${len}s
82
83 cyclebreaker savecmd [myproc SaveOrder]
84
85 state transaction {
86

Keyboard Shortcuts

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