Fossil SCM
Continued to flesh out revision and symbol processing. Started on the project level classses.
Commit
da9295c6f6966abf518c0d261900bebdcbcfd4fa
Parent
be891232a20c3ba…
5 files changed
+9
-23
+34
-8
+10
-2
+19
-8
+6
-1
+9
-23
| --- tools/cvs2fossil/lib/c2f_file.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_file.tcl | ||
| @@ -18,10 +18,11 @@ | ||
| 18 | 18 | |
| 19 | 19 | package require Tcl 8.4 ; # Required runtime. |
| 20 | 20 | package require snit ; # OO system. |
| 21 | 21 | package require struct::set ; # Set operations. |
| 22 | 22 | package require vc::fossil::import::cvs::file::rev ; # CVS per file revisions. |
| 23 | +package require vc::fossil::import::cvs::file::sym ; # CVS per file symbols. | |
| 23 | 24 | |
| 24 | 25 | # # ## ### ##### ######## ############# ##################### |
| 25 | 26 | ## |
| 26 | 27 | |
| 27 | 28 | snit::type ::vc::fossil::import::cvs::file { |
| @@ -38,24 +39,10 @@ | ||
| 38 | 39 | method project {} { return $myproject } |
| 39 | 40 | |
| 40 | 41 | # # ## ### ##### ######## ############# |
| 41 | 42 | ## Methods required for the class to be a sink of the rcs parser |
| 42 | 43 | |
| 43 | - method begin {} {} | |
| 44 | - method done {} {} | |
| 45 | - method admindone {} {} | |
| 46 | - | |
| 47 | - method sethead {h} {} | |
| 48 | - method setprincipalbranch {b} {} | |
| 49 | - | |
| 50 | - method deftag {s r} {} | |
| 51 | - method setcomment {c} {} | |
| 52 | - method setdesc {d} {} | |
| 53 | - | |
| 54 | - method def {rev date author state next branches} {} | |
| 55 | - method extend {rev commitmsg deltarange} {} | |
| 56 | - | |
| 57 | 44 | #method begin {} {puts begin} |
| 58 | 45 | #method sethead {h} {puts head=$h} |
| 59 | 46 | #method setprincipalbranch {b} {puts pb=$b} |
| 60 | 47 | #method deftag {s r} {puts $s=$r} |
| 61 | 48 | #method setcomment {c} {puts comment=$c} |
| @@ -119,11 +106,11 @@ | ||
| 119 | 106 | if {[info exists myrev($revnr)]} { |
| 120 | 107 | trouble fatal "File $mypath contains duplicate definitions for revision $revnr." |
| 121 | 108 | return |
| 122 | 109 | } |
| 123 | 110 | |
| 124 | - set myrev($revnr) [rev %AUTO% $date $author $state $self] | |
| 111 | + set myrev($revnr) [rev %AUTO% $revnr $date $author $state $self] | |
| 125 | 112 | |
| 126 | 113 | RecordBasicDependencies $revnr $next |
| 127 | 114 | return |
| 128 | 115 | } |
| 129 | 116 | |
| @@ -153,10 +140,14 @@ | ||
| 153 | 140 | # Extend the revision with the new information. The revision |
| 154 | 141 | # object uses this to complete its meta data set. |
| 155 | 142 | |
| 156 | 143 | $rev setcommitmsg $cm |
| 157 | 144 | $rev settext $deltarange |
| 145 | + | |
| 146 | + if {![rev istrunkrevnr $revnr]} { | |
| 147 | + $rev setbranch [[$self Rev2Branch $revnr] name] | |
| 148 | + } | |
| 158 | 149 | |
| 159 | 150 | # If this is revision 1.1, we have to determine whether the |
| 160 | 151 | # file seems to have been created through 'cvs add' instead of |
| 161 | 152 | # 'cvs import'. This can be done by looking at the un- |
| 162 | 153 | # adulterated commit message, as CVS uses a hardwired magic |
| @@ -231,23 +222,17 @@ | ||
| 231 | 222 | if {[info exists mybranches($branchnr)]} { |
| 232 | 223 | log write 1 file "In '$mypath': Branch '$branchnr' named '[$mybranches($branchnr) name]'" |
| 233 | 224 | log write 1 file "Cannot have second name '$name', ignoring it" |
| 234 | 225 | return |
| 235 | 226 | } |
| 236 | - set sym "" | |
| 237 | - set branch "" | |
| 238 | - #TODO set sym [$myproject getsymbol $name ] | |
| 239 | - #TODO set tag [sym %AUTO% branch $sym $branchnr] | |
| 227 | + set branch [sym %AUTO% branch $branchnr [$myproject getsymbol $name]] | |
| 240 | 228 | set mybranches($branchnr) $branch |
| 241 | 229 | return $branch |
| 242 | 230 | } |
| 243 | 231 | |
| 244 | 232 | method AddTag {name revnr} { |
| 245 | - set sym "" | |
| 246 | - set tag "" | |
| 247 | - #TODO set sym [$myproject getsymbol $name ] | |
| 248 | - #TODO set tag [sym %AUTO% tag $sym $revnr] | |
| 233 | + set tag [sym %AUTO% tag $revnr [$myproject getsymbol $name]] | |
| 249 | 234 | lappend mytags($revnr) $tag |
| 250 | 235 | return $tag |
| 251 | 236 | } |
| 252 | 237 | |
| 253 | 238 | proc RecordBasicDependencies {revnr next} { |
| @@ -297,13 +282,14 @@ | ||
| 297 | 282 | namespace eval ::vc::fossil::import::cvs { |
| 298 | 283 | namespace export file |
| 299 | 284 | namespace eval file { |
| 300 | 285 | # Import not required, already a child namespace. |
| 301 | 286 | # namespace import vc::fossil::import::cvs::file::rev |
| 287 | + # namespace import vc::fossil::import::cvs::file::sym | |
| 302 | 288 | } |
| 303 | 289 | } |
| 304 | 290 | |
| 305 | 291 | # # ## ### ##### ######## ############# ##################### |
| 306 | 292 | ## Ready |
| 307 | 293 | |
| 308 | 294 | package provide vc::fossil::import::cvs::file 1.0 |
| 309 | 295 | return |
| 310 | 296 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -18,10 +18,11 @@ | |
| 18 | |
| 19 | package require Tcl 8.4 ; # Required runtime. |
| 20 | package require snit ; # OO system. |
| 21 | package require struct::set ; # Set operations. |
| 22 | package require vc::fossil::import::cvs::file::rev ; # CVS per file revisions. |
| 23 | |
| 24 | # # ## ### ##### ######## ############# ##################### |
| 25 | ## |
| 26 | |
| 27 | snit::type ::vc::fossil::import::cvs::file { |
| @@ -38,24 +39,10 @@ | |
| 38 | method project {} { return $myproject } |
| 39 | |
| 40 | # # ## ### ##### ######## ############# |
| 41 | ## Methods required for the class to be a sink of the rcs parser |
| 42 | |
| 43 | method begin {} {} |
| 44 | method done {} {} |
| 45 | method admindone {} {} |
| 46 | |
| 47 | method sethead {h} {} |
| 48 | method setprincipalbranch {b} {} |
| 49 | |
| 50 | method deftag {s r} {} |
| 51 | method setcomment {c} {} |
| 52 | method setdesc {d} {} |
| 53 | |
| 54 | method def {rev date author state next branches} {} |
| 55 | method extend {rev commitmsg deltarange} {} |
| 56 | |
| 57 | #method begin {} {puts begin} |
| 58 | #method sethead {h} {puts head=$h} |
| 59 | #method setprincipalbranch {b} {puts pb=$b} |
| 60 | #method deftag {s r} {puts $s=$r} |
| 61 | #method setcomment {c} {puts comment=$c} |
| @@ -119,11 +106,11 @@ | |
| 119 | if {[info exists myrev($revnr)]} { |
| 120 | trouble fatal "File $mypath contains duplicate definitions for revision $revnr." |
| 121 | return |
| 122 | } |
| 123 | |
| 124 | set myrev($revnr) [rev %AUTO% $date $author $state $self] |
| 125 | |
| 126 | RecordBasicDependencies $revnr $next |
| 127 | return |
| 128 | } |
| 129 | |
| @@ -153,10 +140,14 @@ | |
| 153 | # Extend the revision with the new information. The revision |
| 154 | # object uses this to complete its meta data set. |
| 155 | |
| 156 | $rev setcommitmsg $cm |
| 157 | $rev settext $deltarange |
| 158 | |
| 159 | # If this is revision 1.1, we have to determine whether the |
| 160 | # file seems to have been created through 'cvs add' instead of |
| 161 | # 'cvs import'. This can be done by looking at the un- |
| 162 | # adulterated commit message, as CVS uses a hardwired magic |
| @@ -231,23 +222,17 @@ | |
| 231 | if {[info exists mybranches($branchnr)]} { |
| 232 | log write 1 file "In '$mypath': Branch '$branchnr' named '[$mybranches($branchnr) name]'" |
| 233 | log write 1 file "Cannot have second name '$name', ignoring it" |
| 234 | return |
| 235 | } |
| 236 | set sym "" |
| 237 | set branch "" |
| 238 | #TODO set sym [$myproject getsymbol $name ] |
| 239 | #TODO set tag [sym %AUTO% branch $sym $branchnr] |
| 240 | set mybranches($branchnr) $branch |
| 241 | return $branch |
| 242 | } |
| 243 | |
| 244 | method AddTag {name revnr} { |
| 245 | set sym "" |
| 246 | set tag "" |
| 247 | #TODO set sym [$myproject getsymbol $name ] |
| 248 | #TODO set tag [sym %AUTO% tag $sym $revnr] |
| 249 | lappend mytags($revnr) $tag |
| 250 | return $tag |
| 251 | } |
| 252 | |
| 253 | proc RecordBasicDependencies {revnr next} { |
| @@ -297,13 +282,14 @@ | |
| 297 | namespace eval ::vc::fossil::import::cvs { |
| 298 | namespace export file |
| 299 | namespace eval file { |
| 300 | # Import not required, already a child namespace. |
| 301 | # namespace import vc::fossil::import::cvs::file::rev |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | # # ## ### ##### ######## ############# ##################### |
| 306 | ## Ready |
| 307 | |
| 308 | package provide vc::fossil::import::cvs::file 1.0 |
| 309 | return |
| 310 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -18,10 +18,11 @@ | |
| 18 | |
| 19 | package require Tcl 8.4 ; # Required runtime. |
| 20 | package require snit ; # OO system. |
| 21 | package require struct::set ; # Set operations. |
| 22 | package require vc::fossil::import::cvs::file::rev ; # CVS per file revisions. |
| 23 | package require vc::fossil::import::cvs::file::sym ; # CVS per file symbols. |
| 24 | |
| 25 | # # ## ### ##### ######## ############# ##################### |
| 26 | ## |
| 27 | |
| 28 | snit::type ::vc::fossil::import::cvs::file { |
| @@ -38,24 +39,10 @@ | |
| 39 | method project {} { return $myproject } |
| 40 | |
| 41 | # # ## ### ##### ######## ############# |
| 42 | ## Methods required for the class to be a sink of the rcs parser |
| 43 | |
| 44 | #method begin {} {puts begin} |
| 45 | #method sethead {h} {puts head=$h} |
| 46 | #method setprincipalbranch {b} {puts pb=$b} |
| 47 | #method deftag {s r} {puts $s=$r} |
| 48 | #method setcomment {c} {puts comment=$c} |
| @@ -119,11 +106,11 @@ | |
| 106 | if {[info exists myrev($revnr)]} { |
| 107 | trouble fatal "File $mypath contains duplicate definitions for revision $revnr." |
| 108 | return |
| 109 | } |
| 110 | |
| 111 | set myrev($revnr) [rev %AUTO% $revnr $date $author $state $self] |
| 112 | |
| 113 | RecordBasicDependencies $revnr $next |
| 114 | return |
| 115 | } |
| 116 | |
| @@ -153,10 +140,14 @@ | |
| 140 | # Extend the revision with the new information. The revision |
| 141 | # object uses this to complete its meta data set. |
| 142 | |
| 143 | $rev setcommitmsg $cm |
| 144 | $rev settext $deltarange |
| 145 | |
| 146 | if {![rev istrunkrevnr $revnr]} { |
| 147 | $rev setbranch [[$self Rev2Branch $revnr] name] |
| 148 | } |
| 149 | |
| 150 | # If this is revision 1.1, we have to determine whether the |
| 151 | # file seems to have been created through 'cvs add' instead of |
| 152 | # 'cvs import'. This can be done by looking at the un- |
| 153 | # adulterated commit message, as CVS uses a hardwired magic |
| @@ -231,23 +222,17 @@ | |
| 222 | if {[info exists mybranches($branchnr)]} { |
| 223 | log write 1 file "In '$mypath': Branch '$branchnr' named '[$mybranches($branchnr) name]'" |
| 224 | log write 1 file "Cannot have second name '$name', ignoring it" |
| 225 | return |
| 226 | } |
| 227 | set branch [sym %AUTO% branch $branchnr [$myproject getsymbol $name]] |
| 228 | set mybranches($branchnr) $branch |
| 229 | return $branch |
| 230 | } |
| 231 | |
| 232 | method AddTag {name revnr} { |
| 233 | set tag [sym %AUTO% tag $revnr [$myproject getsymbol $name]] |
| 234 | lappend mytags($revnr) $tag |
| 235 | return $tag |
| 236 | } |
| 237 | |
| 238 | proc RecordBasicDependencies {revnr next} { |
| @@ -297,13 +282,14 @@ | |
| 282 | namespace eval ::vc::fossil::import::cvs { |
| 283 | namespace export file |
| 284 | namespace eval file { |
| 285 | # Import not required, already a child namespace. |
| 286 | # namespace import vc::fossil::import::cvs::file::rev |
| 287 | # namespace import vc::fossil::import::cvs::file::sym |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | # # ## ### ##### ######## ############# ##################### |
| 292 | ## Ready |
| 293 | |
| 294 | package provide vc::fossil::import::cvs::file 1.0 |
| 295 | return |
| 296 |
+34
-8
| --- tools/cvs2fossil/lib/c2f_frev.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_frev.tcl | ||
| @@ -23,30 +23,42 @@ | ||
| 23 | 23 | |
| 24 | 24 | snit::type ::vc::fossil::import::cvs::file::rev { |
| 25 | 25 | # # ## ### ##### ######## ############# |
| 26 | 26 | ## Public API |
| 27 | 27 | |
| 28 | - constructor {date author state thefile} { | |
| 28 | + constructor {revnr date author state thefile} { | |
| 29 | + set myrevnr $revnr | |
| 30 | + set mydate $date | |
| 31 | + set myauthor $author | |
| 32 | + set mystate $state | |
| 33 | + set myfile $thefile | |
| 29 | 34 | return |
| 30 | 35 | } |
| 31 | 36 | |
| 32 | - method hascommitmsg {} { | |
| 33 | - # TODO: check that we have the commit message | |
| 34 | - return 0 | |
| 35 | - } | |
| 37 | + method hascommitmsg {} { return $myhascm } | |
| 36 | 38 | |
| 37 | 39 | method setcommitmsg {cm} { |
| 40 | + set mycommitmsg $cm | |
| 41 | + set myhascm 1 | |
| 42 | + return | |
| 38 | 43 | } |
| 39 | 44 | |
| 40 | 45 | method settext {text} { |
| 46 | + set mytext $text | |
| 47 | + return | |
| 48 | + } | |
| 49 | + | |
| 50 | + method setbranch {branchnr} { | |
| 51 | + set mybranchnr $branchnr | |
| 52 | + return | |
| 41 | 53 | } |
| 42 | 54 | |
| 43 | 55 | # # ## ### ##### ######## ############# |
| 44 | 56 | ## Type API |
| 45 | 57 | |
| 46 | 58 | typemethod istrunkrevnr {revnr} { |
| 47 | - return [expr {[llength [split $revnr .]] == 1}] | |
| 59 | + return [expr {[llength [split $revnr .]] == 2}] | |
| 48 | 60 | } |
| 49 | 61 | |
| 50 | 62 | typemethod 2branchnr {revnr} { |
| 51 | 63 | # Input is a branch revision number, i.e. a revision number |
| 52 | 64 | # with an even number of components; for example '2.9.2.1' |
| @@ -61,11 +73,11 @@ | ||
| 61 | 73 | } |
| 62 | 74 | |
| 63 | 75 | typemethod isbranchrevnr {revnr _ bv} { |
| 64 | 76 | if {[regexp $mybranchpattern $revnr -> head tail]} { |
| 65 | 77 | upvar 1 $bv branchnr |
| 66 | - set branchnr ${head}.$tail | |
| 78 | + set branchnr ${head}$tail | |
| 67 | 79 | return 1 |
| 68 | 80 | } |
| 69 | 81 | return 0 |
| 70 | 82 | } |
| 71 | 83 | |
| @@ -75,19 +87,33 @@ | ||
| 75 | 87 | typevariable mybranchpattern {^((?:\d+\.\d+\.)+)(?:0\.)?(\d+)$} |
| 76 | 88 | # First a nonzero even number of digit groups with trailing dot |
| 77 | 89 | # CVS then sticks an extra 0 in here; RCS does not. |
| 78 | 90 | # And the last digit group. |
| 79 | 91 | |
| 92 | + variable myrevnr {} ; # Revision number of the revision. | |
| 93 | + variable mydate {} ; # Timestamp of the revision, seconds since epoch | |
| 94 | + variable mystate {} ; # State of the revision. | |
| 95 | + variable myfile {} ; # Ref to the file object the revision belongs to. | |
| 96 | + variable myhascm 0 ; # Bool flag, set when the commit msg was set. | |
| 97 | + variable mytext {} ; # Range of the (delta) text for this revision in the file. | |
| 98 | + | |
| 99 | + # The meta data block used later to group revisions into changesets. | |
| 100 | + # The project name factors into this as well, but is not stored | |
| 101 | + # here. The name is acessible via myfile's project. | |
| 102 | + | |
| 103 | + variable myauthor {} ; # Name of the user who committed the revision. | |
| 104 | + variable mycommitmsg {} ; # The message entered as part of the commit. | |
| 105 | + variable mybranchnr {} ; # The number of the branch the commit was done on. | |
| 106 | + | |
| 80 | 107 | # # ## ### ##### ######## ############# |
| 81 | 108 | ## Internal methods |
| 82 | 109 | |
| 83 | 110 | # # ## ### ##### ######## ############# |
| 84 | 111 | ## Configuration |
| 85 | 112 | |
| 86 | 113 | pragma -hastypeinfo no ; # no type introspection |
| 87 | 114 | pragma -hasinfo no ; # no object introspection |
| 88 | - #pragma -hastypemethods no ; # type is not relevant. | |
| 89 | 115 | pragma -simpledispatch yes ; # simple fast dispatch |
| 90 | 116 | |
| 91 | 117 | # # ## ### ##### ######## ############# |
| 92 | 118 | } |
| 93 | 119 | |
| 94 | 120 |
| --- tools/cvs2fossil/lib/c2f_frev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_frev.tcl | |
| @@ -23,30 +23,42 @@ | |
| 23 | |
| 24 | snit::type ::vc::fossil::import::cvs::file::rev { |
| 25 | # # ## ### ##### ######## ############# |
| 26 | ## Public API |
| 27 | |
| 28 | constructor {date author state thefile} { |
| 29 | return |
| 30 | } |
| 31 | |
| 32 | method hascommitmsg {} { |
| 33 | # TODO: check that we have the commit message |
| 34 | return 0 |
| 35 | } |
| 36 | |
| 37 | method setcommitmsg {cm} { |
| 38 | } |
| 39 | |
| 40 | method settext {text} { |
| 41 | } |
| 42 | |
| 43 | # # ## ### ##### ######## ############# |
| 44 | ## Type API |
| 45 | |
| 46 | typemethod istrunkrevnr {revnr} { |
| 47 | return [expr {[llength [split $revnr .]] == 1}] |
| 48 | } |
| 49 | |
| 50 | typemethod 2branchnr {revnr} { |
| 51 | # Input is a branch revision number, i.e. a revision number |
| 52 | # with an even number of components; for example '2.9.2.1' |
| @@ -61,11 +73,11 @@ | |
| 61 | } |
| 62 | |
| 63 | typemethod isbranchrevnr {revnr _ bv} { |
| 64 | if {[regexp $mybranchpattern $revnr -> head tail]} { |
| 65 | upvar 1 $bv branchnr |
| 66 | set branchnr ${head}.$tail |
| 67 | return 1 |
| 68 | } |
| 69 | return 0 |
| 70 | } |
| 71 | |
| @@ -75,19 +87,33 @@ | |
| 75 | typevariable mybranchpattern {^((?:\d+\.\d+\.)+)(?:0\.)?(\d+)$} |
| 76 | # First a nonzero even number of digit groups with trailing dot |
| 77 | # CVS then sticks an extra 0 in here; RCS does not. |
| 78 | # And the last digit group. |
| 79 | |
| 80 | # # ## ### ##### ######## ############# |
| 81 | ## Internal methods |
| 82 | |
| 83 | # # ## ### ##### ######## ############# |
| 84 | ## Configuration |
| 85 | |
| 86 | pragma -hastypeinfo no ; # no type introspection |
| 87 | pragma -hasinfo no ; # no object introspection |
| 88 | #pragma -hastypemethods no ; # type is not relevant. |
| 89 | pragma -simpledispatch yes ; # simple fast dispatch |
| 90 | |
| 91 | # # ## ### ##### ######## ############# |
| 92 | } |
| 93 | |
| 94 |
| --- tools/cvs2fossil/lib/c2f_frev.tcl | |
| +++ tools/cvs2fossil/lib/c2f_frev.tcl | |
| @@ -23,30 +23,42 @@ | |
| 23 | |
| 24 | snit::type ::vc::fossil::import::cvs::file::rev { |
| 25 | # # ## ### ##### ######## ############# |
| 26 | ## Public API |
| 27 | |
| 28 | constructor {revnr date author state thefile} { |
| 29 | set myrevnr $revnr |
| 30 | set mydate $date |
| 31 | set myauthor $author |
| 32 | set mystate $state |
| 33 | set myfile $thefile |
| 34 | return |
| 35 | } |
| 36 | |
| 37 | method hascommitmsg {} { return $myhascm } |
| 38 | |
| 39 | method setcommitmsg {cm} { |
| 40 | set mycommitmsg $cm |
| 41 | set myhascm 1 |
| 42 | return |
| 43 | } |
| 44 | |
| 45 | method settext {text} { |
| 46 | set mytext $text |
| 47 | return |
| 48 | } |
| 49 | |
| 50 | method setbranch {branchnr} { |
| 51 | set mybranchnr $branchnr |
| 52 | return |
| 53 | } |
| 54 | |
| 55 | # # ## ### ##### ######## ############# |
| 56 | ## Type API |
| 57 | |
| 58 | typemethod istrunkrevnr {revnr} { |
| 59 | return [expr {[llength [split $revnr .]] == 2}] |
| 60 | } |
| 61 | |
| 62 | typemethod 2branchnr {revnr} { |
| 63 | # Input is a branch revision number, i.e. a revision number |
| 64 | # with an even number of components; for example '2.9.2.1' |
| @@ -61,11 +73,11 @@ | |
| 73 | } |
| 74 | |
| 75 | typemethod isbranchrevnr {revnr _ bv} { |
| 76 | if {[regexp $mybranchpattern $revnr -> head tail]} { |
| 77 | upvar 1 $bv branchnr |
| 78 | set branchnr ${head}$tail |
| 79 | return 1 |
| 80 | } |
| 81 | return 0 |
| 82 | } |
| 83 | |
| @@ -75,19 +87,33 @@ | |
| 87 | typevariable mybranchpattern {^((?:\d+\.\d+\.)+)(?:0\.)?(\d+)$} |
| 88 | # First a nonzero even number of digit groups with trailing dot |
| 89 | # CVS then sticks an extra 0 in here; RCS does not. |
| 90 | # And the last digit group. |
| 91 | |
| 92 | variable myrevnr {} ; # Revision number of the revision. |
| 93 | variable mydate {} ; # Timestamp of the revision, seconds since epoch |
| 94 | variable mystate {} ; # State of the revision. |
| 95 | variable myfile {} ; # Ref to the file object the revision belongs to. |
| 96 | variable myhascm 0 ; # Bool flag, set when the commit msg was set. |
| 97 | variable mytext {} ; # Range of the (delta) text for this revision in the file. |
| 98 | |
| 99 | # The meta data block used later to group revisions into changesets. |
| 100 | # The project name factors into this as well, but is not stored |
| 101 | # here. The name is acessible via myfile's project. |
| 102 | |
| 103 | variable myauthor {} ; # Name of the user who committed the revision. |
| 104 | variable mycommitmsg {} ; # The message entered as part of the commit. |
| 105 | variable mybranchnr {} ; # The number of the branch the commit was done on. |
| 106 | |
| 107 | # # ## ### ##### ######## ############# |
| 108 | ## Internal methods |
| 109 | |
| 110 | # # ## ### ##### ######## ############# |
| 111 | ## Configuration |
| 112 | |
| 113 | pragma -hastypeinfo no ; # no type introspection |
| 114 | pragma -hasinfo no ; # no object introspection |
| 115 | pragma -simpledispatch yes ; # simple fast dispatch |
| 116 | |
| 117 | # # ## ### ##### ######## ############# |
| 118 | } |
| 119 | |
| 120 |
+10
-2
| --- tools/cvs2fossil/lib/c2f_fsym.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_fsym.tcl | ||
| @@ -23,27 +23,35 @@ | ||
| 23 | 23 | |
| 24 | 24 | snit::type ::vc::fossil::import::cvs::file::sym { |
| 25 | 25 | # # ## ### ##### ######## ############# |
| 26 | 26 | ## Public API |
| 27 | 27 | |
| 28 | - constructor {} { | |
| 28 | + constructor {symtype nr symbol} { | |
| 29 | + set mytype $symtype | |
| 30 | + set mynr $nr | |
| 31 | + set mysymbol $symbol | |
| 29 | 32 | return |
| 30 | 33 | } |
| 34 | + | |
| 35 | + delegate method name to mysymbol | |
| 31 | 36 | |
| 32 | 37 | # # ## ### ##### ######## ############# |
| 33 | 38 | ## State |
| 34 | 39 | |
| 40 | + variable mytype {} ; # Symbol type, 'tag', or 'branch'. | |
| 41 | + variable mynr {} ; # Revision number of a 'tag', branch number of a 'branch'. | |
| 42 | + variable mysymbol {} ; # Ref to symbol object at project level. | |
| 43 | + | |
| 35 | 44 | # # ## ### ##### ######## ############# |
| 36 | 45 | ## Internal methods |
| 37 | 46 | |
| 38 | 47 | # # ## ### ##### ######## ############# |
| 39 | 48 | ## Configuration |
| 40 | 49 | |
| 41 | 50 | pragma -hastypeinfo no ; # no type introspection |
| 42 | 51 | pragma -hasinfo no ; # no object introspection |
| 43 | 52 | pragma -hastypemethods no ; # type is not relevant. |
| 44 | - pragma -simpledispatch yes ; # simple fast dispatch | |
| 45 | 53 | |
| 46 | 54 | # # ## ### ##### ######## ############# |
| 47 | 55 | } |
| 48 | 56 | |
| 49 | 57 | namespace eval ::vc::fossil::import::cvs::file { |
| 50 | 58 |
| --- tools/cvs2fossil/lib/c2f_fsym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_fsym.tcl | |
| @@ -23,27 +23,35 @@ | |
| 23 | |
| 24 | snit::type ::vc::fossil::import::cvs::file::sym { |
| 25 | # # ## ### ##### ######## ############# |
| 26 | ## Public API |
| 27 | |
| 28 | constructor {} { |
| 29 | return |
| 30 | } |
| 31 | |
| 32 | # # ## ### ##### ######## ############# |
| 33 | ## State |
| 34 | |
| 35 | # # ## ### ##### ######## ############# |
| 36 | ## Internal methods |
| 37 | |
| 38 | # # ## ### ##### ######## ############# |
| 39 | ## Configuration |
| 40 | |
| 41 | pragma -hastypeinfo no ; # no type introspection |
| 42 | pragma -hasinfo no ; # no object introspection |
| 43 | pragma -hastypemethods no ; # type is not relevant. |
| 44 | pragma -simpledispatch yes ; # simple fast dispatch |
| 45 | |
| 46 | # # ## ### ##### ######## ############# |
| 47 | } |
| 48 | |
| 49 | namespace eval ::vc::fossil::import::cvs::file { |
| 50 |
| --- tools/cvs2fossil/lib/c2f_fsym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_fsym.tcl | |
| @@ -23,27 +23,35 @@ | |
| 23 | |
| 24 | snit::type ::vc::fossil::import::cvs::file::sym { |
| 25 | # # ## ### ##### ######## ############# |
| 26 | ## Public API |
| 27 | |
| 28 | constructor {symtype nr symbol} { |
| 29 | set mytype $symtype |
| 30 | set mynr $nr |
| 31 | set mysymbol $symbol |
| 32 | return |
| 33 | } |
| 34 | |
| 35 | delegate method name to mysymbol |
| 36 | |
| 37 | # # ## ### ##### ######## ############# |
| 38 | ## State |
| 39 | |
| 40 | variable mytype {} ; # Symbol type, 'tag', or 'branch'. |
| 41 | variable mynr {} ; # Revision number of a 'tag', branch number of a 'branch'. |
| 42 | variable mysymbol {} ; # Ref to symbol object at project level. |
| 43 | |
| 44 | # # ## ### ##### ######## ############# |
| 45 | ## Internal methods |
| 46 | |
| 47 | # # ## ### ##### ######## ############# |
| 48 | ## Configuration |
| 49 | |
| 50 | pragma -hastypeinfo no ; # no type introspection |
| 51 | pragma -hasinfo no ; # no object introspection |
| 52 | pragma -hastypemethods no ; # type is not relevant. |
| 53 | |
| 54 | # # ## ### ##### ######## ############# |
| 55 | } |
| 56 | |
| 57 | namespace eval ::vc::fossil::import::cvs::file { |
| 58 |
+19
-8
| --- tools/cvs2fossil/lib/c2f_project.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_project.tcl | ||
| @@ -13,14 +13,15 @@ | ||
| 13 | 13 | ## Project, part of a CVS repository. Multiple instances are possible. |
| 14 | 14 | |
| 15 | 15 | # # ## ### ##### ######## ############# ##################### |
| 16 | 16 | ## Requirements |
| 17 | 17 | |
| 18 | -package require Tcl 8.4 ; # Required runtime. | |
| 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 | |
| 18 | +package require Tcl 8.4 ; # Required runtime. | |
| 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 | |
| 22 | 23 | |
| 23 | 24 | # # ## ### ##### ######## ############# ##################### |
| 24 | 25 | ## |
| 25 | 26 | |
| 26 | 27 | snit::type ::vc::fossil::import::cvs::project { |
| @@ -54,10 +55,17 @@ | ||
| 54 | 55 | return [TheFiles] |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | 58 | delegate method author to myrepository |
| 58 | 59 | delegate method cmessage to myrepository |
| 60 | + | |
| 61 | + method getsymbol {name} { | |
| 62 | + if {![info exists mysymbols($name)]} { | |
| 63 | + set mysymbols($name) [sym %AUTO% $name] | |
| 64 | + } | |
| 65 | + return $mysymbols($name) | |
| 66 | + } | |
| 59 | 67 | |
| 60 | 68 | # pass I persistence |
| 61 | 69 | method persist {} { |
| 62 | 70 | state transaction { |
| 63 | 71 | # Project data first. Required so that we have its id |
| @@ -94,14 +102,15 @@ | ||
| 94 | 102 | } |
| 95 | 103 | |
| 96 | 104 | # # ## ### ##### ######## ############# |
| 97 | 105 | ## State |
| 98 | 106 | |
| 99 | - variable mybase {} ; # Project directory | |
| 100 | - variable myfiles -array {} ; # Maps rcs archive to their user files. | |
| 101 | - variable myfobj {} ; # File objects for the rcs archives | |
| 102 | - variable myrepository {} ; # Repository the prject belongs to. | |
| 107 | + variable mybase {} ; # Project directory | |
| 108 | + variable myfiles -array {} ; # Maps rcs archive to their user files. | |
| 109 | + variable myfobj {} ; # File objects for the rcs archives | |
| 110 | + variable myrepository {} ; # Repository the prject belongs to. | |
| 111 | + variable mysymbols -array {} ; # Map symbol names to project-level symbol objects. | |
| 103 | 112 | |
| 104 | 113 | # # ## ### ##### ######## ############# |
| 105 | 114 | ## Internal methods |
| 106 | 115 | |
| 107 | 116 | proc TheFiles {} { |
| @@ -134,13 +143,15 @@ | ||
| 134 | 143 | namespace eval ::vc::fossil::import::cvs { |
| 135 | 144 | namespace export project |
| 136 | 145 | namespace eval project { |
| 137 | 146 | namespace import ::vc::fossil::import::cvs::file |
| 138 | 147 | namespace import ::vc::fossil::import::cvs::state |
| 148 | + # Import not required, already a child namespace. | |
| 149 | + # namespace import ::vc::fossil::import::cvs::project::sym | |
| 139 | 150 | } |
| 140 | 151 | } |
| 141 | 152 | |
| 142 | 153 | # # ## ### ##### ######## ############# ##################### |
| 143 | 154 | ## Ready |
| 144 | 155 | |
| 145 | 156 | package provide vc::fossil::import::cvs::project 1.0 |
| 146 | 157 | return |
| 147 | 158 |
| --- tools/cvs2fossil/lib/c2f_project.tcl | |
| +++ tools/cvs2fossil/lib/c2f_project.tcl | |
| @@ -13,14 +13,15 @@ | |
| 13 | ## Project, part of a CVS repository. Multiple instances are possible. |
| 14 | |
| 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::file ; # CVS archive file. |
| 21 | package require vc::fossil::import::cvs::state ; # State storage |
| 22 | |
| 23 | # # ## ### ##### ######## ############# ##################### |
| 24 | ## |
| 25 | |
| 26 | snit::type ::vc::fossil::import::cvs::project { |
| @@ -54,10 +55,17 @@ | |
| 54 | return [TheFiles] |
| 55 | } |
| 56 | |
| 57 | delegate method author to myrepository |
| 58 | delegate method cmessage to myrepository |
| 59 | |
| 60 | # pass I persistence |
| 61 | method persist {} { |
| 62 | state transaction { |
| 63 | # Project data first. Required so that we have its id |
| @@ -94,14 +102,15 @@ | |
| 94 | } |
| 95 | |
| 96 | # # ## ### ##### ######## ############# |
| 97 | ## State |
| 98 | |
| 99 | variable mybase {} ; # Project directory |
| 100 | variable myfiles -array {} ; # Maps rcs archive to their user files. |
| 101 | variable myfobj {} ; # File objects for the rcs archives |
| 102 | variable myrepository {} ; # Repository the prject belongs to. |
| 103 | |
| 104 | # # ## ### ##### ######## ############# |
| 105 | ## Internal methods |
| 106 | |
| 107 | proc TheFiles {} { |
| @@ -134,13 +143,15 @@ | |
| 134 | namespace eval ::vc::fossil::import::cvs { |
| 135 | namespace export project |
| 136 | namespace eval project { |
| 137 | namespace import ::vc::fossil::import::cvs::file |
| 138 | namespace import ::vc::fossil::import::cvs::state |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | # # ## ### ##### ######## ############# ##################### |
| 143 | ## Ready |
| 144 | |
| 145 | package provide vc::fossil::import::cvs::project 1.0 |
| 146 | return |
| 147 |
| --- tools/cvs2fossil/lib/c2f_project.tcl | |
| +++ tools/cvs2fossil/lib/c2f_project.tcl | |
| @@ -13,14 +13,15 @@ | |
| 13 | ## Project, part of a CVS repository. Multiple instances are possible. |
| 14 | |
| 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::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 | |
| 24 | # # ## ### ##### ######## ############# ##################### |
| 25 | ## |
| 26 | |
| 27 | snit::type ::vc::fossil::import::cvs::project { |
| @@ -54,10 +55,17 @@ | |
| 55 | return [TheFiles] |
| 56 | } |
| 57 | |
| 58 | delegate method author to myrepository |
| 59 | delegate method cmessage to myrepository |
| 60 | |
| 61 | method getsymbol {name} { |
| 62 | if {![info exists mysymbols($name)]} { |
| 63 | set mysymbols($name) [sym %AUTO% $name] |
| 64 | } |
| 65 | return $mysymbols($name) |
| 66 | } |
| 67 | |
| 68 | # pass I persistence |
| 69 | method persist {} { |
| 70 | state transaction { |
| 71 | # Project data first. Required so that we have its id |
| @@ -94,14 +102,15 @@ | |
| 102 | } |
| 103 | |
| 104 | # # ## ### ##### ######## ############# |
| 105 | ## State |
| 106 | |
| 107 | variable mybase {} ; # Project directory |
| 108 | variable myfiles -array {} ; # Maps rcs archive to their user files. |
| 109 | variable myfobj {} ; # File objects for the rcs archives |
| 110 | variable myrepository {} ; # Repository the prject belongs to. |
| 111 | variable mysymbols -array {} ; # Map symbol names to project-level symbol objects. |
| 112 | |
| 113 | # # ## ### ##### ######## ############# |
| 114 | ## Internal methods |
| 115 | |
| 116 | proc TheFiles {} { |
| @@ -134,13 +143,15 @@ | |
| 143 | namespace eval ::vc::fossil::import::cvs { |
| 144 | namespace export project |
| 145 | namespace eval project { |
| 146 | namespace import ::vc::fossil::import::cvs::file |
| 147 | namespace import ::vc::fossil::import::cvs::state |
| 148 | # Import not required, already a child namespace. |
| 149 | # namespace import ::vc::fossil::import::cvs::project::sym |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | # # ## ### ##### ######## ############# ##################### |
| 154 | ## Ready |
| 155 | |
| 156 | package provide vc::fossil::import::cvs::project 1.0 |
| 157 | return |
| 158 |
| --- tools/cvs2fossil/lib/c2f_psym.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_psym.tcl | ||
| @@ -23,16 +23,21 @@ | ||
| 23 | 23 | |
| 24 | 24 | snit::type ::vc::fossil::import::cvs::project::sym { |
| 25 | 25 | # # ## ### ##### ######## ############# |
| 26 | 26 | ## Public API |
| 27 | 27 | |
| 28 | - constructor {} { | |
| 28 | + constructor {name} { | |
| 29 | + set myname $name | |
| 29 | 30 | return |
| 30 | 31 | } |
| 32 | + | |
| 33 | + method name {} { return $myname } | |
| 31 | 34 | |
| 32 | 35 | # # ## ### ##### ######## ############# |
| 33 | 36 | ## State |
| 37 | + | |
| 38 | + variable myname {} | |
| 34 | 39 | |
| 35 | 40 | # # ## ### ##### ######## ############# |
| 36 | 41 | ## Internal methods |
| 37 | 42 | |
| 38 | 43 | # # ## ### ##### ######## ############# |
| 39 | 44 |
| --- tools/cvs2fossil/lib/c2f_psym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_psym.tcl | |
| @@ -23,16 +23,21 @@ | |
| 23 | |
| 24 | snit::type ::vc::fossil::import::cvs::project::sym { |
| 25 | # # ## ### ##### ######## ############# |
| 26 | ## Public API |
| 27 | |
| 28 | constructor {} { |
| 29 | return |
| 30 | } |
| 31 | |
| 32 | # # ## ### ##### ######## ############# |
| 33 | ## State |
| 34 | |
| 35 | # # ## ### ##### ######## ############# |
| 36 | ## Internal methods |
| 37 | |
| 38 | # # ## ### ##### ######## ############# |
| 39 |
| --- tools/cvs2fossil/lib/c2f_psym.tcl | |
| +++ tools/cvs2fossil/lib/c2f_psym.tcl | |
| @@ -23,16 +23,21 @@ | |
| 23 | |
| 24 | snit::type ::vc::fossil::import::cvs::project::sym { |
| 25 | # # ## ### ##### ######## ############# |
| 26 | ## Public API |
| 27 | |
| 28 | constructor {name} { |
| 29 | set myname $name |
| 30 | return |
| 31 | } |
| 32 | |
| 33 | method name {} { return $myname } |
| 34 | |
| 35 | # # ## ### ##### ######## ############# |
| 36 | ## State |
| 37 | |
| 38 | variable myname {} |
| 39 | |
| 40 | # # ## ### ##### ######## ############# |
| 41 | ## Internal methods |
| 42 | |
| 43 | # # ## ### ##### ######## ############# |
| 44 |