Fossil SCM
Added code creating aggregate symbol statistics. This completes pass 2 (CollRev).
Commit
6f8667b03e3a644953d6bd72e7eed9ba83881b08
Parent
831e8f360dbeadd…
6 files changed
+58
-1
+57
-2
+10
-1
+18
+64
-6
+21
-4
+58
-1
| --- tools/cvs2fossil/lib/c2f_file.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_file.tcl | ||
| @@ -232,11 +232,12 @@ | ||
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | method done {} { |
| 235 | 235 | # Complete the revisions, branches, and tags. This includes |
| 236 | 236 | # looking for a non-trunk default branch, marking its members |
| 237 | - # and linking them into the trunk. | |
| 237 | + # and linking them into the trunk, possibly excluding | |
| 238 | + # non-trunk data, and collecting aggregate symbol statistics. | |
| 238 | 239 | |
| 239 | 240 | $self DetermineRevisionOperations |
| 240 | 241 | $self DetermineLinesOfDevelopment |
| 241 | 242 | $self HandleNonTrunkDefaultBranch |
| 242 | 243 | $self RemoveIrrelevantDeletions |
| @@ -243,10 +244,12 @@ | ||
| 243 | 244 | $self RemoveInitialBranchDeletions |
| 244 | 245 | |
| 245 | 246 | if {[$myproject trunkonly]} { |
| 246 | 247 | $self ExcludeNonTrunkInformation |
| 247 | 248 | } |
| 249 | + | |
| 250 | + $self AggregateSymbolData | |
| 248 | 251 | return |
| 249 | 252 | } |
| 250 | 253 | |
| 251 | 254 | # # ## ### ##### ######## ############# |
| 252 | 255 | ## State |
| @@ -1024,10 +1027,64 @@ | ||
| 1024 | 1027 | } |
| 1025 | 1028 | |
| 1026 | 1029 | return [list [lsort -unique -dict $revisions] [lsort -unique -dict $symbols]] |
| 1027 | 1030 | } |
| 1028 | 1031 | |
| 1032 | + | |
| 1033 | + method AggregateSymbolData {} { | |
| 1034 | + # Now that the exact set of revisions (and through that | |
| 1035 | + # branches and tags) is known we can update the aggregate | |
| 1036 | + # symbol statistics. | |
| 1037 | + | |
| 1038 | + foreach root [$self LinesOfDevelopment] { | |
| 1039 | + set lod [$root lod] | |
| 1040 | + | |
| 1041 | + # Note: If the LOD is the trunk the count*, etc. methods | |
| 1042 | + # will do nothing, as it is always present (cannot be | |
| 1043 | + # excluded), and is always a branch too. | |
| 1044 | + | |
| 1045 | + # Lines of development count as branches and have a commit | |
| 1046 | + # on them (root). If they are still attached to a tree we | |
| 1047 | + # have to compute and register possible parents. | |
| 1048 | + | |
| 1049 | + $lod countasbranch | |
| 1050 | + $lod countacommit | |
| 1051 | + | |
| 1052 | + if {[$root hasparentbranch]} { | |
| 1053 | + # Note lod == [$root parentbranch] | |
| 1054 | + $lod possibleparents | |
| 1055 | + } | |
| 1056 | + | |
| 1057 | + # For the revisions in the line we register their branches | |
| 1058 | + # and tags as blockers for the lod, and update the type | |
| 1059 | + # counters as well. As branch symbols without commits on | |
| 1060 | + # them are not listed as lines of development, we have to | |
| 1061 | + # count them here as well, as plain branches. At last we | |
| 1062 | + # have to compute and register the possible parents of the | |
| 1063 | + # tags, in case they are later converted as branches. | |
| 1064 | + | |
| 1065 | + while {$root ne ""} { | |
| 1066 | + foreach branch [$root branches] { | |
| 1067 | + $lod blockedby $branch | |
| 1068 | + $branch possibleparents | |
| 1069 | + if {[$branch haschild]} continue | |
| 1070 | + $branch countasbranch | |
| 1071 | + } | |
| 1072 | + | |
| 1073 | + foreach tag [$root tags] { | |
| 1074 | + $lod blockedby $tag | |
| 1075 | + $tag possibleparents | |
| 1076 | + $tag countastag | |
| 1077 | + } | |
| 1078 | + | |
| 1079 | + set root [$root child] | |
| 1080 | + } | |
| 1081 | + } | |
| 1082 | + | |
| 1083 | + return | |
| 1084 | + } | |
| 1085 | + | |
| 1029 | 1086 | # # ## ### ##### ######## ############# |
| 1030 | 1087 | ## Configuration |
| 1031 | 1088 | |
| 1032 | 1089 | pragma -hastypeinfo no ; # no type introspection |
| 1033 | 1090 | pragma -hasinfo no ; # no object introspection |
| 1034 | 1091 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -232,11 +232,12 @@ | |
| 232 | } |
| 233 | |
| 234 | method done {} { |
| 235 | # Complete the revisions, branches, and tags. This includes |
| 236 | # looking for a non-trunk default branch, marking its members |
| 237 | # and linking them into the trunk. |
| 238 | |
| 239 | $self DetermineRevisionOperations |
| 240 | $self DetermineLinesOfDevelopment |
| 241 | $self HandleNonTrunkDefaultBranch |
| 242 | $self RemoveIrrelevantDeletions |
| @@ -243,10 +244,12 @@ | |
| 243 | $self RemoveInitialBranchDeletions |
| 244 | |
| 245 | if {[$myproject trunkonly]} { |
| 246 | $self ExcludeNonTrunkInformation |
| 247 | } |
| 248 | return |
| 249 | } |
| 250 | |
| 251 | # # ## ### ##### ######## ############# |
| 252 | ## State |
| @@ -1024,10 +1027,64 @@ | |
| 1024 | } |
| 1025 | |
| 1026 | return [list [lsort -unique -dict $revisions] [lsort -unique -dict $symbols]] |
| 1027 | } |
| 1028 | |
| 1029 | # # ## ### ##### ######## ############# |
| 1030 | ## Configuration |
| 1031 | |
| 1032 | pragma -hastypeinfo no ; # no type introspection |
| 1033 | pragma -hasinfo no ; # no object introspection |
| 1034 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -232,11 +232,12 @@ | |
| 232 | } |
| 233 | |
| 234 | method done {} { |
| 235 | # Complete the revisions, branches, and tags. This includes |
| 236 | # looking for a non-trunk default branch, marking its members |
| 237 | # and linking them into the trunk, possibly excluding |
| 238 | # non-trunk data, and collecting aggregate symbol statistics. |
| 239 | |
| 240 | $self DetermineRevisionOperations |
| 241 | $self DetermineLinesOfDevelopment |
| 242 | $self HandleNonTrunkDefaultBranch |
| 243 | $self RemoveIrrelevantDeletions |
| @@ -243,10 +244,12 @@ | |
| 244 | $self RemoveInitialBranchDeletions |
| 245 | |
| 246 | if {[$myproject trunkonly]} { |
| 247 | $self ExcludeNonTrunkInformation |
| 248 | } |
| 249 | |
| 250 | $self AggregateSymbolData |
| 251 | return |
| 252 | } |
| 253 | |
| 254 | # # ## ### ##### ######## ############# |
| 255 | ## State |
| @@ -1024,10 +1027,64 @@ | |
| 1027 | } |
| 1028 | |
| 1029 | return [list [lsort -unique -dict $revisions] [lsort -unique -dict $symbols]] |
| 1030 | } |
| 1031 | |
| 1032 | |
| 1033 | method AggregateSymbolData {} { |
| 1034 | # Now that the exact set of revisions (and through that |
| 1035 | # branches and tags) is known we can update the aggregate |
| 1036 | # symbol statistics. |
| 1037 | |
| 1038 | foreach root [$self LinesOfDevelopment] { |
| 1039 | set lod [$root lod] |
| 1040 | |
| 1041 | # Note: If the LOD is the trunk the count*, etc. methods |
| 1042 | # will do nothing, as it is always present (cannot be |
| 1043 | # excluded), and is always a branch too. |
| 1044 | |
| 1045 | # Lines of development count as branches and have a commit |
| 1046 | # on them (root). If they are still attached to a tree we |
| 1047 | # have to compute and register possible parents. |
| 1048 | |
| 1049 | $lod countasbranch |
| 1050 | $lod countacommit |
| 1051 | |
| 1052 | if {[$root hasparentbranch]} { |
| 1053 | # Note lod == [$root parentbranch] |
| 1054 | $lod possibleparents |
| 1055 | } |
| 1056 | |
| 1057 | # For the revisions in the line we register their branches |
| 1058 | # and tags as blockers for the lod, and update the type |
| 1059 | # counters as well. As branch symbols without commits on |
| 1060 | # them are not listed as lines of development, we have to |
| 1061 | # count them here as well, as plain branches. At last we |
| 1062 | # have to compute and register the possible parents of the |
| 1063 | # tags, in case they are later converted as branches. |
| 1064 | |
| 1065 | while {$root ne ""} { |
| 1066 | foreach branch [$root branches] { |
| 1067 | $lod blockedby $branch |
| 1068 | $branch possibleparents |
| 1069 | if {[$branch haschild]} continue |
| 1070 | $branch countasbranch |
| 1071 | } |
| 1072 | |
| 1073 | foreach tag [$root tags] { |
| 1074 | $lod blockedby $tag |
| 1075 | $tag possibleparents |
| 1076 | $tag countastag |
| 1077 | } |
| 1078 | |
| 1079 | set root [$root child] |
| 1080 | } |
| 1081 | } |
| 1082 | |
| 1083 | return |
| 1084 | } |
| 1085 | |
| 1086 | # # ## ### ##### ######## ############# |
| 1087 | ## Configuration |
| 1088 | |
| 1089 | pragma -hastypeinfo no ; # no type introspection |
| 1090 | pragma -hasinfo no ; # no object introspection |
| 1091 |
+57
-2
| --- tools/cvs2fossil/lib/c2f_fsym.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_fsym.tcl | ||
| @@ -45,16 +45,72 @@ | ||
| 45 | 45 | method defid {} { |
| 46 | 46 | set myid [incr myidcounter] |
| 47 | 47 | return |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - method fid {} { return $myid } | |
| 50 | + method fid {} { return $myid } | |
| 51 | + method symbol {} { return $mysymbol } | |
| 51 | 52 | |
| 52 | 53 | # Symbol acessor methods. |
| 53 | 54 | |
| 54 | 55 | delegate method name to mysymbol |
| 55 | 56 | delegate method id to mysymbol |
| 57 | + | |
| 58 | + # Symbol aggregation methods | |
| 59 | + | |
| 60 | + delegate method countasbranch to mysymbol | |
| 61 | + delegate method countastag to mysymbol | |
| 62 | + delegate method countacommit to mysymbol | |
| 63 | + | |
| 64 | + method blockedby {fsymbol} { | |
| 65 | + $mysymbol blockedby [$fsymbol symbol] | |
| 66 | + return | |
| 67 | + } | |
| 68 | + | |
| 69 | + method possibleparents {} { | |
| 70 | + switch -exact -- $mytype { | |
| 71 | + branch { $self BranchParents } | |
| 72 | + tag { $self TagParents } | |
| 73 | + } | |
| 74 | + return | |
| 75 | + } | |
| 76 | + | |
| 77 | + method BranchParents {} { | |
| 78 | + # The "obvious" parent of a branch is the branch holding the | |
| 79 | + # revision spawning the branch. Any other branches that are | |
| 80 | + # rooted at the same revision and were committed earlier than | |
| 81 | + # the branch are also possible parents. | |
| 82 | + | |
| 83 | + $mysymbol possibleparent [[$mybranchparent lod] symbol] | |
| 84 | + | |
| 85 | + foreach branch [$mybranchparent branches] { | |
| 86 | + # A branch cannot be its own parent. Nor can a branch | |
| 87 | + # created after this one be its parent. This means that we | |
| 88 | + # can abort the loop when we have reached ourselves in the | |
| 89 | + # list of branches. Here the order of file::rev.mybranches | |
| 90 | + # comes into play, as created by file::rev::sortbranches. | |
| 91 | + | |
| 92 | + if {$branch eq $self} break | |
| 93 | + $mysymbol possibleparent [$branch symbol] | |
| 94 | + } | |
| 95 | + return | |
| 96 | + } | |
| 97 | + | |
| 98 | + method TagParents {} { | |
| 99 | + # The "obvious" parent of a tag is the branch holding the | |
| 100 | + # revision spawning the tag. Branches that are spawned by the | |
| 101 | + # same revision are also possible parents. | |
| 102 | + | |
| 103 | + $mysymbol possibleparent [[$mytagrev lod] symbol] | |
| 104 | + | |
| 105 | + foreach branch [$mytagrev branches] { | |
| 106 | + $mysymbol possibleparent [$branch symbol] | |
| 107 | + } | |
| 108 | + return | |
| 109 | + } | |
| 110 | + | |
| 111 | + # | |
| 56 | 112 | |
| 57 | 113 | method istrunk {} { return 0 } |
| 58 | 114 | |
| 59 | 115 | # Branch acessor methods. |
| 60 | 116 | |
| @@ -75,11 +131,10 @@ | ||
| 75 | 131 | method haschildrev {} { return [expr {$mybranchchildrevnr ne ""}] } |
| 76 | 132 | method haschild {} { return [expr {$mybranchchild ne ""}] } |
| 77 | 133 | method parent {} { return $mybranchparent } |
| 78 | 134 | method child {} { return $mybranchchild } |
| 79 | 135 | method position {} { return $mybranchposition } |
| 80 | - | |
| 81 | 136 | |
| 82 | 137 | # Tag acessor methods. |
| 83 | 138 | |
| 84 | 139 | method tagrevnr {} { return $mynr } |
| 85 | 140 | method settagrev {rev} {set mytagrev $rev ; return } |
| 86 | 141 |
| --- tools/cvs2fossil/lib/c2f_fsym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_fsym.tcl | |
| @@ -45,16 +45,72 @@ | |
| 45 | method defid {} { |
| 46 | set myid [incr myidcounter] |
| 47 | return |
| 48 | } |
| 49 | |
| 50 | method fid {} { return $myid } |
| 51 | |
| 52 | # Symbol acessor methods. |
| 53 | |
| 54 | delegate method name to mysymbol |
| 55 | delegate method id to mysymbol |
| 56 | |
| 57 | method istrunk {} { return 0 } |
| 58 | |
| 59 | # Branch acessor methods. |
| 60 | |
| @@ -75,11 +131,10 @@ | |
| 75 | method haschildrev {} { return [expr {$mybranchchildrevnr ne ""}] } |
| 76 | method haschild {} { return [expr {$mybranchchild ne ""}] } |
| 77 | method parent {} { return $mybranchparent } |
| 78 | method child {} { return $mybranchchild } |
| 79 | method position {} { return $mybranchposition } |
| 80 | |
| 81 | |
| 82 | # Tag acessor methods. |
| 83 | |
| 84 | method tagrevnr {} { return $mynr } |
| 85 | method settagrev {rev} {set mytagrev $rev ; return } |
| 86 |
| --- tools/cvs2fossil/lib/c2f_fsym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_fsym.tcl | |
| @@ -45,16 +45,72 @@ | |
| 45 | method defid {} { |
| 46 | set myid [incr myidcounter] |
| 47 | return |
| 48 | } |
| 49 | |
| 50 | method fid {} { return $myid } |
| 51 | method symbol {} { return $mysymbol } |
| 52 | |
| 53 | # Symbol acessor methods. |
| 54 | |
| 55 | delegate method name to mysymbol |
| 56 | delegate method id to mysymbol |
| 57 | |
| 58 | # Symbol aggregation methods |
| 59 | |
| 60 | delegate method countasbranch to mysymbol |
| 61 | delegate method countastag to mysymbol |
| 62 | delegate method countacommit to mysymbol |
| 63 | |
| 64 | method blockedby {fsymbol} { |
| 65 | $mysymbol blockedby [$fsymbol symbol] |
| 66 | return |
| 67 | } |
| 68 | |
| 69 | method possibleparents {} { |
| 70 | switch -exact -- $mytype { |
| 71 | branch { $self BranchParents } |
| 72 | tag { $self TagParents } |
| 73 | } |
| 74 | return |
| 75 | } |
| 76 | |
| 77 | method BranchParents {} { |
| 78 | # The "obvious" parent of a branch is the branch holding the |
| 79 | # revision spawning the branch. Any other branches that are |
| 80 | # rooted at the same revision and were committed earlier than |
| 81 | # the branch are also possible parents. |
| 82 | |
| 83 | $mysymbol possibleparent [[$mybranchparent lod] symbol] |
| 84 | |
| 85 | foreach branch [$mybranchparent branches] { |
| 86 | # A branch cannot be its own parent. Nor can a branch |
| 87 | # created after this one be its parent. This means that we |
| 88 | # can abort the loop when we have reached ourselves in the |
| 89 | # list of branches. Here the order of file::rev.mybranches |
| 90 | # comes into play, as created by file::rev::sortbranches. |
| 91 | |
| 92 | if {$branch eq $self} break |
| 93 | $mysymbol possibleparent [$branch symbol] |
| 94 | } |
| 95 | return |
| 96 | } |
| 97 | |
| 98 | method TagParents {} { |
| 99 | # The "obvious" parent of a tag is the branch holding the |
| 100 | # revision spawning the tag. Branches that are spawned by the |
| 101 | # same revision are also possible parents. |
| 102 | |
| 103 | $mysymbol possibleparent [[$mytagrev lod] symbol] |
| 104 | |
| 105 | foreach branch [$mytagrev branches] { |
| 106 | $mysymbol possibleparent [$branch symbol] |
| 107 | } |
| 108 | return |
| 109 | } |
| 110 | |
| 111 | # |
| 112 | |
| 113 | method istrunk {} { return 0 } |
| 114 | |
| 115 | # Branch acessor methods. |
| 116 | |
| @@ -75,11 +131,10 @@ | |
| 131 | method haschildrev {} { return [expr {$mybranchchildrevnr ne ""}] } |
| 132 | method haschild {} { return [expr {$mybranchchild ne ""}] } |
| 133 | method parent {} { return $mybranchparent } |
| 134 | method child {} { return $mybranchchild } |
| 135 | method position {} { return $mybranchposition } |
| 136 | |
| 137 | # Tag acessor methods. |
| 138 | |
| 139 | method tagrevnr {} { return $mynr } |
| 140 | method settagrev {rev} {set mytagrev $rev ; return } |
| 141 |
| --- tools/cvs2fossil/lib/c2f_pcollrev.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_pcollrev.tcl | ||
| @@ -186,18 +186,25 @@ | ||
| 186 | 186 | |
| 187 | 187 | UNIQUE (pid, name) -- Symbols are unique within the project |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | state writing blocker { |
| 191 | + -- For each symbol we save which other symbols are | |
| 192 | + -- blocking its removal (if the user asks for it). | |
| 193 | + | |
| 191 | 194 | sid INTEGER NOT NULL REFERENCES symbol, -- |
| 192 | 195 | bid INTEGER NOT NULL REFERENCES symbol, -- Sprouted from sid, blocks it. |
| 193 | 196 | UNIQUE (sid, bid) |
| 194 | 197 | } |
| 195 | 198 | |
| 196 | 199 | state writing parent { |
| 200 | + -- For each symbol we save which other symbols can act as | |
| 201 | + -- a possible parent in some file, and how often. | |
| 202 | + | |
| 197 | 203 | sid INTEGER NOT NULL REFERENCES symbol, -- |
| 198 | 204 | pid INTEGER NOT NULL REFERENCES symbol, -- Possible parent of sid |
| 205 | + n INTEGER NOT NULL, -- How often pid can act as parent. | |
| 199 | 206 | UNIQUE (sid, pid) |
| 200 | 207 | } |
| 201 | 208 | |
| 202 | 209 | state writing meta { |
| 203 | 210 | -- Meta data of revisions. See revision.mid for the |
| @@ -283,10 +290,12 @@ | ||
| 283 | 290 | $file persist |
| 284 | 291 | } |
| 285 | 292 | |
| 286 | 293 | $file drop |
| 287 | 294 | } |
| 295 | + | |
| 296 | + $project purgeghostsymbols | |
| 288 | 297 | } |
| 289 | 298 | |
| 290 | 299 | repository printrevstatistics |
| 291 | 300 | repository persistrev |
| 292 | 301 | |
| @@ -312,11 +321,11 @@ | ||
| 312 | 321 | return |
| 313 | 322 | } |
| 314 | 323 | |
| 315 | 324 | proc Paranoia {} { |
| 316 | 325 | # This code performs a number of paranoid checks of the |
| 317 | - # database for inconsistent cross-references. | |
| 326 | + # database, searching for inconsistent cross-references. | |
| 318 | 327 | log write 4 collrev {Check database consistency} |
| 319 | 328 | |
| 320 | 329 | set n 0 ; # Counter for the checks (we print an id before the |
| 321 | 330 | # main label). |
| 322 | 331 | |
| 323 | 332 |
| --- tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| @@ -186,18 +186,25 @@ | |
| 186 | |
| 187 | UNIQUE (pid, name) -- Symbols are unique within the project |
| 188 | } |
| 189 | |
| 190 | state writing blocker { |
| 191 | sid INTEGER NOT NULL REFERENCES symbol, -- |
| 192 | bid INTEGER NOT NULL REFERENCES symbol, -- Sprouted from sid, blocks it. |
| 193 | UNIQUE (sid, bid) |
| 194 | } |
| 195 | |
| 196 | state writing parent { |
| 197 | sid INTEGER NOT NULL REFERENCES symbol, -- |
| 198 | pid INTEGER NOT NULL REFERENCES symbol, -- Possible parent of sid |
| 199 | UNIQUE (sid, pid) |
| 200 | } |
| 201 | |
| 202 | state writing meta { |
| 203 | -- Meta data of revisions. See revision.mid for the |
| @@ -283,10 +290,12 @@ | |
| 283 | $file persist |
| 284 | } |
| 285 | |
| 286 | $file drop |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | repository printrevstatistics |
| 291 | repository persistrev |
| 292 | |
| @@ -312,11 +321,11 @@ | |
| 312 | return |
| 313 | } |
| 314 | |
| 315 | proc Paranoia {} { |
| 316 | # This code performs a number of paranoid checks of the |
| 317 | # database for inconsistent cross-references. |
| 318 | log write 4 collrev {Check database consistency} |
| 319 | |
| 320 | set n 0 ; # Counter for the checks (we print an id before the |
| 321 | # main label). |
| 322 | |
| 323 |
| --- tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_pcollrev.tcl | |
| @@ -186,18 +186,25 @@ | |
| 186 | |
| 187 | UNIQUE (pid, name) -- Symbols are unique within the project |
| 188 | } |
| 189 | |
| 190 | state writing blocker { |
| 191 | -- For each symbol we save which other symbols are |
| 192 | -- blocking its removal (if the user asks for it). |
| 193 | |
| 194 | sid INTEGER NOT NULL REFERENCES symbol, -- |
| 195 | bid INTEGER NOT NULL REFERENCES symbol, -- Sprouted from sid, blocks it. |
| 196 | UNIQUE (sid, bid) |
| 197 | } |
| 198 | |
| 199 | state writing parent { |
| 200 | -- For each symbol we save which other symbols can act as |
| 201 | -- a possible parent in some file, and how often. |
| 202 | |
| 203 | sid INTEGER NOT NULL REFERENCES symbol, -- |
| 204 | pid INTEGER NOT NULL REFERENCES symbol, -- Possible parent of sid |
| 205 | n INTEGER NOT NULL, -- How often pid can act as parent. |
| 206 | UNIQUE (sid, pid) |
| 207 | } |
| 208 | |
| 209 | state writing meta { |
| 210 | -- Meta data of revisions. See revision.mid for the |
| @@ -283,10 +290,12 @@ | |
| 290 | $file persist |
| 291 | } |
| 292 | |
| 293 | $file drop |
| 294 | } |
| 295 | |
| 296 | $project purgeghostsymbols |
| 297 | } |
| 298 | |
| 299 | repository printrevstatistics |
| 300 | repository persistrev |
| 301 | |
| @@ -312,11 +321,11 @@ | |
| 321 | return |
| 322 | } |
| 323 | |
| 324 | proc Paranoia {} { |
| 325 | # This code performs a number of paranoid checks of the |
| 326 | # database, searching for inconsistent cross-references. |
| 327 | log write 4 collrev {Check database consistency} |
| 328 | |
| 329 | set n 0 ; # Counter for the checks (we print an id before the |
| 330 | # main label). |
| 331 | |
| 332 |
| --- tools/cvs2fossil/lib/c2f_project.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_project.tcl | ||
| @@ -19,10 +19,11 @@ | ||
| 19 | 19 | package require snit ; # OO system. |
| 20 | 20 | package require vc::fossil::import::cvs::file ; # CVS archive file. |
| 21 | 21 | package require vc::fossil::import::cvs::state ; # State storage. |
| 22 | 22 | package require vc::fossil::import::cvs::project::sym ; # Per project symbols. |
| 23 | 23 | package require vc::fossil::import::cvs::project::trunk ; # Per project trunk, main lod |
| 24 | +package require vc::tools::log ; # User feedback | |
| 24 | 25 | package require struct::list ; # Advanced list operations.. |
| 25 | 26 | |
| 26 | 27 | # # ## ### ##### ######## ############# ##################### |
| 27 | 28 | ## |
| 28 | 29 | |
| @@ -32,10 +33,11 @@ | ||
| 32 | 33 | |
| 33 | 34 | constructor {path r} { |
| 34 | 35 | set mybase $path |
| 35 | 36 | set myrepository $r |
| 36 | 37 | set mytrunk [trunk %AUTO% $self] |
| 38 | + set mysymbol([$mytrunk name]) $mytrunk | |
| 37 | 39 | return |
| 38 | 40 | } |
| 39 | 41 | |
| 40 | 42 | method base {} { return $mybase } |
| 41 | 43 | method trunk {} { return $mytrunk } |
| @@ -75,10 +77,25 @@ | ||
| 75 | 77 | set mysymbol($name) \ |
| 76 | 78 | [sym %AUTO% $name [$myrepository defsymbol $myid $name] $self] |
| 77 | 79 | } |
| 78 | 80 | return $mysymbol($name) |
| 79 | 81 | } |
| 82 | + | |
| 83 | + method purgeghostsymbols {} { | |
| 84 | + set changes 1 | |
| 85 | + while {$changes} { | |
| 86 | + set changes 0 | |
| 87 | + foreach {name symbol} [array get mysymbol] { | |
| 88 | + if {![$symbol isghost]} continue | |
| 89 | + log write 3 project "$mybase: Deleting ghost symbol '$name'" | |
| 90 | + $symbol destroy | |
| 91 | + unset mysymbol($name) | |
| 92 | + set changes 1 | |
| 93 | + } | |
| 94 | + } | |
| 95 | + return | |
| 96 | + } | |
| 80 | 97 | |
| 81 | 98 | # pass I persistence |
| 82 | 99 | method persist {} { |
| 83 | 100 | TheFiles ; # Force id assignment. |
| 84 | 101 | |
| @@ -177,10 +194,11 @@ | ||
| 177 | 194 | } |
| 178 | 195 | |
| 179 | 196 | namespace eval ::vc::fossil::import::cvs { |
| 180 | 197 | namespace export project |
| 181 | 198 | namespace eval project { |
| 199 | + namespace import ::vc::tools::log | |
| 182 | 200 | namespace import ::vc::fossil::import::cvs::file |
| 183 | 201 | namespace import ::vc::fossil::import::cvs::state |
| 184 | 202 | # Import not required, already a child namespace. |
| 185 | 203 | # namespace import ::vc::fossil::import::cvs::project::sym |
| 186 | 204 | } |
| 187 | 205 |
| --- tools/cvs2fossil/lib/c2f_project.tcl | |
| +++ tools/cvs2fossil/lib/c2f_project.tcl | |
| @@ -19,10 +19,11 @@ | |
| 19 | package require snit ; # OO system. |
| 20 | package require vc::fossil::import::cvs::file ; # CVS archive file. |
| 21 | package require vc::fossil::import::cvs::state ; # State storage. |
| 22 | package require vc::fossil::import::cvs::project::sym ; # Per project symbols. |
| 23 | package require vc::fossil::import::cvs::project::trunk ; # Per project trunk, main lod |
| 24 | package require struct::list ; # Advanced list operations.. |
| 25 | |
| 26 | # # ## ### ##### ######## ############# ##################### |
| 27 | ## |
| 28 | |
| @@ -32,10 +33,11 @@ | |
| 32 | |
| 33 | constructor {path r} { |
| 34 | set mybase $path |
| 35 | set myrepository $r |
| 36 | set mytrunk [trunk %AUTO% $self] |
| 37 | return |
| 38 | } |
| 39 | |
| 40 | method base {} { return $mybase } |
| 41 | method trunk {} { return $mytrunk } |
| @@ -75,10 +77,25 @@ | |
| 75 | set mysymbol($name) \ |
| 76 | [sym %AUTO% $name [$myrepository defsymbol $myid $name] $self] |
| 77 | } |
| 78 | return $mysymbol($name) |
| 79 | } |
| 80 | |
| 81 | # pass I persistence |
| 82 | method persist {} { |
| 83 | TheFiles ; # Force id assignment. |
| 84 | |
| @@ -177,10 +194,11 @@ | |
| 177 | } |
| 178 | |
| 179 | namespace eval ::vc::fossil::import::cvs { |
| 180 | namespace export project |
| 181 | namespace eval project { |
| 182 | namespace import ::vc::fossil::import::cvs::file |
| 183 | namespace import ::vc::fossil::import::cvs::state |
| 184 | # Import not required, already a child namespace. |
| 185 | # namespace import ::vc::fossil::import::cvs::project::sym |
| 186 | } |
| 187 |
| --- tools/cvs2fossil/lib/c2f_project.tcl | |
| +++ tools/cvs2fossil/lib/c2f_project.tcl | |
| @@ -19,10 +19,11 @@ | |
| 19 | package require snit ; # OO system. |
| 20 | package require vc::fossil::import::cvs::file ; # CVS archive file. |
| 21 | package require vc::fossil::import::cvs::state ; # State storage. |
| 22 | package require vc::fossil::import::cvs::project::sym ; # Per project symbols. |
| 23 | package require vc::fossil::import::cvs::project::trunk ; # Per project trunk, main lod |
| 24 | package require vc::tools::log ; # User feedback |
| 25 | package require struct::list ; # Advanced list operations.. |
| 26 | |
| 27 | # # ## ### ##### ######## ############# ##################### |
| 28 | ## |
| 29 | |
| @@ -32,10 +33,11 @@ | |
| 33 | |
| 34 | constructor {path r} { |
| 35 | set mybase $path |
| 36 | set myrepository $r |
| 37 | set mytrunk [trunk %AUTO% $self] |
| 38 | set mysymbol([$mytrunk name]) $mytrunk |
| 39 | return |
| 40 | } |
| 41 | |
| 42 | method base {} { return $mybase } |
| 43 | method trunk {} { return $mytrunk } |
| @@ -75,10 +77,25 @@ | |
| 77 | set mysymbol($name) \ |
| 78 | [sym %AUTO% $name [$myrepository defsymbol $myid $name] $self] |
| 79 | } |
| 80 | return $mysymbol($name) |
| 81 | } |
| 82 | |
| 83 | method purgeghostsymbols {} { |
| 84 | set changes 1 |
| 85 | while {$changes} { |
| 86 | set changes 0 |
| 87 | foreach {name symbol} [array get mysymbol] { |
| 88 | if {![$symbol isghost]} continue |
| 89 | log write 3 project "$mybase: Deleting ghost symbol '$name'" |
| 90 | $symbol destroy |
| 91 | unset mysymbol($name) |
| 92 | set changes 1 |
| 93 | } |
| 94 | } |
| 95 | return |
| 96 | } |
| 97 | |
| 98 | # pass I persistence |
| 99 | method persist {} { |
| 100 | TheFiles ; # Force id assignment. |
| 101 | |
| @@ -177,10 +194,11 @@ | |
| 194 | } |
| 195 | |
| 196 | namespace eval ::vc::fossil::import::cvs { |
| 197 | namespace export project |
| 198 | namespace eval project { |
| 199 | namespace import ::vc::tools::log |
| 200 | namespace import ::vc::fossil::import::cvs::file |
| 201 | namespace import ::vc::fossil::import::cvs::state |
| 202 | # Import not required, already a child namespace. |
| 203 | # namespace import ::vc::fossil::import::cvs::project::sym |
| 204 | } |
| 205 |
+64
-6
| --- tools/cvs2fossil/lib/c2f_psym.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_psym.tcl | ||
| @@ -15,10 +15,11 @@ | ||
| 15 | 15 | # # ## ### ##### ######## ############# ##################### |
| 16 | 16 | ## Requirements |
| 17 | 17 | |
| 18 | 18 | package require Tcl 8.4 ; # Required runtime. |
| 19 | 19 | package require snit ; # OO system. |
| 20 | +package require struct::set ; # Set handling. | |
| 20 | 21 | package require vc::fossil::import::cvs::state ; # State storage. |
| 21 | 22 | |
| 22 | 23 | # # ## ### ##### ######## ############# ##################### |
| 23 | 24 | ## |
| 24 | 25 | |
| @@ -35,22 +36,68 @@ | ||
| 35 | 36 | |
| 36 | 37 | method name {} { return $myname } |
| 37 | 38 | method id {} { return $myid } |
| 38 | 39 | |
| 39 | 40 | # # ## ### ##### ######## ############# |
| 41 | + ## Symbol statistics | |
| 42 | + | |
| 43 | + method countasbranch {} { incr mybranchcount ; return } | |
| 44 | + method countastag {} { incr mytagcount ; return } | |
| 45 | + method countacommit {} { incr mycommitcount ; return } | |
| 46 | + | |
| 47 | + method blockedby {symbol} { | |
| 48 | + # Remember the symbol as preventing the removal of this | |
| 49 | + # symbol. Ot is a tag or branch that spawned from a revision | |
| 50 | + # on this symbol. | |
| 51 | + | |
| 52 | + struct::set include myblockers $symbol | |
| 53 | + return | |
| 54 | + } | |
| 55 | + | |
| 56 | + method possibleparent {symbol} { | |
| 57 | + if {[info exists mypparent($symbol)]} { | |
| 58 | + incr mypparent($symbol) | |
| 59 | + } else { | |
| 60 | + set mypparent($symbol) 1 | |
| 61 | + } | |
| 62 | + return | |
| 63 | + } | |
| 64 | + | |
| 65 | + method isghost {} { | |
| 66 | + # Checks if this symbol (as line of development) never | |
| 67 | + # existed. | |
| 68 | + | |
| 69 | + if {$mycommitcount > 0} { return 0 } | |
| 70 | + if {[llength $myblockers]} { return 0 } | |
| 71 | + if {[array size mypparent] > 0} { return 0 } | |
| 72 | + | |
| 73 | + return 1 | |
| 74 | + } | |
| 75 | + | |
| 76 | + # # ## ### ##### ######## ############# | |
| 40 | 77 | |
| 41 | 78 | method persistrev {} { |
| 42 | 79 | set pid [$myproject id] |
| 43 | 80 | |
| 44 | - # TODO: Compute the various counts. All the necessary | |
| 45 | - # TODO: information is already in the database. Actually it | |
| 46 | - # TODO: never was in memory. | |
| 47 | - | |
| 48 | 81 | state transaction { |
| 49 | 82 | state run { |
| 50 | - INSERT INTO symbol ( sid, pid, name, type, tag_count, branch_count, commit_count) | |
| 51 | - VALUES ($myid, $pid, $myname, $myundef, 0, 0, 0); | |
| 83 | + INSERT INTO symbol ( sid, pid, name, type, tag_count, branch_count, commit_count) | |
| 84 | + VALUES ($myid, $pid, $myname, $myundef, $mytagcount, $mybranchcount, $mycommitcount); | |
| 85 | + } | |
| 86 | + foreach symbol $myblockers { | |
| 87 | + set bid [$symbol id] | |
| 88 | + state run { | |
| 89 | + INSERT INTO blocker (sid, bid) | |
| 90 | + VALUES ($myid, $bid); | |
| 91 | + } | |
| 92 | + } | |
| 93 | + foreach {symbol count} [array get mypparent] { | |
| 94 | + set pid [$symbol id] | |
| 95 | + state run { | |
| 96 | + INSERT INTO parent (sid, pid, n) | |
| 97 | + VALUES ($myid, $pid, $count); | |
| 98 | + } | |
| 52 | 99 | } |
| 53 | 100 | } |
| 54 | 101 | return |
| 55 | 102 | } |
| 56 | 103 | |
| @@ -61,10 +108,21 @@ | ||
| 61 | 108 | # containing the symbol. |
| 62 | 109 | variable myname {} ; # The symbol's name |
| 63 | 110 | variable myid {} ; # Repository wide numeric id of the |
| 64 | 111 | # symbol. This implicitly encodes the |
| 65 | 112 | # project as well. |
| 113 | + | |
| 114 | + variable mybranchcount 0 ; # Count how many uses as branch. | |
| 115 | + variable mytagcount 0 ; # Count how many uses as tag. | |
| 116 | + variable mycommitcount 0 ; # Count how many files did a commit on the symbol. | |
| 117 | + | |
| 118 | + variable myblockers {} ; # List (Set) of the symbols which block | |
| 119 | + # the exclusion of this symbol. | |
| 120 | + | |
| 121 | + variable mypparent -array {} ; # Maps from symbols to the number | |
| 122 | + # of files in which it could have | |
| 123 | + # been a parent of this symbol. | |
| 66 | 124 | |
| 67 | 125 | typevariable mytag 1 ; # Code for symbols which are tags. |
| 68 | 126 | typevariable mybranch 2 ; # Code for symbols which are branches. |
| 69 | 127 | typevariable myundef 3 ; # Code for symbols of unknown type. |
| 70 | 128 | |
| 71 | 129 |
| --- tools/cvs2fossil/lib/c2f_psym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_psym.tcl | |
| @@ -15,10 +15,11 @@ | |
| 15 | # # ## ### ##### ######## ############# ##################### |
| 16 | ## Requirements |
| 17 | |
| 18 | package require Tcl 8.4 ; # Required runtime. |
| 19 | package require snit ; # OO system. |
| 20 | package require vc::fossil::import::cvs::state ; # State storage. |
| 21 | |
| 22 | # # ## ### ##### ######## ############# ##################### |
| 23 | ## |
| 24 | |
| @@ -35,22 +36,68 @@ | |
| 35 | |
| 36 | method name {} { return $myname } |
| 37 | method id {} { return $myid } |
| 38 | |
| 39 | # # ## ### ##### ######## ############# |
| 40 | |
| 41 | method persistrev {} { |
| 42 | set pid [$myproject id] |
| 43 | |
| 44 | # TODO: Compute the various counts. All the necessary |
| 45 | # TODO: information is already in the database. Actually it |
| 46 | # TODO: never was in memory. |
| 47 | |
| 48 | state transaction { |
| 49 | state run { |
| 50 | INSERT INTO symbol ( sid, pid, name, type, tag_count, branch_count, commit_count) |
| 51 | VALUES ($myid, $pid, $myname, $myundef, 0, 0, 0); |
| 52 | } |
| 53 | } |
| 54 | return |
| 55 | } |
| 56 | |
| @@ -61,10 +108,21 @@ | |
| 61 | # containing the symbol. |
| 62 | variable myname {} ; # The symbol's name |
| 63 | variable myid {} ; # Repository wide numeric id of the |
| 64 | # symbol. This implicitly encodes the |
| 65 | # project as well. |
| 66 | |
| 67 | typevariable mytag 1 ; # Code for symbols which are tags. |
| 68 | typevariable mybranch 2 ; # Code for symbols which are branches. |
| 69 | typevariable myundef 3 ; # Code for symbols of unknown type. |
| 70 | |
| 71 |
| --- tools/cvs2fossil/lib/c2f_psym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_psym.tcl | |
| @@ -15,10 +15,11 @@ | |
| 15 | # # ## ### ##### ######## ############# ##################### |
| 16 | ## Requirements |
| 17 | |
| 18 | package require Tcl 8.4 ; # Required runtime. |
| 19 | package require snit ; # OO system. |
| 20 | package require struct::set ; # Set handling. |
| 21 | package require vc::fossil::import::cvs::state ; # State storage. |
| 22 | |
| 23 | # # ## ### ##### ######## ############# ##################### |
| 24 | ## |
| 25 | |
| @@ -35,22 +36,68 @@ | |
| 36 | |
| 37 | method name {} { return $myname } |
| 38 | method id {} { return $myid } |
| 39 | |
| 40 | # # ## ### ##### ######## ############# |
| 41 | ## Symbol statistics |
| 42 | |
| 43 | method countasbranch {} { incr mybranchcount ; return } |
| 44 | method countastag {} { incr mytagcount ; return } |
| 45 | method countacommit {} { incr mycommitcount ; return } |
| 46 | |
| 47 | method blockedby {symbol} { |
| 48 | # Remember the symbol as preventing the removal of this |
| 49 | # symbol. Ot is a tag or branch that spawned from a revision |
| 50 | # on this symbol. |
| 51 | |
| 52 | struct::set include myblockers $symbol |
| 53 | return |
| 54 | } |
| 55 | |
| 56 | method possibleparent {symbol} { |
| 57 | if {[info exists mypparent($symbol)]} { |
| 58 | incr mypparent($symbol) |
| 59 | } else { |
| 60 | set mypparent($symbol) 1 |
| 61 | } |
| 62 | return |
| 63 | } |
| 64 | |
| 65 | method isghost {} { |
| 66 | # Checks if this symbol (as line of development) never |
| 67 | # existed. |
| 68 | |
| 69 | if {$mycommitcount > 0} { return 0 } |
| 70 | if {[llength $myblockers]} { return 0 } |
| 71 | if {[array size mypparent] > 0} { return 0 } |
| 72 | |
| 73 | return 1 |
| 74 | } |
| 75 | |
| 76 | # # ## ### ##### ######## ############# |
| 77 | |
| 78 | method persistrev {} { |
| 79 | set pid [$myproject id] |
| 80 | |
| 81 | state transaction { |
| 82 | state run { |
| 83 | INSERT INTO symbol ( sid, pid, name, type, tag_count, branch_count, commit_count) |
| 84 | VALUES ($myid, $pid, $myname, $myundef, $mytagcount, $mybranchcount, $mycommitcount); |
| 85 | } |
| 86 | foreach symbol $myblockers { |
| 87 | set bid [$symbol id] |
| 88 | state run { |
| 89 | INSERT INTO blocker (sid, bid) |
| 90 | VALUES ($myid, $bid); |
| 91 | } |
| 92 | } |
| 93 | foreach {symbol count} [array get mypparent] { |
| 94 | set pid [$symbol id] |
| 95 | state run { |
| 96 | INSERT INTO parent (sid, pid, n) |
| 97 | VALUES ($myid, $pid, $count); |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | return |
| 102 | } |
| 103 | |
| @@ -61,10 +108,21 @@ | |
| 108 | # containing the symbol. |
| 109 | variable myname {} ; # The symbol's name |
| 110 | variable myid {} ; # Repository wide numeric id of the |
| 111 | # symbol. This implicitly encodes the |
| 112 | # project as well. |
| 113 | |
| 114 | variable mybranchcount 0 ; # Count how many uses as branch. |
| 115 | variable mytagcount 0 ; # Count how many uses as tag. |
| 116 | variable mycommitcount 0 ; # Count how many files did a commit on the symbol. |
| 117 | |
| 118 | variable myblockers {} ; # List (Set) of the symbols which block |
| 119 | # the exclusion of this symbol. |
| 120 | |
| 121 | variable mypparent -array {} ; # Maps from symbols to the number |
| 122 | # of files in which it could have |
| 123 | # been a parent of this symbol. |
| 124 | |
| 125 | typevariable mytag 1 ; # Code for symbols which are tags. |
| 126 | typevariable mybranch 2 ; # Code for symbols which are branches. |
| 127 | typevariable myundef 3 ; # Code for symbols of unknown type. |
| 128 | |
| 129 |
+21
-4
| --- tools/cvs2fossil/lib/c2f_ptrunk.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_ptrunk.tcl | ||
| @@ -24,23 +24,41 @@ | ||
| 24 | 24 | snit::type ::vc::fossil::import::cvs::project::trunk { |
| 25 | 25 | # # ## ### ##### ######## ############# |
| 26 | 26 | ## Public API |
| 27 | 27 | |
| 28 | 28 | constructor {project} { |
| 29 | - set myid [[$project getsymbol $myname] id] | |
| 29 | + set mysymbol [$project getsymbol $myname] | |
| 30 | + set myid [$mysymbol id] | |
| 30 | 31 | return |
| 31 | 32 | } |
| 33 | + | |
| 34 | + destructor { | |
| 35 | + $mysymbol destroy | |
| 36 | + } | |
| 32 | 37 | |
| 33 | 38 | method name {} { return $myname } |
| 34 | 39 | method id {} { return $myid } |
| 35 | 40 | method istrunk {} { return 1 } |
| 41 | + method symbol {} { return $self } | |
| 42 | + | |
| 43 | + method countasbranch {} {} | |
| 44 | + method countastag {} {} | |
| 45 | + method countacommit {} {} | |
| 46 | + | |
| 47 | + method blockedby {symbol} {} | |
| 48 | + method possibleparent {symbol} {} | |
| 49 | + | |
| 50 | + method isghost {} { return 0 } | |
| 51 | + | |
| 52 | + delegate method persistrev to mysymbol | |
| 36 | 53 | |
| 37 | 54 | # # ## ### ##### ######## ############# |
| 38 | 55 | ## State |
| 39 | 56 | |
| 40 | - typevariable myname :trunk: ; # Name shared by all trunk symbols. | |
| 41 | - variable myid {} ; # The trunk's symbol id. | |
| 57 | + typevariable myname :trunk: ; # Name shared by all trunk symbols. | |
| 58 | + variable myid {} ; # The trunk's symbol id. | |
| 59 | + variable mysymbol {} ; # The symbol underneath the trunk. | |
| 42 | 60 | |
| 43 | 61 | # # ## ### ##### ######## ############# |
| 44 | 62 | ## Internal methods |
| 45 | 63 | |
| 46 | 64 | # # ## ### ##### ######## ############# |
| @@ -47,11 +65,10 @@ | ||
| 47 | 65 | ## Configuration |
| 48 | 66 | |
| 49 | 67 | pragma -hastypeinfo no ; # no type introspection |
| 50 | 68 | pragma -hasinfo no ; # no object introspection |
| 51 | 69 | pragma -hastypemethods no ; # type is not relevant. |
| 52 | - pragma -simpledispatch yes ; # simple fast dispatch | |
| 53 | 70 | |
| 54 | 71 | # # ## ### ##### ######## ############# |
| 55 | 72 | } |
| 56 | 73 | |
| 57 | 74 | namespace eval ::vc::fossil::import::cvs::project { |
| 58 | 75 |
| --- tools/cvs2fossil/lib/c2f_ptrunk.tcl | |
| +++ tools/cvs2fossil/lib/c2f_ptrunk.tcl | |
| @@ -24,23 +24,41 @@ | |
| 24 | snit::type ::vc::fossil::import::cvs::project::trunk { |
| 25 | # # ## ### ##### ######## ############# |
| 26 | ## Public API |
| 27 | |
| 28 | constructor {project} { |
| 29 | set myid [[$project getsymbol $myname] id] |
| 30 | return |
| 31 | } |
| 32 | |
| 33 | method name {} { return $myname } |
| 34 | method id {} { return $myid } |
| 35 | method istrunk {} { return 1 } |
| 36 | |
| 37 | # # ## ### ##### ######## ############# |
| 38 | ## State |
| 39 | |
| 40 | typevariable myname :trunk: ; # Name shared by all trunk symbols. |
| 41 | variable myid {} ; # The trunk's symbol id. |
| 42 | |
| 43 | # # ## ### ##### ######## ############# |
| 44 | ## Internal methods |
| 45 | |
| 46 | # # ## ### ##### ######## ############# |
| @@ -47,11 +65,10 @@ | |
| 47 | ## Configuration |
| 48 | |
| 49 | pragma -hastypeinfo no ; # no type introspection |
| 50 | pragma -hasinfo no ; # no object introspection |
| 51 | pragma -hastypemethods no ; # type is not relevant. |
| 52 | pragma -simpledispatch yes ; # simple fast dispatch |
| 53 | |
| 54 | # # ## ### ##### ######## ############# |
| 55 | } |
| 56 | |
| 57 | namespace eval ::vc::fossil::import::cvs::project { |
| 58 |
| --- tools/cvs2fossil/lib/c2f_ptrunk.tcl | |
| +++ tools/cvs2fossil/lib/c2f_ptrunk.tcl | |
| @@ -24,23 +24,41 @@ | |
| 24 | snit::type ::vc::fossil::import::cvs::project::trunk { |
| 25 | # # ## ### ##### ######## ############# |
| 26 | ## Public API |
| 27 | |
| 28 | constructor {project} { |
| 29 | set mysymbol [$project getsymbol $myname] |
| 30 | set myid [$mysymbol id] |
| 31 | return |
| 32 | } |
| 33 | |
| 34 | destructor { |
| 35 | $mysymbol destroy |
| 36 | } |
| 37 | |
| 38 | method name {} { return $myname } |
| 39 | method id {} { return $myid } |
| 40 | method istrunk {} { return 1 } |
| 41 | method symbol {} { return $self } |
| 42 | |
| 43 | method countasbranch {} {} |
| 44 | method countastag {} {} |
| 45 | method countacommit {} {} |
| 46 | |
| 47 | method blockedby {symbol} {} |
| 48 | method possibleparent {symbol} {} |
| 49 | |
| 50 | method isghost {} { return 0 } |
| 51 | |
| 52 | delegate method persistrev to mysymbol |
| 53 | |
| 54 | # # ## ### ##### ######## ############# |
| 55 | ## State |
| 56 | |
| 57 | typevariable myname :trunk: ; # Name shared by all trunk symbols. |
| 58 | variable myid {} ; # The trunk's symbol id. |
| 59 | variable mysymbol {} ; # The symbol underneath the trunk. |
| 60 | |
| 61 | # # ## ### ##### ######## ############# |
| 62 | ## Internal methods |
| 63 | |
| 64 | # # ## ### ##### ######## ############# |
| @@ -47,11 +65,10 @@ | |
| 65 | ## Configuration |
| 66 | |
| 67 | pragma -hastypeinfo no ; # no type introspection |
| 68 | pragma -hasinfo no ; # no object introspection |
| 69 | pragma -hastypemethods no ; # type is not relevant. |
| 70 | |
| 71 | # # ## ### ##### ######## ############# |
| 72 | } |
| 73 | |
| 74 | namespace eval ::vc::fossil::import::cvs::project { |
| 75 |