Differences From:
File
tools/cvs2fossil/lib/c2f_prev.tcl
part of check-in
[de4cff4142]
- Extended changeset class with in-memory database mapping from changeset ids to the proper object, and extended the objects with position information and associated accessors. Extended pass 8 to load the commit order computed in pass 6, this is stored in the new position slot of changesets, and an inverted index mapping from position to changeset at that position.
by
aku on
2007-11-22 03:21:43.
[view]
To:
File
tools/cvs2fossil/lib/c2f_prev.tcl
part of check-in
[4866889e88]
- Continued work on pass 8, added outline for handling of retrograde branches, extended changesets with predicate allowing us to find the branch changesets.
by
aku on
2007-11-22 03:33:32.
[view]
@@ -21,8 +21,9 @@
package require vc::tools::misc ; # Text formatting
package require vc::tools::trouble ; # Error reporting.
package require vc::tools::log ; # User feedback.
package require vc::fossil::import::cvs::state ; # State storage.
+package require vc::fossil::import::cvs::project::sym ; # Project level symbols
# # ## ### ##### ######## ############# #####################
##
@@ -59,8 +60,15 @@
method byrevision {} { return [expr {$mytype eq "rev"}] }
method setpos {p} { set mypos $p ; return }
method pos {} { return $mypos }
+
+ method isbranch {} {
+ return [expr {($mytype eq "sym") &&
+ ($mybranchcode == [state one {
+ SELECT type FROM symbol WHERE sid = $mysrcid
+ }])}]
+ }
method successors {} {
# NOTE / FUTURE: Possible bottleneck.
set csets {}
@@ -599,11 +607,17 @@
typevariable mychangesets {} ; # List of all known changesets.
typevariable myrevmap -array {} ; # Map from revisions to their changeset.
typevariable myidmap -array {} ; # Map from changeset id to changeset.
+ typevariable mybranchcode {} ; # Local copy of project::sym/mybranch.
typemethod all {} { return $mychangesets }
typemethod of {id} { return $myidmap($id) }
+
+ typeconstructor {
+ set mybranchcode [project::sym branch]
+ return
+ }
# # ## ### ##### ######## #############
## Configuration
@@ -617,8 +631,11 @@
namespace eval ::vc::fossil::import::cvs::project {
namespace export rev
namespace eval rev {
namespace import ::vc::fossil::import::cvs::state
+ namespace eval project {
+ namespace import ::vc::fossil::import::cvs::project::sym
+ }
namespace import ::vc::tools::misc::*
namespace import ::vc::tools::trouble
namespace import ::vc::tools::log
log register csets