Fossil SCM

Extended pass I to capture the 'file executable' info of rcs archives. Currently the only way to store this info in the destination will be the use of fossil tags.

aku 2007-10-13 21:15 trunk
Commit 27470a9304a6123594dba78eee4681d7980ea10e
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -29,13 +29,14 @@
2929
3030
snit::type ::vc::fossil::import::cvs::file {
3131
# # ## ### ##### ######## #############
3232
## Public API
3333
34
- constructor {path project} {
35
- set mypath $path
36
- set myproject $project
34
+ constructor {path executable project} {
35
+ set mypath $path
36
+ set myexecutable $executable
37
+ set myproject $project
3738
return
3839
}
3940
4041
method path {} { return $mypath }
4142
method project {} { return $myproject }
@@ -186,11 +187,12 @@
186187
method done {} {}
187188
188189
# # ## ### ##### ######## #############
189190
## State
190191
191
- variable mypath {} ; # Path of our rcs archive.
192
+ variable mypath {} ; # Path of the file's rcs archive.
193
+ variable myexecutable 0 ; # Boolean flag 'file executable'.
192194
variable myproject {} ; # Reference to the project object
193195
# the file belongs to.
194196
variable myrev -array {} ; # Maps revision number to the
195197
# associated revision object.
196198
variable myrevisions {} ; # Same as myrev, but a list,
@@ -225,11 +227,10 @@
225227
# reverse of definition. I.e. a smaller
226228
# number means 'Defined earlier', means
227229
# 'Created later'.
228230
229231
### TODO ###
230
- ### File flag - executable,
231232
### RCS mode info (kb, kkb, ...)
232233
233234
# # ## ### ##### ######## #############
234235
## Internal methods
235236
236237
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -29,13 +29,14 @@
29
30 snit::type ::vc::fossil::import::cvs::file {
31 # # ## ### ##### ######## #############
32 ## Public API
33
34 constructor {path project} {
35 set mypath $path
36 set myproject $project
 
37 return
38 }
39
40 method path {} { return $mypath }
41 method project {} { return $myproject }
@@ -186,11 +187,12 @@
186 method done {} {}
187
188 # # ## ### ##### ######## #############
189 ## State
190
191 variable mypath {} ; # Path of our rcs archive.
 
192 variable myproject {} ; # Reference to the project object
193 # the file belongs to.
194 variable myrev -array {} ; # Maps revision number to the
195 # associated revision object.
196 variable myrevisions {} ; # Same as myrev, but a list,
@@ -225,11 +227,10 @@
225 # reverse of definition. I.e. a smaller
226 # number means 'Defined earlier', means
227 # 'Created later'.
228
229 ### TODO ###
230 ### File flag - executable,
231 ### RCS mode info (kb, kkb, ...)
232
233 # # ## ### ##### ######## #############
234 ## Internal methods
235
236
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -29,13 +29,14 @@
29
30 snit::type ::vc::fossil::import::cvs::file {
31 # # ## ### ##### ######## #############
32 ## Public API
33
34 constructor {path executable project} {
35 set mypath $path
36 set myexecutable $executable
37 set myproject $project
38 return
39 }
40
41 method path {} { return $mypath }
42 method project {} { return $myproject }
@@ -186,11 +187,12 @@
187 method done {} {}
188
189 # # ## ### ##### ######## #############
190 ## State
191
192 variable mypath {} ; # Path of the file's rcs archive.
193 variable myexecutable 0 ; # Boolean flag 'file executable'.
194 variable myproject {} ; # Reference to the project object
195 # the file belongs to.
196 variable myrev -array {} ; # Maps revision number to the
197 # associated revision object.
198 variable myrevisions {} ; # Same as myrev, but a list,
@@ -225,11 +227,10 @@
227 # reverse of definition. I.e. a smaller
228 # number means 'Defined earlier', means
229 # 'Created later'.
230
231 ### TODO ###
 
232 ### RCS mode info (kb, kkb, ...)
233
234 # # ## ### ##### ######## #############
235 ## Internal methods
236
237
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -72,10 +72,11 @@
7272
state writing file {
7373
fid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
7474
pid INTEGER NOT NULL REFERENCES project, -- project the file belongs to
7575
name TEXT NOT NULL,
7676
visible TEXT NOT NULL,
77
+ exec INTEGER NOT NULL, -- boolean, 'file executable'.
7778
UNIQUE (pid, name) -- file names are unique within a project
7879
}
7980
return
8081
}
8182
@@ -108,11 +109,11 @@
108109
trouble fatal " $base/$rcs"
109110
continue
110111
}
111112
112113
log write 4 collar "Found $rcs"
113
- $project add $rcs $usr
114
+ $project addfile $rcs $usr [file executable $rcs]
114115
115116
incr n
116117
if {[log verbosity?] < 4} {
117118
log progress 0 collar $n {}
118119
}
119120
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -72,10 +72,11 @@
72 state writing file {
73 fid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
74 pid INTEGER NOT NULL REFERENCES project, -- project the file belongs to
75 name TEXT NOT NULL,
76 visible TEXT NOT NULL,
 
77 UNIQUE (pid, name) -- file names are unique within a project
78 }
79 return
80 }
81
@@ -108,11 +109,11 @@
108 trouble fatal " $base/$rcs"
109 continue
110 }
111
112 log write 4 collar "Found $rcs"
113 $project add $rcs $usr
114
115 incr n
116 if {[log verbosity?] < 4} {
117 log progress 0 collar $n {}
118 }
119
--- tools/cvs2fossil/lib/c2f_pcollar.tcl
+++ tools/cvs2fossil/lib/c2f_pcollar.tcl
@@ -72,10 +72,11 @@
72 state writing file {
73 fid INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
74 pid INTEGER NOT NULL REFERENCES project, -- project the file belongs to
75 name TEXT NOT NULL,
76 visible TEXT NOT NULL,
77 exec INTEGER NOT NULL, -- boolean, 'file executable'.
78 UNIQUE (pid, name) -- file names are unique within a project
79 }
80 return
81 }
82
@@ -108,11 +109,11 @@
109 trouble fatal " $base/$rcs"
110 continue
111 }
112
113 log write 4 collar "Found $rcs"
114 $project addfile $rcs $usr [file executable $rcs]
115
116 incr n
117 if {[log verbosity?] < 4} {
118 log progress 0 collar $n {}
119 }
120
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -16,12 +16,13 @@
1616
## Requirements
1717
1818
package require Tcl 8.4 ; # Required runtime.
1919
package require snit ; # OO system.
2020
package require vc::fossil::import::cvs::file ; # CVS archive file.
21
-package require vc::fossil::import::cvs::state ; # State storage
22
-package require vc::fossil::import::cvs::project::sym ; # Per project symbols
21
+package require vc::fossil::import::cvs::state ; # State storage.
22
+package require vc::fossil::import::cvs::project::sym ; # Per project symbols.
23
+package require struct::list ; # Advanced list operations..
2324
2425
# # ## ### ##### ######## ############# #####################
2526
##
2627
2728
snit::type ::vc::fossil::import::cvs::project {
@@ -39,12 +40,12 @@
3940
method printbase {} {
4041
if {$mybase eq ""} {return <Repository>}
4142
return $mybase
4243
}
4344
44
- method add {rcs usr} {
45
- set myfiles($rcs) $usr
45
+ method addfile {rcs usr executable} {
46
+ set myfiles($rcs) [list $usr $executable]
4647
return
4748
}
4849
4950
method filenames {} {
5051
return [lsort -dict [array names myfiles]]
@@ -78,14 +79,15 @@
7879
set pid [state id]
7980
8081
# Then all files, with proper backreference to their
8182
# project.
8283
83
- foreach {rcs usr} [array get myfiles] {
84
+ foreach {rcs item} [array get myfiles] {
85
+ struct::list assign $item usr executable
8486
state run {
85
- INSERT INTO file (fid, pid, name, visible)
86
- VALUES (NULL, $pid, $rcs, $usr);
87
+ INSERT INTO file (fid, pid, name, visible, exec)
88
+ VALUES (NULL, $pid, $rcs, $usr, $executable);
8789
}
8890
}
8991
}
9092
return
9193
}
@@ -122,12 +124,13 @@
122124
}
123125
124126
proc EmptyFiles {fv} {
125127
upvar 1 $fv myfiles self self
126128
set res {}
127
- foreach f [lsort -dict [array names myfiles]] {
128
- lappend res [file %AUTO% $f $self]
129
+ foreach item [lsort -dict [array names myfiles]] {
130
+ struct::list assign $item f executable
131
+ lappend res [file %AUTO% $f $executable $self]
129132
}
130133
return $res
131134
}
132135
133136
# # ## ### ##### ######## #############
134137
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -16,12 +16,13 @@
16 ## Requirements
17
18 package require Tcl 8.4 ; # Required runtime.
19 package require snit ; # OO system.
20 package require vc::fossil::import::cvs::file ; # CVS archive file.
21 package require vc::fossil::import::cvs::state ; # State storage
22 package require vc::fossil::import::cvs::project::sym ; # Per project symbols
 
23
24 # # ## ### ##### ######## ############# #####################
25 ##
26
27 snit::type ::vc::fossil::import::cvs::project {
@@ -39,12 +40,12 @@
39 method printbase {} {
40 if {$mybase eq ""} {return <Repository>}
41 return $mybase
42 }
43
44 method add {rcs usr} {
45 set myfiles($rcs) $usr
46 return
47 }
48
49 method filenames {} {
50 return [lsort -dict [array names myfiles]]
@@ -78,14 +79,15 @@
78 set pid [state id]
79
80 # Then all files, with proper backreference to their
81 # project.
82
83 foreach {rcs usr} [array get myfiles] {
 
84 state run {
85 INSERT INTO file (fid, pid, name, visible)
86 VALUES (NULL, $pid, $rcs, $usr);
87 }
88 }
89 }
90 return
91 }
@@ -122,12 +124,13 @@
122 }
123
124 proc EmptyFiles {fv} {
125 upvar 1 $fv myfiles self self
126 set res {}
127 foreach f [lsort -dict [array names myfiles]] {
128 lappend res [file %AUTO% $f $self]
 
129 }
130 return $res
131 }
132
133 # # ## ### ##### ######## #############
134
--- tools/cvs2fossil/lib/c2f_project.tcl
+++ tools/cvs2fossil/lib/c2f_project.tcl
@@ -16,12 +16,13 @@
16 ## Requirements
17
18 package require Tcl 8.4 ; # Required runtime.
19 package require snit ; # OO system.
20 package require vc::fossil::import::cvs::file ; # CVS archive file.
21 package require vc::fossil::import::cvs::state ; # State storage.
22 package require vc::fossil::import::cvs::project::sym ; # Per project symbols.
23 package require struct::list ; # Advanced list operations..
24
25 # # ## ### ##### ######## ############# #####################
26 ##
27
28 snit::type ::vc::fossil::import::cvs::project {
@@ -39,12 +40,12 @@
40 method printbase {} {
41 if {$mybase eq ""} {return <Repository>}
42 return $mybase
43 }
44
45 method addfile {rcs usr executable} {
46 set myfiles($rcs) [list $usr $executable]
47 return
48 }
49
50 method filenames {} {
51 return [lsort -dict [array names myfiles]]
@@ -78,14 +79,15 @@
79 set pid [state id]
80
81 # Then all files, with proper backreference to their
82 # project.
83
84 foreach {rcs item} [array get myfiles] {
85 struct::list assign $item usr executable
86 state run {
87 INSERT INTO file (fid, pid, name, visible, exec)
88 VALUES (NULL, $pid, $rcs, $usr, $executable);
89 }
90 }
91 }
92 return
93 }
@@ -122,12 +124,13 @@
124 }
125
126 proc EmptyFiles {fv} {
127 upvar 1 $fv myfiles self self
128 set res {}
129 foreach item [lsort -dict [array names myfiles]] {
130 struct::list assign $item f executable
131 lappend res [file %AUTO% $f $executable $self]
132 }
133 return $res
134 }
135
136 # # ## ### ##### ######## #############
137

Keyboard Shortcuts

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