Fossil SCM

Continued to flesh out revision and symbol processing. Started on the project level classses.

aku 2007-10-12 07:18 trunk
Commit da9295c6f6966abf518c0d261900bebdcbcfd4fa
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -18,10 +18,11 @@
1818
1919
package require Tcl 8.4 ; # Required runtime.
2020
package require snit ; # OO system.
2121
package require struct::set ; # Set operations.
2222
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.
2324
2425
# # ## ### ##### ######## ############# #####################
2526
##
2627
2728
snit::type ::vc::fossil::import::cvs::file {
@@ -38,24 +39,10 @@
3839
method project {} { return $myproject }
3940
4041
# # ## ### ##### ######## #############
4142
## Methods required for the class to be a sink of the rcs parser
4243
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
-
5744
#method begin {} {puts begin}
5845
#method sethead {h} {puts head=$h}
5946
#method setprincipalbranch {b} {puts pb=$b}
6047
#method deftag {s r} {puts $s=$r}
6148
#method setcomment {c} {puts comment=$c}
@@ -119,11 +106,11 @@
119106
if {[info exists myrev($revnr)]} {
120107
trouble fatal "File $mypath contains duplicate definitions for revision $revnr."
121108
return
122109
}
123110
124
- set myrev($revnr) [rev %AUTO% $date $author $state $self]
111
+ set myrev($revnr) [rev %AUTO% $revnr $date $author $state $self]
125112
126113
RecordBasicDependencies $revnr $next
127114
return
128115
}
129116
@@ -153,10 +140,14 @@
153140
# Extend the revision with the new information. The revision
154141
# object uses this to complete its meta data set.
155142
156143
$rev setcommitmsg $cm
157144
$rev settext $deltarange
145
+
146
+ if {![rev istrunkrevnr $revnr]} {
147
+ $rev setbranch [[$self Rev2Branch $revnr] name]
148
+ }
158149
159150
# If this is revision 1.1, we have to determine whether the
160151
# file seems to have been created through 'cvs add' instead of
161152
# 'cvs import'. This can be done by looking at the un-
162153
# adulterated commit message, as CVS uses a hardwired magic
@@ -231,23 +222,17 @@
231222
if {[info exists mybranches($branchnr)]} {
232223
log write 1 file "In '$mypath': Branch '$branchnr' named '[$mybranches($branchnr) name]'"
233224
log write 1 file "Cannot have second name '$name', ignoring it"
234225
return
235226
}
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]]
240228
set mybranches($branchnr) $branch
241229
return $branch
242230
}
243231
244232
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]]
249234
lappend mytags($revnr) $tag
250235
return $tag
251236
}
252237
253238
proc RecordBasicDependencies {revnr next} {
@@ -297,13 +282,14 @@
297282
namespace eval ::vc::fossil::import::cvs {
298283
namespace export file
299284
namespace eval file {
300285
# Import not required, already a child namespace.
301286
# namespace import vc::fossil::import::cvs::file::rev
287
+ # namespace import vc::fossil::import::cvs::file::sym
302288
}
303289
}
304290
305291
# # ## ### ##### ######## ############# #####################
306292
## Ready
307293
308294
package provide vc::fossil::import::cvs::file 1.0
309295
return
310296
--- 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
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -23,30 +23,42 @@
2323
2424
snit::type ::vc::fossil::import::cvs::file::rev {
2525
# # ## ### ##### ######## #############
2626
## Public API
2727
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
2934
return
3035
}
3136
32
- method hascommitmsg {} {
33
- # TODO: check that we have the commit message
34
- return 0
35
- }
37
+ method hascommitmsg {} { return $myhascm }
3638
3739
method setcommitmsg {cm} {
40
+ set mycommitmsg $cm
41
+ set myhascm 1
42
+ return
3843
}
3944
4045
method settext {text} {
46
+ set mytext $text
47
+ return
48
+ }
49
+
50
+ method setbranch {branchnr} {
51
+ set mybranchnr $branchnr
52
+ return
4153
}
4254
4355
# # ## ### ##### ######## #############
4456
## Type API
4557
4658
typemethod istrunkrevnr {revnr} {
47
- return [expr {[llength [split $revnr .]] == 1}]
59
+ return [expr {[llength [split $revnr .]] == 2}]
4860
}
4961
5062
typemethod 2branchnr {revnr} {
5163
# Input is a branch revision number, i.e. a revision number
5264
# with an even number of components; for example '2.9.2.1'
@@ -61,11 +73,11 @@
6173
}
6274
6375
typemethod isbranchrevnr {revnr _ bv} {
6476
if {[regexp $mybranchpattern $revnr -> head tail]} {
6577
upvar 1 $bv branchnr
66
- set branchnr ${head}.$tail
78
+ set branchnr ${head}$tail
6779
return 1
6880
}
6981
return 0
7082
}
7183
@@ -75,19 +87,33 @@
7587
typevariable mybranchpattern {^((?:\d+\.\d+\.)+)(?:0\.)?(\d+)$}
7688
# First a nonzero even number of digit groups with trailing dot
7789
# CVS then sticks an extra 0 in here; RCS does not.
7890
# And the last digit group.
7991
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
+
80107
# # ## ### ##### ######## #############
81108
## Internal methods
82109
83110
# # ## ### ##### ######## #############
84111
## Configuration
85112
86113
pragma -hastypeinfo no ; # no type introspection
87114
pragma -hasinfo no ; # no object introspection
88
- #pragma -hastypemethods no ; # type is not relevant.
89115
pragma -simpledispatch yes ; # simple fast dispatch
90116
91117
# # ## ### ##### ######## #############
92118
}
93119
94120
--- 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
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -23,27 +23,35 @@
2323
2424
snit::type ::vc::fossil::import::cvs::file::sym {
2525
# # ## ### ##### ######## #############
2626
## Public API
2727
28
- constructor {} {
28
+ constructor {symtype nr symbol} {
29
+ set mytype $symtype
30
+ set mynr $nr
31
+ set mysymbol $symbol
2932
return
3033
}
34
+
35
+ delegate method name to mysymbol
3136
3237
# # ## ### ##### ######## #############
3338
## State
3439
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
+
3544
# # ## ### ##### ######## #############
3645
## Internal methods
3746
3847
# # ## ### ##### ######## #############
3948
## Configuration
4049
4150
pragma -hastypeinfo no ; # no type introspection
4251
pragma -hasinfo no ; # no object introspection
4352
pragma -hastypemethods no ; # type is not relevant.
44
- pragma -simpledispatch yes ; # simple fast dispatch
4553
4654
# # ## ### ##### ######## #############
4755
}
4856
4957
namespace eval ::vc::fossil::import::cvs::file {
5058
--- 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
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -13,14 +13,15 @@
1313
## Project, part of a CVS repository. Multiple instances are possible.
1414
1515
# # ## ### ##### ######## ############# #####################
1616
## Requirements
1717
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
2223
2324
# # ## ### ##### ######## ############# #####################
2425
##
2526
2627
snit::type ::vc::fossil::import::cvs::project {
@@ -54,10 +55,17 @@
5455
return [TheFiles]
5556
}
5657
5758
delegate method author to myrepository
5859
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
+ }
5967
6068
# pass I persistence
6169
method persist {} {
6270
state transaction {
6371
# Project data first. Required so that we have its id
@@ -94,14 +102,15 @@
94102
}
95103
96104
# # ## ### ##### ######## #############
97105
## State
98106
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.
103112
104113
# # ## ### ##### ######## #############
105114
## Internal methods
106115
107116
proc TheFiles {} {
@@ -134,13 +143,15 @@
134143
namespace eval ::vc::fossil::import::cvs {
135144
namespace export project
136145
namespace eval project {
137146
namespace import ::vc::fossil::import::cvs::file
138147
namespace import ::vc::fossil::import::cvs::state
148
+ # Import not required, already a child namespace.
149
+ # namespace import ::vc::fossil::import::cvs::project::sym
139150
}
140151
}
141152
142153
# # ## ### ##### ######## ############# #####################
143154
## Ready
144155
145156
package provide vc::fossil::import::cvs::project 1.0
146157
return
147158
--- 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 @@
2323
2424
snit::type ::vc::fossil::import::cvs::project::sym {
2525
# # ## ### ##### ######## #############
2626
## Public API
2727
28
- constructor {} {
28
+ constructor {name} {
29
+ set myname $name
2930
return
3031
}
32
+
33
+ method name {} { return $myname }
3134
3235
# # ## ### ##### ######## #############
3336
## State
37
+
38
+ variable myname {}
3439
3540
# # ## ### ##### ######## #############
3641
## Internal methods
3742
3843
# # ## ### ##### ######## #############
3944
--- 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

Keyboard Shortcuts

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