Fossil SCM

Merge with aku's branch.

drh 2008-02-13 14:44 trunk merge
Commit be2f99e6a4959f10c57fd2e198080b60da565897
--- cvs2fossil.txt
+++ cvs2fossil.txt
@@ -7,5 +7,36 @@
77
tcllib, or a single subproject of tcllib, like tklib, but not
88
multiple sub-projects in one go.
99
1010
* We have to look into the pass 'InitCsets' and hunt for the
1111
cause of the large amount of memory it is gobbling up.
12
+
13
+* Look at the dependencies on external packages and consider
14
+ which of them can be moved into the importer, either as a
15
+ simple utility command, or wholesale.
16
+
17
+ struct::list
18
+ assign, map, reverse, filter
19
+
20
+ Very few and self-contained commands.
21
+
22
+ struct::set
23
+ size, empty, contains, add, include, exclude,
24
+ intersect, subsetof
25
+
26
+ Most of the core commands.
27
+
28
+ fileutil
29
+ cat, appendToFile, writeFile,
30
+ tempfile, stripPath, test
31
+
32
+ fileutil::traverse
33
+ In toto
34
+
35
+ struct::graph
36
+ In toto
37
+
38
+ snit
39
+ In toto
40
+
41
+ sqlite3
42
+ In tota
1243
--- cvs2fossil.txt
+++ cvs2fossil.txt
@@ -7,5 +7,36 @@
7 tcllib, or a single subproject of tcllib, like tklib, but not
8 multiple sub-projects in one go.
9
10 * We have to look into the pass 'InitCsets' and hunt for the
11 cause of the large amount of memory it is gobbling up.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
--- cvs2fossil.txt
+++ cvs2fossil.txt
@@ -7,5 +7,36 @@
7 tcllib, or a single subproject of tcllib, like tklib, but not
8 multiple sub-projects in one go.
9
10 * We have to look into the pass 'InitCsets' and hunt for the
11 cause of the large amount of memory it is gobbling up.
12
13 * Look at the dependencies on external packages and consider
14 which of them can be moved into the importer, either as a
15 simple utility command, or wholesale.
16
17 struct::list
18 assign, map, reverse, filter
19
20 Very few and self-contained commands.
21
22 struct::set
23 size, empty, contains, add, include, exclude,
24 intersect, subsetof
25
26 Most of the core commands.
27
28 fileutil
29 cat, appendToFile, writeFile,
30 tempfile, stripPath, test
31
32 fileutil::traverse
33 In toto
34
35 struct::graph
36 In toto
37
38 snit
39 In toto
40
41 sqlite3
42 In tota
43
--- tools/cvs2fossil/lib/c2f_fossil.tcl
+++ tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -140,10 +140,12 @@
140140
Do rebuild [::file nativename $myrepository]
141141
142142
::file rename -force $myrepository $destination
143143
::file delete -force $myworkspace
144144
$self destroy
145
+
146
+ log write 2 fossil {destination $destination}
145147
return
146148
}
147149
148150
# # ## ### ##### ######## #############
149151
##
150152
--- tools/cvs2fossil/lib/c2f_fossil.tcl
+++ tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -140,10 +140,12 @@
140 Do rebuild [::file nativename $myrepository]
141
142 ::file rename -force $myrepository $destination
143 ::file delete -force $myworkspace
144 $self destroy
 
 
145 return
146 }
147
148 # # ## ### ##### ######## #############
149 ##
150
--- tools/cvs2fossil/lib/c2f_fossil.tcl
+++ tools/cvs2fossil/lib/c2f_fossil.tcl
@@ -140,10 +140,12 @@
140 Do rebuild [::file nativename $myrepository]
141
142 ::file rename -force $myrepository $destination
143 ::file delete -force $myworkspace
144 $self destroy
145
146 log write 2 fossil {destination $destination}
147 return
148 }
149
150 # # ## ### ##### ######## #############
151 ##
152
--- tools/cvs2fossil/lib/c2f_option.tcl
+++ tools/cvs2fossil/lib/c2f_option.tcl
@@ -41,10 +41,11 @@
4141
4242
# --help, --help-passes, -h
4343
# --version
4444
# -p, --pass, --passes
4545
# --ignore-conflicting-attics
46
+ # --convert-dotfiles
4647
# --project
4748
# -v, --verbose
4849
# -q, --quiet
4950
# --state (conversion status, ala config.cache)
5051
# --trunk-only
@@ -70,10 +71,11 @@
7071
--version { PrintVersion ; exit 0 }
7172
-p -
7273
--pass -
7374
--passes { pass select [Value arguments] }
7475
--ignore-conflicting-attics { collar ignore_conflicting_attics }
76
+ --convert-dotfiles { collar accept_and_convert_dotfiles }
7577
--project { repository add [Value arguments] }
7678
-v -
7779
--verbose { log verbose }
7880
-q -
7981
--quiet { log quiet }
@@ -128,10 +130,15 @@
128130
trouble info ""
129131
trouble info " --ignore-conflicting-attics"
130132
trouble info " Prevent abort when conflicting archives"
131133
trouble info " were found in both regular and Attic."
132134
trouble info ""
135
+ trouble info " --convert-dotfiles"
136
+ trouble info " Prevent abort when dot-files were found,"
137
+ trouble info " causing their conversion to nondot-form"
138
+ trouble info " instead."
139
+ trouble info ""
133140
trouble info " --state PATH Save state to the specified file, and"
134141
trouble info " load state of previous runs from it too."
135142
trouble info ""
136143
trouble info " --exclude ?PROJECT:?SYMBOL Exclude the named symbol from all or"
137144
trouble info " just the specified project. Both project"
138145
--- tools/cvs2fossil/lib/c2f_option.tcl
+++ tools/cvs2fossil/lib/c2f_option.tcl
@@ -41,10 +41,11 @@
41
42 # --help, --help-passes, -h
43 # --version
44 # -p, --pass, --passes
45 # --ignore-conflicting-attics
 
46 # --project
47 # -v, --verbose
48 # -q, --quiet
49 # --state (conversion status, ala config.cache)
50 # --trunk-only
@@ -70,10 +71,11 @@
70 --version { PrintVersion ; exit 0 }
71 -p -
72 --pass -
73 --passes { pass select [Value arguments] }
74 --ignore-conflicting-attics { collar ignore_conflicting_attics }
 
75 --project { repository add [Value arguments] }
76 -v -
77 --verbose { log verbose }
78 -q -
79 --quiet { log quiet }
@@ -128,10 +130,15 @@
128 trouble info ""
129 trouble info " --ignore-conflicting-attics"
130 trouble info " Prevent abort when conflicting archives"
131 trouble info " were found in both regular and Attic."
132 trouble info ""
 
 
 
 
 
133 trouble info " --state PATH Save state to the specified file, and"
134 trouble info " load state of previous runs from it too."
135 trouble info ""
136 trouble info " --exclude ?PROJECT:?SYMBOL Exclude the named symbol from all or"
137 trouble info " just the specified project. Both project"
138
--- tools/cvs2fossil/lib/c2f_option.tcl
+++ tools/cvs2fossil/lib/c2f_option.tcl
@@ -41,10 +41,11 @@
41
42 # --help, --help-passes, -h
43 # --version
44 # -p, --pass, --passes
45 # --ignore-conflicting-attics
46 # --convert-dotfiles
47 # --project
48 # -v, --verbose
49 # -q, --quiet
50 # --state (conversion status, ala config.cache)
51 # --trunk-only
@@ -70,10 +71,11 @@
71 --version { PrintVersion ; exit 0 }
72 -p -
73 --pass -
74 --passes { pass select [Value arguments] }
75 --ignore-conflicting-attics { collar ignore_conflicting_attics }
76 --convert-dotfiles { collar accept_and_convert_dotfiles }
77 --project { repository add [Value arguments] }
78 -v -
79 --verbose { log verbose }
80 -q -
81 --quiet { log quiet }
@@ -128,10 +130,15 @@
130 trouble info ""
131 trouble info " --ignore-conflicting-attics"
132 trouble info " Prevent abort when conflicting archives"
133 trouble info " were found in both regular and Attic."
134 trouble info ""
135 trouble info " --convert-dotfiles"
136 trouble info " Prevent abort when dot-files were found,"
137 trouble info " causing their conversion to nondot-form"
138 trouble info " instead."
139 trouble info ""
140 trouble info " --state PATH Save state to the specified file, and"
141 trouble info " load state of previous runs from it too."
142 trouble info ""
143 trouble info " --exclude ?PROJECT:?SYMBOL Exclude the named symbol from all or"
144 trouble info " just the specified project. Both project"
145
--- tools/cvs2fossil/lib/c2f_pass.tcl
+++ tools/cvs2fossil/lib/c2f_pass.tcl
@@ -143,18 +143,35 @@
143143
return
144144
}
145145
146146
proc ShowTimes {} {
147147
::variable mytime
148
+ set total 0
148149
foreach {pass seconds} $mytime {
149150
ShowTime $pass $seconds
151
+ incr total $seconds
150152
}
153
+ ShowTime Total $total
151154
return
152155
}
153156
154157
proc ShowTime {pass seconds} {
155
- log write 0 pass "[format %8d $seconds] sec/$pass"
158
+ if {$seconds > 3600} {
159
+ set hr [expr {$seconds / 3600}]
160
+ set min [expr {$seconds % 3600}]
161
+ set sec [expr {$min % 60}]
162
+ set min [expr {$min / 60}]
163
+
164
+ log write 0 pass "[format %8d $seconds] sec/$pass ([nsp $hr hour] [nsp $min minute] [nsp $sec second])"
165
+ } elseif {$seconds > 60} {
166
+ set min [expr {$seconds / 60}]
167
+ set sec [expr {$seconds % 60}]
168
+
169
+ log write 0 pass "[format %8d $seconds] sec/$pass ([nsp $min minute] [nsp $sec second])"
170
+ } else {
171
+ log write 0 pass "[format %8d $seconds] sec/$pass"
172
+ }
156173
return
157174
}
158175
159176
proc Ok? {code label ov {emptyok 1}} {
160177
upvar 1 $ov ok
161178
--- tools/cvs2fossil/lib/c2f_pass.tcl
+++ tools/cvs2fossil/lib/c2f_pass.tcl
@@ -143,18 +143,35 @@
143 return
144 }
145
146 proc ShowTimes {} {
147 ::variable mytime
 
148 foreach {pass seconds} $mytime {
149 ShowTime $pass $seconds
 
150 }
 
151 return
152 }
153
154 proc ShowTime {pass seconds} {
155 log write 0 pass "[format %8d $seconds] sec/$pass"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156 return
157 }
158
159 proc Ok? {code label ov {emptyok 1}} {
160 upvar 1 $ov ok
161
--- tools/cvs2fossil/lib/c2f_pass.tcl
+++ tools/cvs2fossil/lib/c2f_pass.tcl
@@ -143,18 +143,35 @@
143 return
144 }
145
146 proc ShowTimes {} {
147 ::variable mytime
148 set total 0
149 foreach {pass seconds} $mytime {
150 ShowTime $pass $seconds
151 incr total $seconds
152 }
153 ShowTime Total $total
154 return
155 }
156
157 proc ShowTime {pass seconds} {
158 if {$seconds > 3600} {
159 set hr [expr {$seconds / 3600}]
160 set min [expr {$seconds % 3600}]
161 set sec [expr {$min % 60}]
162 set min [expr {$min / 60}]
163
164 log write 0 pass "[format %8d $seconds] sec/$pass ([nsp $hr hour] [nsp $min minute] [nsp $sec second])"
165 } elseif {$seconds > 60} {
166 set min [expr {$seconds / 60}]
167 set sec [expr {$seconds % 60}]
168
169 log write 0 pass "[format %8d $seconds] sec/$pass ([nsp $min minute] [nsp $sec second])"
170 } else {
171 log write 0 pass "[format %8d $seconds] sec/$pass"
172 }
173 return
174 }
175
176 proc Ok? {code label ov {emptyok 1}} {
177 upvar 1 $ov ok
178
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -111,23 +111,13 @@
111111
set rcs [fileutil::stripPath $base $path]
112112
if {[IsCVSAdmin $rcs]} continue
113113
if {![IsRCSArchive $path]} continue
114114
115115
set usr [UserPath $rcs isattic]
116
- if {[IsSuperceded $base $rcs $usr $isattic]} continue
117
-
118
- # XXX Checkme: not sure if this will still fail in the case where a directory does conflict with a file XXX
119
- if {
120
- [fileexists_cs $base/$usr] &&
121
- [fileisdir_cs $base/$usr]
122
- } {
123
- trouble fatal "Directory name conflicts with filename."
124
- trouble fatal "Please remove or rename one of the following:"
125
- trouble fatal " $base/$usr"
126
- trouble fatal " $base/$rcs"
127
- continue
128
- }
116
+
117
+ if {[CheckForAndReportPathConflicts $base $rcs $usr $isattic]} continue
118
+ if {[HandleDotFile $base $rcs usr $isattic]} continue
129119
130120
log write 4 collar "Found $rcs"
131121
$project addfile $rcs $usr [file executable $rcs]
132122
133123
incr n
@@ -158,15 +148,26 @@
158148
159149
typemethod ignore_conflicting_attics {} {
160150
set myignore 1
161151
return
162152
}
153
+
154
+ typemethod accept_and_convert_dotfiles {} {
155
+ set myconvertdot 1
156
+ return
157
+ }
163158
164159
# # ## ### ##### ######## #############
165160
## Internal methods
166161
167
- typevariable myignore 0
162
+ typevariable myignore 0 ; # Flag. When set Attic files
163
+ # superceded by regular files
164
+ # ignored.
165
+ typevariable myconvertdot 0 ; # Flag. When set dotfiles do not
166
+ # cause rejection, but their names
167
+ # are converted to a dotless form
168
+ # ('dot-' prefix instead of '.').
168169
169170
proc FilterAtticSubdir {base path} {
170171
# This command is used by the traverser to prevent it from
171172
# scanning into subdirectories of an Attic. We get away with
172173
# checking the immediate parent directory of the current path
@@ -186,13 +187,18 @@
186187
trouble warn $msg
187188
return 0
188189
}
189190
190191
proc IsCVSAdmin {rcs} {
191
- if {![string match CVSROOT/* $rcs]} {return 0}
192
- log write 4 collar "Ignored $rcs, administrative archive"
193
- return 1
192
+ if {
193
+ [string match {CVSROOT/*} $rcs] ||
194
+ [string match {.cvsignore*} [file tail $rcs]]
195
+ } {
196
+ log write 4 collar "Ignored $rcs, administrative archive"
197
+ return 1
198
+ }
199
+ return 0
194200
}
195201
196202
proc UserPath {rcs iav} {
197203
upvar 1 $iav isattic
198204
@@ -237,10 +243,72 @@
237243
} else {
238244
trouble warn "Ignored $rcs, superceded archive"
239245
}
240246
return 1
241247
}
248
+
249
+ # In the future we should move the activity below into the fossil
250
+ # backend, as the exact set of paths requiring translation, and
251
+ # how to translate them, depends entirely on the limitations
252
+ # imposed by the destination repository.
253
+
254
+ proc HandleDotFile {base rcs usrvar isattic} {
255
+ ::variable myconvertdot
256
+ upvar 1 $usrvar usr
257
+
258
+ set dedot [DeDot $usr]
259
+ if {$dedot eq $usr} { return 0 }
260
+
261
+ # Ok, we now have established that the path has to be
262
+ # translated. Which as already happened as part of the check
263
+ # above. Left is to report the action, and to check if the new
264
+ # path collides with existing files and directories.
265
+
266
+ if {!$myconvertdot} {
267
+ trouble warn "Ignored $rcs, is a dot-file"
268
+ return 1
269
+ }
270
+
271
+ log write 2 collar "Convert $rcs, is a dot-file"
272
+ set usr $dedot
273
+
274
+ return [CheckForAndReportPathConflicts $base $rcs $usr $isattic]
275
+ }
276
+
277
+ proc DeDot {path} {
278
+ set res {}
279
+ foreach segment [file split $path] {
280
+ lappend res [expr {
281
+ [string match {.*} $segment]
282
+ ? "dot-[string range $segment 1 end]"
283
+ : $segment
284
+ }]
285
+ }
286
+ return [eval [linsert $res 0 file join]]
287
+ #8.5: return [file join {*}$res]
288
+ }
289
+
290
+ proc CheckForAndReportPathConflicts {base rcs usr isattic {intro {}}} {
291
+ if {[IsSuperceded $base $rcs $usr $isattic]} { return 1 }
292
+
293
+ # XXX Checkme: not sure if this will still fail in the case
294
+ # where a directory does conflict with a file XXX
295
+ if {
296
+ [fileexists_cs $base/$usr] &&
297
+ [fileisdir_cs $base/$usr]
298
+ } {
299
+ if {$intro ne {}} {
300
+ trouble fatal $intro
301
+ }
302
+ trouble fatal "Directory name conflicts with filename."
303
+ trouble fatal "Please remove or rename one of the following:"
304
+ trouble fatal " $base/$usr"
305
+ trouble fatal " $base/$rcs"
306
+ return 1
307
+ }
308
+ return 0
309
+ }
242310
243311
# # ## ### ##### ######## #############
244312
## Configuration
245313
246314
pragma -hasinstances no ; # singleton
247315
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -111,23 +111,13 @@
111 set rcs [fileutil::stripPath $base $path]
112 if {[IsCVSAdmin $rcs]} continue
113 if {![IsRCSArchive $path]} continue
114
115 set usr [UserPath $rcs isattic]
116 if {[IsSuperceded $base $rcs $usr $isattic]} continue
117
118 # XXX Checkme: not sure if this will still fail in the case where a directory does conflict with a file XXX
119 if {
120 [fileexists_cs $base/$usr] &&
121 [fileisdir_cs $base/$usr]
122 } {
123 trouble fatal "Directory name conflicts with filename."
124 trouble fatal "Please remove or rename one of the following:"
125 trouble fatal " $base/$usr"
126 trouble fatal " $base/$rcs"
127 continue
128 }
129
130 log write 4 collar "Found $rcs"
131 $project addfile $rcs $usr [file executable $rcs]
132
133 incr n
@@ -158,15 +148,26 @@
158
159 typemethod ignore_conflicting_attics {} {
160 set myignore 1
161 return
162 }
 
 
 
 
 
163
164 # # ## ### ##### ######## #############
165 ## Internal methods
166
167 typevariable myignore 0
 
 
 
 
 
 
168
169 proc FilterAtticSubdir {base path} {
170 # This command is used by the traverser to prevent it from
171 # scanning into subdirectories of an Attic. We get away with
172 # checking the immediate parent directory of the current path
@@ -186,13 +187,18 @@
186 trouble warn $msg
187 return 0
188 }
189
190 proc IsCVSAdmin {rcs} {
191 if {![string match CVSROOT/* $rcs]} {return 0}
192 log write 4 collar "Ignored $rcs, administrative archive"
193 return 1
 
 
 
 
 
194 }
195
196 proc UserPath {rcs iav} {
197 upvar 1 $iav isattic
198
@@ -237,10 +243,72 @@
237 } else {
238 trouble warn "Ignored $rcs, superceded archive"
239 }
240 return 1
241 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
243 # # ## ### ##### ######## #############
244 ## Configuration
245
246 pragma -hasinstances no ; # singleton
247
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -111,23 +111,13 @@
111 set rcs [fileutil::stripPath $base $path]
112 if {[IsCVSAdmin $rcs]} continue
113 if {![IsRCSArchive $path]} continue
114
115 set usr [UserPath $rcs isattic]
116
117 if {[CheckForAndReportPathConflicts $base $rcs $usr $isattic]} continue
118 if {[HandleDotFile $base $rcs usr $isattic]} continue
 
 
 
 
 
 
 
 
 
 
119
120 log write 4 collar "Found $rcs"
121 $project addfile $rcs $usr [file executable $rcs]
122
123 incr n
@@ -158,15 +148,26 @@
148
149 typemethod ignore_conflicting_attics {} {
150 set myignore 1
151 return
152 }
153
154 typemethod accept_and_convert_dotfiles {} {
155 set myconvertdot 1
156 return
157 }
158
159 # # ## ### ##### ######## #############
160 ## Internal methods
161
162 typevariable myignore 0 ; # Flag. When set Attic files
163 # superceded by regular files
164 # ignored.
165 typevariable myconvertdot 0 ; # Flag. When set dotfiles do not
166 # cause rejection, but their names
167 # are converted to a dotless form
168 # ('dot-' prefix instead of '.').
169
170 proc FilterAtticSubdir {base path} {
171 # This command is used by the traverser to prevent it from
172 # scanning into subdirectories of an Attic. We get away with
173 # checking the immediate parent directory of the current path
@@ -186,13 +187,18 @@
187 trouble warn $msg
188 return 0
189 }
190
191 proc IsCVSAdmin {rcs} {
192 if {
193 [string match {CVSROOT/*} $rcs] ||
194 [string match {.cvsignore*} [file tail $rcs]]
195 } {
196 log write 4 collar "Ignored $rcs, administrative archive"
197 return 1
198 }
199 return 0
200 }
201
202 proc UserPath {rcs iav} {
203 upvar 1 $iav isattic
204
@@ -237,10 +243,72 @@
243 } else {
244 trouble warn "Ignored $rcs, superceded archive"
245 }
246 return 1
247 }
248
249 # In the future we should move the activity below into the fossil
250 # backend, as the exact set of paths requiring translation, and
251 # how to translate them, depends entirely on the limitations
252 # imposed by the destination repository.
253
254 proc HandleDotFile {base rcs usrvar isattic} {
255 ::variable myconvertdot
256 upvar 1 $usrvar usr
257
258 set dedot [DeDot $usr]
259 if {$dedot eq $usr} { return 0 }
260
261 # Ok, we now have established that the path has to be
262 # translated. Which as already happened as part of the check
263 # above. Left is to report the action, and to check if the new
264 # path collides with existing files and directories.
265
266 if {!$myconvertdot} {
267 trouble warn "Ignored $rcs, is a dot-file"
268 return 1
269 }
270
271 log write 2 collar "Convert $rcs, is a dot-file"
272 set usr $dedot
273
274 return [CheckForAndReportPathConflicts $base $rcs $usr $isattic]
275 }
276
277 proc DeDot {path} {
278 set res {}
279 foreach segment [file split $path] {
280 lappend res [expr {
281 [string match {.*} $segment]
282 ? "dot-[string range $segment 1 end]"
283 : $segment
284 }]
285 }
286 return [eval [linsert $res 0 file join]]
287 #8.5: return [file join {*}$res]
288 }
289
290 proc CheckForAndReportPathConflicts {base rcs usr isattic {intro {}}} {
291 if {[IsSuperceded $base $rcs $usr $isattic]} { return 1 }
292
293 # XXX Checkme: not sure if this will still fail in the case
294 # where a directory does conflict with a file XXX
295 if {
296 [fileexists_cs $base/$usr] &&
297 [fileisdir_cs $base/$usr]
298 } {
299 if {$intro ne {}} {
300 trouble fatal $intro
301 }
302 trouble fatal "Directory name conflicts with filename."
303 trouble fatal "Please remove or rename one of the following:"
304 trouble fatal " $base/$usr"
305 trouble fatal " $base/$rcs"
306 return 1
307 }
308 return 0
309 }
310
311 # # ## ### ##### ######## #############
312 ## Configuration
313
314 pragma -hasinstances no ; # singleton
315
--- tools/cvs2fossil/lib/c2f_pimport.tcl
+++ tools/cvs2fossil/lib/c2f_pimport.tcl
@@ -103,11 +103,17 @@
103103
$rstate destroy
104104
105105
# At last copy the temporary repository file to its final
106106
# destination and release the associated memory.
107107
108
- $fossil finalize [$project base].fsl
108
+ set destination [$project base]
109
+ if {$destination eq ""} {
110
+ set destination [file tail [repository base?]]
111
+ }
112
+ append destination .fsl
113
+
114
+ $fossil finalize $destination
109115
}
110116
111117
# This does not live beyond the pass. We use the state for the
112118
# data despite its transient nature to keep the memory
113119
# requirements down.
114120
--- tools/cvs2fossil/lib/c2f_pimport.tcl
+++ tools/cvs2fossil/lib/c2f_pimport.tcl
@@ -103,11 +103,17 @@
103 $rstate destroy
104
105 # At last copy the temporary repository file to its final
106 # destination and release the associated memory.
107
108 $fossil finalize [$project base].fsl
 
 
 
 
 
 
109 }
110
111 # This does not live beyond the pass. We use the state for the
112 # data despite its transient nature to keep the memory
113 # requirements down.
114
--- tools/cvs2fossil/lib/c2f_pimport.tcl
+++ tools/cvs2fossil/lib/c2f_pimport.tcl
@@ -103,11 +103,17 @@
103 $rstate destroy
104
105 # At last copy the temporary repository file to its final
106 # destination and release the associated memory.
107
108 set destination [$project base]
109 if {$destination eq ""} {
110 set destination [file tail [repository base?]]
111 }
112 append destination .fsl
113
114 $fossil finalize $destination
115 }
116
117 # This does not live beyond the pass. We use the state for the
118 # data despite its transient nature to keep the memory
119 # requirements down.
120
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -497,20 +497,36 @@
497497
# (a) root of a vendor branch,
498498
# (b) root of the trunk LOD, or
499499
# (c) the first changeset in a new LOD which was spawned from
500500
# an existing LOD.
501501
502
- if {$isdefault || ($lodname eq ":trunk:")} {
503
- # For both (a) and (b) we have to create a new workspace
504
- # for the lod, and it doesn't inherit from anything.
505
-
506
- # Note that case (b) may never occur. See the variable
507
- # 'lastdefaultontrunk' in the caller (method pushto). This
508
- # flag can the generation of the workspace for the :trunk:
509
- # LOD as well, making it inherit the state of the last
510
- # trunk-changeset on the vendor-branch.
511
-
502
+ # For both (a) and (b) we have to create a new workspace for
503
+ # the lod, and it doesn't inherit from anything.
504
+
505
+ # One exception for (a). If we already have a :vendor: branch
506
+ # then multiple symbols were used for the vendor branch by
507
+ # different files. In that case the 'new' branch is made an
508
+ # alias of the :vendor:, effectively merging the symbols
509
+ # together.
510
+
511
+ # Note that case (b) may never occur. See the variable
512
+ # 'lastdefaultontrunk' in the caller (method pushto). This
513
+ # flag can the generation of the workspace for the :trunk: LOD
514
+ # as well, making it inherit the state of the last
515
+ # trunk-changeset on the vendor-branch.
516
+
517
+ if {$isdefault} {
518
+ if {![$rstate has ":vendor:"]} {
519
+ # Create the vendor branch if not present already.
520
+ $rstate new :vendor:
521
+ }
522
+ # Merge the new symbol to the vendor branch
523
+ $rstate dup $lodname <-- :vendor:
524
+ return [$rstate get $lodname]
525
+ }
526
+
527
+ if {$lodname eq ":trunk:"} {
512528
return [$rstate new $lodname]
513529
}
514530
515531
# Case (c). We find the parent LOD of our LOD and let the new
516532
# workspace inherit from the parent's workspace.
517533
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -497,20 +497,36 @@
497 # (a) root of a vendor branch,
498 # (b) root of the trunk LOD, or
499 # (c) the first changeset in a new LOD which was spawned from
500 # an existing LOD.
501
502 if {$isdefault || ($lodname eq ":trunk:")} {
503 # For both (a) and (b) we have to create a new workspace
504 # for the lod, and it doesn't inherit from anything.
505
506 # Note that case (b) may never occur. See the variable
507 # 'lastdefaultontrunk' in the caller (method pushto). This
508 # flag can the generation of the workspace for the :trunk:
509 # LOD as well, making it inherit the state of the last
510 # trunk-changeset on the vendor-branch.
511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512 return [$rstate new $lodname]
513 }
514
515 # Case (c). We find the parent LOD of our LOD and let the new
516 # workspace inherit from the parent's workspace.
517
--- tools/cvs2fossil/lib/c2f_prev.tcl
+++ tools/cvs2fossil/lib/c2f_prev.tcl
@@ -497,20 +497,36 @@
497 # (a) root of a vendor branch,
498 # (b) root of the trunk LOD, or
499 # (c) the first changeset in a new LOD which was spawned from
500 # an existing LOD.
501
502 # For both (a) and (b) we have to create a new workspace for
503 # the lod, and it doesn't inherit from anything.
504
505 # One exception for (a). If we already have a :vendor: branch
506 # then multiple symbols were used for the vendor branch by
507 # different files. In that case the 'new' branch is made an
508 # alias of the :vendor:, effectively merging the symbols
509 # together.
510
511 # Note that case (b) may never occur. See the variable
512 # 'lastdefaultontrunk' in the caller (method pushto). This
513 # flag can the generation of the workspace for the :trunk: LOD
514 # as well, making it inherit the state of the last
515 # trunk-changeset on the vendor-branch.
516
517 if {$isdefault} {
518 if {![$rstate has ":vendor:"]} {
519 # Create the vendor branch if not present already.
520 $rstate new :vendor:
521 }
522 # Merge the new symbol to the vendor branch
523 $rstate dup $lodname <-- :vendor:
524 return [$rstate get $lodname]
525 }
526
527 if {$lodname eq ":trunk:"} {
528 return [$rstate new $lodname]
529 }
530
531 # Case (c). We find the parent LOD of our LOD and let the new
532 # workspace inherit from the parent's workspace.
533
--- tools/cvs2fossil/lib/c2f_ristate.tcl
+++ tools/cvs2fossil/lib/c2f_ristate.tcl
@@ -68,10 +68,16 @@
6868
6969
method get {lod} { return $mystate($lod) }
7070
method has {lod} { return [info exists mystate($lod)] }
7171
7272
method names {} { return [array names mystate] }
73
+
74
+ method dup {dst _from_ src} {
75
+ log write 8 ristate {Duplicate workspace state for LOD "$dst" from "$src"}
76
+ set mystate($dst) $mystate($src)
77
+ return
78
+ }
7379
7480
# # ## ### ##### ######## #############
7581
## State
7682
7783
variable mystate -array {} ; # Map from lines of development
7884
--- tools/cvs2fossil/lib/c2f_ristate.tcl
+++ tools/cvs2fossil/lib/c2f_ristate.tcl
@@ -68,10 +68,16 @@
68
69 method get {lod} { return $mystate($lod) }
70 method has {lod} { return [info exists mystate($lod)] }
71
72 method names {} { return [array names mystate] }
 
 
 
 
 
 
73
74 # # ## ### ##### ######## #############
75 ## State
76
77 variable mystate -array {} ; # Map from lines of development
78
--- tools/cvs2fossil/lib/c2f_ristate.tcl
+++ tools/cvs2fossil/lib/c2f_ristate.tcl
@@ -68,10 +68,16 @@
68
69 method get {lod} { return $mystate($lod) }
70 method has {lod} { return [info exists mystate($lod)] }
71
72 method names {} { return [array names mystate] }
73
74 method dup {dst _from_ src} {
75 log write 8 ristate {Duplicate workspace state for LOD "$dst" from "$src"}
76 set mystate($dst) $mystate($src)
77 return
78 }
79
80 # # ## ### ##### ######## #############
81 ## State
82
83 variable mystate -array {} ; # Map from lines of development
84

Keyboard Shortcuts

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