Differences From:
File
tools/cvs2fossil/lib/c2f_file.tcl
part of check-in
[6d1811d61e]
- Continued work on pass II, skeleton of it completed by adding outline of code for persistence.
by
aku on
2007-10-06 21:19:26.
[view]
To:
File
tools/cvs2fossil/lib/c2f_file.tcl
part of check-in
[3d88cfd05d]
- Started capture of revision information in file objects. Capturing authors and commit messages and repository level. Completed persistence for these latter too. Rearranged the requirements, imports, and exports a bit to handle the new dependency cycle repository <- project <- file <- repository
by
aku on
2007-10-06 21:59:03.
[view]
@@ -15,10 +15,11 @@
# # ## ### ##### ######## ############# #####################
## Requirements
-package require Tcl 8.4 ; # Required runtime.
-package require snit ; # OO system.
+package require Tcl 8.4 ; # Required runtime.
+package require snit ; # OO system.
+package require vc::fossil::import::cvs::repository ; # Repository management.
# # ## ### ##### ######## ############# #####################
##
@@ -61,20 +62,61 @@
#method setdesc {d} {puts desc=$d}
#method extend {rev commitmsg deltarange} {puts "extend $commitmsg $deltarange"}
#method done {} {puts done}
-
# # ## ### ##### ######## #############
## Persistence (pass II)
method persist {} {
}
# # ## ### ##### ######## #############
+ ## Implement the sink
+
+ method begin {} {}
+ method done {} {}
+ method admindone {} {}
+
+ method sethead {h} {
+ set myhead $h
+ return
+ }
+
+ method setprincipalbranch {b} {
+ set myprincipal $b
+ return
+ }
+
+ method setsymbols {dict} {
+ # Slice symbols into branches and tags, canonical numbers ...
+array set _ $dict
+parray _
+ }
+
+ method setcomment {c} {# ignore}
+ method setdesc {d} {# ignore}
+
+ method def {rev date author state next branches} {
+ set myrev($rev) [list $date $author $state $next $branches]
+ repository author $author
+ return
+ }
+
+ method extend {rev commitmsg deltarange} {
+ set cm [string trim $commitmsg]
+ lappend myrev($rev) $cm $deltarange
+ repository cmessage $cm
+ return
+ }
+
+ # # ## ### ##### ######## #############
## State
- variable mypath {} ; # Path of rcs archive
- variable myproject {} ; # Project object the file belongs to.
+ variable mypath {} ; # Path of rcs archive
+ variable myproject {} ; # Project object the file belongs to.
+ variable myrev -array {} ; # All revisions and their connections.
+ variable myhead {} ; # Head revision (rev number)
+ variable myprincipal {} ; # Principal branch (branch number)
# # ## ### ##### ######## #############
## Internal methods
@@ -87,11 +129,14 @@
}
namespace eval ::vc::fossil::import::cvs {
namespace export file
+ namespace eval file {
+ namespace import ::vc::fossil::import::cvs::repository
+ }
}
# # ## ### ##### ######## ############# #####################
## Ready
package provide vc::fossil::import::cvs::file 1.0
return