Fossil SCM

Moved the code loading changesets from state to its proper class.

aku 2008-01-30 03:23 trunk
Commit 49dd66f64fc236df7de37abbee1888f352aab46d
--- tools/cvs2fossil/lib/c2f_pinitcsets.tcl
+++ tools/cvs2fossil/lib/c2f_pinitcsets.tcl
@@ -110,33 +110,15 @@
110110
111111
state use changeset
112112
state use csitem
113113
state use cstype
114114
115
- # Need the types first, the constructor in the loop below uses
116
- # them to assert the correctness of type names.
115
+ # Need the types first, the constructor used inside of the
116
+ # 'load' below uses them to assert the correctness of type
117
+ # names.
117118
project::rev getcstypes
118
-
119
- # TODO: Move to project::rev
120
- set n 0
121
- log write 2 initcsets {Loading the changesets}
122
- foreach {id pid cstype srcid} [state run {
123
- SELECT C.cid, C.pid, CS.name, C.src
124
- FROM changeset C, cstype CS
125
- WHERE C.type = CS.tid
126
- ORDER BY C.cid
127
- }] {
128
- log progress 2 initcsets $n {}
129
- set r [project::rev %AUTO% [repository projectof $pid] $cstype $srcid [state run {
130
- SELECT C.iid
131
- FROM csitem C
132
- WHERE C.cid = $id
133
- ORDER BY C.pos
134
- }] $id]
135
- incr n
136
- }
137
-
119
+ project::rev load
138120
project::rev loadcounter
139121
return
140122
}
141123
142124
typemethod run {} {
143125
--- tools/cvs2fossil/lib/c2f_pinitcsets.tcl
+++ tools/cvs2fossil/lib/c2f_pinitcsets.tcl
@@ -110,33 +110,15 @@
110
111 state use changeset
112 state use csitem
113 state use cstype
114
115 # Need the types first, the constructor in the loop below uses
116 # them to assert the correctness of type names.
 
117 project::rev getcstypes
118
119 # TODO: Move to project::rev
120 set n 0
121 log write 2 initcsets {Loading the changesets}
122 foreach {id pid cstype srcid} [state run {
123 SELECT C.cid, C.pid, CS.name, C.src
124 FROM changeset C, cstype CS
125 WHERE C.type = CS.tid
126 ORDER BY C.cid
127 }] {
128 log progress 2 initcsets $n {}
129 set r [project::rev %AUTO% [repository projectof $pid] $cstype $srcid [state run {
130 SELECT C.iid
131 FROM csitem C
132 WHERE C.cid = $id
133 ORDER BY C.pos
134 }] $id]
135 incr n
136 }
137
138 project::rev loadcounter
139 return
140 }
141
142 typemethod run {} {
143
--- tools/cvs2fossil/lib/c2f_pinitcsets.tcl
+++ tools/cvs2fossil/lib/c2f_pinitcsets.tcl
@@ -110,33 +110,15 @@
110
111 state use changeset
112 state use csitem
113 state use cstype
114
115 # Need the types first, the constructor used inside of the
116 # 'load' below uses them to assert the correctness of type
117 # names.
118 project::rev getcstypes
119 project::rev load
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120 project::rev loadcounter
121 return
122 }
123
124 typemethod run {} {
125
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -20,10 +20,11 @@
2020
package require snit ; # OO system.
2121
package require struct::set ; # Set operations.
2222
package require vc::tools::misc ; # Text formatting
2323
package require vc::tools::trouble ; # Error reporting.
2424
package require vc::tools::log ; # User feedback.
25
+package require vc::fossil::import::cvs::repository ; # Repository management.
2526
package require vc::fossil::import::cvs::state ; # State storage.
2627
package require vc::fossil::import::cvs::integrity ; # State integrity checks.
2728
2829
# # ## ### ##### ######## ############# #####################
2930
##
@@ -548,14 +549,35 @@
548549
foreach {tid name} [state run {
549550
SELECT tid, name FROM cstype;
550551
}] { set mycstype($name) $tid }
551552
return
552553
}
554
+
555
+ typemethod load {} {
556
+ set n 0
557
+ log write 2 csets {Loading the changesets}
558
+ foreach {id pid cstype srcid} [state run {
559
+ SELECT C.cid, C.pid, CS.name, C.src
560
+ FROM changeset C, cstype CS
561
+ WHERE C.type = CS.tid
562
+ ORDER BY C.cid
563
+ }] {
564
+ log progress 2 csets $n {}
565
+ set r [$type %AUTO% [repository projectof $pid] $cstype $srcid [state run {
566
+ SELECT C.iid
567
+ FROM csitem C
568
+ WHERE C.cid = $id
569
+ ORDER BY C.pos
570
+ }] $id]
571
+ incr n
572
+ }
573
+ return
574
+ }
553575
554576
typemethod loadcounter {} {
555577
# Initialize the counter from the state
556
- log write 2 initcsets {Loading changeset counter}
578
+ log write 2 csets {Loading changeset counter}
557579
set mycounter [state one { SELECT MAX(cid) FROM changeset }]
558580
return
559581
}
560582
561583
typemethod num {} { return $mycounter }
@@ -1336,10 +1358,11 @@
13361358
##
13371359
13381360
namespace eval ::vc::fossil::import::cvs::project {
13391361
namespace export rev
13401362
namespace eval rev {
1363
+ namespace import ::vc::fossil::import::cvs::repository
13411364
namespace import ::vc::fossil::import::cvs::state
13421365
namespace import ::vc::fossil::import::cvs::integrity
13431366
namespace import ::vc::tools::misc::*
13441367
namespace import ::vc::tools::trouble
13451368
namespace import ::vc::tools::log
13461369
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -20,10 +20,11 @@
20 package require snit ; # OO system.
21 package require struct::set ; # Set operations.
22 package require vc::tools::misc ; # Text formatting
23 package require vc::tools::trouble ; # Error reporting.
24 package require vc::tools::log ; # User feedback.
 
25 package require vc::fossil::import::cvs::state ; # State storage.
26 package require vc::fossil::import::cvs::integrity ; # State integrity checks.
27
28 # # ## ### ##### ######## ############# #####################
29 ##
@@ -548,14 +549,35 @@
548 foreach {tid name} [state run {
549 SELECT tid, name FROM cstype;
550 }] { set mycstype($name) $tid }
551 return
552 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
554 typemethod loadcounter {} {
555 # Initialize the counter from the state
556 log write 2 initcsets {Loading changeset counter}
557 set mycounter [state one { SELECT MAX(cid) FROM changeset }]
558 return
559 }
560
561 typemethod num {} { return $mycounter }
@@ -1336,10 +1358,11 @@
1336 ##
1337
1338 namespace eval ::vc::fossil::import::cvs::project {
1339 namespace export rev
1340 namespace eval rev {
 
1341 namespace import ::vc::fossil::import::cvs::state
1342 namespace import ::vc::fossil::import::cvs::integrity
1343 namespace import ::vc::tools::misc::*
1344 namespace import ::vc::tools::trouble
1345 namespace import ::vc::tools::log
1346
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -20,10 +20,11 @@
20 package require snit ; # OO system.
21 package require struct::set ; # Set operations.
22 package require vc::tools::misc ; # Text formatting
23 package require vc::tools::trouble ; # Error reporting.
24 package require vc::tools::log ; # User feedback.
25 package require vc::fossil::import::cvs::repository ; # Repository management.
26 package require vc::fossil::import::cvs::state ; # State storage.
27 package require vc::fossil::import::cvs::integrity ; # State integrity checks.
28
29 # # ## ### ##### ######## ############# #####################
30 ##
@@ -548,14 +549,35 @@
549 foreach {tid name} [state run {
550 SELECT tid, name FROM cstype;
551 }] { set mycstype($name) $tid }
552 return
553 }
554
555 typemethod load {} {
556 set n 0
557 log write 2 csets {Loading the changesets}
558 foreach {id pid cstype srcid} [state run {
559 SELECT C.cid, C.pid, CS.name, C.src
560 FROM changeset C, cstype CS
561 WHERE C.type = CS.tid
562 ORDER BY C.cid
563 }] {
564 log progress 2 csets $n {}
565 set r [$type %AUTO% [repository projectof $pid] $cstype $srcid [state run {
566 SELECT C.iid
567 FROM csitem C
568 WHERE C.cid = $id
569 ORDER BY C.pos
570 }] $id]
571 incr n
572 }
573 return
574 }
575
576 typemethod loadcounter {} {
577 # Initialize the counter from the state
578 log write 2 csets {Loading changeset counter}
579 set mycounter [state one { SELECT MAX(cid) FROM changeset }]
580 return
581 }
582
583 typemethod num {} { return $mycounter }
@@ -1336,10 +1358,11 @@
1358 ##
1359
1360 namespace eval ::vc::fossil::import::cvs::project {
1361 namespace export rev
1362 namespace eval rev {
1363 namespace import ::vc::fossil::import::cvs::repository
1364 namespace import ::vc::fossil::import::cvs::state
1365 namespace import ::vc::fossil::import::cvs::integrity
1366 namespace import ::vc::tools::misc::*
1367 namespace import ::vc::tools::trouble
1368 namespace import ::vc::tools::log
1369

Keyboard Shortcuts

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