Fossil SCM

Added detection of irrelevant trunk revisions for files added to a branch but not the trunk. Repository extended to keep inverted indices for the meta data and commit messages for retrieval of commit messages per meta data, required for the previous. fixed problem with file objects, we kept only the rcs path, and need the user visible path too.

aku 2007-10-17 04:37 trunk
Commit cfe4b269ac5ef7edf85c8b39c633d62465d874ad
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -30,20 +30,24 @@
3030
3131
snit::type ::vc::fossil::import::cvs::file {
3232
# # ## ### ##### ######## #############
3333
## Public API
3434
35
- constructor {path executable project} {
35
+ constructor {path usrpath executable project} {
3636
set mypath $path
37
+ set myusrpath $usrpath
3738
set myexecutable $executable
3839
set myproject $project
3940
set mytrunk [$myproject trunk]
4041
return
4142
}
4243
4344
method path {} { return $mypath }
45
+ method usrpath {} { return $myusrpath }
4446
method project {} { return $myproject }
47
+
48
+ delegate method commitmessageof to myproject
4549
4650
# # ## ### ##### ######## #############
4751
## Methods required for the class to be a sink of the rcs parser
4852
4953
#method begin {} {puts begin}
@@ -208,10 +212,11 @@
208212
209213
# # ## ### ##### ######## #############
210214
## State
211215
212216
variable mypath {} ; # Path of the file's rcs archive.
217
+ variable myusrpath {} ; # Path of the file as seen by users.
213218
variable myexecutable 0 ; # Boolean flag 'file executable'.
214219
variable myproject {} ; # Reference to the project object
215220
# the file belongs to.
216221
variable myrev -array {} ; # Maps revision number to the
217222
# associated revision object.
@@ -686,10 +691,54 @@
686691
}
687692
return
688693
}
689694
690695
method RemoveIrrelevantDeletions {} {
696
+ # From cvs2fossil:
697
+ # If a file is added on a branch, then a trunk revision is
698
+ # added at the same time in the 'Dead' state. This revision
699
+ # doesn't do anything useful, so delete it.
700
+
701
+ foreach root $myroots {
702
+ if {[$root isneeded]} continue
703
+ log write 2 file "Removing unnecessary dead revision [$root revnr]"
704
+
705
+ # Remove as root, make its child new root after
706
+ # disconnecting it from the revision just going away.
707
+
708
+ ldelete myroots $root
709
+ if {[$root haschild]} {
710
+ set child [$root child]
711
+ $child cutfromparent
712
+ lappend myroots $child
713
+ }
714
+
715
+ # Remove the branches spawned by the revision to be
716
+ # deleted. If the branch has revisions they should already
717
+ # use operation 'add', no need to change that. The first
718
+ # revision on each branch becomes a new and disconnected
719
+ # root.
720
+
721
+ foreach branch [$root branches] {
722
+ if {![$branch haschild]} continue
723
+ set first [$branch child]
724
+ $first cutfromparentbranch
725
+ $first cutfromparent
726
+ lappend myroots $first
727
+ }
728
+ $root removeallbranches
729
+
730
+ # Tagging a dead revision doesn't do anything, so remove
731
+ # any tags that were set on it.
732
+
733
+ $root removealltags
734
+
735
+ # This can only happen once per file, and we might have
736
+ # just changed myroots, so break out of the loop:
737
+ break
738
+ }
739
+ return
691740
}
692741
693742
method RemoveInitialBranchDeletions {} {
694743
}
695744
@@ -700,11 +749,10 @@
700749
## Configuration
701750
702751
pragma -hastypeinfo no ; # no type introspection
703752
pragma -hasinfo no ; # no object introspection
704753
pragma -hastypemethods no ; # type is not relevant.
705
- pragma -simpledispatch yes ; # simple fast dispatch
706754
707755
# # ## ### ##### ######## #############
708756
}
709757
710758
namespace eval ::vc::fossil::import::cvs {
711759
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -30,20 +30,24 @@
30
31 snit::type ::vc::fossil::import::cvs::file {
32 # # ## ### ##### ######## #############
33 ## Public API
34
35 constructor {path executable project} {
36 set mypath $path
 
37 set myexecutable $executable
38 set myproject $project
39 set mytrunk [$myproject trunk]
40 return
41 }
42
43 method path {} { return $mypath }
 
44 method project {} { return $myproject }
 
 
45
46 # # ## ### ##### ######## #############
47 ## Methods required for the class to be a sink of the rcs parser
48
49 #method begin {} {puts begin}
@@ -208,10 +212,11 @@
208
209 # # ## ### ##### ######## #############
210 ## State
211
212 variable mypath {} ; # Path of the file's rcs archive.
 
213 variable myexecutable 0 ; # Boolean flag 'file executable'.
214 variable myproject {} ; # Reference to the project object
215 # the file belongs to.
216 variable myrev -array {} ; # Maps revision number to the
217 # associated revision object.
@@ -686,10 +691,54 @@
686 }
687 return
688 }
689
690 method RemoveIrrelevantDeletions {} {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
691 }
692
693 method RemoveInitialBranchDeletions {} {
694 }
695
@@ -700,11 +749,10 @@
700 ## Configuration
701
702 pragma -hastypeinfo no ; # no type introspection
703 pragma -hasinfo no ; # no object introspection
704 pragma -hastypemethods no ; # type is not relevant.
705 pragma -simpledispatch yes ; # simple fast dispatch
706
707 # # ## ### ##### ######## #############
708 }
709
710 namespace eval ::vc::fossil::import::cvs {
711
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -30,20 +30,24 @@
30
31 snit::type ::vc::fossil::import::cvs::file {
32 # # ## ### ##### ######## #############
33 ## Public API
34
35 constructor {path usrpath executable project} {
36 set mypath $path
37 set myusrpath $usrpath
38 set myexecutable $executable
39 set myproject $project
40 set mytrunk [$myproject trunk]
41 return
42 }
43
44 method path {} { return $mypath }
45 method usrpath {} { return $myusrpath }
46 method project {} { return $myproject }
47
48 delegate method commitmessageof to myproject
49
50 # # ## ### ##### ######## #############
51 ## Methods required for the class to be a sink of the rcs parser
52
53 #method begin {} {puts begin}
@@ -208,10 +212,11 @@
212
213 # # ## ### ##### ######## #############
214 ## State
215
216 variable mypath {} ; # Path of the file's rcs archive.
217 variable myusrpath {} ; # Path of the file as seen by users.
218 variable myexecutable 0 ; # Boolean flag 'file executable'.
219 variable myproject {} ; # Reference to the project object
220 # the file belongs to.
221 variable myrev -array {} ; # Maps revision number to the
222 # associated revision object.
@@ -686,10 +691,54 @@
691 }
692 return
693 }
694
695 method RemoveIrrelevantDeletions {} {
696 # From cvs2fossil:
697 # If a file is added on a branch, then a trunk revision is
698 # added at the same time in the 'Dead' state. This revision
699 # doesn't do anything useful, so delete it.
700
701 foreach root $myroots {
702 if {[$root isneeded]} continue
703 log write 2 file "Removing unnecessary dead revision [$root revnr]"
704
705 # Remove as root, make its child new root after
706 # disconnecting it from the revision just going away.
707
708 ldelete myroots $root
709 if {[$root haschild]} {
710 set child [$root child]
711 $child cutfromparent
712 lappend myroots $child
713 }
714
715 # Remove the branches spawned by the revision to be
716 # deleted. If the branch has revisions they should already
717 # use operation 'add', no need to change that. The first
718 # revision on each branch becomes a new and disconnected
719 # root.
720
721 foreach branch [$root branches] {
722 if {![$branch haschild]} continue
723 set first [$branch child]
724 $first cutfromparentbranch
725 $first cutfromparent
726 lappend myroots $first
727 }
728 $root removeallbranches
729
730 # Tagging a dead revision doesn't do anything, so remove
731 # any tags that were set on it.
732
733 $root removealltags
734
735 # This can only happen once per file, and we might have
736 # just changed myroots, so break out of the loop:
737 break
738 }
739 return
740 }
741
742 method RemoveInitialBranchDeletions {} {
743 }
744
@@ -700,11 +749,10 @@
749 ## Configuration
750
751 pragma -hastypeinfo no ; # no type introspection
752 pragma -hasinfo no ; # no object introspection
753 pragma -hastypemethods no ; # type is not relevant.
 
754
755 # # ## ### ##### ######## #############
756 }
757
758 namespace eval ::vc::fossil::import::cvs {
759
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -49,10 +49,28 @@
4949
5050
method revnr {} { return $myrevnr }
5151
method state {} { return $mystate }
5252
method lod {} { return $mylod }
5353
method date {} { return $mydate }
54
+
55
+ method isneeded {} {
56
+ if {$myoperation ne "nothing"} {return 1}
57
+ if {$myrevnr ne "1.1"} {return 1}
58
+ if {![$mylod istrunk]} {return 1}
59
+ if {![llength $mybranches]} {return 1}
60
+ set firstbranch [lindex $mybranches 0]
61
+ if {![$firstbranch haschild]} {return 1}
62
+ if {$myisondefaultbranch} {return 1}
63
+
64
+ # FIX: This message will not match if the RCS file was renamed
65
+ # manually after it was created.
66
+
67
+ set gen "file [file tail [$myfile usrpath]] was initially added on branch [$firstbranch name]."
68
+ set log [$myfile commitmessageof $mymetaid]
69
+
70
+ return [expr {$log ne $gen}]
71
+ }
5472
5573
# Basic parent/child linkage __________
5674
5775
method hasparent {} { return [expr {$myparent ne ""}] }
5876
method haschild {} { return [expr {$mychild ne ""}] }
@@ -82,10 +100,11 @@
82100
set myparentbranch $branch
83101
return
84102
}
85103
86104
method parentbranch {} { return $myparentbranch }
105
+ method branches {} { return $mybranches }
87106
88107
method addbranch {branch} {
89108
lappend mybranches $branch
90109
return
91110
}
@@ -147,17 +166,32 @@
147166
}
148167
set mybranches {}
149168
set mybranchchildren {}
150169
return
151170
}
171
+
172
+ method removeallbranches {} {
173
+ foreach branch $mybranches {
174
+ $branch destroy
175
+ }
176
+ set mybranches {}
177
+ set mybranchchildren {}
178
+ return
179
+ }
152180
153181
# Tag linkage _________________________
154182
155183
method addtag {tag} {
156184
lappend mytags $tag
157185
return
158186
}
187
+
188
+ method removealltags {} {
189
+ foreach tag $mytags { $tag destroy }
190
+ set mytags {}
191
+ return
192
+ }
159193
160194
method movetagsto {rev} {
161195
set revlod [$rev lod]
162196
foreach tag $mytags {
163197
$rev addtag $tag
164198
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -49,10 +49,28 @@
49
50 method revnr {} { return $myrevnr }
51 method state {} { return $mystate }
52 method lod {} { return $mylod }
53 method date {} { return $mydate }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
55 # Basic parent/child linkage __________
56
57 method hasparent {} { return [expr {$myparent ne ""}] }
58 method haschild {} { return [expr {$mychild ne ""}] }
@@ -82,10 +100,11 @@
82 set myparentbranch $branch
83 return
84 }
85
86 method parentbranch {} { return $myparentbranch }
 
87
88 method addbranch {branch} {
89 lappend mybranches $branch
90 return
91 }
@@ -147,17 +166,32 @@
147 }
148 set mybranches {}
149 set mybranchchildren {}
150 return
151 }
 
 
 
 
 
 
 
 
 
152
153 # Tag linkage _________________________
154
155 method addtag {tag} {
156 lappend mytags $tag
157 return
158 }
 
 
 
 
 
 
159
160 method movetagsto {rev} {
161 set revlod [$rev lod]
162 foreach tag $mytags {
163 $rev addtag $tag
164
--- tools/cvs2fossil/lib/c2f_frev.tcl
+++ tools/cvs2fossil/lib/c2f_frev.tcl
@@ -49,10 +49,28 @@
49
50 method revnr {} { return $myrevnr }
51 method state {} { return $mystate }
52 method lod {} { return $mylod }
53 method date {} { return $mydate }
54
55 method isneeded {} {
56 if {$myoperation ne "nothing"} {return 1}
57 if {$myrevnr ne "1.1"} {return 1}
58 if {![$mylod istrunk]} {return 1}
59 if {![llength $mybranches]} {return 1}
60 set firstbranch [lindex $mybranches 0]
61 if {![$firstbranch haschild]} {return 1}
62 if {$myisondefaultbranch} {return 1}
63
64 # FIX: This message will not match if the RCS file was renamed
65 # manually after it was created.
66
67 set gen "file [file tail [$myfile usrpath]] was initially added on branch [$firstbranch name]."
68 set log [$myfile commitmessageof $mymetaid]
69
70 return [expr {$log ne $gen}]
71 }
72
73 # Basic parent/child linkage __________
74
75 method hasparent {} { return [expr {$myparent ne ""}] }
76 method haschild {} { return [expr {$mychild ne ""}] }
@@ -82,10 +100,11 @@
100 set myparentbranch $branch
101 return
102 }
103
104 method parentbranch {} { return $myparentbranch }
105 method branches {} { return $mybranches }
106
107 method addbranch {branch} {
108 lappend mybranches $branch
109 return
110 }
@@ -147,17 +166,32 @@
166 }
167 set mybranches {}
168 set mybranchchildren {}
169 return
170 }
171
172 method removeallbranches {} {
173 foreach branch $mybranches {
174 $branch destroy
175 }
176 set mybranches {}
177 set mybranchchildren {}
178 return
179 }
180
181 # Tag linkage _________________________
182
183 method addtag {tag} {
184 lappend mytags $tag
185 return
186 }
187
188 method removealltags {} {
189 foreach tag $mytags { $tag destroy }
190 set mytags {}
191 return
192 }
193
194 method movetagsto {rev} {
195 set revlod [$rev lod]
196 foreach tag $mytags {
197 $rev addtag $tag
198
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -58,13 +58,14 @@
5858
5959
method files {} {
6060
return [TheFiles]
6161
}
6262
63
- delegate method defauthor to myrepository
64
- delegate method defcmessage to myrepository
65
- delegate method trunkonly to myrepository
63
+ delegate method defauthor to myrepository
64
+ delegate method defcmessage to myrepository
65
+ delegate method trunkonly to myrepository
66
+ delegate method commitmessageof to myrepository
6667
6768
method defmeta {bid aid cid} {
6869
return [$myrepository defmeta $myid $bid $aid $cid]
6970
}
7071
@@ -139,13 +140,13 @@
139140
}
140141
141142
proc EmptyFiles {fv} {
142143
upvar 1 $fv myfiles self self
143144
set res {}
144
- foreach item [lsort -dict [array names myfiles]] {
145
- struct::list assign $item f executable
146
- lappend res [file %AUTO% $f $executable $self]
145
+ foreach rcs [lsort -dict [array names myfiles]] {
146
+ struct::list assign $myfiles($rcs) f executable
147
+ lappend res [file %AUTO% $rcs $f $executable $self]
147148
}
148149
return $res
149150
}
150151
151152
# # ## ### ##### ######## #############
152153
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -58,13 +58,14 @@
58
59 method files {} {
60 return [TheFiles]
61 }
62
63 delegate method defauthor to myrepository
64 delegate method defcmessage to myrepository
65 delegate method trunkonly to myrepository
 
66
67 method defmeta {bid aid cid} {
68 return [$myrepository defmeta $myid $bid $aid $cid]
69 }
70
@@ -139,13 +140,13 @@
139 }
140
141 proc EmptyFiles {fv} {
142 upvar 1 $fv myfiles self self
143 set res {}
144 foreach item [lsort -dict [array names myfiles]] {
145 struct::list assign $item f executable
146 lappend res [file %AUTO% $f $executable $self]
147 }
148 return $res
149 }
150
151 # # ## ### ##### ######## #############
152
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -58,13 +58,14 @@
58
59 method files {} {
60 return [TheFiles]
61 }
62
63 delegate method defauthor to myrepository
64 delegate method defcmessage to myrepository
65 delegate method trunkonly to myrepository
66 delegate method commitmessageof to myrepository
67
68 method defmeta {bid aid cid} {
69 return [$myrepository defmeta $myid $bid $aid $cid]
70 }
71
@@ -139,13 +140,13 @@
140 }
141
142 proc EmptyFiles {fv} {
143 upvar 1 $fv myfiles self self
144 set res {}
145 foreach rcs [lsort -dict [array names myfiles]] {
146 struct::list assign $myfiles($rcs) f executable
147 lappend res [file %AUTO% $rcs $f $executable $self]
148 }
149 return $res
150 }
151
152 # # ## ### ##### ######## #############
153
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -83,12 +83,13 @@
8383
return $myauthor($a)
8484
}
8585
8686
typemethod defcmessage {cm} {
8787
if {![info exists mycmsg($cm)]} {
88
- set mycmsg($cm) [incr mycmsgcnt]
89
- log write 6 repository "cmessage '$cm' = $mycmsg($cm)"
88
+ set mycmsg($cm) [set cid [incr mycmsgcnt]]
89
+ set mycmsginv($cid) $cm
90
+ log write 6 repository "cmessage '$cm' = $cid"
9091
}
9192
return $mycmsg($cm)
9293
}
9394
9495
typemethod defsymbol {pid name} {
@@ -101,15 +102,21 @@
101102
}
102103
103104
typemethod defmeta {pid bid aid cid} {
104105
set key [list $pid $bid $aid $cid]
105106
if {![info exists mymeta($key)]} {
106
- set mymeta($key) [incr mymetacnt]
107
+ set mymeta($key) [set mid [incr mymetacnt]]
108
+ set mymetainv($mid) $key
107109
log write 6 repository "meta ($key) = $mymeta($key)"
108110
}
109111
return $mymeta($key)
110112
}
113
+
114
+ typemethod commitmessageof {metaid} {
115
+ struct::list assign $mymetainv($metaid) pid bid aid cid
116
+ return $mycmsginv($cid)
117
+ }
111118
112119
# pass I results
113120
typemethod printstatistics {} {
114121
set prlist [TheProjects]
115122
set npr [llength $prlist]
@@ -203,34 +210,35 @@
203210
}
204211
205212
# # ## ### ##### ######## #############
206213
## State
207214
208
- typevariable mybase {} ; # Base path to CVS repository.
209
- typevariable myprojpaths {} ; # List of paths to all declared
210
- # projects, relative to mybase.
211
- typevariable myprojects {} ; # List of objects for all
212
- # declared projects.
213
- typevariable myauthor -array {} ; # Names of all authors found,
214
- # maps to their ids.
215
- typevariable myauthorcnt 0 ; # Counter for author ids.
216
- typevariable mycmsg -array {} ; # All commit messages found,
217
- # maps to their ids.
218
- typevariable mycmsgcnt 0 ; # Counter for message ids.
219
- typevariable mymeta -array {} ; # Maps all meta data tuples
220
- # (project, branch, author,
221
- # cmessage) to their ids.
222
- typevariable mymetacnt 0 ; # Counter for meta ids.
223
- typevariable mysymbol -array {} ; # Map symbols identified by
224
- # project and name to their
225
- # id. This information is not
226
- # saved directly.
227
- typevariable mysymbolcnt 0 ; # Counter for symbol ids.
228
-
229
- typevariable mytrunkonly 0 ; # Boolean flag. Set by option
230
- # processing when the user
231
- # requested a trunk-only import
215
+ typevariable mybase {} ; # Base path to CVS repository.
216
+ typevariable myprojpaths {} ; # List of paths to all declared
217
+ # projects, relative to mybase.
218
+ typevariable myprojects {} ; # List of objects for all
219
+ # declared projects.
220
+ typevariable myauthor -array {} ; # Names of all authors found,
221
+ # maps to their ids.
222
+ typevariable myauthorcnt 0 ; # Counter for author ids.
223
+ typevariable mycmsg -array {} ; # All commit messages found,
224
+ # maps to their ids.
225
+ typevariable mycmsginv -array {} ; # Inverted index, keyed by id.
226
+ typevariable mycmsgcnt 0 ; # Counter for message ids.
227
+ typevariable mymeta -array {} ; # Maps all meta data tuples
228
+ # (project, branch, author,
229
+ # cmessage) to their ids.
230
+ typevariable mymetainv -array {} ; # Inverted index, keyed by id.
231
+ typevariable mymetacnt 0 ; # Counter for meta ids.
232
+ typevariable mysymbol -array {} ; # Map symbols identified by
233
+ # project and name to their
234
+ # id. This information is not
235
+ # saved directly.
236
+ typevariable mysymbolcnt 0 ; # Counter for symbol ids.
237
+ typevariable mytrunkonly 0 ; # Boolean flag. Set by option
238
+ # processing when the user
239
+ # requested a trunk-only import
232240
233241
# # ## ### ##### ######## #############
234242
## Internal methods
235243
236244
proc .BaseLength {p} {
237245
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -83,12 +83,13 @@
83 return $myauthor($a)
84 }
85
86 typemethod defcmessage {cm} {
87 if {![info exists mycmsg($cm)]} {
88 set mycmsg($cm) [incr mycmsgcnt]
89 log write 6 repository "cmessage '$cm' = $mycmsg($cm)"
 
90 }
91 return $mycmsg($cm)
92 }
93
94 typemethod defsymbol {pid name} {
@@ -101,15 +102,21 @@
101 }
102
103 typemethod defmeta {pid bid aid cid} {
104 set key [list $pid $bid $aid $cid]
105 if {![info exists mymeta($key)]} {
106 set mymeta($key) [incr mymetacnt]
 
107 log write 6 repository "meta ($key) = $mymeta($key)"
108 }
109 return $mymeta($key)
110 }
 
 
 
 
 
111
112 # pass I results
113 typemethod printstatistics {} {
114 set prlist [TheProjects]
115 set npr [llength $prlist]
@@ -203,34 +210,35 @@
203 }
204
205 # # ## ### ##### ######## #############
206 ## State
207
208 typevariable mybase {} ; # Base path to CVS repository.
209 typevariable myprojpaths {} ; # List of paths to all declared
210 # projects, relative to mybase.
211 typevariable myprojects {} ; # List of objects for all
212 # declared projects.
213 typevariable myauthor -array {} ; # Names of all authors found,
214 # maps to their ids.
215 typevariable myauthorcnt 0 ; # Counter for author ids.
216 typevariable mycmsg -array {} ; # All commit messages found,
217 # maps to their ids.
218 typevariable mycmsgcnt 0 ; # Counter for message ids.
219 typevariable mymeta -array {} ; # Maps all meta data tuples
220 # (project, branch, author,
221 # cmessage) to their ids.
222 typevariable mymetacnt 0 ; # Counter for meta ids.
223 typevariable mysymbol -array {} ; # Map symbols identified by
224 # project and name to their
225 # id. This information is not
226 # saved directly.
227 typevariable mysymbolcnt 0 ; # Counter for symbol ids.
228
229 typevariable mytrunkonly 0 ; # Boolean flag. Set by option
230 # processing when the user
231 # requested a trunk-only import
 
232
233 # # ## ### ##### ######## #############
234 ## Internal methods
235
236 proc .BaseLength {p} {
237
--- tools/cvs2fossil/lib/c2f_repository.tcl
+++ tools/cvs2fossil/lib/c2f_repository.tcl
@@ -83,12 +83,13 @@
83 return $myauthor($a)
84 }
85
86 typemethod defcmessage {cm} {
87 if {![info exists mycmsg($cm)]} {
88 set mycmsg($cm) [set cid [incr mycmsgcnt]]
89 set mycmsginv($cid) $cm
90 log write 6 repository "cmessage '$cm' = $cid"
91 }
92 return $mycmsg($cm)
93 }
94
95 typemethod defsymbol {pid name} {
@@ -101,15 +102,21 @@
102 }
103
104 typemethod defmeta {pid bid aid cid} {
105 set key [list $pid $bid $aid $cid]
106 if {![info exists mymeta($key)]} {
107 set mymeta($key) [set mid [incr mymetacnt]]
108 set mymetainv($mid) $key
109 log write 6 repository "meta ($key) = $mymeta($key)"
110 }
111 return $mymeta($key)
112 }
113
114 typemethod commitmessageof {metaid} {
115 struct::list assign $mymetainv($metaid) pid bid aid cid
116 return $mycmsginv($cid)
117 }
118
119 # pass I results
120 typemethod printstatistics {} {
121 set prlist [TheProjects]
122 set npr [llength $prlist]
@@ -203,34 +210,35 @@
210 }
211
212 # # ## ### ##### ######## #############
213 ## State
214
215 typevariable mybase {} ; # Base path to CVS repository.
216 typevariable myprojpaths {} ; # List of paths to all declared
217 # projects, relative to mybase.
218 typevariable myprojects {} ; # List of objects for all
219 # declared projects.
220 typevariable myauthor -array {} ; # Names of all authors found,
221 # maps to their ids.
222 typevariable myauthorcnt 0 ; # Counter for author ids.
223 typevariable mycmsg -array {} ; # All commit messages found,
224 # maps to their ids.
225 typevariable mycmsginv -array {} ; # Inverted index, keyed by id.
226 typevariable mycmsgcnt 0 ; # Counter for message ids.
227 typevariable mymeta -array {} ; # Maps all meta data tuples
228 # (project, branch, author,
229 # cmessage) to their ids.
230 typevariable mymetainv -array {} ; # Inverted index, keyed by id.
231 typevariable mymetacnt 0 ; # Counter for meta ids.
232 typevariable mysymbol -array {} ; # Map symbols identified by
233 # project and name to their
234 # id. This information is not
235 # saved directly.
236 typevariable mysymbolcnt 0 ; # Counter for symbol ids.
237 typevariable mytrunkonly 0 ; # Boolean flag. Set by option
238 # processing when the user
239 # requested a trunk-only import
240
241 # # ## ### ##### ######## #############
242 ## Internal methods
243
244 proc .BaseLength {p} {
245

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button