author | fm |
Mon, 19 Oct 2009 14:23:41 +0200 | |
changeset 446 | fb1d0a725ae0 |
parent 321 | 83467e93cf4f |
child 692 | d91ed9be5c25 |
permissions | -rw-r--r-- |
446 | 1 |
"{ Package: 'stx:libsvn' }" |
66 | 2 |
|
3 |
"{ NameSpace: SVN }" |
|
4 |
||
5 |
CVSTask subclass:#ImportFromCVSTask |
|
6 |
instanceVariableNames:'svnRoot' |
|
7 |
classVariableNames:'SVNRoot' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'SVN-Tasks' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!ImportFromCVSTask class methodsFor:'accessing'! |
|
14 |
||
15 |
svnRoot |
|
16 |
||
17 |
^SVNRoot |
|
18 |
||
19 |
" |
|
20 |
self svnRoot |
|
21 |
self svnRoot: '/home/janfrog/Projects/SmalltalkX/sandbox/svn' |
|
22 |
" |
|
23 |
||
24 |
"Created: / 25-05-2009 / 21:06:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
25 |
"Modified: / 29-05-2009 / 16:47:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
26 |
! |
|
27 |
||
28 |
svnRoot: aString |
|
29 |
||
30 |
SVNRoot := aString |
|
31 |
||
32 |
" |
|
33 |
self svnRoot |
|
34 |
self svnRoot: '/home/janfrog/Projects/SmalltalkX/sandbox/svn' |
|
35 |
" |
|
36 |
||
37 |
"Created: / 25-05-2009 / 21:07:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
38 |
"Modified: / 26-05-2009 / 18:26:37 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
39 |
! ! |
|
40 |
||
41 |
!ImportFromCVSTask class methodsFor:'examples'! |
|
42 |
||
43 |
migrate_eXept_repository |
|
44 |
self import:#( #'stx:libbasic' |
|
45 |
#'stx:libbasic2' |
|
46 |
#'stx:libbasic3' |
|
47 |
#'stx:libcomp' ) |
|
48 |
logOn:'/tmp/migrate_eXept.log' |
|
49 |
||
50 |
" |
|
51 |
SVN::CVSMigrationTool migrate_eXept_repository" |
|
52 |
"Created: / 26-05-2009 / 17:34:08 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
53 |
! |
|
54 |
||
55 |
migrate_eXept_repository_tinytalk |
|
56 |
self import:#( #'stx:libbasic' |
|
57 |
#'stx:libbasic2' |
|
58 |
#'stx:libbasic3' |
|
59 |
#'stx:libcomp' |
|
60 |
#'stx:projects/tinytalk' ) |
|
61 |
logOn:'/tmp/migrate_eXept.log' |
|
62 |
||
63 |
" |
|
64 |
SVN::CVSMigrationTool migrate_eXept_repository_tinytalk" |
|
65 |
"Created: / 27-05-2009 / 10:08:30 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
66 |
! |
|
67 |
||
68 |
migrate_stx_libbasic2 |
|
69 |
self import:#'stx:libbasic2' |
|
70 |
||
71 |
" |
|
72 |
SVN::CVSMigrationTool migrate_stx_libbasic2" |
|
73 |
"Created: / 25-05-2009 / 19:41:52 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
74 |
"Modified: / 27-05-2009 / 10:09:43 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
75 |
! |
|
76 |
||
77 |
migrate_stx_libtool |
|
78 |
self import:#'stx:libbasic' |
|
79 |
||
80 |
" |
|
81 |
SVN::CVSMigrationTool migrate_stx_libtool" |
|
82 |
"Created: / 25-05-2009 / 22:12:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
83 |
"Modified: / 26-05-2009 / 18:22:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
84 |
! ! |
|
85 |
||
86 |
!ImportFromCVSTask class methodsFor:'migration'! |
|
87 |
||
88 |
import:pkgs |
|
89 |
^ self doFor:pkgs |
|
90 |
||
91 |
"Created: / 28-05-2009 / 11:08:54 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
92 |
! |
|
93 |
||
94 |
import:pkgs logOn:log |
|
95 |
^ self doFor:pkgs logOn:log |
|
96 |
||
97 |
"Created: / 28-05-2009 / 11:09:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
98 |
! ! |
|
99 |
||
100 |
!ImportFromCVSTask methodsFor:'executing'! |
|
101 |
||
102 |
do |
|
103 |
self notify:'Importing package ' , package. |
|
104 |
self |
|
105 |
doChecks; |
|
106 |
doPrepareRepositories; |
|
107 |
doCVS2SVN; |
|
108 |
doSVNFixPackageContent; |
|
109 |
doCleanup. |
|
110 |
self notify:'Package ' , package , ' imported' |
|
111 |
||
112 |
"Created: / 29-05-2009 / 18:05:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
113 |
"Modified: / 31-05-2009 / 10:17:18 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
114 |
! |
|
115 |
||
116 |
doCVS2SVN |
|
117 |
||
118 |
| cvs2svn | |
|
119 |
||
120 |
||
121 |
self notify: 'Importing CVS repository into SVN'. |
|
122 |
||
123 |
(svnRoot construct:packageDir) directory recursiveMakeDirectory. |
|
124 |
cvs2svn := OSProcess new |
|
125 |
executable: '/usr/bin/cvs2svn'; |
|
126 |
arguments: { |
|
127 |
'--quiet'. '--quiet'. |
|
128 |
"/'--use-cvs'. |
|
129 |
'--use-rcs'. |
|
130 |
'--encoding=ascii'. |
|
131 |
'--encoding=utf8'. |
|
132 |
'--encoding=latin_1'. |
|
133 |
'--encoding=iso8859_2'. |
|
134 |
'--tmpdir=' , (tmpDir construct:'cvs2svn-tmp') pathName. |
|
135 |
'--svnrepos'. (svnRoot construct: packageDir) pathName. |
|
136 |
||
137 |
(cvsRoot construct: packageDir) pathName. |
|
138 |
}; |
|
139 |
stdout: transcript; |
|
140 |
stderr: transcript. |
|
141 |
||
142 |
cvs2svn execute. |
|
143 |
self |
|
144 |
assert: cvs2svn exitValue = 0 |
|
145 |
message: 'cvs2svn failed to finish properly. Check transcript'. |
|
146 |
||
147 |
"Created: / 29-05-2009 / 18:05:42 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
148 |
"Modified: / 19-08-2009 / 11:48:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
149 |
! |
|
150 |
||
151 |
doChecks |
|
152 |
||
153 |
self notify: 'Checking repositories'. |
|
154 |
||
155 |
self |
|
156 |
assert:cvsRoot exists |
|
157 |
message:'cvsRoot does not exist'; |
|
158 |
||
159 |
assert:(cvsRoot construct:'CVSROOT') exists |
|
160 |
message:'cvsRoot seems not to be a valid CVS root (no CVSROOT directory)'; |
|
161 |
||
162 |
assert:(cvsRoot construct:packageDir) exists |
|
163 |
message:'cvsRoot seems does not contain given package'; |
|
164 |
||
165 |
assert:svnRoot exists |
|
166 |
message:'svnRoot does not exist'; |
|
167 |
||
168 |
assert:(svnRoot construct:packageDir) exists not |
|
169 |
message:'SVN repository already exists in svnRoot' |
|
170 |
||
171 |
"Created: / 29-05-2009 / 17:18:57 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
172 |
"Modified: / 30-05-2009 / 16:03:29 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
173 |
! |
|
174 |
||
175 |
doPrepareRepositories |
|
176 |
self doCVSRemoveDuplicateCommaVFilesInAttic |
|
177 |
||
178 |
"Created: / 29-05-2009 / 18:02:49 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
179 |
! |
|
180 |
||
181 |
doSVNFixPackageContent |
|
182 |
self |
|
183 |
doSVNCheckout; |
|
184 |
doFixPackageContentIn: workingCopy path; |
|
185 |
doSVNSetSvnEolStylePropertyFor: #( '*.st' ); |
|
186 |
doSVNSetSvnKeywordPropertyFor: #( '*.st' ); |
|
187 |
doSVNCommit |
|
188 |
||
189 |
"Created: / 29-05-2009 / 18:06:35 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
190 |
"Modified: / 19-08-2009 / 11:26:38 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
191 |
! ! |
|
192 |
||
193 |
!ImportFromCVSTask methodsFor:'executing - private'! |
|
194 |
||
195 |
doCVSRemoveDuplicateCommaVFilesInAttic |
|
196 |
||
197 |
self notify: 'Removing duplicate *,v files in Attic'. |
|
198 |
||
199 |
self doRemoveDuplicateCommaVFilesInAtticIn:(cvsRoot construct:packageDir). |
|
200 |
||
201 |
"Created: / 25-05-2009 / 22:28:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
202 |
"Modified: / 30-05-2009 / 16:04:36 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
203 |
! ! |
|
204 |
||
205 |
!ImportFromCVSTask methodsFor:'initialization'! |
|
206 |
||
207 |
initialize |
|
208 |
||
209 |
super initialize. |
|
210 |
svnRoot := self class svnRoot asFilename. |
|
211 |
||
212 |
"Created: / 28-05-2009 / 09:06:08 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
213 |
! ! |
|
214 |
||
215 |
!ImportFromCVSTask methodsFor:'private'! |
|
216 |
||
217 |
removeFiles: filenames |
|
218 |
(DeleteCommand new) |
|
219 |
workingCopy: workingCopy; |
|
220 |
paths: filenames; |
|
221 |
execute |
|
222 |
||
223 |
"Created: / 30-05-2009 / 16:09:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
224 |
"Modified: / 19-08-2009 / 11:28:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
225 |
! |
|
226 |
||
227 |
renameFile: oldFilename to: newFilename |
|
228 |
(MoveCommand new) |
|
229 |
workingCopy: workingCopy; |
|
230 |
src: oldFilename pathName; |
|
231 |
dst: newFilename pathName; |
|
232 |
execute. |
|
233 |
||
234 |
"Created: / 30-05-2009 / 16:09:10 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
235 |
"Modified: / 19-08-2009 / 11:28:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
236 |
! |
|
237 |
||
238 |
svnBranchPath |
|
239 |
"raise an error: must be redefined in concrete subclass(es)" |
|
240 |
||
241 |
^'/trunk' |
|
242 |
||
243 |
"Modified: / 19-08-2009 / 11:18:34 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
244 |
! |
|
245 |
||
246 |
svnCommitMessage |
|
247 |
^ 'Manufactured by SVN::ImportFromCVSTask to fix repository layout' |
|
248 |
||
249 |
"Modified: / 30-05-2009 / 16:15:57 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
250 |
! |
|
251 |
||
252 |
svnRepositoryUrl |
|
253 |
^ 'file://' , (svnRoot asAbsoluteFilename construct:packageDir) pathName |
|
254 |
||
255 |
"Modified: / 19-08-2009 / 11:09:25 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
256 |
! ! |
|
257 |
||
258 |
!ImportFromCVSTask class methodsFor:'documentation'! |
|
259 |
||
260 |
version |
|
261 |
^ '$Header$' |
|
138 | 262 |
! |
263 |
||
264 |
version_CVS |
|
265 |
^ '$Header$' |
|
266 |
! |
|
267 |
||
268 |
version_SVN |
|
321
83467e93cf4f
update #version_SVN with § as keyword expansion character
fm
parents:
138
diff
changeset
|
269 |
^'§Id: SVN__ImportFromCVSTask.st 110 2009-08-19 13:21:10Z vranyj1 §' |
66 | 270 |
! ! |