Fossil SCM

Added basic import of changesets. Note that this code is incomplete with regard to handling the various possible interactions between a vendor-branh and trunk.

aku 2008-01-30 08:28 trunk
Commit 348e45b0d66e5f80b89a5a5101036c5e057c83b2
--- tools/cvs2fossil/lib/c2f_pimport.tcl
+++ tools/cvs2fossil/lib/c2f_pimport.tcl
@@ -45,10 +45,14 @@
4545
# this pass.
4646
4747
state use project
4848
state use file
4949
state use revision
50
+ state use meta
51
+ state use author
52
+ state use cmessage
53
+ state use symbol
5054
5155
# This data is actually transient, confined to this pass. We
5256
# use the state storage only to keep the RAM usage low.
5357
state extend revuuid {
5458
rid INTEGER NOT NULL REFERENCES revision UNIQUE,
@@ -82,21 +86,23 @@
8286
log write 1 import {Importing project "[$project base]"}
8387
8488
set fossil [fossil %AUTO%]
8589
8690
state transaction {
91
+ # Layer I: Files and their revisions
8792
foreach file [$project files] {
8893
set path [$file path]
8994
log write 2 import {Importing file "$path"}
9095
$file pushto $fossil
9196
}
92
-
93
- # TODO: Generate manifests for the changesets in the
94
- # project and import them. This needs
95
- # topological traversal. And the creation of
96
- # empty helper baselines for stuff like the root
97
- # of ntdb and such.
97
+ # Layer II: Changesets
98
+ array set rstate {}
99
+ foreach {revision date} [$project revisionsinorder] {
100
+ log write 2 import {Importing revision [$revision str]}
101
+ $revision pushto rstate $fossil $date
102
+ }
103
+ unset rstate
98104
}
99105
100106
# At last copy the temporary repository file to its final
101107
# destination and release the associated memory.
102108
103109
--- tools/cvs2fossil/lib/c2f_pimport.tcl
+++ tools/cvs2fossil/lib/c2f_pimport.tcl
@@ -45,10 +45,14 @@
45 # this pass.
46
47 state use project
48 state use file
49 state use revision
 
 
 
 
50
51 # This data is actually transient, confined to this pass. We
52 # use the state storage only to keep the RAM usage low.
53 state extend revuuid {
54 rid INTEGER NOT NULL REFERENCES revision UNIQUE,
@@ -82,21 +86,23 @@
82 log write 1 import {Importing project "[$project base]"}
83
84 set fossil [fossil %AUTO%]
85
86 state transaction {
 
87 foreach file [$project files] {
88 set path [$file path]
89 log write 2 import {Importing file "$path"}
90 $file pushto $fossil
91 }
92
93 # TODO: Generate manifests for the changesets in the
94 # project and import them. This needs
95 # topological traversal. And the creation of
96 # empty helper baselines for stuff like the root
97 # of ntdb and such.
 
98 }
99
100 # At last copy the temporary repository file to its final
101 # destination and release the associated memory.
102
103
--- tools/cvs2fossil/lib/c2f_pimport.tcl
+++ tools/cvs2fossil/lib/c2f_pimport.tcl
@@ -45,10 +45,14 @@
45 # this pass.
46
47 state use project
48 state use file
49 state use revision
50 state use meta
51 state use author
52 state use cmessage
53 state use symbol
54
55 # This data is actually transient, confined to this pass. We
56 # use the state storage only to keep the RAM usage low.
57 state extend revuuid {
58 rid INTEGER NOT NULL REFERENCES revision UNIQUE,
@@ -82,21 +86,23 @@
86 log write 1 import {Importing project "[$project base]"}
87
88 set fossil [fossil %AUTO%]
89
90 state transaction {
91 # Layer I: Files and their revisions
92 foreach file [$project files] {
93 set path [$file path]
94 log write 2 import {Importing file "$path"}
95 $file pushto $fossil
96 }
97 # Layer II: Changesets
98 array set rstate {}
99 foreach {revision date} [$project revisionsinorder] {
100 log write 2 import {Importing revision [$revision str]}
101 $revision pushto rstate $fossil $date
102 }
103 unset rstate
104 }
105
106 # At last copy the temporary repository file to its final
107 # destination and release the associated memory.
108
109
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -388,10 +388,94 @@
388388
389389
if {!$kill} return
390390
trouble internal "[$self str] depends on itself"
391391
return
392392
}
393
+
394
+ method pushto {sv repository date} {
395
+ upvar 1 $sv state
396
+
397
+ # Generate and import the manifest for this changeset.
398
+ #
399
+ # Data needed:
400
+ # - Commit message (-- mysrcid -> repository meta)
401
+ # - User doing the commit (s.a.)
402
+ #
403
+ # - Timestamp of when committed (command argument)
404
+ #
405
+ # - The parent changeset, if any. If there is no parent use
406
+ # the empty base revision as parent.
407
+ #
408
+ # - List of the file revisions in the changeset.
409
+
410
+ struct::list assign [$myproject getmeta $mysrcid] __ branch user message
411
+ struct::list assign $branch __ lodname
412
+
413
+ # The parent is determined via the line-of-development (LOD)
414
+ # information of each changeset, and the history of
415
+ # imports. The last changeset committed to the same LOD is
416
+ # taken as the parent of the current changeset. If the
417
+ # changeset is the first on that LOD it can be either spawned
418
+ # from another LOD, or detached. For the first case we
419
+ # retrieve the parent LOD of the current LOD symbol (*) and
420
+ # recheck for a committed changeset. The second case is taken
421
+ # if that lookup fails as well.
422
+ #
423
+ # (*) And this parent was found in previous passes when
424
+ # determining the prefered parents of all the symbols.
425
+
426
+ # NOTE: The above is incomplete and buggy. Vendor-branches and
427
+ # the various possibilities of its interaction with the
428
+ # trunk are not fully handled.
429
+
430
+ if {[info exists state($lodname)]} {
431
+ # LOD exists and has already been committed to.
432
+ set parent $state($lodname)
433
+ } else {
434
+ # LOD has not been committed to before, this is the first
435
+ # time. Determine the name of the parent LOD.
436
+
437
+ set plodname [[[$myproject getsymbol $lodname] parent] name]
438
+
439
+ if {[info exists state($plodname)]} {
440
+ # The parental LOD has been committed to, take that
441
+ # last changeset as the spawnpoint for the new LOD.
442
+ set parent $state($plodname)
443
+ } else {
444
+ # The parental LOD is not defined (yet). This LOD is
445
+ # detached. We choose as our parent the automatic
446
+ # empty root baseline of the target repository.
447
+ set parent {}
448
+ }
449
+ }
450
+
451
+ # Perform the import. As part of that convert the list of
452
+ # items in the changeset into uuids and printable data.
453
+
454
+ set theset ('[join $myitems {','}]')
455
+ set uuid [$repository importrevision [$self str] \
456
+ $user $message $date $parent \
457
+ [state run [subst -nocommands -nobackslashes {
458
+ SELECT U.uuid, F.name, R.rev
459
+ FROM revision R, revuuid U, file F
460
+ WHERE R.rid IN $theset -- All specified revisions
461
+ AND U.rid = R.rid -- get fossil uuid of revision
462
+ AND F.fid = R.fid -- get file of revision
463
+ }]]]
464
+
465
+ # Remember the imported changeset in the state, under our LOD.
466
+
467
+ set state($lodname) $uuid
468
+
469
+ # Remember the whole changeset / uuid mapping, for the tags.
470
+
471
+ state run {
472
+ INSERT INTO csuuid (cid, uuid)
473
+ VALUES ($myid, $uuid)
474
+ }
475
+ return
476
+ }
393477
394478
typemethod split {cset args} {
395479
# As part of the creation of the new changesets specified in
396480
# ARGS as sets of items, all subsets of CSET's item set, CSET
397481
# will be dropped from all databases, in and out of memory,
@@ -541,10 +625,30 @@
541625
typevariable mycstype -array {} ; # Map cstypes (names) to persistent
542626
# ids. Note that we have to keep
543627
# the names in the table 'cstype'
544628
# in sync with the names of the
545629
# helper singletons.
630
+
631
+ typemethod inorder {projectid} {
632
+ # Return all revision changesets for the specified project, in
633
+ # the order given to them by the sort passes. Both the
634
+ # filtering by project and sorting make use of 'project::rev
635
+ # rev' impossible.
636
+
637
+ set res {}
638
+ foreach {cid cdate} [state run {
639
+ SELECT C.cid, T.date
640
+ FROM changeset C, cstimestamp T
641
+ WHERE C.type = 0 -- limit to revision changesets
642
+ AND C.pid = $projectid -- limit to changesets in project
643
+ AND T.cid = C.cid -- get ordering information
644
+ ORDER BY T.date -- sort into commit order
645
+ }] {
646
+ lappend res $myidmap($cid) $cdate
647
+ }
648
+ return $res
649
+ }
546650
547651
typemethod getcstypes {} {
548652
foreach {tid name} [state run {
549653
SELECT tid, name FROM cstype;
550654
}] { set mycstype($name) $tid }
551655
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -388,10 +388,94 @@
388
389 if {!$kill} return
390 trouble internal "[$self str] depends on itself"
391 return
392 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
393
394 typemethod split {cset args} {
395 # As part of the creation of the new changesets specified in
396 # ARGS as sets of items, all subsets of CSET's item set, CSET
397 # will be dropped from all databases, in and out of memory,
@@ -541,10 +625,30 @@
541 typevariable mycstype -array {} ; # Map cstypes (names) to persistent
542 # ids. Note that we have to keep
543 # the names in the table 'cstype'
544 # in sync with the names of the
545 # helper singletons.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
547 typemethod getcstypes {} {
548 foreach {tid name} [state run {
549 SELECT tid, name FROM cstype;
550 }] { set mycstype($name) $tid }
551
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -388,10 +388,94 @@
388
389 if {!$kill} return
390 trouble internal "[$self str] depends on itself"
391 return
392 }
393
394 method pushto {sv repository date} {
395 upvar 1 $sv state
396
397 # Generate and import the manifest for this changeset.
398 #
399 # Data needed:
400 # - Commit message (-- mysrcid -> repository meta)
401 # - User doing the commit (s.a.)
402 #
403 # - Timestamp of when committed (command argument)
404 #
405 # - The parent changeset, if any. If there is no parent use
406 # the empty base revision as parent.
407 #
408 # - List of the file revisions in the changeset.
409
410 struct::list assign [$myproject getmeta $mysrcid] __ branch user message
411 struct::list assign $branch __ lodname
412
413 # The parent is determined via the line-of-development (LOD)
414 # information of each changeset, and the history of
415 # imports. The last changeset committed to the same LOD is
416 # taken as the parent of the current changeset. If the
417 # changeset is the first on that LOD it can be either spawned
418 # from another LOD, or detached. For the first case we
419 # retrieve the parent LOD of the current LOD symbol (*) and
420 # recheck for a committed changeset. The second case is taken
421 # if that lookup fails as well.
422 #
423 # (*) And this parent was found in previous passes when
424 # determining the prefered parents of all the symbols.
425
426 # NOTE: The above is incomplete and buggy. Vendor-branches and
427 # the various possibilities of its interaction with the
428 # trunk are not fully handled.
429
430 if {[info exists state($lodname)]} {
431 # LOD exists and has already been committed to.
432 set parent $state($lodname)
433 } else {
434 # LOD has not been committed to before, this is the first
435 # time. Determine the name of the parent LOD.
436
437 set plodname [[[$myproject getsymbol $lodname] parent] name]
438
439 if {[info exists state($plodname)]} {
440 # The parental LOD has been committed to, take that
441 # last changeset as the spawnpoint for the new LOD.
442 set parent $state($plodname)
443 } else {
444 # The parental LOD is not defined (yet). This LOD is
445 # detached. We choose as our parent the automatic
446 # empty root baseline of the target repository.
447 set parent {}
448 }
449 }
450
451 # Perform the import. As part of that convert the list of
452 # items in the changeset into uuids and printable data.
453
454 set theset ('[join $myitems {','}]')
455 set uuid [$repository importrevision [$self str] \
456 $user $message $date $parent \
457 [state run [subst -nocommands -nobackslashes {
458 SELECT U.uuid, F.name, R.rev
459 FROM revision R, revuuid U, file F
460 WHERE R.rid IN $theset -- All specified revisions
461 AND U.rid = R.rid -- get fossil uuid of revision
462 AND F.fid = R.fid -- get file of revision
463 }]]]
464
465 # Remember the imported changeset in the state, under our LOD.
466
467 set state($lodname) $uuid
468
469 # Remember the whole changeset / uuid mapping, for the tags.
470
471 state run {
472 INSERT INTO csuuid (cid, uuid)
473 VALUES ($myid, $uuid)
474 }
475 return
476 }
477
478 typemethod split {cset args} {
479 # As part of the creation of the new changesets specified in
480 # ARGS as sets of items, all subsets of CSET's item set, CSET
481 # will be dropped from all databases, in and out of memory,
@@ -541,10 +625,30 @@
625 typevariable mycstype -array {} ; # Map cstypes (names) to persistent
626 # ids. Note that we have to keep
627 # the names in the table 'cstype'
628 # in sync with the names of the
629 # helper singletons.
630
631 typemethod inorder {projectid} {
632 # Return all revision changesets for the specified project, in
633 # the order given to them by the sort passes. Both the
634 # filtering by project and sorting make use of 'project::rev
635 # rev' impossible.
636
637 set res {}
638 foreach {cid cdate} [state run {
639 SELECT C.cid, T.date
640 FROM changeset C, cstimestamp T
641 WHERE C.type = 0 -- limit to revision changesets
642 AND C.pid = $projectid -- limit to changesets in project
643 AND T.cid = C.cid -- get ordering information
644 ORDER BY T.date -- sort into commit order
645 }] {
646 lappend res $myidmap($cid) $cdate
647 }
648 return $res
649 }
650
651 typemethod getcstypes {} {
652 foreach {tid name} [state run {
653 SELECT tid, name FROM cstype;
654 }] { set mycstype($name) $tid }
655
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -17,10 +17,11 @@
1717
1818
package require Tcl 8.4 ; # Required runtime.
1919
package require snit ; # OO system.
2020
package require vc::fossil::import::cvs::file ; # CVS archive file.
2121
package require vc::fossil::import::cvs::state ; # State storage.
22
+package require vc::fossil::import::cvs::project::rev ; # Changesets.
2223
package require vc::fossil::import::cvs::project::sym ; # Per project symbols.
2324
package require vc::fossil::import::cvs::project::trunk ; # Per project trunk, main lod
2425
package require vc::tools::log ; # User feedback
2526
package require struct::list ; # Advanced list operations..
2627
@@ -156,10 +157,16 @@
156157
}
157158
}
158159
return
159160
}
160161
162
+ method revisionsinorder {} {
163
+ return [rev inorder $myid]
164
+ }
165
+
166
+ delegate method getmeta to myrepository
167
+
161168
# # ## ### ##### ######## #############
162169
## State
163170
164171
variable mybase {} ; # Project directory.
165172
variable myid {} ; # Project id in the persistent state.
@@ -167,11 +174,11 @@
167174
# development for the project.
168175
variable myfiles -array {} ; # Maps the rcs archive paths to
169176
# their user-visible files.
170177
variable myfobj {} ; # File objects for the rcs archives
171178
variable myfmap -array {} ; # Map rcs archive to their object.
172
- variable myrepository {} ; # Repository the prject belongs to.
179
+ variable myrepository {} ; # Repository the project belongs to.
173180
variable mysymbol -array {} ; # Map symbol names to project-level
174181
# symbol objects.
175182
176183
# # ## ### ##### ######## #############
177184
## Internal methods
@@ -212,13 +219,15 @@
212219
namespace import ::vc::tools::log
213220
namespace import ::vc::fossil::import::cvs::file
214221
namespace import ::vc::fossil::import::cvs::state
215222
# Import not required, already a child namespace.
216223
# namespace import ::vc::fossil::import::cvs::project::sym
224
+ # Import not required, already a child namespace.
225
+ # namespace import ::vc::fossil::import::cvs::project::rev
217226
}
218227
}
219228
220229
# # ## ### ##### ######## ############# #####################
221230
## Ready
222231
223232
package provide vc::fossil::import::cvs::project 1.0
224233
return
225234
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -17,10 +17,11 @@
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 vc::tools::log ; # User feedback
25 package require struct::list ; # Advanced list operations..
26
@@ -156,10 +157,16 @@
156 }
157 }
158 return
159 }
160
 
 
 
 
 
 
161 # # ## ### ##### ######## #############
162 ## State
163
164 variable mybase {} ; # Project directory.
165 variable myid {} ; # Project id in the persistent state.
@@ -167,11 +174,11 @@
167 # development for the project.
168 variable myfiles -array {} ; # Maps the rcs archive paths to
169 # their user-visible files.
170 variable myfobj {} ; # File objects for the rcs archives
171 variable myfmap -array {} ; # Map rcs archive to their object.
172 variable myrepository {} ; # Repository the prject belongs to.
173 variable mysymbol -array {} ; # Map symbol names to project-level
174 # symbol objects.
175
176 # # ## ### ##### ######## #############
177 ## Internal methods
@@ -212,13 +219,15 @@
212 namespace import ::vc::tools::log
213 namespace import ::vc::fossil::import::cvs::file
214 namespace import ::vc::fossil::import::cvs::state
215 # Import not required, already a child namespace.
216 # namespace import ::vc::fossil::import::cvs::project::sym
 
 
217 }
218 }
219
220 # # ## ### ##### ######## ############# #####################
221 ## Ready
222
223 package provide vc::fossil::import::cvs::project 1.0
224 return
225
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -17,10 +17,11 @@
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::rev ; # Changesets.
23 package require vc::fossil::import::cvs::project::sym ; # Per project symbols.
24 package require vc::fossil::import::cvs::project::trunk ; # Per project trunk, main lod
25 package require vc::tools::log ; # User feedback
26 package require struct::list ; # Advanced list operations..
27
@@ -156,10 +157,16 @@
157 }
158 }
159 return
160 }
161
162 method revisionsinorder {} {
163 return [rev inorder $myid]
164 }
165
166 delegate method getmeta to myrepository
167
168 # # ## ### ##### ######## #############
169 ## State
170
171 variable mybase {} ; # Project directory.
172 variable myid {} ; # Project id in the persistent state.
@@ -167,11 +174,11 @@
174 # development for the project.
175 variable myfiles -array {} ; # Maps the rcs archive paths to
176 # their user-visible files.
177 variable myfobj {} ; # File objects for the rcs archives
178 variable myfmap -array {} ; # Map rcs archive to their object.
179 variable myrepository {} ; # Repository the project belongs to.
180 variable mysymbol -array {} ; # Map symbol names to project-level
181 # symbol objects.
182
183 # # ## ### ##### ######## #############
184 ## Internal methods
@@ -212,13 +219,15 @@
219 namespace import ::vc::tools::log
220 namespace import ::vc::fossil::import::cvs::file
221 namespace import ::vc::fossil::import::cvs::state
222 # Import not required, already a child namespace.
223 # namespace import ::vc::fossil::import::cvs::project::sym
224 # Import not required, already a child namespace.
225 # namespace import ::vc::fossil::import::cvs::project::rev
226 }
227 }
228
229 # # ## ### ##### ######## ############# #####################
230 ## Ready
231
232 package provide vc::fossil::import::cvs::project 1.0
233 return
234
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -40,10 +40,22 @@
4040
return
4141
}
4242
4343
method name {} { return $myname }
4444
method id {} { return $myid }
45
+
46
+ method istrunk {} { return 0 }
47
+
48
+ method parent {} {
49
+ return [$myproject getsymbol [state one {
50
+ SELECT S.name
51
+ FROM preferedparent P, symbol S
52
+ WHERE P.sid = $myid
53
+ AND S.sid = P.pid
54
+ }]]
55
+ return
56
+ }
4557
4658
# # ## ### ##### ######## #############
4759
## Symbol type
4860
4961
method determinetype {} {
5062
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -40,10 +40,22 @@
40 return
41 }
42
43 method name {} { return $myname }
44 method id {} { return $myid }
 
 
 
 
 
 
 
 
 
 
 
 
45
46 # # ## ### ##### ######## #############
47 ## Symbol type
48
49 method determinetype {} {
50
--- tools/cvs2fossil/lib/c2f_psym.tcl
+++ tools/cvs2fossil/lib/c2f_psym.tcl
@@ -40,10 +40,22 @@
40 return
41 }
42
43 method name {} { return $myname }
44 method id {} { return $myid }
45
46 method istrunk {} { return 0 }
47
48 method parent {} {
49 return [$myproject getsymbol [state one {
50 SELECT S.name
51 FROM preferedparent P, symbol S
52 WHERE P.sid = $myid
53 AND S.sid = P.pid
54 }]]
55 return
56 }
57
58 # # ## ### ##### ######## #############
59 ## Symbol type
60
61 method determinetype {} {
62
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -37,10 +37,11 @@
3737
3838
method name {} { return $myname }
3939
method id {} { return $myid }
4040
method istrunk {} { return 1 }
4141
method symbol {} { return $self }
42
+ method parent {} { return $self }
4243
4344
method forceid {id} { set myid $id ; return }
4445
4546
method defcounts {tc bc cc} {}
4647
4748
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -37,10 +37,11 @@
37
38 method name {} { return $myname }
39 method id {} { return $myid }
40 method istrunk {} { return 1 }
41 method symbol {} { return $self }
 
42
43 method forceid {id} { set myid $id ; return }
44
45 method defcounts {tc bc cc} {}
46
47
--- tools/cvs2fossil/lib/c2f_ptrunk.tcl
+++ tools/cvs2fossil/lib/c2f_ptrunk.tcl
@@ -37,10 +37,11 @@
37
38 method name {} { return $myname }
39 method id {} { return $myid }
40 method istrunk {} { return 1 }
41 method symbol {} { return $self }
42 method parent {} { return $self }
43
44 method forceid {id} { set myid $id ; return }
45
46 method defcounts {tc bc cc} {}
47
48
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -83,10 +83,19 @@
8383
8484
typemethod commitmessageof {mid} {
8585
struct::list assign [$mymeta keyof $mid] pid bid aid cid
8686
return [$mycmsg keyof $cid]
8787
}
88
+
89
+ typemethod getmeta {mid} {
90
+ struct::list assign [$mymeta keyof $mid] pid bid aid cid
91
+ return [list \
92
+ $myprojmap($pid) \
93
+ [$mysymbol keyof $bid] \
94
+ [$myauthor keyof $aid] \
95
+ [$mycmsg keyof $cid]]
96
+ }
8897
8998
# pass I results
9099
typemethod printstatistics {} {
91100
set prlist [TheProjects]
92101
set npr [llength $prlist]
@@ -258,10 +267,29 @@
258267
# this is used to load the pass II data, which means
259268
# that everything is 'undefined' at this point anyway.
260269
261270
# future: $symbol load (blockers, and parents)
262271
}
272
+
273
+ # Beyond the symbols we also load the author, commit log,
274
+ # and meta information.
275
+
276
+ foreach {aid aname} [state run {
277
+ SELECT aid, name FROM author
278
+ }] {
279
+ $myauthor map $aid $aname
280
+ }
281
+ foreach {cid text} [state run {
282
+ SELECT cid, text FROM cmessage
283
+ }] {
284
+ $mycmsg map $cid $text
285
+ }
286
+ foreach {mid pid bid aid cid} [state run {
287
+ SELECT mid, pid, bid, aid, cid FROM meta
288
+ }] {
289
+ $mymeta map $mid [list $pid $bid $aid $cid]
290
+ }
263291
}
264292
return
265293
}
266294
267295
typemethod determinesymboltypes {} {
@@ -470,7 +498,6 @@
470498
}
471499
}
472500
473501
# # ## ### ##### ######## ############# #####################
474502
## Ready
475
-
476503
return
477504
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -83,10 +83,19 @@
83
84 typemethod commitmessageof {mid} {
85 struct::list assign [$mymeta keyof $mid] pid bid aid cid
86 return [$mycmsg keyof $cid]
87 }
 
 
 
 
 
 
 
 
 
88
89 # pass I results
90 typemethod printstatistics {} {
91 set prlist [TheProjects]
92 set npr [llength $prlist]
@@ -258,10 +267,29 @@
258 # this is used to load the pass II data, which means
259 # that everything is 'undefined' at this point anyway.
260
261 # future: $symbol load (blockers, and parents)
262 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263 }
264 return
265 }
266
267 typemethod determinesymboltypes {} {
@@ -470,7 +498,6 @@
470 }
471 }
472
473 # # ## ### ##### ######## ############# #####################
474 ## Ready
475
476 return
477
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -83,10 +83,19 @@
83
84 typemethod commitmessageof {mid} {
85 struct::list assign [$mymeta keyof $mid] pid bid aid cid
86 return [$mycmsg keyof $cid]
87 }
88
89 typemethod getmeta {mid} {
90 struct::list assign [$mymeta keyof $mid] pid bid aid cid
91 return [list \
92 $myprojmap($pid) \
93 [$mysymbol keyof $bid] \
94 [$myauthor keyof $aid] \
95 [$mycmsg keyof $cid]]
96 }
97
98 # pass I results
99 typemethod printstatistics {} {
100 set prlist [TheProjects]
101 set npr [llength $prlist]
@@ -258,10 +267,29 @@
267 # this is used to load the pass II data, which means
268 # that everything is 'undefined' at this point anyway.
269
270 # future: $symbol load (blockers, and parents)
271 }
272
273 # Beyond the symbols we also load the author, commit log,
274 # and meta information.
275
276 foreach {aid aname} [state run {
277 SELECT aid, name FROM author
278 }] {
279 $myauthor map $aid $aname
280 }
281 foreach {cid text} [state run {
282 SELECT cid, text FROM cmessage
283 }] {
284 $mycmsg map $cid $text
285 }
286 foreach {mid pid bid aid cid} [state run {
287 SELECT mid, pid, bid, aid, cid FROM meta
288 }] {
289 $mymeta map $mid [list $pid $bid $aid $cid]
290 }
291 }
292 return
293 }
294
295 typemethod determinesymboltypes {} {
@@ -470,7 +498,6 @@
498 }
499 }
500
501 # # ## ### ##### ######## ############# #####################
502 ## Ready
 
503 return
504

Keyboard Shortcuts

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