Fossil SCM

Split the current import pass into three, for files, changesets, and finalization (fossil rebuild).

aku 2008-03-05 03:42 trunk
Commit 31b15fcf3070b5032cb009e251e1418016bde013
--- a/tools/cvs2fossil/lib/c2f_pimportcsets.tcl
+++ b/tools/cvs2fossil/lib/c2f_pimportcsets.tcl
@@ -0,0 +1,133 @@
1
+## -*- tcl -*-
2
+# # ## ### ##### ######## ############# #####################
3
+## Copyright (c) 2008 Andreas Kupries.
4
+#
5
+# This software is licensed as described in the file LICENSE, which
6
+# you should have received as part of this distribution.
7
+#
8
+# This software consists of voluntary contributions made by many
9
+# individuals. For exact contribution history, see the revision
10
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
11
+# # ## ### ##### ######## ############# #####################
12
+
13
+## Pass XIII. This is the second of the backend passes. It imports the
14
+## changesets constructed by the previous passes into one or more
15
+## fossil repositories, one per project.
16
+
17
+# # ## ### ##### ######## ############# #####################
18
+## Requirements
19
+
20
+package require Tcl 8.4 ; # Required runtime.
21
+package require snit ; # OO system.
22
+package require vc::tools::log ; # User feedback.
23
+package require vc::fossil::import::cvs::repository ; # Repository management.
24
+package require vc::fossil::import::cvs::state ; # State storage.
25
+package require vc::fossil::import::cvs::fossil ; # Access to fossil repositories.
26
+package require vc::fossil::import::cvs::ristate ; # Import state (revisions)
27
+
28
+# # ## ### ##### ######## ############# #####################
29
+## Register the pass with the management
30
+
31
+vc::fossil::import::cvs::pass define \
32
+ ImportCSets \
33
+ {Import the changesets into fossil repositories} \
34
+ ::vc::fossil::import::cvs::pass::importcsets
35
+
36
+# # ## ### ##### ######## ############# #####################
37
+##
38
+
39
+snit::type ::vc::fossil::import::cvs::pass::importcsets {
40
+ # # ## ### ##### ######## #############
41
+ ## Public API
42
+
43
+ typemethod setup {} {
44
+ # Define the names and structure of the persistent state of
45
+ # this pass.
46
+
47
+ state use project
48
+ state use file
49
+ state use revision
50
+ state use meta
51
+ state use author
52
+ state use cmessage
53
+ state use symbol
54
+ state use space
55
+ state use revuuid
56
+ return
57
+ }
58
+
59
+ typemethod load {} {
60
+ # Pass manager interface. Executed to load data computed by
61
+ # this pass into memory when this pass is skipped instead of
62
+ # executed.
63
+ return
64
+ }
65
+
66
+ typemethod run {} {
67
+ # Pass manager interface. Executed to perform the
68
+ # functionality of the pass.
69
+
70
+ foreach project [repository projects] {
71
+ log write 1 importcsets {Importing project "[$project base]"}
72
+
73
+ set pid [$project id]
74
+ set fossil [fossil %AUTO%]
75
+ struct::list assign [state run {
76
+ SELECT repository, workspace
77
+ FROM space
78
+ WHERE pid = $pid
79
+ }] r w
80
+ $fossil load $r $w
81
+
82
+ set rstate [ristate %AUTO%]
83
+
84
+ state transaction {
85
+ # Layer II: Changesets
86
+ foreach {cset date} [$project changesetsinorder] {
87
+ $cset pushto $fossil $date $rstate
88
+ }
89
+ }
90
+
91
+ $rstate destroy
92
+ $fossil destroy
93
+ }
94
+ return
95
+ }
96
+
97
+ typemethod discard {} {
98
+ # Pass manager interface. Executed for all passes after the
99
+ # run passes, to remove all data of this pass from the state,
100
+ # as being out of date.
101
+ return
102
+ }
103
+
104
+ # # ## ### ##### ######## #############
105
+ ## Internal methods
106
+
107
+ # # ## ### ##### ######## #############
108
+ ## Configuration
109
+
110
+ pragma -hasinstances no ; # singleton
111
+ pragma -hastypeinfo no ; # no introspection
112
+ pragma -hastypedestroy no ; # immortal
113
+
114
+ # # ## ### ##### ######## #############
115
+}
116
+
117
+namespace eval ::vc::fossil::import::cvs::pass {
118
+ namespace export importcsets
119
+ namespace eval importcsets {
120
+ namespace import ::vc::fossil::import::cvs::repository
121
+ namespace import ::vc::fossil::import::cvs::state
122
+ namespace import ::vc::fossil::import::cvs::fossil
123
+ namespace import ::vc::fossil::import::cvs::ristate
124
+ namespace import ::vc::tools::log
125
+ log register importcsets
126
+ }
127
+}
128
+
129
+# # ## ### ##### ######## ############# #####################
130
+## Ready
131
+
132
+package provide vc::fossil::import::cvs::pass::importcsets 1.0
133
+return
--- a/tools/cvs2fossil/lib/c2f_pimportcsets.tcl
+++ b/tools/cvs2fossil/lib/c2f_pimportcsets.tcl
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/cvs2fossil/lib/c2f_pimportcsets.tcl
+++ b/tools/cvs2fossil/lib/c2f_pimportcsets.tcl
@@ -0,0 +1,133 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9 # individuals. For exact contribution history, see the revision
10 # history and logs, available at http://fossil-scm.hwaci.com/fossil
11 # # ## ### ##### ######## ############# #####################
12
13 ## Pass XIII. This is the second of the backend passes. It imports the
14 ## changesets constructed by the previous passes into one or more
15 ## fossil repositories, one per project.
16
17 # # ## ### ##### ######## ############# #####################
18 ## Requirements
19
20 package require Tcl 8.4 ; # Required runtime.
21 package require snit ; # OO system.
22 package require vc::tools::log ; # User feedback.
23 package require vc::fossil::import::cvs::repository ; # Repository management.
24 package require vc::fossil::import::cvs::state ; # State storage.
25 package require vc::fossil::import::cvs::fossil ; # Access to fossil repositories.
26 package require vc::fossil::import::cvs::ristate ; # Import state (revisions)
27
28 # # ## ### ##### ######## ############# #####################
29 ## Register the pass with the management
30
31 vc::fossil::import::cvs::pass define \
32 ImportCSets \
33 {Import the changesets into fossil repositories} \
34 ::vc::fossil::import::cvs::pass::importcsets
35
36 # # ## ### ##### ######## ############# #####################
37 ##
38
39 snit::type ::vc::fossil::import::cvs::pass::importcsets {
40 # # ## ### ##### ######## #############
41 ## Public API
42
43 typemethod setup {} {
44 # Define the names and structure of the persistent state of
45 # this pass.
46
47 state use project
48 state use file
49 state use revision
50 state use meta
51 state use author
52 state use cmessage
53 state use symbol
54 state use space
55 state use revuuid
56 return
57 }
58
59 typemethod load {} {
60 # Pass manager interface. Executed to load data computed by
61 # this pass into memory when this pass is skipped instead of
62 # executed.
63 return
64 }
65
66 typemethod run {} {
67 # Pass manager interface. Executed to perform the
68 # functionality of the pass.
69
70 foreach project [repository projects] {
71 log write 1 importcsets {Importing project "[$project base]"}
72
73 set pid [$project id]
74 set fossil [fossil %AUTO%]
75 struct::list assign [state run {
76 SELECT repository, workspace
77 FROM space
78 WHERE pid = $pid
79 }] r w
80 $fossil load $r $w
81
82 set rstate [ristate %AUTO%]
83
84 state transaction {
85 # Layer II: Changesets
86 foreach {cset date} [$project changesetsinorder] {
87 $cset pushto $fossil $date $rstate
88 }
89 }
90
91 $rstate destroy
92 $fossil destroy
93 }
94 return
95 }
96
97 typemethod discard {} {
98 # Pass manager interface. Executed for all passes after the
99 # run passes, to remove all data of this pass from the state,
100 # as being out of date.
101 return
102 }
103
104 # # ## ### ##### ######## #############
105 ## Internal methods
106
107 # # ## ### ##### ######## #############
108 ## Configuration
109
110 pragma -hasinstances no ; # singleton
111 pragma -hastypeinfo no ; # no introspection
112 pragma -hastypedestroy no ; # immortal
113
114 # # ## ### ##### ######## #############
115 }
116
117 namespace eval ::vc::fossil::import::cvs::pass {
118 namespace export importcsets
119 namespace eval importcsets {
120 namespace import ::vc::fossil::import::cvs::repository
121 namespace import ::vc::fossil::import::cvs::state
122 namespace import ::vc::fossil::import::cvs::fossil
123 namespace import ::vc::fossil::import::cvs::ristate
124 namespace import ::vc::tools::log
125 log register importcsets
126 }
127 }
128
129 # # ## ### ##### ######## ############# #####################
130 ## Ready
131
132 package provide vc::fossil::import::cvs::pass::importcsets 1.0
133 return
--- a/tools/cvs2fossil/lib/c2f_pimportfiles.tcl
+++ b/tools/cvs2fossil/lib/c2f_pimportfiles.tcl
@@ -0,0 +1,151 @@
1
+## -*- tcl -*-
2
+# # ## ### ##### ######## ############# #####################
3
+## Copyright (c) 2007-2008 Andreas Kupries.
4
+#
5
+# This software is licensed as described in the file LICENSE, which
6
+# you should have received as part of this distribution.
7
+#
8
+# This software consists of voluntary contributions made by many
9
+# individuals. For exact contribution history, see the revision
10
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
11
+# # ## ### ##### ######## ############# #####################
12
+
13
+## Pass XII. This is the first of the backend passes. It imports the
14
+## revisions of all files into one or more fossil repositories, one
15
+## per project.
16
+
17
+# # ## ### ##### ######## ############# #####################
18
+## Requirements
19
+
20
+package require Tcl 8.4 ; # Required runtime.
21
+package require snit ; # OO system.
22
+package require vc::tools::log ; # User feedback.
23
+package require vc::fossil::import::cvs::repository ; # Repository management.
24
+package require vc::fossil::import::cvs::state ; # State storage.
25
+package require vc::fossil::import::cvs::fossil ; # Access to fossil repositories.
26
+
27
+# # ## ### ##### ######## ############# #####################
28
+## Register the pass with the management
29
+
30
+vc::fossil::import::cvs::pass define \
31
+ ImportFiles \
32
+ {Import the file revisions into fossil repositories} \
33
+ ::vc::fossil::import::cvs::pass::importfiles
34
+
35
+# # ## ### ##### ######## ############# #####################
36
+##
37
+
38
+snit::type ::vc::fossil::import::cvs::pass::importfiles {
39
+ # # ## ### ##### ######## #############
40
+ ## Public API
41
+
42
+ typemethod setup {} {
43
+ # Define the names and structure of the persistent state of
44
+ # this pass.
45
+
46
+ state use project
47
+ state use file
48
+ state use revision
49
+ state use meta
50
+ state use author
51
+ state use cmessage
52
+ state use symbol
53
+
54
+ # Discard on setup. Do not discard on deferal.
55
+ state discard revuuid
56
+ state extend revuuid {
57
+ rid INTEGER NOT NULL REFERENCES revision UNIQUE,
58
+ uuid INTEGER NOT NULL -- fossil id of the revision
59
+ -- unique within the project
60
+ }
61
+
62
+ # Remember the locations of the scratch data createdby this
63
+ # pass, for use by the next (importing changesets).
64
+ state discard space
65
+ state extend space {
66
+ pid INTEGER NOT NULL REFERENCES project,
67
+ repository TEXT NOT NULL,
68
+ workspace TEXT NOT NULL
69
+ }
70
+ return
71
+ }
72
+
73
+ typemethod load {} {
74
+ # Pass manager interface. Executed to load data computed by
75
+ # this pass into memory when this pass is skipped instead of
76
+ # executed.
77
+ return
78
+ }
79
+
80
+ typemethod run {} {
81
+ # Pass manager interface. Executed to perform the
82
+ # functionality of the pass.
83
+
84
+ foreach project [repository projects] {
85
+ log write 1 importfiles {Importing project "[$project base]"}
86
+
87
+ set pid [$project id]
88
+ set fossil [fossil %AUTO%]
89
+ $fossil initialize
90
+
91
+ state transaction {
92
+ # Layer I: Files and their revisions
93
+ foreach file [$project files] {
94
+ $file pushto $fossil
95
+ }
96
+
97
+ # Save the scratch locations, needed by the next pass.
98
+ struct::list assign [$fossil space] r w
99
+ state run {
100
+ DELETE FROM space
101
+ WHERE pid = $pid
102
+ ;
103
+ INSERT INTO space (pid, repository, workspace)
104
+ VALUES ($pid, $r, $w);
105
+ }
106
+ }
107
+
108
+ $fossil destroy
109
+ }
110
+ return
111
+ }
112
+
113
+ typemethod discard {} {
114
+ # Pass manager interface. Executed for all passes after the
115
+ # run passes, to remove all data of this pass from the state,
116
+ # as being out of date.
117
+
118
+ # Not discarding revuuid/space here, allow us to keep the info
119
+ # for the next pass even if the revisions are recomputed.
120
+ return
121
+ }
122
+
123
+ # # ## ### ##### ######## #############
124
+ ## Internal methods
125
+
126
+ # # ## ### ##### ######## #############
127
+ ## Configuration
128
+
129
+ pragma -hasinstances no ; # singleton
130
+ pragma -hastypeinfo no ; # no introspection
131
+ pragma -hastypedestroy no ; # immortal
132
+
133
+ # # ## ### ##### ######## #############
134
+}
135
+
136
+namespace eval ::vc::fossil::import::cvs::pass {
137
+ namespace export importfiles
138
+ namespace eval importfiles {
139
+ namespace import ::vc::fossil::import::cvs::repository
140
+ namespace import ::vc::fossil::import::cvs::state
141
+ namespace import ::vc::fossil::import::cvs::fossil
142
+ namespace import ::vc::tools::log
143
+ log register importfiles
144
+ }
145
+}
146
+
147
+# # ## ### ##### ######## ############# #####################
148
+## Ready
149
+
150
+package provide vc::fossil::import::cvs::pass::importfiles 1.0
151
+return
--- a/tools/cvs2fossil/lib/c2f_pimportfiles.tcl
+++ b/tools/cvs2fossil/lib/c2f_pimportfiles.tcl
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/cvs2fossil/lib/c2f_pimportfiles.tcl
+++ b/tools/cvs2fossil/lib/c2f_pimportfiles.tcl
@@ -0,0 +1,151 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2007-2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9 # individuals. For exact contribution history, see the revision
10 # history and logs, available at http://fossil-scm.hwaci.com/fossil
11 # # ## ### ##### ######## ############# #####################
12
13 ## Pass XII. This is the first of the backend passes. It imports the
14 ## revisions of all files into one or more fossil repositories, one
15 ## per project.
16
17 # # ## ### ##### ######## ############# #####################
18 ## Requirements
19
20 package require Tcl 8.4 ; # Required runtime.
21 package require snit ; # OO system.
22 package require vc::tools::log ; # User feedback.
23 package require vc::fossil::import::cvs::repository ; # Repository management.
24 package require vc::fossil::import::cvs::state ; # State storage.
25 package require vc::fossil::import::cvs::fossil ; # Access to fossil repositories.
26
27 # # ## ### ##### ######## ############# #####################
28 ## Register the pass with the management
29
30 vc::fossil::import::cvs::pass define \
31 ImportFiles \
32 {Import the file revisions into fossil repositories} \
33 ::vc::fossil::import::cvs::pass::importfiles
34
35 # # ## ### ##### ######## ############# #####################
36 ##
37
38 snit::type ::vc::fossil::import::cvs::pass::importfiles {
39 # # ## ### ##### ######## #############
40 ## Public API
41
42 typemethod setup {} {
43 # Define the names and structure of the persistent state of
44 # this pass.
45
46 state use project
47 state use file
48 state use revision
49 state use meta
50 state use author
51 state use cmessage
52 state use symbol
53
54 # Discard on setup. Do not discard on deferal.
55 state discard revuuid
56 state extend revuuid {
57 rid INTEGER NOT NULL REFERENCES revision UNIQUE,
58 uuid INTEGER NOT NULL -- fossil id of the revision
59 -- unique within the project
60 }
61
62 # Remember the locations of the scratch data createdby this
63 # pass, for use by the next (importing changesets).
64 state discard space
65 state extend space {
66 pid INTEGER NOT NULL REFERENCES project,
67 repository TEXT NOT NULL,
68 workspace TEXT NOT NULL
69 }
70 return
71 }
72
73 typemethod load {} {
74 # Pass manager interface. Executed to load data computed by
75 # this pass into memory when this pass is skipped instead of
76 # executed.
77 return
78 }
79
80 typemethod run {} {
81 # Pass manager interface. Executed to perform the
82 # functionality of the pass.
83
84 foreach project [repository projects] {
85 log write 1 importfiles {Importing project "[$project base]"}
86
87 set pid [$project id]
88 set fossil [fossil %AUTO%]
89 $fossil initialize
90
91 state transaction {
92 # Layer I: Files and their revisions
93 foreach file [$project files] {
94 $file pushto $fossil
95 }
96
97 # Save the scratch locations, needed by the next pass.
98 struct::list assign [$fossil space] r w
99 state run {
100 DELETE FROM space
101 WHERE pid = $pid
102 ;
103 INSERT INTO space (pid, repository, workspace)
104 VALUES ($pid, $r, $w);
105 }
106 }
107
108 $fossil destroy
109 }
110 return
111 }
112
113 typemethod discard {} {
114 # Pass manager interface. Executed for all passes after the
115 # run passes, to remove all data of this pass from the state,
116 # as being out of date.
117
118 # Not discarding revuuid/space here, allow us to keep the info
119 # for the next pass even if the revisions are recomputed.
120 return
121 }
122
123 # # ## ### ##### ######## #############
124 ## Internal methods
125
126 # # ## ### ##### ######## #############
127 ## Configuration
128
129 pragma -hasinstances no ; # singleton
130 pragma -hastypeinfo no ; # no introspection
131 pragma -hastypedestroy no ; # immortal
132
133 # # ## ### ##### ######## #############
134 }
135
136 namespace eval ::vc::fossil::import::cvs::pass {
137 namespace export importfiles
138 namespace eval importfiles {
139 namespace import ::vc::fossil::import::cvs::repository
140 namespace import ::vc::fossil::import::cvs::state
141 namespace import ::vc::fossil::import::cvs::fossil
142 namespace import ::vc::tools::log
143 log register importfiles
144 }
145 }
146
147 # # ## ### ##### ######## ############# #####################
148 ## Ready
149
150 package provide vc::fossil::import::cvs::pass::importfiles 1.0
151 return
--- a/tools/cvs2fossil/lib/c2f_pimportfinal.tcl
+++ b/tools/cvs2fossil/lib/c2f_pimportfinal.tcl
@@ -0,0 +1,122 @@
1
+## -*- tcl -*-
2
+# # ## ### ##### ######## ############# #####################
3
+## Copyright (c) 2008 Andreas Kupries.
4
+#
5
+# This software is licensed as described in the file LICENSE, which
6
+# you should have received as part of this distribution.
7
+#
8
+# This software consists of voluntary contributions made by many
9
+# individuals. For exact contribution history, see the revision
10
+# history and logs, available at http://fossil-scm.hwaci.com/fossil
11
+# # ## ### ##### ######## ############# #####################
12
+
13
+## Pass XIV. This is the third and last of the backend passes. It
14
+## finalizes the fossil repositories we have constructed in the
15
+## previous import passes.
16
+
17
+# # ## ### ##### ######## ############# #####################
18
+## Requirements
19
+
20
+package require Tcl 8.4 ; # Required runtime.
21
+package require snit ; # OO system.
22
+package require vc::tools::log ; # User feedback.
23
+package require vc::fossil::import::cvs::repository ; # Repository management.
24
+package require vc::fossil::import::cvs::state ; # State storage.
25
+package require vc::fossil::import::cvs::fossil ; # Access to fossil repositories.
26
+
27
+# # ## ### ##### ######## ############# #####################
28
+## Register the pass with the management
29
+
30
+vc::fossil::import::cvs::pass define \
31
+ ImportFinal \
32
+ {Finalize the import into fossil repositories} \
33
+ ::vc::fossil::import::cvs::pass::importfinal
34
+
35
+# # ## ### ##### ######## ############# #####################
36
+##
37
+
38
+snit::type ::vc::fossil::import::cvs::pass::importfinal {
39
+ # # ## ### ##### ######## #############
40
+ ## Public API
41
+
42
+ typemethod setup {} {
43
+ # Define the names and structure of the persistent state of
44
+ # this pass.
45
+
46
+ state use space
47
+ return
48
+ }
49
+
50
+ typemethod load {} {
51
+ # Pass manager interface. Executed to load data computed by
52
+ # this pass into memory when this pass is skipped instead of
53
+ # executed.
54
+ return
55
+ }
56
+
57
+ typemethod run {} {
58
+ # Pass manager interface. Executed to perform the
59
+ # functionality of the pass.
60
+
61
+ foreach project [repository projects] {
62
+ log write 1 importfinal {Finalize project "[$project base]"}
63
+
64
+ set pid [$project id]
65
+ set fossil [fossil %AUTO%]
66
+ struct::list assign [state run {
67
+ SELECT repository, workspace
68
+ FROM space
69
+ WHERE pid = $pid
70
+ }] r w
71
+ $fossil load $r $w
72
+
73
+ # At last copy the temporary repository file to its final
74
+ # destination and release the associated memory.
75
+
76
+ set destination [$project base]
77
+ if {$destination eq ""} {
78
+ set destination [file tail [repository base?]]
79
+ }
80
+ append destination .fsl
81
+
82
+ $fossil finalize $destination ; # implies destroy
83
+ }
84
+ return
85
+ }
86
+
87
+ typemethod discard {} {
88
+ # Pass manager interface. Executed for all passes after the
89
+ # run passes, to remove all data of this pass from the state,
90
+ # as being out of date.
91
+ return
92
+ }
93
+
94
+ # # ## ### ##### ######## #############
95
+ ## Internal methods
96
+
97
+ # # ## ### ##### ######## #############
98
+ ## Configuration
99
+
100
+ pragma -hasinstances no ; # singleton
101
+ pragma -hastypeinfo no ; # no introspection
102
+ pragma -hastypedestroy no ; # immortal
103
+
104
+ # # ## ### ##### ######## #############
105
+}
106
+
107
+namespace eval ::vc::fossil::import::cvs::pass {
108
+ namespace export importfinal
109
+ namespace eval importfinal {
110
+ namespace import ::vc::fossil::import::cvs::repository
111
+ namespace import ::vc::fossil::import::cvs::state
112
+ namespace import ::vc::fossil::import::cvs::fossil
113
+ namespace import ::vc::tools::log
114
+ log register importfinal
115
+ }
116
+}
117
+
118
+# # ## ### ##### ######## ############# #####################
119
+## Ready
120
+
121
+package provide vc::fossil::import::cvs::pass::importfinal 1.0
122
+return
--- a/tools/cvs2fossil/lib/c2f_pimportfinal.tcl
+++ b/tools/cvs2fossil/lib/c2f_pimportfinal.tcl
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/cvs2fossil/lib/c2f_pimportfinal.tcl
+++ b/tools/cvs2fossil/lib/c2f_pimportfinal.tcl
@@ -0,0 +1,122 @@
1 ## -*- tcl -*-
2 # # ## ### ##### ######## ############# #####################
3 ## Copyright (c) 2008 Andreas Kupries.
4 #
5 # This software is licensed as described in the file LICENSE, which
6 # you should have received as part of this distribution.
7 #
8 # This software consists of voluntary contributions made by many
9 # individuals. For exact contribution history, see the revision
10 # history and logs, available at http://fossil-scm.hwaci.com/fossil
11 # # ## ### ##### ######## ############# #####################
12
13 ## Pass XIV. This is the third and last of the backend passes. It
14 ## finalizes the fossil repositories we have constructed in the
15 ## previous import passes.
16
17 # # ## ### ##### ######## ############# #####################
18 ## Requirements
19
20 package require Tcl 8.4 ; # Required runtime.
21 package require snit ; # OO system.
22 package require vc::tools::log ; # User feedback.
23 package require vc::fossil::import::cvs::repository ; # Repository management.
24 package require vc::fossil::import::cvs::state ; # State storage.
25 package require vc::fossil::import::cvs::fossil ; # Access to fossil repositories.
26
27 # # ## ### ##### ######## ############# #####################
28 ## Register the pass with the management
29
30 vc::fossil::import::cvs::pass define \
31 ImportFinal \
32 {Finalize the import into fossil repositories} \
33 ::vc::fossil::import::cvs::pass::importfinal
34
35 # # ## ### ##### ######## ############# #####################
36 ##
37
38 snit::type ::vc::fossil::import::cvs::pass::importfinal {
39 # # ## ### ##### ######## #############
40 ## Public API
41
42 typemethod setup {} {
43 # Define the names and structure of the persistent state of
44 # this pass.
45
46 state use space
47 return
48 }
49
50 typemethod load {} {
51 # Pass manager interface. Executed to load data computed by
52 # this pass into memory when this pass is skipped instead of
53 # executed.
54 return
55 }
56
57 typemethod run {} {
58 # Pass manager interface. Executed to perform the
59 # functionality of the pass.
60
61 foreach project [repository projects] {
62 log write 1 importfinal {Finalize project "[$project base]"}
63
64 set pid [$project id]
65 set fossil [fossil %AUTO%]
66 struct::list assign [state run {
67 SELECT repository, workspace
68 FROM space
69 WHERE pid = $pid
70 }] r w
71 $fossil load $r $w
72
73 # At last copy the temporary repository file to its final
74 # destination and release the associated memory.
75
76 set destination [$project base]
77 if {$destination eq ""} {
78 set destination [file tail [repository base?]]
79 }
80 append destination .fsl
81
82 $fossil finalize $destination ; # implies destroy
83 }
84 return
85 }
86
87 typemethod discard {} {
88 # Pass manager interface. Executed for all passes after the
89 # run passes, to remove all data of this pass from the state,
90 # as being out of date.
91 return
92 }
93
94 # # ## ### ##### ######## #############
95 ## Internal methods
96
97 # # ## ### ##### ######## #############
98 ## Configuration
99
100 pragma -hasinstances no ; # singleton
101 pragma -hastypeinfo no ; # no introspection
102 pragma -hastypedestroy no ; # immortal
103
104 # # ## ### ##### ######## #############
105 }
106
107 namespace eval ::vc::fossil::import::cvs::pass {
108 namespace export importfinal
109 namespace eval importfinal {
110 namespace import ::vc::fossil::import::cvs::repository
111 namespace import ::vc::fossil::import::cvs::state
112 namespace import ::vc::fossil::import::cvs::fossil
113 namespace import ::vc::tools::log
114 log register importfinal
115 }
116 }
117
118 # # ## ### ##### ######## ############# #####################
119 ## Ready
120
121 package provide vc::fossil::import::cvs::pass::importfinal 1.0
122 return
--- tools/cvs2fossil/lib/cvs2fossil.tcl
+++ tools/cvs2fossil/lib/cvs2fossil.tcl
@@ -39,11 +39,13 @@
3939
package require vc::fossil::import::cvs::pass::breakrcycle ; # Break' R'evision Cycle's
4040
package require vc::fossil::import::cvs::pass::rtopsort ; # R'evision Top'ological Sort'
4141
package require vc::fossil::import::cvs::pass::breakscycle ; # Break' S'ymbol Cycle's
4242
package require vc::fossil::import::cvs::pass::breakacycle ; # Break' A'll Cycle's
4343
package require vc::fossil::import::cvs::pass::atopsort ; # A'll Top'ological Sort'
44
-package require vc::fossil::import::cvs::pass::import ; # Import' Files and Changesets
44
+package require vc::fossil::import::cvs::pass::importfiles ; # Import' Files
45
+package require vc::fossil::import::cvs::pass::importcsets ; # Import' Changesets
46
+package require vc::fossil::import::cvs::pass::importfinal ; # Import' Finalization
4547
4648
# # ## ### ##### ######## ############# #####################
4749
## Support for passes etc.
4850
4951
package require vc::fossil::import::cvs::option ; # Cmd line parsing & database
5052
--- tools/cvs2fossil/lib/cvs2fossil.tcl
+++ tools/cvs2fossil/lib/cvs2fossil.tcl
@@ -39,11 +39,13 @@
39 package require vc::fossil::import::cvs::pass::breakrcycle ; # Break' R'evision Cycle's
40 package require vc::fossil::import::cvs::pass::rtopsort ; # R'evision Top'ological Sort'
41 package require vc::fossil::import::cvs::pass::breakscycle ; # Break' S'ymbol Cycle's
42 package require vc::fossil::import::cvs::pass::breakacycle ; # Break' A'll Cycle's
43 package require vc::fossil::import::cvs::pass::atopsort ; # A'll Top'ological Sort'
44 package require vc::fossil::import::cvs::pass::import ; # Import' Files and Changesets
 
 
45
46 # # ## ### ##### ######## ############# #####################
47 ## Support for passes etc.
48
49 package require vc::fossil::import::cvs::option ; # Cmd line parsing & database
50
--- tools/cvs2fossil/lib/cvs2fossil.tcl
+++ tools/cvs2fossil/lib/cvs2fossil.tcl
@@ -39,11 +39,13 @@
39 package require vc::fossil::import::cvs::pass::breakrcycle ; # Break' R'evision Cycle's
40 package require vc::fossil::import::cvs::pass::rtopsort ; # R'evision Top'ological Sort'
41 package require vc::fossil::import::cvs::pass::breakscycle ; # Break' S'ymbol Cycle's
42 package require vc::fossil::import::cvs::pass::breakacycle ; # Break' A'll Cycle's
43 package require vc::fossil::import::cvs::pass::atopsort ; # A'll Top'ological Sort'
44 package require vc::fossil::import::cvs::pass::importfiles ; # Import' Files
45 package require vc::fossil::import::cvs::pass::importcsets ; # Import' Changesets
46 package require vc::fossil::import::cvs::pass::importfinal ; # Import' Finalization
47
48 # # ## ### ##### ######## ############# #####################
49 ## Support for passes etc.
50
51 package require vc::fossil::import::cvs::option ; # Cmd line parsing & database
52
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -22,11 +22,13 @@
2222
package ifneeded vc::fossil::import::cvs::pass::breakrcycle 1.0 [list source [file join $dir c2f_pbreakrcycle.tcl]]
2323
package ifneeded vc::fossil::import::cvs::pass::rtopsort 1.0 [list source [file join $dir c2f_prtopsort.tcl]]
2424
package ifneeded vc::fossil::import::cvs::pass::breakscycle 1.0 [list source [file join $dir c2f_pbreakscycle.tcl]]
2525
package ifneeded vc::fossil::import::cvs::pass::breakacycle 1.0 [list source [file join $dir c2f_pbreakacycle.tcl]]
2626
package ifneeded vc::fossil::import::cvs::pass::atopsort 1.0 [list source [file join $dir c2f_patopsort.tcl]]
27
-package ifneeded vc::fossil::import::cvs::pass::import 1.0 [list source [file join $dir c2f_pimport.tcl]]
27
+package ifneeded vc::fossil::import::cvs::pass::importfiles 1.0 [list source [file join $dir c2f_pimportfiles.tcl]]
28
+package ifneeded vc::fossil::import::cvs::pass::importcsets 1.0 [list source [file join $dir c2f_pimportcsets.tcl]]
29
+package ifneeded vc::fossil::import::cvs::pass::importfinal 1.0 [list source [file join $dir c2f_pimportfinal.tcl]]
2830
package ifneeded vc::fossil::import::cvs::gtcore 1.0 [list source [file join $dir c2f_gtcore.tcl]]
2931
package ifneeded vc::fossil::import::cvs::cyclebreaker 1.0 [list source [file join $dir c2f_cyclebreaker.tcl]]
3032
package ifneeded vc::fossil::import::cvs::project 1.0 [list source [file join $dir c2f_project.tcl]]
3133
package ifneeded vc::fossil::import::cvs::project::rev 1.0 [list source [file join $dir c2f_prev.tcl]]
3234
package ifneeded vc::fossil::import::cvs::project::revlink 1.0 [list source [file join $dir c2f_prevlink.tcl]]
3335
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -22,11 +22,13 @@
22 package ifneeded vc::fossil::import::cvs::pass::breakrcycle 1.0 [list source [file join $dir c2f_pbreakrcycle.tcl]]
23 package ifneeded vc::fossil::import::cvs::pass::rtopsort 1.0 [list source [file join $dir c2f_prtopsort.tcl]]
24 package ifneeded vc::fossil::import::cvs::pass::breakscycle 1.0 [list source [file join $dir c2f_pbreakscycle.tcl]]
25 package ifneeded vc::fossil::import::cvs::pass::breakacycle 1.0 [list source [file join $dir c2f_pbreakacycle.tcl]]
26 package ifneeded vc::fossil::import::cvs::pass::atopsort 1.0 [list source [file join $dir c2f_patopsort.tcl]]
27 package ifneeded vc::fossil::import::cvs::pass::import 1.0 [list source [file join $dir c2f_pimport.tcl]]
 
 
28 package ifneeded vc::fossil::import::cvs::gtcore 1.0 [list source [file join $dir c2f_gtcore.tcl]]
29 package ifneeded vc::fossil::import::cvs::cyclebreaker 1.0 [list source [file join $dir c2f_cyclebreaker.tcl]]
30 package ifneeded vc::fossil::import::cvs::project 1.0 [list source [file join $dir c2f_project.tcl]]
31 package ifneeded vc::fossil::import::cvs::project::rev 1.0 [list source [file join $dir c2f_prev.tcl]]
32 package ifneeded vc::fossil::import::cvs::project::revlink 1.0 [list source [file join $dir c2f_prevlink.tcl]]
33
--- tools/cvs2fossil/lib/pkgIndex.tcl
+++ tools/cvs2fossil/lib/pkgIndex.tcl
@@ -22,11 +22,13 @@
22 package ifneeded vc::fossil::import::cvs::pass::breakrcycle 1.0 [list source [file join $dir c2f_pbreakrcycle.tcl]]
23 package ifneeded vc::fossil::import::cvs::pass::rtopsort 1.0 [list source [file join $dir c2f_prtopsort.tcl]]
24 package ifneeded vc::fossil::import::cvs::pass::breakscycle 1.0 [list source [file join $dir c2f_pbreakscycle.tcl]]
25 package ifneeded vc::fossil::import::cvs::pass::breakacycle 1.0 [list source [file join $dir c2f_pbreakacycle.tcl]]
26 package ifneeded vc::fossil::import::cvs::pass::atopsort 1.0 [list source [file join $dir c2f_patopsort.tcl]]
27 package ifneeded vc::fossil::import::cvs::pass::importfiles 1.0 [list source [file join $dir c2f_pimportfiles.tcl]]
28 package ifneeded vc::fossil::import::cvs::pass::importcsets 1.0 [list source [file join $dir c2f_pimportcsets.tcl]]
29 package ifneeded vc::fossil::import::cvs::pass::importfinal 1.0 [list source [file join $dir c2f_pimportfinal.tcl]]
30 package ifneeded vc::fossil::import::cvs::gtcore 1.0 [list source [file join $dir c2f_gtcore.tcl]]
31 package ifneeded vc::fossil::import::cvs::cyclebreaker 1.0 [list source [file join $dir c2f_cyclebreaker.tcl]]
32 package ifneeded vc::fossil::import::cvs::project 1.0 [list source [file join $dir c2f_project.tcl]]
33 package ifneeded vc::fossil::import::cvs::project::rev 1.0 [list source [file join $dir c2f_prev.tcl]]
34 package ifneeded vc::fossil::import::cvs::project::revlink 1.0 [list source [file join $dir c2f_prevlink.tcl]]
35

Keyboard Shortcuts

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