Fossil SCM

Allow for detached branches when checking lod consistency. Fixed formatting nit. Added debug helper method.

aku 2008-01-27 20:42 trunk
Commit d3aa33884b6ce408dc8ad45fa2a28a43fbc788ac
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -140,11 +140,11 @@
140140
method position {} { return $mybranchposition }
141141
142142
# Tag acessor methods.
143143
144144
method tagrevnr {} { return $mynr }
145
- method settagrev {rev} {set mytagrev $rev ; return }
145
+ method settagrev {rev} { set mytagrev $rev ; return }
146146
147147
# Derived information
148148
149149
method lod {} { return $mylod }
150150
@@ -158,11 +158,17 @@
158158
# Consistency check. The symbol's line-of-development has to
159159
# be same as the line-of-development of its source (parent
160160
# revision of a branch, revision of a tag itself).
161161
162162
switch -exact -- $mytype {
163
- branch { set slod [$mybranchparent lod] }
163
+ branch {
164
+ # However, ignore this if the branch symbol is
165
+ # detached.
166
+ if {$mybranchparent eq ""} return
167
+
168
+ set slod [$mybranchparent lod]
169
+ }
164170
tag { set slod [$mytagrev lod] }
165171
}
166172
167173
if {$mylod ne $slod} {
168174
trouble fatal "For $mytype [$mysymbol name]: LOD conflict with source, '[$mylod name]' vs. '[$slod name]'"
@@ -204,10 +210,26 @@
204210
}
205211
}
206212
207213
return
208214
}
215
+
216
+ method DUMP {label} {
217
+ puts "$label = $self $mytype [$self name] \{"
218
+ switch -exact -- $mytype {
219
+ tag {
220
+ puts "\tR\t$mytagrev"
221
+ }
222
+ branch {
223
+ puts "\tP\t$mybranchparent"
224
+ puts "\tC\t$mybranchchild"
225
+ puts "\t\t<$mynr>"
226
+ }
227
+ }
228
+ puts "\}"
229
+ return
230
+ }
209231
210232
# # ## ### ##### ######## #############
211233
## State
212234
213235
# Persistent:
214236
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -140,11 +140,11 @@
140 method position {} { return $mybranchposition }
141
142 # Tag acessor methods.
143
144 method tagrevnr {} { return $mynr }
145 method settagrev {rev} {set mytagrev $rev ; return }
146
147 # Derived information
148
149 method lod {} { return $mylod }
150
@@ -158,11 +158,17 @@
158 # Consistency check. The symbol's line-of-development has to
159 # be same as the line-of-development of its source (parent
160 # revision of a branch, revision of a tag itself).
161
162 switch -exact -- $mytype {
163 branch { set slod [$mybranchparent lod] }
 
 
 
 
 
 
164 tag { set slod [$mytagrev lod] }
165 }
166
167 if {$mylod ne $slod} {
168 trouble fatal "For $mytype [$mysymbol name]: LOD conflict with source, '[$mylod name]' vs. '[$slod name]'"
@@ -204,10 +210,26 @@
204 }
205 }
206
207 return
208 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
210 # # ## ### ##### ######## #############
211 ## State
212
213 # Persistent:
214
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -140,11 +140,11 @@
140 method position {} { return $mybranchposition }
141
142 # Tag acessor methods.
143
144 method tagrevnr {} { return $mynr }
145 method settagrev {rev} { set mytagrev $rev ; return }
146
147 # Derived information
148
149 method lod {} { return $mylod }
150
@@ -158,11 +158,17 @@
158 # Consistency check. The symbol's line-of-development has to
159 # be same as the line-of-development of its source (parent
160 # revision of a branch, revision of a tag itself).
161
162 switch -exact -- $mytype {
163 branch {
164 # However, ignore this if the branch symbol is
165 # detached.
166 if {$mybranchparent eq ""} return
167
168 set slod [$mybranchparent lod]
169 }
170 tag { set slod [$mytagrev lod] }
171 }
172
173 if {$mylod ne $slod} {
174 trouble fatal "For $mytype [$mysymbol name]: LOD conflict with source, '[$mylod name]' vs. '[$slod name]'"
@@ -204,10 +210,26 @@
210 }
211 }
212
213 return
214 }
215
216 method DUMP {label} {
217 puts "$label = $self $mytype [$self name] \{"
218 switch -exact -- $mytype {
219 tag {
220 puts "\tR\t$mytagrev"
221 }
222 branch {
223 puts "\tP\t$mybranchparent"
224 puts "\tC\t$mybranchchild"
225 puts "\t\t<$mynr>"
226 }
227 }
228 puts "\}"
229 return
230 }
231
232 # # ## ### ##### ######## #############
233 ## State
234
235 # Persistent:
236

Keyboard Shortcuts

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