Fossil SCM
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
Commit
3d88cfd05d2cec7cc9c801c41a39bb8d23481f70
Parent
6d1811d61ed7708…
2 files changed
+50
-5
+60
-14
+50
-5
| --- tools/cvs2fossil/lib/c2f_file.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_file.tcl | ||
| @@ -14,12 +14,13 @@ | ||
| 14 | 14 | ## instances are possible. |
| 15 | 15 | |
| 16 | 16 | # # ## ### ##### ######## ############# ##################### |
| 17 | 17 | ## Requirements |
| 18 | 18 | |
| 19 | -package require Tcl 8.4 ; # Required runtime. | |
| 20 | -package require snit ; # OO system. | |
| 19 | +package require Tcl 8.4 ; # Required runtime. | |
| 20 | +package require snit ; # OO system. | |
| 21 | +package require vc::fossil::import::cvs::repository ; # Repository management. | |
| 21 | 22 | |
| 22 | 23 | # # ## ### ##### ######## ############# ##################### |
| 23 | 24 | ## |
| 24 | 25 | |
| 25 | 26 | snit::type ::vc::fossil::import::cvs::file { |
| @@ -60,22 +61,63 @@ | ||
| 60 | 61 | #method def {rev date author state next branches} {puts "def $rev $date $author $state $next $branches"} |
| 61 | 62 | #method setdesc {d} {puts desc=$d} |
| 62 | 63 | #method extend {rev commitmsg deltarange} {puts "extend $commitmsg $deltarange"} |
| 63 | 64 | #method done {} {puts done} |
| 64 | 65 | |
| 65 | - | |
| 66 | 66 | # # ## ### ##### ######## ############# |
| 67 | 67 | ## Persistence (pass II) |
| 68 | 68 | |
| 69 | 69 | method persist {} { |
| 70 | 70 | } |
| 71 | + | |
| 72 | + # # ## ### ##### ######## ############# | |
| 73 | + ## Implement the sink | |
| 74 | + | |
| 75 | + method begin {} {} | |
| 76 | + method done {} {} | |
| 77 | + method admindone {} {} | |
| 78 | + | |
| 79 | + method sethead {h} { | |
| 80 | + set myhead $h | |
| 81 | + return | |
| 82 | + } | |
| 83 | + | |
| 84 | + method setprincipalbranch {b} { | |
| 85 | + set myprincipal $b | |
| 86 | + return | |
| 87 | + } | |
| 88 | + | |
| 89 | + method setsymbols {dict} { | |
| 90 | + # Slice symbols into branches and tags, canonical numbers ... | |
| 91 | +array set _ $dict | |
| 92 | +parray _ | |
| 93 | + } | |
| 94 | + | |
| 95 | + method setcomment {c} {# ignore} | |
| 96 | + method setdesc {d} {# ignore} | |
| 97 | + | |
| 98 | + method def {rev date author state next branches} { | |
| 99 | + set myrev($rev) [list $date $author $state $next $branches] | |
| 100 | + repository author $author | |
| 101 | + return | |
| 102 | + } | |
| 103 | + | |
| 104 | + method extend {rev commitmsg deltarange} { | |
| 105 | + set cm [string trim $commitmsg] | |
| 106 | + lappend myrev($rev) $cm $deltarange | |
| 107 | + repository cmessage $cm | |
| 108 | + return | |
| 109 | + } | |
| 71 | 110 | |
| 72 | 111 | # # ## ### ##### ######## ############# |
| 73 | 112 | ## State |
| 74 | 113 | |
| 75 | - variable mypath {} ; # Path of rcs archive | |
| 76 | - variable myproject {} ; # Project object the file belongs to. | |
| 114 | + variable mypath {} ; # Path of rcs archive | |
| 115 | + variable myproject {} ; # Project object the file belongs to. | |
| 116 | + variable myrev -array {} ; # All revisions and their connections. | |
| 117 | + variable myhead {} ; # Head revision (rev number) | |
| 118 | + variable myprincipal {} ; # Principal branch (branch number) | |
| 77 | 119 | |
| 78 | 120 | # # ## ### ##### ######## ############# |
| 79 | 121 | ## Internal methods |
| 80 | 122 | |
| 81 | 123 | pragma -hastypeinfo no ; # no type introspection |
| @@ -86,12 +128,15 @@ | ||
| 86 | 128 | # # ## ### ##### ######## ############# |
| 87 | 129 | } |
| 88 | 130 | |
| 89 | 131 | namespace eval ::vc::fossil::import::cvs { |
| 90 | 132 | namespace export file |
| 133 | + namespace eval file { | |
| 134 | + namespace import ::vc::fossil::import::cvs::repository | |
| 135 | + } | |
| 91 | 136 | } |
| 92 | 137 | |
| 93 | 138 | # # ## ### ##### ######## ############# ##################### |
| 94 | 139 | ## Ready |
| 95 | 140 | |
| 96 | 141 | package provide vc::fossil::import::cvs::file 1.0 |
| 97 | 142 | return |
| 98 | 143 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -14,12 +14,13 @@ | |
| 14 | ## instances are possible. |
| 15 | |
| 16 | # # ## ### ##### ######## ############# ##################### |
| 17 | ## Requirements |
| 18 | |
| 19 | package require Tcl 8.4 ; # Required runtime. |
| 20 | package require snit ; # OO system. |
| 21 | |
| 22 | # # ## ### ##### ######## ############# ##################### |
| 23 | ## |
| 24 | |
| 25 | snit::type ::vc::fossil::import::cvs::file { |
| @@ -60,22 +61,63 @@ | |
| 60 | #method def {rev date author state next branches} {puts "def $rev $date $author $state $next $branches"} |
| 61 | #method setdesc {d} {puts desc=$d} |
| 62 | #method extend {rev commitmsg deltarange} {puts "extend $commitmsg $deltarange"} |
| 63 | #method done {} {puts done} |
| 64 | |
| 65 | |
| 66 | # # ## ### ##### ######## ############# |
| 67 | ## Persistence (pass II) |
| 68 | |
| 69 | method persist {} { |
| 70 | } |
| 71 | |
| 72 | # # ## ### ##### ######## ############# |
| 73 | ## State |
| 74 | |
| 75 | variable mypath {} ; # Path of rcs archive |
| 76 | variable myproject {} ; # Project object the file belongs to. |
| 77 | |
| 78 | # # ## ### ##### ######## ############# |
| 79 | ## Internal methods |
| 80 | |
| 81 | pragma -hastypeinfo no ; # no type introspection |
| @@ -86,12 +128,15 @@ | |
| 86 | # # ## ### ##### ######## ############# |
| 87 | } |
| 88 | |
| 89 | namespace eval ::vc::fossil::import::cvs { |
| 90 | namespace export file |
| 91 | } |
| 92 | |
| 93 | # # ## ### ##### ######## ############# ##################### |
| 94 | ## Ready |
| 95 | |
| 96 | package provide vc::fossil::import::cvs::file 1.0 |
| 97 | return |
| 98 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -14,12 +14,13 @@ | |
| 14 | ## instances are possible. |
| 15 | |
| 16 | # # ## ### ##### ######## ############# ##################### |
| 17 | ## Requirements |
| 18 | |
| 19 | package require Tcl 8.4 ; # Required runtime. |
| 20 | package require snit ; # OO system. |
| 21 | package require vc::fossil::import::cvs::repository ; # Repository management. |
| 22 | |
| 23 | # # ## ### ##### ######## ############# ##################### |
| 24 | ## |
| 25 | |
| 26 | snit::type ::vc::fossil::import::cvs::file { |
| @@ -60,22 +61,63 @@ | |
| 61 | #method def {rev date author state next branches} {puts "def $rev $date $author $state $next $branches"} |
| 62 | #method setdesc {d} {puts desc=$d} |
| 63 | #method extend {rev commitmsg deltarange} {puts "extend $commitmsg $deltarange"} |
| 64 | #method done {} {puts done} |
| 65 | |
| 66 | # # ## ### ##### ######## ############# |
| 67 | ## Persistence (pass II) |
| 68 | |
| 69 | method persist {} { |
| 70 | } |
| 71 | |
| 72 | # # ## ### ##### ######## ############# |
| 73 | ## Implement the sink |
| 74 | |
| 75 | method begin {} {} |
| 76 | method done {} {} |
| 77 | method admindone {} {} |
| 78 | |
| 79 | method sethead {h} { |
| 80 | set myhead $h |
| 81 | return |
| 82 | } |
| 83 | |
| 84 | method setprincipalbranch {b} { |
| 85 | set myprincipal $b |
| 86 | return |
| 87 | } |
| 88 | |
| 89 | method setsymbols {dict} { |
| 90 | # Slice symbols into branches and tags, canonical numbers ... |
| 91 | array set _ $dict |
| 92 | parray _ |
| 93 | } |
| 94 | |
| 95 | method setcomment {c} {# ignore} |
| 96 | method setdesc {d} {# ignore} |
| 97 | |
| 98 | method def {rev date author state next branches} { |
| 99 | set myrev($rev) [list $date $author $state $next $branches] |
| 100 | repository author $author |
| 101 | return |
| 102 | } |
| 103 | |
| 104 | method extend {rev commitmsg deltarange} { |
| 105 | set cm [string trim $commitmsg] |
| 106 | lappend myrev($rev) $cm $deltarange |
| 107 | repository cmessage $cm |
| 108 | return |
| 109 | } |
| 110 | |
| 111 | # # ## ### ##### ######## ############# |
| 112 | ## State |
| 113 | |
| 114 | variable mypath {} ; # Path of rcs archive |
| 115 | variable myproject {} ; # Project object the file belongs to. |
| 116 | variable myrev -array {} ; # All revisions and their connections. |
| 117 | variable myhead {} ; # Head revision (rev number) |
| 118 | variable myprincipal {} ; # Principal branch (branch number) |
| 119 | |
| 120 | # # ## ### ##### ######## ############# |
| 121 | ## Internal methods |
| 122 | |
| 123 | pragma -hastypeinfo no ; # no type introspection |
| @@ -86,12 +128,15 @@ | |
| 128 | # # ## ### ##### ######## ############# |
| 129 | } |
| 130 | |
| 131 | namespace eval ::vc::fossil::import::cvs { |
| 132 | namespace export file |
| 133 | namespace eval file { |
| 134 | namespace import ::vc::fossil::import::cvs::repository |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | # # ## ### ##### ######## ############# ##################### |
| 139 | ## Ready |
| 140 | |
| 141 | package provide vc::fossil::import::cvs::file 1.0 |
| 142 | return |
| 143 |
+60
-14
| --- tools/cvs2fossil/lib/c2f_repository.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_repository.tcl | ||
| @@ -9,20 +9,22 @@ | ||
| 9 | 9 | # individuals. For exact contribution history, see the revision |
| 10 | 10 | # history and logs, available at http://fossil-scm.hwaci.com/fossil |
| 11 | 11 | # # ## ### ##### ######## ############# ##################### |
| 12 | 12 | |
| 13 | 13 | ## Repository manager. Keeps projects and their files around. |
| 14 | + | |
| 15 | +package provide vc::fossil::import::cvs::repository 1.0 | |
| 14 | 16 | |
| 15 | 17 | # # ## ### ##### ######## ############# ##################### |
| 16 | 18 | ## Requirements |
| 17 | 19 | |
| 18 | 20 | package require Tcl 8.4 ; # Required runtime. |
| 19 | 21 | package require snit ; # OO system. |
| 20 | 22 | package require vc::tools::trouble ; # Error reporting. |
| 21 | 23 | package require vc::tools::log ; # User feedback. |
| 22 | 24 | package require vc::tools::misc ; # Text formatting |
| 23 | -package require vc::fossil::import::cvs::project ; # CVS projects | |
| 25 | +# CVS Projects later (see bottom) to handle circular dependency in 'file'. | |
| 24 | 26 | package require vc::fossil::import::cvs::state ; # State storage |
| 25 | 27 | package require struct::list ; # List operations. |
| 26 | 28 | package require fileutil ; # File operations. |
| 27 | 29 | |
| 28 | 30 | # # ## ### ##### ######## ############# ##################### |
| @@ -70,10 +72,20 @@ | ||
| 70 | 72 | trouble fatal $msg |
| 71 | 73 | } |
| 72 | 74 | } |
| 73 | 75 | return |
| 74 | 76 | } |
| 77 | + | |
| 78 | + typemethod author {a} { | |
| 79 | + set myauthor($a) "" | |
| 80 | + return | |
| 81 | + } | |
| 82 | + | |
| 83 | + typemethod cmessage {cm} { | |
| 84 | + set mycmsg($cm) "" | |
| 85 | + return | |
| 86 | + } | |
| 75 | 87 | |
| 76 | 88 | # pass I results |
| 77 | 89 | typemethod printstatistics {} { |
| 78 | 90 | set prlist [TheProjects] |
| 79 | 91 | set npr [llength $prlist] |
| @@ -134,22 +146,25 @@ | ||
| 134 | 146 | } |
| 135 | 147 | |
| 136 | 148 | # pass II persistence |
| 137 | 149 | typemethod persistrev {} { |
| 138 | 150 | state transaction { |
| 139 | - # TODO: per repository persistence (authors, commit messages) | |
| 151 | + SaveAuthors | |
| 152 | + SaveCommitMessages | |
| 140 | 153 | foreach p [TheProjects] { $p persistrev } |
| 141 | 154 | } |
| 142 | 155 | return |
| 143 | 156 | } |
| 144 | 157 | |
| 145 | 158 | # # ## ### ##### ######## ############# |
| 146 | 159 | ## State |
| 147 | 160 | |
| 148 | - typevariable mybase {} | |
| 149 | - typevariable myprojpaths {} | |
| 150 | - typevariable myprojects {} | |
| 161 | + typevariable mybase {} ; # Base path to CVS repository. | |
| 162 | + typevariable myprojpaths {} ; # Paths to all declared projects, relative to mybase. | |
| 163 | + typevariable myprojects {} ; # Objects for all declared projects. | |
| 164 | + typevariable myauthor -array {} ; # Names of all authors found, later with id. | |
| 165 | + typevariable mycmsg -array {} ; # All commit messages found, later with id. | |
| 151 | 166 | |
| 152 | 167 | # # ## ### ##### ######## ############# |
| 153 | 168 | ## Internal methods |
| 154 | 169 | |
| 155 | 170 | proc .BaseLength {p} { |
| @@ -200,10 +215,36 @@ | ||
| 200 | 215 | # Base is the single project. |
| 201 | 216 | lappend res [project %AUTO% ""] |
| 202 | 217 | } |
| 203 | 218 | return $res |
| 204 | 219 | } |
| 220 | + | |
| 221 | + proc SaveAuthors {} { | |
| 222 | + ::variable myauthor | |
| 223 | + foreach a [lsort -dict [array names myauthor]] { | |
| 224 | + state run { | |
| 225 | + INSERT INTO author (aid, name) | |
| 226 | + VALUES (NULL, $a); | |
| 227 | + } | |
| 228 | + # Save id for use by the project/file persistence code. | |
| 229 | + set myauthor($a) [state id] | |
| 230 | + } | |
| 231 | + return | |
| 232 | + } | |
| 233 | + | |
| 234 | + proc SaveCommitMessages {} { | |
| 235 | + ::variable mycmsg | |
| 236 | + foreach t [lsort -dict [array names mycmsg]] { | |
| 237 | + state run { | |
| 238 | + INSERT INTO cmessage (cid, text) | |
| 239 | + VALUES (NULL, $t); | |
| 240 | + } | |
| 241 | + # Save id for use by the project/file persistence code. | |
| 242 | + set mycmsg($t) [state id] | |
| 243 | + } | |
| 244 | + return | |
| 245 | + } | |
| 205 | 246 | |
| 206 | 247 | # # ## ### ##### ######## ############# |
| 207 | 248 | ## Configuration |
| 208 | 249 | |
| 209 | 250 | pragma -hasinstances no ; # singleton |
| @@ -213,20 +254,25 @@ | ||
| 213 | 254 | # # ## ### ##### ######## ############# |
| 214 | 255 | } |
| 215 | 256 | |
| 216 | 257 | namespace eval ::vc::fossil::import::cvs { |
| 217 | 258 | namespace export repository |
| 218 | - namespace eval repository { | |
| 219 | - namespace import ::vc::fossil::import::cvs::project | |
| 220 | - namespace import ::vc::fossil::import::cvs::state | |
| 221 | - namespace import ::vc::tools::misc::* | |
| 222 | - namespace import ::vc::tools::trouble | |
| 223 | - namespace import ::vc::tools::log | |
| 224 | - log register repository | |
| 225 | - } | |
| 259 | +} | |
| 260 | + | |
| 261 | +# CVS projects here to handle circular dependency | |
| 262 | +# repository <- project <- file <- repository | |
| 263 | + | |
| 264 | +package require vc::fossil::import::cvs::project | |
| 265 | + | |
| 266 | +namespace eval ::vc::fossil::import::cvs::repository { | |
| 267 | + namespace import ::vc::fossil::import::cvs::project | |
| 268 | + namespace import ::vc::fossil::import::cvs::state | |
| 269 | + namespace import ::vc::tools::misc::* | |
| 270 | + namespace import ::vc::tools::trouble | |
| 271 | + namespace import ::vc::tools::log | |
| 272 | + log register repository | |
| 226 | 273 | } |
| 227 | 274 | |
| 228 | 275 | # # ## ### ##### ######## ############# ##################### |
| 229 | 276 | ## Ready |
| 230 | 277 | |
| 231 | -package provide vc::fossil::import::cvs::repository 1.0 | |
| 232 | 278 | return |
| 233 | 279 |
| --- tools/cvs2fossil/lib/c2f_repository.tcl | |
| +++ tools/cvs2fossil/lib/c2f_repository.tcl | |
| @@ -9,20 +9,22 @@ | |
| 9 | # individuals. For exact contribution history, see the revision |
| 10 | # history and logs, available at http://fossil-scm.hwaci.com/fossil |
| 11 | # # ## ### ##### ######## ############# ##################### |
| 12 | |
| 13 | ## Repository manager. Keeps projects and their files around. |
| 14 | |
| 15 | # # ## ### ##### ######## ############# ##################### |
| 16 | ## Requirements |
| 17 | |
| 18 | package require Tcl 8.4 ; # Required runtime. |
| 19 | package require snit ; # OO system. |
| 20 | package require vc::tools::trouble ; # Error reporting. |
| 21 | package require vc::tools::log ; # User feedback. |
| 22 | package require vc::tools::misc ; # Text formatting |
| 23 | package require vc::fossil::import::cvs::project ; # CVS projects |
| 24 | package require vc::fossil::import::cvs::state ; # State storage |
| 25 | package require struct::list ; # List operations. |
| 26 | package require fileutil ; # File operations. |
| 27 | |
| 28 | # # ## ### ##### ######## ############# ##################### |
| @@ -70,10 +72,20 @@ | |
| 70 | trouble fatal $msg |
| 71 | } |
| 72 | } |
| 73 | return |
| 74 | } |
| 75 | |
| 76 | # pass I results |
| 77 | typemethod printstatistics {} { |
| 78 | set prlist [TheProjects] |
| 79 | set npr [llength $prlist] |
| @@ -134,22 +146,25 @@ | |
| 134 | } |
| 135 | |
| 136 | # pass II persistence |
| 137 | typemethod persistrev {} { |
| 138 | state transaction { |
| 139 | # TODO: per repository persistence (authors, commit messages) |
| 140 | foreach p [TheProjects] { $p persistrev } |
| 141 | } |
| 142 | return |
| 143 | } |
| 144 | |
| 145 | # # ## ### ##### ######## ############# |
| 146 | ## State |
| 147 | |
| 148 | typevariable mybase {} |
| 149 | typevariable myprojpaths {} |
| 150 | typevariable myprojects {} |
| 151 | |
| 152 | # # ## ### ##### ######## ############# |
| 153 | ## Internal methods |
| 154 | |
| 155 | proc .BaseLength {p} { |
| @@ -200,10 +215,36 @@ | |
| 200 | # Base is the single project. |
| 201 | lappend res [project %AUTO% ""] |
| 202 | } |
| 203 | return $res |
| 204 | } |
| 205 | |
| 206 | # # ## ### ##### ######## ############# |
| 207 | ## Configuration |
| 208 | |
| 209 | pragma -hasinstances no ; # singleton |
| @@ -213,20 +254,25 @@ | |
| 213 | # # ## ### ##### ######## ############# |
| 214 | } |
| 215 | |
| 216 | namespace eval ::vc::fossil::import::cvs { |
| 217 | namespace export repository |
| 218 | namespace eval repository { |
| 219 | namespace import ::vc::fossil::import::cvs::project |
| 220 | namespace import ::vc::fossil::import::cvs::state |
| 221 | namespace import ::vc::tools::misc::* |
| 222 | namespace import ::vc::tools::trouble |
| 223 | namespace import ::vc::tools::log |
| 224 | log register repository |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | # # ## ### ##### ######## ############# ##################### |
| 229 | ## Ready |
| 230 | |
| 231 | package provide vc::fossil::import::cvs::repository 1.0 |
| 232 | return |
| 233 |
| --- tools/cvs2fossil/lib/c2f_repository.tcl | |
| +++ tools/cvs2fossil/lib/c2f_repository.tcl | |
| @@ -9,20 +9,22 @@ | |
| 9 | # individuals. For exact contribution history, see the revision |
| 10 | # history and logs, available at http://fossil-scm.hwaci.com/fossil |
| 11 | # # ## ### ##### ######## ############# ##################### |
| 12 | |
| 13 | ## Repository manager. Keeps projects and their files around. |
| 14 | |
| 15 | package provide vc::fossil::import::cvs::repository 1.0 |
| 16 | |
| 17 | # # ## ### ##### ######## ############# ##################### |
| 18 | ## Requirements |
| 19 | |
| 20 | package require Tcl 8.4 ; # Required runtime. |
| 21 | package require snit ; # OO system. |
| 22 | package require vc::tools::trouble ; # Error reporting. |
| 23 | package require vc::tools::log ; # User feedback. |
| 24 | package require vc::tools::misc ; # Text formatting |
| 25 | # CVS Projects later (see bottom) to handle circular dependency in 'file'. |
| 26 | package require vc::fossil::import::cvs::state ; # State storage |
| 27 | package require struct::list ; # List operations. |
| 28 | package require fileutil ; # File operations. |
| 29 | |
| 30 | # # ## ### ##### ######## ############# ##################### |
| @@ -70,10 +72,20 @@ | |
| 72 | trouble fatal $msg |
| 73 | } |
| 74 | } |
| 75 | return |
| 76 | } |
| 77 | |
| 78 | typemethod author {a} { |
| 79 | set myauthor($a) "" |
| 80 | return |
| 81 | } |
| 82 | |
| 83 | typemethod cmessage {cm} { |
| 84 | set mycmsg($cm) "" |
| 85 | return |
| 86 | } |
| 87 | |
| 88 | # pass I results |
| 89 | typemethod printstatistics {} { |
| 90 | set prlist [TheProjects] |
| 91 | set npr [llength $prlist] |
| @@ -134,22 +146,25 @@ | |
| 146 | } |
| 147 | |
| 148 | # pass II persistence |
| 149 | typemethod persistrev {} { |
| 150 | state transaction { |
| 151 | SaveAuthors |
| 152 | SaveCommitMessages |
| 153 | foreach p [TheProjects] { $p persistrev } |
| 154 | } |
| 155 | return |
| 156 | } |
| 157 | |
| 158 | # # ## ### ##### ######## ############# |
| 159 | ## State |
| 160 | |
| 161 | typevariable mybase {} ; # Base path to CVS repository. |
| 162 | typevariable myprojpaths {} ; # Paths to all declared projects, relative to mybase. |
| 163 | typevariable myprojects {} ; # Objects for all declared projects. |
| 164 | typevariable myauthor -array {} ; # Names of all authors found, later with id. |
| 165 | typevariable mycmsg -array {} ; # All commit messages found, later with id. |
| 166 | |
| 167 | # # ## ### ##### ######## ############# |
| 168 | ## Internal methods |
| 169 | |
| 170 | proc .BaseLength {p} { |
| @@ -200,10 +215,36 @@ | |
| 215 | # Base is the single project. |
| 216 | lappend res [project %AUTO% ""] |
| 217 | } |
| 218 | return $res |
| 219 | } |
| 220 | |
| 221 | proc SaveAuthors {} { |
| 222 | ::variable myauthor |
| 223 | foreach a [lsort -dict [array names myauthor]] { |
| 224 | state run { |
| 225 | INSERT INTO author (aid, name) |
| 226 | VALUES (NULL, $a); |
| 227 | } |
| 228 | # Save id for use by the project/file persistence code. |
| 229 | set myauthor($a) [state id] |
| 230 | } |
| 231 | return |
| 232 | } |
| 233 | |
| 234 | proc SaveCommitMessages {} { |
| 235 | ::variable mycmsg |
| 236 | foreach t [lsort -dict [array names mycmsg]] { |
| 237 | state run { |
| 238 | INSERT INTO cmessage (cid, text) |
| 239 | VALUES (NULL, $t); |
| 240 | } |
| 241 | # Save id for use by the project/file persistence code. |
| 242 | set mycmsg($t) [state id] |
| 243 | } |
| 244 | return |
| 245 | } |
| 246 | |
| 247 | # # ## ### ##### ######## ############# |
| 248 | ## Configuration |
| 249 | |
| 250 | pragma -hasinstances no ; # singleton |
| @@ -213,20 +254,25 @@ | |
| 254 | # # ## ### ##### ######## ############# |
| 255 | } |
| 256 | |
| 257 | namespace eval ::vc::fossil::import::cvs { |
| 258 | namespace export repository |
| 259 | } |
| 260 | |
| 261 | # CVS projects here to handle circular dependency |
| 262 | # repository <- project <- file <- repository |
| 263 | |
| 264 | package require vc::fossil::import::cvs::project |
| 265 | |
| 266 | namespace eval ::vc::fossil::import::cvs::repository { |
| 267 | namespace import ::vc::fossil::import::cvs::project |
| 268 | namespace import ::vc::fossil::import::cvs::state |
| 269 | namespace import ::vc::tools::misc::* |
| 270 | namespace import ::vc::tools::trouble |
| 271 | namespace import ::vc::tools::log |
| 272 | log register repository |
| 273 | } |
| 274 | |
| 275 | # # ## ### ##### ######## ############# ##################### |
| 276 | ## Ready |
| 277 | |
| 278 | return |
| 279 |