Fossil SCM

Continued work on pass II, starting to post-process tags, branches, and revisions, cleaning up cvs quirks, determining higher-level aggregates ...

aku 2007-10-15 00:03 trunk
Commit e5441b908ddf48ae32e27661a93b5b9cfc3fd63b
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -33,10 +33,11 @@
3333
3434
constructor {path executable project} {
3535
set mypath $path
3636
set myexecutable $executable
3737
set myproject $project
38
+ set mytrunk [$myproject trunk]
3839
return
3940
}
4041
4142
method path {} { return $mypath }
4243
method project {} { return $myproject }
@@ -151,18 +152,23 @@
151152
log write 1 file "In file $mypath : Duplicate delta data for revision $revnr"
152153
log write 1 file "Ignoring the duplicate"
153154
return
154155
}
155156
156
- if {[rev istrunkrevnr $revnr]} {
157
- set branchid {}
158
- } else {
159
- set branchid [[$self Rev2Branch $revnr] id]
160
- }
157
+ # Determine the line of development for the revision (project
158
+ # level). This gives us the branchid too, required for the
159
+ # meta data group the revision is in. (Note: By putting both
160
+ # branch/lod and project information into the group we ensure
161
+ # that any cross-project and cross-branch commits are
162
+ # separated into multiple commits, one in each of the projects
163
+ # and/or branches).
164
+
165
+ set lod [GetLOD $revnr]
161166
162
- $rev setmeta [$myproject defmeta $branchid $myaid($revnr) $cmid]
167
+ $rev setmeta [$myproject defmeta [$lod id] $myaid($revnr) $cmid]
163168
$rev settext $textrange
169
+ $rev setlod $lod
164170
165171
# If this is revision 1.1, we have to determine whether the
166172
# file seems to have been created through 'cvs add' instead of
167173
# 'cvs import'. This can be done by looking at the un-
168174
# adulterated commit message, as CVS uses a hardwired magic
@@ -180,11 +186,21 @@
180186
181187
lappend myrevisions $rev
182188
return
183189
}
184190
185
- method done {} {}
191
+ method done {} {
192
+ # Complete the revisions, branches, and tags. This includes
193
+ # looking for a non-trunk default branch, marking its members
194
+ # and linking them into the trunk.
195
+
196
+ DetermineRevisionOperations
197
+ DetermineLinesOfDevelopment
198
+
199
+ # list of roots ... first only one, later can become more.
200
+ return
201
+ }
186202
187203
# # ## ### ##### ######## #############
188204
## State
189205
190206
variable mypath {} ; # Path of the file's rcs archive.
@@ -228,10 +244,12 @@
228244
# order of definition. This also defines
229245
# their order of creation, which is the
230246
# reverse of definition. I.e. a smaller
231247
# number means 'Defined earlier', means
232248
# 'Created later'.
249
+
250
+ variable mytrunk {} ; # Direct reference to myproject -> trunk.
233251
234252
# # ## ### ##### ######## #############
235253
## Internal methods
236254
237255
method RecordBranchCommits {branches} {
@@ -336,10 +354,11 @@
336354
$branch destroy
337355
unset mybranches($branchnr)
338356
} else {
339357
set rev $myrev($revnr)
340358
$rev addbranch $branch
359
+ $branch setparent $rev
341360
342361
# If revisions were committed on the branch we store a
343362
# reference to the branch there, and further declare
344363
# the first child's parent to be branch's parent, and
345364
# list this child in the parent revision.
@@ -379,11 +398,14 @@
379398
$tag destroy
380399
}
381400
unset mytags($revnr)
382401
} else {
383402
set rev $myrev($revnr)
384
- foreach tag $taglist { $rev addtag $tag }
403
+ foreach tag $taglist {
404
+ $rev addtag $tag
405
+ $tag settagrev $rev
406
+ }
385407
}
386408
}
387409
return
388410
}
389411
@@ -401,10 +423,44 @@
401423
if {$myroot ne ""} { trouble internal "Multiple root revisions found" }
402424
set myroot $rev
403425
}
404426
return
405427
}
428
+
429
+ proc DetermineRevisionOperations {} {
430
+ upvar 1 myrevisions myrevisions
431
+ foreach rev $myrevisions { $rev determineoperation }
432
+ return
433
+ }
434
+
435
+ proc DetermineLinesOfDevelopment {} {
436
+ # For revisions this has been done already, in 'extend'. Now
437
+ # we do this for the branches and tags.
438
+
439
+ upvar 1 self self mybranches mybranches mytags mytags mytrunk mytrunk
440
+
441
+ foreach {_ branch} [array get mybranches] {
442
+ $branch setlod [GetLOD [$branch parentrevnr]]
443
+ }
444
+
445
+ foreach {_ taglist} [array get mytags] {
446
+ foreach tag $taglist {
447
+ $tag setlod [GetLOD [$tag tagrevnr]]
448
+ }
449
+ }
450
+ return
451
+ }
452
+
453
+ proc GetLOD {revnr} {
454
+ if {[rev istrunkrevnr $revnr]} {
455
+ upvar 1 mytrunk mytrunk
456
+ return $mytrunk
457
+ } else {
458
+ upvar 1 self self
459
+ return [$self Rev2Branch $revnr]
460
+ }
461
+ }
406462
407463
# # ## ### ##### ######## #############
408464
## Configuration
409465
410466
pragma -hastypeinfo no ; # no type introspection
411467
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -33,10 +33,11 @@
33
34 constructor {path executable project} {
35 set mypath $path
36 set myexecutable $executable
37 set myproject $project
 
38 return
39 }
40
41 method path {} { return $mypath }
42 method project {} { return $myproject }
@@ -151,18 +152,23 @@
151 log write 1 file "In file $mypath : Duplicate delta data for revision $revnr"
152 log write 1 file "Ignoring the duplicate"
153 return
154 }
155
156 if {[rev istrunkrevnr $revnr]} {
157 set branchid {}
158 } else {
159 set branchid [[$self Rev2Branch $revnr] id]
160 }
 
 
 
 
161
162 $rev setmeta [$myproject defmeta $branchid $myaid($revnr) $cmid]
163 $rev settext $textrange
 
164
165 # If this is revision 1.1, we have to determine whether the
166 # file seems to have been created through 'cvs add' instead of
167 # 'cvs import'. This can be done by looking at the un-
168 # adulterated commit message, as CVS uses a hardwired magic
@@ -180,11 +186,21 @@
180
181 lappend myrevisions $rev
182 return
183 }
184
185 method done {} {}
 
 
 
 
 
 
 
 
 
 
186
187 # # ## ### ##### ######## #############
188 ## State
189
190 variable mypath {} ; # Path of the file's rcs archive.
@@ -228,10 +244,12 @@
228 # order of definition. This also defines
229 # their order of creation, which is the
230 # reverse of definition. I.e. a smaller
231 # number means 'Defined earlier', means
232 # 'Created later'.
 
 
233
234 # # ## ### ##### ######## #############
235 ## Internal methods
236
237 method RecordBranchCommits {branches} {
@@ -336,10 +354,11 @@
336 $branch destroy
337 unset mybranches($branchnr)
338 } else {
339 set rev $myrev($revnr)
340 $rev addbranch $branch
 
341
342 # If revisions were committed on the branch we store a
343 # reference to the branch there, and further declare
344 # the first child's parent to be branch's parent, and
345 # list this child in the parent revision.
@@ -379,11 +398,14 @@
379 $tag destroy
380 }
381 unset mytags($revnr)
382 } else {
383 set rev $myrev($revnr)
384 foreach tag $taglist { $rev addtag $tag }
 
 
 
385 }
386 }
387 return
388 }
389
@@ -401,10 +423,44 @@
401 if {$myroot ne ""} { trouble internal "Multiple root revisions found" }
402 set myroot $rev
403 }
404 return
405 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
407 # # ## ### ##### ######## #############
408 ## Configuration
409
410 pragma -hastypeinfo no ; # no type introspection
411
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -33,10 +33,11 @@
33
34 constructor {path executable project} {
35 set mypath $path
36 set myexecutable $executable
37 set myproject $project
38 set mytrunk [$myproject trunk]
39 return
40 }
41
42 method path {} { return $mypath }
43 method project {} { return $myproject }
@@ -151,18 +152,23 @@
152 log write 1 file "In file $mypath : Duplicate delta data for revision $revnr"
153 log write 1 file "Ignoring the duplicate"
154 return
155 }
156
157 # Determine the line of development for the revision (project
158 # level). This gives us the branchid too, required for the
159 # meta data group the revision is in. (Note: By putting both
160 # branch/lod and project information into the group we ensure
161 # that any cross-project and cross-branch commits are
162 # separated into multiple commits, one in each of the projects
163 # and/or branches).
164
165 set lod [GetLOD $revnr]
166
167 $rev setmeta [$myproject defmeta [$lod id] $myaid($revnr) $cmid]
168 $rev settext $textrange
169 $rev setlod $lod
170
171 # If this is revision 1.1, we have to determine whether the
172 # file seems to have been created through 'cvs add' instead of
173 # 'cvs import'. This can be done by looking at the un-
174 # adulterated commit message, as CVS uses a hardwired magic
@@ -180,11 +186,21 @@
186
187 lappend myrevisions $rev
188 return
189 }
190
191 method done {} {
192 # Complete the revisions, branches, and tags. This includes
193 # looking for a non-trunk default branch, marking its members
194 # and linking them into the trunk.
195
196 DetermineRevisionOperations
197 DetermineLinesOfDevelopment
198
199 # list of roots ... first only one, later can become more.
200 return
201 }
202
203 # # ## ### ##### ######## #############
204 ## State
205
206 variable mypath {} ; # Path of the file's rcs archive.
@@ -228,10 +244,12 @@
244 # order of definition. This also defines
245 # their order of creation, which is the
246 # reverse of definition. I.e. a smaller
247 # number means 'Defined earlier', means
248 # 'Created later'.
249
250 variable mytrunk {} ; # Direct reference to myproject -> trunk.
251
252 # # ## ### ##### ######## #############
253 ## Internal methods
254
255 method RecordBranchCommits {branches} {
@@ -336,10 +354,11 @@
354 $branch destroy
355 unset mybranches($branchnr)
356 } else {
357 set rev $myrev($revnr)
358 $rev addbranch $branch
359 $branch setparent $rev
360
361 # If revisions were committed on the branch we store a
362 # reference to the branch there, and further declare
363 # the first child's parent to be branch's parent, and
364 # list this child in the parent revision.
@@ -379,11 +398,14 @@
398 $tag destroy
399 }
400 unset mytags($revnr)
401 } else {
402 set rev $myrev($revnr)
403 foreach tag $taglist {
404 $rev addtag $tag
405 $tag settagrev $rev
406 }
407 }
408 }
409 return
410 }
411
@@ -401,10 +423,44 @@
423 if {$myroot ne ""} { trouble internal "Multiple root revisions found" }
424 set myroot $rev
425 }
426 return
427 }
428
429 proc DetermineRevisionOperations {} {
430 upvar 1 myrevisions myrevisions
431 foreach rev $myrevisions { $rev determineoperation }
432 return
433 }
434
435 proc DetermineLinesOfDevelopment {} {
436 # For revisions this has been done already, in 'extend'. Now
437 # we do this for the branches and tags.
438
439 upvar 1 self self mybranches mybranches mytags mytags mytrunk mytrunk
440
441 foreach {_ branch} [array get mybranches] {
442 $branch setlod [GetLOD [$branch parentrevnr]]
443 }
444
445 foreach {_ taglist} [array get mytags] {
446 foreach tag $taglist {
447 $tag setlod [GetLOD [$tag tagrevnr]]
448 }
449 }
450 return
451 }
452
453 proc GetLOD {revnr} {
454 if {[rev istrunkrevnr $revnr]} {
455 upvar 1 mytrunk mytrunk
456 return $mytrunk
457 } else {
458 upvar 1 self self
459 return [$self Rev2Branch $revnr]
460 }
461 }
462
463 # # ## ### ##### ######## #############
464 ## Configuration
465
466 pragma -hastypeinfo no ; # no type introspection
467
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -37,12 +37,15 @@
3737
# Basic pieces ________________________
3838
3939
method hasmeta {} { return [expr {$mymetaid ne ""}] }
4040
method setmeta {meta} { set mymetaid $meta ; return }
4141
method settext {text} { set mytext $text ; return }
42
+ method setlod {lod} { set mylod $lod ; return }
4243
4344
method revnr {} { return $myrevnr }
45
+ method state {} { return $mystate }
46
+ method lod {} { return $mylod }
4447
4548
# Basic parent/child linkage __________
4649
4750
method hasparent {} { return [expr {$myparent ne ""}] }
4851
method haschild {} { return [expr {$mychild ne ""}] }
@@ -111,10 +114,25 @@
111114
struct::list assign $item -> branch position
112115
lappend mybranches $branch
113116
}
114117
return
115118
}
119
+
120
+ method determineoperation {} {
121
+ # Look at the state of both this revision and its parent to
122
+ # determine the type opf operation which was performed (add,
123
+ # modify, delete, none).
124
+ #
125
+ # The important information is dead vs not-dead for both,
126
+ # giving rise to four possible types.
127
+
128
+ set sdead [expr {$mystate eq "dead"}]
129
+ set pdead [expr {$myparent eq "" || [$myparent state] eq "dead"}]
130
+
131
+ set myoperation $myopstate([list $pdead $sdead])
132
+ return
133
+ }
116134
117135
# # ## ### ##### ######## #############
118136
## Type API
119137
120138
typemethod istrunkrevnr {revnr} {
@@ -160,20 +178,25 @@
160178
variable mydate {} ; # Timestamp of the revision, seconds since epoch
161179
variable myorigdate {} ; # Original unmodified timestamp.
162180
variable mystate {} ; # State of the revision.
163181
variable myfile {} ; # Ref to the file object the revision belongs to.
164182
variable mytext {} ; # Range of the (delta) text for this revision in the file.
165
-
166183
variable mymetaid {} ; # Id of the meta data group the revision
167184
# belongs to. This is later used to put
168185
# the file revisions into preliminary
169186
# changesets (aka project revisions).
170187
# This id encodes 4 pieces of data,
171188
# namely: the project and branch the
172189
# revision was committed to, the author
173190
# who did the commit, and the message
174191
# used.
192
+ variable mylod {} ; # Reference to the line-of-development
193
+ # object the revision belongs to. An
194
+ # alternative idiom would be to call it
195
+ # the branch the revision is on. This
196
+ # reference is to a project-level object
197
+ # (symbol or trunk).
175198
176199
# Basic parent/child linkage (lines of development)
177200
178201
variable myparent {} ; # Ref to parent revision object. Link required because of
179202
# ; # 'cvsadmin -o', which can create arbitrary gaps in the
@@ -208,10 +231,24 @@
208231
# ; # mybranches.
209232
210233
# Tag linkage ________________________
211234
212235
variable mytags {} ; # List of tags (objs) associated with this revision.
236
+
237
+ # More derived data
238
+
239
+ variable myoperation {} ; # One of 'add', 'change', 'delete', or
240
+ # 'nothing'. Derived from our and its
241
+ # parent's state.
242
+
243
+ # dead(self) x dead(parent) -> operation
244
+ typevariable myopstate -array {
245
+ {0 0} change
246
+ {0 1} delete
247
+ {1 0} add
248
+ {1 1} nothing
249
+ }
213250
214251
# # ## ### ##### ######## #############
215252
## Internal methods
216253
217254
# # ## ### ##### ######## #############
218255
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -37,12 +37,15 @@
37 # Basic pieces ________________________
38
39 method hasmeta {} { return [expr {$mymetaid ne ""}] }
40 method setmeta {meta} { set mymetaid $meta ; return }
41 method settext {text} { set mytext $text ; return }
 
42
43 method revnr {} { return $myrevnr }
 
 
44
45 # Basic parent/child linkage __________
46
47 method hasparent {} { return [expr {$myparent ne ""}] }
48 method haschild {} { return [expr {$mychild ne ""}] }
@@ -111,10 +114,25 @@
111 struct::list assign $item -> branch position
112 lappend mybranches $branch
113 }
114 return
115 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
117 # # ## ### ##### ######## #############
118 ## Type API
119
120 typemethod istrunkrevnr {revnr} {
@@ -160,20 +178,25 @@
160 variable mydate {} ; # Timestamp of the revision, seconds since epoch
161 variable myorigdate {} ; # Original unmodified timestamp.
162 variable mystate {} ; # State of the revision.
163 variable myfile {} ; # Ref to the file object the revision belongs to.
164 variable mytext {} ; # Range of the (delta) text for this revision in the file.
165
166 variable mymetaid {} ; # Id of the meta data group the revision
167 # belongs to. This is later used to put
168 # the file revisions into preliminary
169 # changesets (aka project revisions).
170 # This id encodes 4 pieces of data,
171 # namely: the project and branch the
172 # revision was committed to, the author
173 # who did the commit, and the message
174 # used.
 
 
 
 
 
 
175
176 # Basic parent/child linkage (lines of development)
177
178 variable myparent {} ; # Ref to parent revision object. Link required because of
179 # ; # 'cvsadmin -o', which can create arbitrary gaps in the
@@ -208,10 +231,24 @@
208 # ; # mybranches.
209
210 # Tag linkage ________________________
211
212 variable mytags {} ; # List of tags (objs) associated with this revision.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
214 # # ## ### ##### ######## #############
215 ## Internal methods
216
217 # # ## ### ##### ######## #############
218
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -37,12 +37,15 @@
37 # Basic pieces ________________________
38
39 method hasmeta {} { return [expr {$mymetaid ne ""}] }
40 method setmeta {meta} { set mymetaid $meta ; return }
41 method settext {text} { set mytext $text ; return }
42 method setlod {lod} { set mylod $lod ; return }
43
44 method revnr {} { return $myrevnr }
45 method state {} { return $mystate }
46 method lod {} { return $mylod }
47
48 # Basic parent/child linkage __________
49
50 method hasparent {} { return [expr {$myparent ne ""}] }
51 method haschild {} { return [expr {$mychild ne ""}] }
@@ -111,10 +114,25 @@
114 struct::list assign $item -> branch position
115 lappend mybranches $branch
116 }
117 return
118 }
119
120 method determineoperation {} {
121 # Look at the state of both this revision and its parent to
122 # determine the type opf operation which was performed (add,
123 # modify, delete, none).
124 #
125 # The important information is dead vs not-dead for both,
126 # giving rise to four possible types.
127
128 set sdead [expr {$mystate eq "dead"}]
129 set pdead [expr {$myparent eq "" || [$myparent state] eq "dead"}]
130
131 set myoperation $myopstate([list $pdead $sdead])
132 return
133 }
134
135 # # ## ### ##### ######## #############
136 ## Type API
137
138 typemethod istrunkrevnr {revnr} {
@@ -160,20 +178,25 @@
178 variable mydate {} ; # Timestamp of the revision, seconds since epoch
179 variable myorigdate {} ; # Original unmodified timestamp.
180 variable mystate {} ; # State of the revision.
181 variable myfile {} ; # Ref to the file object the revision belongs to.
182 variable mytext {} ; # Range of the (delta) text for this revision in the file.
 
183 variable mymetaid {} ; # Id of the meta data group the revision
184 # belongs to. This is later used to put
185 # the file revisions into preliminary
186 # changesets (aka project revisions).
187 # This id encodes 4 pieces of data,
188 # namely: the project and branch the
189 # revision was committed to, the author
190 # who did the commit, and the message
191 # used.
192 variable mylod {} ; # Reference to the line-of-development
193 # object the revision belongs to. An
194 # alternative idiom would be to call it
195 # the branch the revision is on. This
196 # reference is to a project-level object
197 # (symbol or trunk).
198
199 # Basic parent/child linkage (lines of development)
200
201 variable myparent {} ; # Ref to parent revision object. Link required because of
202 # ; # 'cvsadmin -o', which can create arbitrary gaps in the
@@ -208,10 +231,24 @@
231 # ; # mybranches.
232
233 # Tag linkage ________________________
234
235 variable mytags {} ; # List of tags (objs) associated with this revision.
236
237 # More derived data
238
239 variable myoperation {} ; # One of 'add', 'change', 'delete', or
240 # 'nothing'. Derived from our and its
241 # parent's state.
242
243 # dead(self) x dead(parent) -> operation
244 typevariable myopstate -array {
245 {0 0} change
246 {0 1} delete
247 {1 0} add
248 {1 1} nothing
249 }
250
251 # # ## ### ##### ######## #############
252 ## Internal methods
253
254 # # ## ### ##### ######## #############
255
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -51,24 +51,47 @@
5151
if {$mybranchchildrevnr ne ""} { trouble internal "Child already defined" }
5252
set mybranchchildrevnr $revnr
5353
return
5454
}
5555
56
- method setposition {n} { set mybranchposition $n }
56
+ method setposition {n} { set mybranchposition $n ; return }
57
+ method setparent {rev} { set mybranchparent $rev ; return }
5758
5859
method branchnr {} { return $mynr }
5960
method parentrevnr {} { return $mybranchparentrevnr }
6061
method childrevnr {} { return $mybranchchildrevnr }
61
-
6262
method haschild {} { return [expr {$mybranchchildrevnr ne ""}] }
6363
method child {} { return $mybranchchild }
64
-
65
- method position {} { return $mybranchposition }
64
+ method position {} { return $mybranchposition }
6665
6766
# Tag acessor methods.
6867
69
- method tagrevnr {} { return $mynr }
68
+ method tagrevnr {} { return $mynr }
69
+ method settagrev {rev} {set mytagrev $rev ; return }
70
+
71
+ # Derived information
72
+
73
+ method lod {} { return $mylod }
74
+
75
+ method setlod {lod} {
76
+ set mylod $lod
77
+
78
+ # Consistency check integrated. The symbol's
79
+ # line-of-development has to be same as the
80
+ # line-of-development of its source.
81
+
82
+ switch -exact -- $mytype {
83
+ branch { set slod [$mybranchparent lod] }
84
+ tag { set slod [$mytagrev lod] }
85
+ }
86
+
87
+ if {$mylod ne $slod} {
88
+ trouble fatal "For [$mysymbol name]: LOD conflict with source, '[$mylod name]' vs. '[$slod name]'"
89
+ return
90
+ }
91
+ return
92
+ }
7093
7194
# # ## ### ##### ######## #############
7295
## State
7396
7497
## Basic, all symbols _________________
@@ -76,10 +99,15 @@
7699
variable mytype {} ; # Symbol type, 'tag', or 'branch'.
77100
variable mynr {} ; # Revision number of a 'tag', branch number
78101
# of a 'branch'.
79102
variable mysymbol {} ; # Reference to the symbol object of this
80103
# symbol at the project level.
104
+ variable mylod {} ; # Reference to the line-of-development
105
+ # object the symbol belongs to. An
106
+ # alternative idiom would be to call it the
107
+ # branch the symbol is on. This reference
108
+ # is to a project-level symbol object.
81109
82110
## Branch symbols _____________________
83111
84112
variable mybranchparentrevnr {} ; # The number of the parent
85113
# revision, derived from our
@@ -95,10 +123,13 @@
95123
variable mybranchposition {} ; # Relative id of the branch in
96124
# the file, to sort into
97125
# creation order.
98126
99127
## Tag symbols ________________________
128
+
129
+ variable mytagrev {} ; # Reference to the revision object the tag
130
+ # is on, identified by 'mynr'.
100131
101132
# ... nothing special ... (only mynr, see basic)
102133
103134
# # ## ### ##### ######## #############
104135
## Internal methods
105136
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -51,24 +51,47 @@
51 if {$mybranchchildrevnr ne ""} { trouble internal "Child already defined" }
52 set mybranchchildrevnr $revnr
53 return
54 }
55
56 method setposition {n} { set mybranchposition $n }
 
57
58 method branchnr {} { return $mynr }
59 method parentrevnr {} { return $mybranchparentrevnr }
60 method childrevnr {} { return $mybranchchildrevnr }
61
62 method haschild {} { return [expr {$mybranchchildrevnr ne ""}] }
63 method child {} { return $mybranchchild }
64
65 method position {} { return $mybranchposition }
66
67 # Tag acessor methods.
68
69 method tagrevnr {} { return $mynr }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
71 # # ## ### ##### ######## #############
72 ## State
73
74 ## Basic, all symbols _________________
@@ -76,10 +99,15 @@
76 variable mytype {} ; # Symbol type, 'tag', or 'branch'.
77 variable mynr {} ; # Revision number of a 'tag', branch number
78 # of a 'branch'.
79 variable mysymbol {} ; # Reference to the symbol object of this
80 # symbol at the project level.
 
 
 
 
 
81
82 ## Branch symbols _____________________
83
84 variable mybranchparentrevnr {} ; # The number of the parent
85 # revision, derived from our
@@ -95,10 +123,13 @@
95 variable mybranchposition {} ; # Relative id of the branch in
96 # the file, to sort into
97 # creation order.
98
99 ## Tag symbols ________________________
 
 
 
100
101 # ... nothing special ... (only mynr, see basic)
102
103 # # ## ### ##### ######## #############
104 ## Internal methods
105
--- tools/cvs2fossil/lib/c2f_fsym.tcl
+++ tools/cvs2fossil/lib/c2f_fsym.tcl
@@ -51,24 +51,47 @@
51 if {$mybranchchildrevnr ne ""} { trouble internal "Child already defined" }
52 set mybranchchildrevnr $revnr
53 return
54 }
55
56 method setposition {n} { set mybranchposition $n ; return }
57 method setparent {rev} { set mybranchparent $rev ; return }
58
59 method branchnr {} { return $mynr }
60 method parentrevnr {} { return $mybranchparentrevnr }
61 method childrevnr {} { return $mybranchchildrevnr }
 
62 method haschild {} { return [expr {$mybranchchildrevnr ne ""}] }
63 method child {} { return $mybranchchild }
64 method position {} { return $mybranchposition }
 
65
66 # Tag acessor methods.
67
68 method tagrevnr {} { return $mynr }
69 method settagrev {rev} {set mytagrev $rev ; return }
70
71 # Derived information
72
73 method lod {} { return $mylod }
74
75 method setlod {lod} {
76 set mylod $lod
77
78 # Consistency check integrated. The symbol's
79 # line-of-development has to be same as the
80 # line-of-development of its source.
81
82 switch -exact -- $mytype {
83 branch { set slod [$mybranchparent lod] }
84 tag { set slod [$mytagrev lod] }
85 }
86
87 if {$mylod ne $slod} {
88 trouble fatal "For [$mysymbol name]: LOD conflict with source, '[$mylod name]' vs. '[$slod name]'"
89 return
90 }
91 return
92 }
93
94 # # ## ### ##### ######## #############
95 ## State
96
97 ## Basic, all symbols _________________
@@ -76,10 +99,15 @@
99 variable mytype {} ; # Symbol type, 'tag', or 'branch'.
100 variable mynr {} ; # Revision number of a 'tag', branch number
101 # of a 'branch'.
102 variable mysymbol {} ; # Reference to the symbol object of this
103 # symbol at the project level.
104 variable mylod {} ; # Reference to the line-of-development
105 # object the symbol belongs to. An
106 # alternative idiom would be to call it the
107 # branch the symbol is on. This reference
108 # is to a project-level symbol object.
109
110 ## Branch symbols _____________________
111
112 variable mybranchparentrevnr {} ; # The number of the parent
113 # revision, derived from our
@@ -95,10 +123,13 @@
123 variable mybranchposition {} ; # Relative id of the branch in
124 # the file, to sort into
125 # creation order.
126
127 ## Tag symbols ________________________
128
129 variable mytagrev {} ; # Reference to the revision object the tag
130 # is on, identified by 'mynr'.
131
132 # ... nothing special ... (only mynr, see basic)
133
134 # # ## ### ##### ######## #############
135 ## Internal methods
136
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -13,16 +13,17 @@
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.
22
-package require vc::fossil::import::cvs::project::sym ; # Per project symbols.
23
-package require struct::list ; # Advanced list operations..
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
+package require vc::fossil::import::cvs::project::trunk ; # Per project trunk, main lod
24
+package require struct::list ; # Advanced list operations..
2425
2526
# # ## ### ##### ######## ############# #####################
2627
##
2728
2829
snit::type ::vc::fossil::import::cvs::project {
@@ -30,14 +31,16 @@
3031
## Public API
3132
3233
constructor {path r} {
3334
set mybase $path
3435
set myrepository $r
36
+ set mytrunk [trunk %AUTO%]
3537
return
3638
}
3739
38
- method base {} { return $mybase }
40
+ method base {} { return $mybase }
41
+ method trunk {} { return $mytrunk }
3942
4043
method printbase {} {
4144
if {$mybase eq ""} {return <Repository>}
4245
return $mybase
4346
}
@@ -110,16 +113,20 @@
110113
}
111114
112115
# # ## ### ##### ######## #############
113116
## State
114117
115
- variable mybase {} ; # Project directory
118
+ variable mybase {} ; # Project directory.
116119
variable myid {} ; # Project id in the persistent state.
117
- variable myfiles -array {} ; # Maps rcs archive to their user files.
120
+ variable mytrunk {} ; # Reference to the main line of
121
+ # development for the project.
122
+ variable myfiles -array {} ; # Maps the rcs archive paths to
123
+ # their user-visible files.
118124
variable myfobj {} ; # File objects for the rcs archives
119125
variable myrepository {} ; # Repository the prject belongs to.
120
- variable mysymbols -array {} ; # Map symbol names to project-level symbol objects.
126
+ variable mysymbols -array {} ; # Map symbol names to project-level
127
+ # symbol objects.
121128
122129
# # ## ### ##### ######## #############
123130
## Internal methods
124131
125132
proc TheFiles {} {
126133
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -13,16 +13,17 @@
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 package require struct::list ; # Advanced list operations..
 
24
25 # # ## ### ##### ######## ############# #####################
26 ##
27
28 snit::type ::vc::fossil::import::cvs::project {
@@ -30,14 +31,16 @@
30 ## Public API
31
32 constructor {path r} {
33 set mybase $path
34 set myrepository $r
 
35 return
36 }
37
38 method base {} { return $mybase }
 
39
40 method printbase {} {
41 if {$mybase eq ""} {return <Repository>}
42 return $mybase
43 }
@@ -110,16 +113,20 @@
110 }
111
112 # # ## ### ##### ######## #############
113 ## State
114
115 variable mybase {} ; # Project directory
116 variable myid {} ; # Project id in the persistent state.
117 variable myfiles -array {} ; # Maps rcs archive to their user files.
 
 
 
118 variable myfobj {} ; # File objects for the rcs archives
119 variable myrepository {} ; # Repository the prject belongs to.
120 variable mysymbols -array {} ; # Map symbol names to project-level symbol objects.
 
121
122 # # ## ### ##### ######## #############
123 ## Internal methods
124
125 proc TheFiles {} {
126
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -13,16 +13,17 @@
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 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
29 snit::type ::vc::fossil::import::cvs::project {
@@ -30,14 +31,16 @@
31 ## Public API
32
33 constructor {path r} {
34 set mybase $path
35 set myrepository $r
36 set mytrunk [trunk %AUTO%]
37 return
38 }
39
40 method base {} { return $mybase }
41 method trunk {} { return $mytrunk }
42
43 method printbase {} {
44 if {$mybase eq ""} {return <Repository>}
45 return $mybase
46 }
@@ -110,16 +113,20 @@
113 }
114
115 # # ## ### ##### ######## #############
116 ## State
117
118 variable mybase {} ; # Project directory.
119 variable myid {} ; # Project id in the persistent state.
120 variable mytrunk {} ; # Reference to the main line of
121 # development for the project.
122 variable myfiles -array {} ; # Maps the rcs archive paths to
123 # their user-visible files.
124 variable myfobj {} ; # File objects for the rcs archives
125 variable myrepository {} ; # Repository the prject belongs to.
126 variable mysymbols -array {} ; # Map symbol names to project-level
127 # symbol objects.
128
129 # # ## ### ##### ######## #############
130 ## Internal methods
131
132 proc TheFiles {} {
133
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -26,10 +26,13 @@
2626
## Public API
2727
2828
constructor {} {
2929
return
3030
}
31
+
32
+ method name {} { return :trunk: }
33
+ method id {} { return {} }
3134
3235
# # ## ### ##### ######## #############
3336
## State
3437
3538
# # ## ### ##### ######## #############
3639
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -26,10 +26,13 @@
26 ## Public API
27
28 constructor {} {
29 return
30 }
 
 
 
31
32 # # ## ### ##### ######## #############
33 ## State
34
35 # # ## ### ##### ######## #############
36
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -26,10 +26,13 @@
26 ## Public API
27
28 constructor {} {
29 return
30 }
31
32 method name {} { return :trunk: }
33 method id {} { return {} }
34
35 # # ## ### ##### ######## #############
36 ## State
37
38 # # ## ### ##### ######## #############
39

Keyboard Shortcuts

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