Fossil SCM

Added stub for repository management, added most of pass I, collecting archives in the repository.

aku 2007-10-03 04:18 trunk
Commit 47740cc1f6e14ac2449d87a0fc28a6ef23106e18
--- tools/cvs2fossil/lib/c2f_option.tcl
+++ tools/cvs2fossil/lib/c2f_option.tcl
@@ -16,14 +16,16 @@
1616
## delegation
1717
1818
# # ## ### ##### ######## ############# #####################
1919
## Requirements
2020
21
-package require Tcl 8.4 ; # Required runtime.
22
-package require snit ; # OO system.
23
-package require vc::tools::trouble ; # Error reporting.
24
-package require vc::fossil::import::cvs::pass ; # Pass management
21
+package require Tcl 8.4 ; # Required runtime.
22
+package require snit ; # OO system.
23
+package require vc::tools::trouble ; # Error reporting.
24
+package require vc::fossil::import::cvs::pass ; # Pass management
25
+package require vc::fossil::import::cvs::pass::collar ; # Pass I.
26
+package require vc::fossil::import::cvs::repository ; # Repository management
2527
2628
# # ## ### ##### ######## ############# #####################
2729
##
2830
2931
snit::type ::vc::fossil::import::cvs::option {
@@ -31,10 +33,11 @@
3133
## Public API, Options.
3234
3335
# --help, --help-passes, -h
3436
# --version
3537
# -p, --pass, --passes
38
+ # --ignore-conflicting-attics
3639
3740
# --project
3841
# --cache (conversion status, ala config.cache)
3942
# -o, --output
4043
# --dry-run
@@ -62,12 +65,15 @@
6265
-p -
6366
--pass -
6467
--passes {
6568
pass select [Value arguments]
6669
}
70
+ --ignore-conflicting-attics {
71
+ collar ignore_conflicting_attics
72
+ }
6773
--project {
68
- #cvs::repository addproject [Value arguments]
74
+ repository add [Value arguments]
6975
}
7076
--cache {
7177
# [Value arguments]
7278
}
7379
default {
@@ -76,11 +82,11 @@
7682
}
7783
}
7884
7985
if {[llength $arguments] > 1} Usage
8086
if {[llength $arguments] < 1} { Usage $nocvs }
81
- #cvs::repository setbase [lindex $arguments 0]
87
+ repository base [lindex $arguments 0]
8288
8389
Validate
8490
return
8591
}
8692
@@ -103,10 +109,15 @@
103109
trouble info " -p, --passes ?START?:?END? Run only the passes START through END,"
104110
trouble info " inclusive."
105111
trouble info ""
106112
trouble info " Passes are specified by name."
107113
trouble info ""
114
+ trouble info " --ignore-conflicting-attics"
115
+ trouble info " Prevent abort when conflicting archives"
116
+ trouble info " were found in both regular and Attic."
117
+ trouble info ""
118
+
108119
# --project, --cache
109120
# ...
110121
return
111122
}
112123
@@ -153,10 +164,11 @@
153164
154165
proc Validate {} {
155166
# Prevent in-depth validation if the options were already bad.
156167
trouble abort?
157168
169
+ repository validate
158170
159171
trouble abort?
160172
return
161173
}
162174
@@ -168,15 +180,20 @@
168180
pragma -hastypedestroy no ; # immortal
169181
170182
# # ## ### ##### ######## #############
171183
}
172184
173
-namespace eval ::vc::fossil::import::cvs::option {
174
- namespace import ::vc::tools::trouble
175
- namespace import ::vc::fossil::import::cvs::pass
185
+namespace eval ::vc::fossil::import::cvs {
186
+ namespace export option
187
+ namespace eval option {
188
+ namespace import ::vc::tools::trouble
189
+ namespace import ::vc::fossil::import::cvs::pass
190
+ namespace import ::vc::fossil::import::cvs::pass::collar
191
+ namespace import ::vc::fossil::import::cvs::repository
192
+ }
176193
}
177194
178195
# # ## ### ##### ######## ############# #####################
179196
## Ready
180197
181198
package provide vc::fossil::import::cvs::option 1.0
182199
return
183200
--- tools/cvs2fossil/lib/c2f_option.tcl
+++ tools/cvs2fossil/lib/c2f_option.tcl
@@ -16,14 +16,16 @@
16 ## delegation
17
18 # # ## ### ##### ######## ############# #####################
19 ## Requirements
20
21 package require Tcl 8.4 ; # Required runtime.
22 package require snit ; # OO system.
23 package require vc::tools::trouble ; # Error reporting.
24 package require vc::fossil::import::cvs::pass ; # Pass management
 
 
25
26 # # ## ### ##### ######## ############# #####################
27 ##
28
29 snit::type ::vc::fossil::import::cvs::option {
@@ -31,10 +33,11 @@
31 ## Public API, Options.
32
33 # --help, --help-passes, -h
34 # --version
35 # -p, --pass, --passes
 
36
37 # --project
38 # --cache (conversion status, ala config.cache)
39 # -o, --output
40 # --dry-run
@@ -62,12 +65,15 @@
62 -p -
63 --pass -
64 --passes {
65 pass select [Value arguments]
66 }
 
 
 
67 --project {
68 #cvs::repository addproject [Value arguments]
69 }
70 --cache {
71 # [Value arguments]
72 }
73 default {
@@ -76,11 +82,11 @@
76 }
77 }
78
79 if {[llength $arguments] > 1} Usage
80 if {[llength $arguments] < 1} { Usage $nocvs }
81 #cvs::repository setbase [lindex $arguments 0]
82
83 Validate
84 return
85 }
86
@@ -103,10 +109,15 @@
103 trouble info " -p, --passes ?START?:?END? Run only the passes START through END,"
104 trouble info " inclusive."
105 trouble info ""
106 trouble info " Passes are specified by name."
107 trouble info ""
 
 
 
 
 
108 # --project, --cache
109 # ...
110 return
111 }
112
@@ -153,10 +164,11 @@
153
154 proc Validate {} {
155 # Prevent in-depth validation if the options were already bad.
156 trouble abort?
157
 
158
159 trouble abort?
160 return
161 }
162
@@ -168,15 +180,20 @@
168 pragma -hastypedestroy no ; # immortal
169
170 # # ## ### ##### ######## #############
171 }
172
173 namespace eval ::vc::fossil::import::cvs::option {
174 namespace import ::vc::tools::trouble
175 namespace import ::vc::fossil::import::cvs::pass
 
 
 
 
 
176 }
177
178 # # ## ### ##### ######## ############# #####################
179 ## Ready
180
181 package provide vc::fossil::import::cvs::option 1.0
182 return
183
--- tools/cvs2fossil/lib/c2f_option.tcl
+++ tools/cvs2fossil/lib/c2f_option.tcl
@@ -16,14 +16,16 @@
16 ## delegation
17
18 # # ## ### ##### ######## ############# #####################
19 ## Requirements
20
21 package require Tcl 8.4 ; # Required runtime.
22 package require snit ; # OO system.
23 package require vc::tools::trouble ; # Error reporting.
24 package require vc::fossil::import::cvs::pass ; # Pass management
25 package require vc::fossil::import::cvs::pass::collar ; # Pass I.
26 package require vc::fossil::import::cvs::repository ; # Repository management
27
28 # # ## ### ##### ######## ############# #####################
29 ##
30
31 snit::type ::vc::fossil::import::cvs::option {
@@ -31,10 +33,11 @@
33 ## Public API, Options.
34
35 # --help, --help-passes, -h
36 # --version
37 # -p, --pass, --passes
38 # --ignore-conflicting-attics
39
40 # --project
41 # --cache (conversion status, ala config.cache)
42 # -o, --output
43 # --dry-run
@@ -62,12 +65,15 @@
65 -p -
66 --pass -
67 --passes {
68 pass select [Value arguments]
69 }
70 --ignore-conflicting-attics {
71 collar ignore_conflicting_attics
72 }
73 --project {
74 repository add [Value arguments]
75 }
76 --cache {
77 # [Value arguments]
78 }
79 default {
@@ -76,11 +82,11 @@
82 }
83 }
84
85 if {[llength $arguments] > 1} Usage
86 if {[llength $arguments] < 1} { Usage $nocvs }
87 repository base [lindex $arguments 0]
88
89 Validate
90 return
91 }
92
@@ -103,10 +109,15 @@
109 trouble info " -p, --passes ?START?:?END? Run only the passes START through END,"
110 trouble info " inclusive."
111 trouble info ""
112 trouble info " Passes are specified by name."
113 trouble info ""
114 trouble info " --ignore-conflicting-attics"
115 trouble info " Prevent abort when conflicting archives"
116 trouble info " were found in both regular and Attic."
117 trouble info ""
118
119 # --project, --cache
120 # ...
121 return
122 }
123
@@ -153,10 +164,11 @@
164
165 proc Validate {} {
166 # Prevent in-depth validation if the options were already bad.
167 trouble abort?
168
169 repository validate
170
171 trouble abort?
172 return
173 }
174
@@ -168,15 +180,20 @@
180 pragma -hastypedestroy no ; # immortal
181
182 # # ## ### ##### ######## #############
183 }
184
185 namespace eval ::vc::fossil::import::cvs {
186 namespace export option
187 namespace eval option {
188 namespace import ::vc::tools::trouble
189 namespace import ::vc::fossil::import::cvs::pass
190 namespace import ::vc::fossil::import::cvs::pass::collar
191 namespace import ::vc::fossil::import::cvs::repository
192 }
193 }
194
195 # # ## ### ##### ######## ############# #####################
196 ## Ready
197
198 package provide vc::fossil::import::cvs::option 1.0
199 return
200
--- tools/cvs2fossil/lib/c2f_pass.tcl
+++ tools/cvs2fossil/lib/c2f_pass.tcl
@@ -18,10 +18,11 @@
1818
## Requirements
1919
2020
package require Tcl 8.4 ; # Required runtime.
2121
package require snit ; # OO system.
2222
package require vc::tools::trouble ; # Error reporting.
23
+package require vc::tools::log ; # User feedback.
2324
package require struct::list ; # Portable lassign
2425
2526
# # ## ### ##### ######## ############# #####################
2627
##
2728
@@ -95,12 +96,20 @@
9596
# TODO: Timing statistics for the passes.
9697
# TODO: Artifact manager (clean after pass?. need to know skipped/defered passes ?)
9798
# TODO:
9899
# TODO:
99100
100
- foreach p $runlist { Call $p setup }
101
- foreach p $runlist { Call $p run }
101
+ foreach p $runlist {
102
+ log write 0 pass "Setup $p"
103
+ Call $p setup
104
+ }
105
+ foreach p $runlist {
106
+ log write 0 pass "Begin $p"
107
+ Call $p run
108
+ log write 0 pass "Done $p"
109
+ trouble abort?
110
+ }
102111
return
103112
}
104113
105114
# # ## ### ##### ######## #############
106115
## Internal methods
@@ -127,11 +136,11 @@
127136
128137
proc Call {code args} {
129138
upvar 1 mycmd mycmd
130139
set cmd $mycmd($code)
131140
foreach a $args { lappend cmd $a }
132
- eval $a
141
+ eval $cmd
133142
return
134143
}
135144
136145
# # ## ### ##### ######## #############
137146
## Internal, state
@@ -153,13 +162,17 @@
153162
# # ## ### ##### ######## #############
154163
}
155164
156165
namespace eval ::vc::fossil::import::cvs {
157166
namespace export pass
158
- namespace eval pass { namespace import ::vc::tools::trouble }
167
+ namespace eval pass {
168
+ namespace import ::vc::tools::trouble
169
+ namespace import ::vc::tools::log
170
+ log register pass
171
+ }
159172
}
160173
161174
# # ## ### ##### ######## ############# #####################
162175
## Ready
163176
164177
package provide vc::fossil::import::cvs::pass 1.0
165178
return
166179
167180
ADDED tools/cvs2fossil/lib/c2f_pcollar.tcl
168181
ADDED tools/cvs2fossil/lib/c2f_repository.tcl
--- tools/cvs2fossil/lib/c2f_pass.tcl
+++ tools/cvs2fossil/lib/c2f_pass.tcl
@@ -18,10 +18,11 @@
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 struct::list ; # Portable lassign
24
25 # # ## ### ##### ######## ############# #####################
26 ##
27
@@ -95,12 +96,20 @@
95 # TODO: Timing statistics for the passes.
96 # TODO: Artifact manager (clean after pass?. need to know skipped/defered passes ?)
97 # TODO:
98 # TODO:
99
100 foreach p $runlist { Call $p setup }
101 foreach p $runlist { Call $p run }
 
 
 
 
 
 
 
 
102 return
103 }
104
105 # # ## ### ##### ######## #############
106 ## Internal methods
@@ -127,11 +136,11 @@
127
128 proc Call {code args} {
129 upvar 1 mycmd mycmd
130 set cmd $mycmd($code)
131 foreach a $args { lappend cmd $a }
132 eval $a
133 return
134 }
135
136 # # ## ### ##### ######## #############
137 ## Internal, state
@@ -153,13 +162,17 @@
153 # # ## ### ##### ######## #############
154 }
155
156 namespace eval ::vc::fossil::import::cvs {
157 namespace export pass
158 namespace eval pass { namespace import ::vc::tools::trouble }
 
 
 
 
159 }
160
161 # # ## ### ##### ######## ############# #####################
162 ## Ready
163
164 package provide vc::fossil::import::cvs::pass 1.0
165 return
166
167 DDED tools/cvs2fossil/lib/c2f_pcollar.tcl
168 DDED tools/cvs2fossil/lib/c2f_repository.tcl
--- tools/cvs2fossil/lib/c2f_pass.tcl
+++ tools/cvs2fossil/lib/c2f_pass.tcl
@@ -18,10 +18,11 @@
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 struct::list ; # Portable lassign
25
26 # # ## ### ##### ######## ############# #####################
27 ##
28
@@ -95,12 +96,20 @@
96 # TODO: Timing statistics for the passes.
97 # TODO: Artifact manager (clean after pass?. need to know skipped/defered passes ?)
98 # TODO:
99 # TODO:
100
101 foreach p $runlist {
102 log write 0 pass "Setup $p"
103 Call $p setup
104 }
105 foreach p $runlist {
106 log write 0 pass "Begin $p"
107 Call $p run
108 log write 0 pass "Done $p"
109 trouble abort?
110 }
111 return
112 }
113
114 # # ## ### ##### ######## #############
115 ## Internal methods
@@ -127,11 +136,11 @@
136
137 proc Call {code args} {
138 upvar 1 mycmd mycmd
139 set cmd $mycmd($code)
140 foreach a $args { lappend cmd $a }
141 eval $cmd
142 return
143 }
144
145 # # ## ### ##### ######## #############
146 ## Internal, state
@@ -153,13 +162,17 @@
162 # # ## ### ##### ######## #############
163 }
164
165 namespace eval ::vc::fossil::import::cvs {
166 namespace export pass
167 namespace eval pass {
168 namespace import ::vc::tools::trouble
169 namespace import ::vc::tools::log
170 log register pass
171 }
172 }
173
174 # # ## ### ##### ######## ############# #####################
175 ## Ready
176
177 package provide vc::fossil::import::cvs::pass 1.0
178 return
179
180 DDED tools/cvs2fossil/lib/c2f_pcollar.tcl
181 DDED tools/cvs2fossil/lib/c2f_repository.tcl
--- a/tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ b/tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -0,0 +1 @@
1
+$project base12if {$
--- a/tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ b/tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -0,0 +1 @@
 
--- a/tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ b/tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -0,0 +1 @@
1 $project base12if {$
--- a/tools/cvs2fossil/lib/c2f_repository.tcl
+++ b/tools/cvs2fossil/lib/c2f_repository.tcl
@@ -0,0 +1,4 @@
1
+Cthe base is not known wot known w ; # OO system.
2
+ot known wot known wadd {path} {validate {} {#tools::trouble
3
+ #tools::log
4
+ #log register collar
--- a/tools/cvs2fossil/lib/c2f_repository.tcl
+++ b/tools/cvs2fossil/lib/c2f_repository.tcl
@@ -0,0 +1,4 @@
 
 
 
 
--- a/tools/cvs2fossil/lib/c2f_repository.tcl
+++ b/tools/cvs2fossil/lib/c2f_repository.tcl
@@ -0,0 +1,4 @@
1 Cthe base is not known wot known w ; # OO system.
2 ot known wot known wadd {path} {validate {} {#tools::trouble
3 #tools::log
4 #log register collar
--- tools/cvs2fossil/lib/cvs2fossil.tcl
+++ tools/cvs2fossil/lib/cvs2fossil.tcl
@@ -16,10 +16,21 @@
1616
# # ## ### ##### ######## ############# #####################
1717
## Requirements
1818
1919
package require Tcl 8.4 ; # Required runtime.
2020
package require snit ; # OO system
21
+
22
+# # ## ### ##### ######## ############# #####################
23
+## Passes. The order in which the import passes are loaded is
24
+## important. It is the same order they will register, and then be run
25
+## in.
26
+
27
+package require vc::fossil::import::cvs::pass::collar ; # Coll'ect AR'chives.
28
+
29
+# # ## ### ##### ######## ############# #####################
30
+## Support for passes etc.
31
+
2132
package require vc::fossil::import::cvs::option ; # Cmd line parsing & database
2233
package require vc::fossil::import::cvs::pass ; # Pass management
2334
2435
# # ## ### ##### ######## ############# #####################
2536
##
2637
--- tools/cvs2fossil/lib/cvs2fossil.tcl
+++ tools/cvs2fossil/lib/cvs2fossil.tcl
@@ -16,10 +16,21 @@
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::option ; # Cmd line parsing & database
22 package require vc::fossil::import::cvs::pass ; # Pass management
23
24 # # ## ### ##### ######## ############# #####################
25 ##
26
--- tools/cvs2fossil/lib/cvs2fossil.tcl
+++ tools/cvs2fossil/lib/cvs2fossil.tcl
@@ -16,10 +16,21 @@
16 # # ## ### ##### ######## ############# #####################
17 ## Requirements
18
19 package require Tcl 8.4 ; # Required runtime.
20 package require snit ; # OO system
21
22 # # ## ### ##### ######## ############# #####################
23 ## Passes. The order in which the import passes are loaded is
24 ## important. It is the same order they will register, and then be run
25 ## in.
26
27 package require vc::fossil::import::cvs::pass::collar ; # Coll'ect AR'chives.
28
29 # # ## ### ##### ######## ############# #####################
30 ## Support for passes etc.
31
32 package require vc::fossil::import::cvs::option ; # Cmd line parsing & database
33 package require vc::fossil::import::cvs::pass ; # Pass management
34
35 # # ## ### ##### ######## ############# #####################
36 ##
37
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -1,10 +1,12 @@
11
# # ## ### ##### ######## ############# #####################
22
## Package management.
33
## Index of the local packages required by cvs2fossil
44
# # ## ### ##### ######## ############# #####################
55
if {![package vsatisfies [package require Tcl] 8.4]} return
6
-package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir cvs2fossil.tcl]]
7
-package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]]
8
-package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]]
9
-package ifneeded vc::tools::trouble 1.0 [list source [file join $dir trouble.tcl]]
10
-package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
6
+package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir cvs2fossil.tcl]]
7
+package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]]
8
+package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]]
9
+package ifneeded vc::fossil::import::cvs::pass::collar 1.0 [list source [file join $dir c2f_pcollar.tcl]]
10
+package ifneeded vc::fossil::import::cvs::repository 1.0 [list source [file join $dir c2f_repository.tcl]]
11
+package ifneeded vc::tools::trouble 1.0 [list source [file join $dir trouble.tcl]]
12
+package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
1113
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -1,10 +1,12 @@
1 # # ## ### ##### ######## ############# #####################
2 ## Package management.
3 ## Index of the local packages required by cvs2fossil
4 # # ## ### ##### ######## ############# #####################
5 if {![package vsatisfies [package require Tcl] 8.4]} return
6 package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir cvs2fossil.tcl]]
7 package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]]
8 package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]]
9 package ifneeded vc::tools::trouble 1.0 [list source [file join $dir trouble.tcl]]
10 package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
 
 
11
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -1,10 +1,12 @@
1 # # ## ### ##### ######## ############# #####################
2 ## Package management.
3 ## Index of the local packages required by cvs2fossil
4 # # ## ### ##### ######## ############# #####################
5 if {![package vsatisfies [package require Tcl] 8.4]} return
6 package ifneeded vc::fossil::import::cvs 1.0 [list source [file join $dir cvs2fossil.tcl]]
7 package ifneeded vc::fossil::import::cvs::option 1.0 [list source [file join $dir c2f_option.tcl]]
8 package ifneeded vc::fossil::import::cvs::pass 1.0 [list source [file join $dir c2f_pass.tcl]]
9 package ifneeded vc::fossil::import::cvs::pass::collar 1.0 [list source [file join $dir c2f_pcollar.tcl]]
10 package ifneeded vc::fossil::import::cvs::repository 1.0 [list source [file join $dir c2f_repository.tcl]]
11 package ifneeded vc::tools::trouble 1.0 [list source [file join $dir trouble.tcl]]
12 package ifneeded vc::tools::log 1.0 [list source [file join $dir log.tcl]]
13

Keyboard Shortcuts

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