Differences From:
File
tools/cvs2fossil/lib/c2f_project.tcl
part of check-in
[54ac684df7]
- Completed loading of pass I from persistent state when skipped.
by
aku on
2007-10-13 23:57:15.
[view]
To:
File
tools/cvs2fossil/lib/c2f_project.tcl
part of check-in
[67c24820c7]
- Reworked the whole handling of meta data (author, commit message, plus project/branch information), so that revisions now store only the meta id, everything else is stored centrally. All the relevant pieces (author, cmessage, symbols, projects) now also get numeric ids assigned early instead of when being saved to the state. Project ids are loaded from the state now too.
by
aku on
2007-10-14 01:58:07.
[view]
@@ -41,8 +41,10 @@
if {$mybase eq ""} {return <Repository>}
return $mybase
}
+ method setid {id} { set myid $id ; return }
+
method addfile {rcs usr executable} {
set myfiles($rcs) [list $usr $executable]
return
}
@@ -54,14 +56,19 @@
method files {} {
return [TheFiles]
}
- delegate method author to myrepository
- delegate method cmessage to myrepository
+ delegate method defauthor to myrepository
+ delegate method defcmessage to myrepository
+
+ method defmeta {bid aid cid} {
+ return [$myrepository defmeta $myid $bid $aid $cid]
+ }
method getsymbol {name} {
if {![info exists mysymbols($name)]} {
- set mysymbols($name) [sym %AUTO% $name]
+ set mysymbols($name) \
+ [sym %AUTO% $name [$myrepository defsymbol $myid $name]]
}
return $mysymbols($name)
}
@@ -74,18 +81,18 @@
state run {
INSERT INTO project (pid, name)
VALUES (NULL, $mybase);
}
- set pid [state id]
+ set myid [state id]
# Then all files, with proper backreference to their
# project.
foreach {rcs item} [array get myfiles] {
struct::list assign $item usr executable
state run {
- INSERT INTO file (fid, pid, name, visible, exec)
- VALUES (NULL, $pid, $rcs, $usr, $executable);
+ INSERT INTO file (fid, pid, name, visible, exec)
+ VALUES (NULL, $myid, $rcs, $usr, $executable);
}
}
}
return
@@ -105,8 +112,9 @@
# # ## ### ##### ######## #############
## State
variable mybase {} ; # Project directory
+ variable myid {} ; # Project id in the persistent state.
variable myfiles -array {} ; # Maps rcs archive to their user files.
variable myfobj {} ; # File objects for the rcs archives
variable myrepository {} ; # Repository the prject belongs to.
variable mysymbols -array {} ; # Map symbol names to project-level symbol objects.