| | @@ -20,10 +20,11 @@ |
| 20 | 20 | package require snit ; # OO system. |
| 21 | 21 | package require struct::set ; # Set operations. |
| 22 | 22 | package require vc::tools::misc ; # Text formatting |
| 23 | 23 | package require vc::tools::trouble ; # Error reporting. |
| 24 | 24 | package require vc::tools::log ; # User feedback. |
| 25 | +package require vc::fossil::import::cvs::repository ; # Repository management. |
| 25 | 26 | package require vc::fossil::import::cvs::state ; # State storage. |
| 26 | 27 | package require vc::fossil::import::cvs::integrity ; # State integrity checks. |
| 27 | 28 | |
| 28 | 29 | # # ## ### ##### ######## ############# ##################### |
| 29 | 30 | ## |
| | @@ -548,14 +549,35 @@ |
| 548 | 549 | foreach {tid name} [state run { |
| 549 | 550 | SELECT tid, name FROM cstype; |
| 550 | 551 | }] { set mycstype($name) $tid } |
| 551 | 552 | return |
| 552 | 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 | + } |
| 553 | 575 | |
| 554 | 576 | typemethod loadcounter {} { |
| 555 | 577 | # Initialize the counter from the state |
| 556 | | - log write 2 initcsets {Loading changeset counter} |
| 578 | + log write 2 csets {Loading changeset counter} |
| 557 | 579 | set mycounter [state one { SELECT MAX(cid) FROM changeset }] |
| 558 | 580 | return |
| 559 | 581 | } |
| 560 | 582 | |
| 561 | 583 | typemethod num {} { return $mycounter } |
| | @@ -1336,10 +1358,11 @@ |
| 1336 | 1358 | ## |
| 1337 | 1359 | |
| 1338 | 1360 | namespace eval ::vc::fossil::import::cvs::project { |
| 1339 | 1361 | namespace export rev |
| 1340 | 1362 | namespace eval rev { |
| 1363 | + namespace import ::vc::fossil::import::cvs::repository |
| 1341 | 1364 | namespace import ::vc::fossil::import::cvs::state |
| 1342 | 1365 | namespace import ::vc::fossil::import::cvs::integrity |
| 1343 | 1366 | namespace import ::vc::tools::misc::* |
| 1344 | 1367 | namespace import ::vc::tools::trouble |
| 1345 | 1368 | namespace import ::vc::tools::log |
| 1346 | 1369 | |