Fossil SCM
Allow for detached branches when checking lod consistency. Fixed formatting nit. Added debug helper method.
Commit
d3aa33884b6ce408dc8ad45fa2a28a43fbc788ac
Parent
0adaabf11231d63…
1 file changed
+24
-2
+24
-2
| --- tools/cvs2fossil/lib/c2f_fsym.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_fsym.tcl | ||
| @@ -140,11 +140,11 @@ | ||
| 140 | 140 | method position {} { return $mybranchposition } |
| 141 | 141 | |
| 142 | 142 | # Tag acessor methods. |
| 143 | 143 | |
| 144 | 144 | method tagrevnr {} { return $mynr } |
| 145 | - method settagrev {rev} {set mytagrev $rev ; return } | |
| 145 | + method settagrev {rev} { set mytagrev $rev ; return } | |
| 146 | 146 | |
| 147 | 147 | # Derived information |
| 148 | 148 | |
| 149 | 149 | method lod {} { return $mylod } |
| 150 | 150 | |
| @@ -158,11 +158,17 @@ | ||
| 158 | 158 | # Consistency check. The symbol's line-of-development has to |
| 159 | 159 | # be same as the line-of-development of its source (parent |
| 160 | 160 | # revision of a branch, revision of a tag itself). |
| 161 | 161 | |
| 162 | 162 | 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 | + } | |
| 164 | 170 | tag { set slod [$mytagrev lod] } |
| 165 | 171 | } |
| 166 | 172 | |
| 167 | 173 | if {$mylod ne $slod} { |
| 168 | 174 | trouble fatal "For $mytype [$mysymbol name]: LOD conflict with source, '[$mylod name]' vs. '[$slod name]'" |
| @@ -204,10 +210,26 @@ | ||
| 204 | 210 | } |
| 205 | 211 | } |
| 206 | 212 | |
| 207 | 213 | return |
| 208 | 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 | + } | |
| 209 | 231 | |
| 210 | 232 | # # ## ### ##### ######## ############# |
| 211 | 233 | ## State |
| 212 | 234 | |
| 213 | 235 | # Persistent: |
| 214 | 236 |
| --- 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 |