author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 11 Apr 2012 18:16:30 +0200 | |
changeset 1097 | dfb1b29688d1 |
parent 1083 | 5e80705106c0 |
child 1105 | b78c2d9e3b07 |
permissions | -rw-r--r-- |
665 | 1 |
" |
2 |
Copyright (c) 2007-2010 Jan Vrany |
|
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
4 |
||
5 |
Permission is hereby granted, free of charge, to any person |
|
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
25 |
" |
|
482 | 26 |
"{ Package: 'stx:libsvn' }" |
378 | 27 |
|
28 |
AbstractSourceCodeManager subclass:#SVNSourceCodeManager |
|
956 | 29 |
instanceVariableNames:'' |
30 |
classVariableNames:'LoadInProgressQuery' |
|
31 |
poolDictionaries:'' |
|
32 |
category:'System-SourceCodeManagement' |
|
955 | 33 |
! |
34 |
||
35 |
SourceCodeManagerUtilities subclass:#Utilities |
|
956 | 36 |
instanceVariableNames:'' |
37 |
classVariableNames:'' |
|
38 |
poolDictionaries:'' |
|
39 |
privateIn:SVNSourceCodeManager |
|
378 | 40 |
! |
41 |
||
42 |
!SVNSourceCodeManager class methodsFor:'documentation'! |
|
43 |
||
665 | 44 |
copyright |
45 |
" |
|
46 |
Copyright (c) 2007-2010 Jan Vrany |
|
47 |
Copyright (c) 2009-2010 eXept Software AG |
|
48 |
||
49 |
Permission is hereby granted, free of charge, to any person |
|
50 |
obtaining a copy of this software and associated documentation |
|
51 |
files (the 'Software'), to deal in the Software without |
|
52 |
restriction, including without limitation the rights to use, |
|
53 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
54 |
copies of the Software, and to permit persons to whom the |
|
55 |
Software is furnished to do so, subject to the following |
|
56 |
conditions: |
|
57 |
||
58 |
The above copyright notice and this permission notice shall be |
|
59 |
included in all copies or substantial portions of the Software. |
|
60 |
||
61 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
62 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
63 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
64 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
65 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
66 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
67 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
68 |
OTHER DEALINGS IN THE SOFTWARE. |
|
69 |
||
70 |
" |
|
71 |
! |
|
72 |
||
378 | 73 |
documentation |
74 |
" |
|
75 |
For now, this is a dummy SourceCodeManager. |
|
76 |
It is only provided to deliver the correct versionMethodNameTemplates |
|
77 |
and versionMethod names. |
|
78 |
||
79 |
Might get more in the future. |
|
80 |
" |
|
81 |
! ! |
|
82 |
||
665 | 83 |
!SVNSourceCodeManager class methodsFor:'Signal constants'! |
84 |
||
85 |
loadInProgressQuery |
|
86 |
||
87 |
LoadInProgressQuery ifNil: |
|
955 | 88 |
[LoadInProgressQuery := QuerySignal new]. |
665 | 89 |
^LoadInProgressQuery |
90 |
! ! |
|
91 |
||
955 | 92 |
!SVNSourceCodeManager class methodsFor:'accessing'! |
93 |
||
94 |
repositoryNameForPackage:packageId |
|
95 |
"superclass AbstractSourceCodeManager class says that I am responsible to implement this method" |
|
96 |
||
97 |
|repo| |
|
98 |
||
99 |
repo := SVN::RepositoryManager current repositoryForPackage:packageId. |
|
100 |
repo isNil ifTrue:[ |
|
101 |
^ 'N/A' |
|
102 |
] ifFalse:[ |
|
103 |
^ repo url asString |
|
104 |
] |
|
105 |
||
106 |
"Modified: / 10-10-2011 / 19:49:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
107 |
! |
|
108 |
||
968
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
109 |
shownInBrowserMenus |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
110 |
"can be redefined in subclasses which can be suppressed in the browser's menus" |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
111 |
|
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
112 |
^ UserPreferences current svnEnabled |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
113 |
|
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
114 |
"Created: / 08-01-2012 / 19:56:22 / cg" |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
115 |
"Created: / 19-01-2012 / 13:11:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
116 |
! |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
117 |
|
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
118 |
shownInBrowserMenus:aBoolean |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
119 |
"can be redefined in subclasses which can be suppressed in the browser's menus" |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
120 |
|
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
121 |
^ UserPreferences current svnEnabled: aBoolean |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
122 |
|
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
123 |
"Created: / 19-01-2012 / 13:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
124 |
! |
6d8ea40478b6
added shownInBrowserMenus
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
956
diff
changeset
|
125 |
|
955 | 126 |
utilities |
127 |
||
128 |
^Utilities forManager: self. |
|
129 |
||
130 |
"Created: / 11-10-2011 / 11:24:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
131 |
! ! |
|
132 |
||
665 | 133 |
!SVNSourceCodeManager class methodsFor:'basic access'! |
134 |
||
1064
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
135 |
checkin:filename text:contents directory:directory module:module logMessage: message force: force |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
136 |
| branch wc | |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
137 |
|
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
138 |
branch := self branchForModule: module directory: directory. |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
139 |
wc := branch repository workingCopy. |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
140 |
wc ensureIsValid. |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
141 |
(wc path / filename) writingFileDo:[:s|s nextPutAll: contents]. |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
142 |
wc commit: message files: { filename } |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
143 |
|
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
144 |
"Created: / 27-11-2011 / 22:51:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
145 |
"Modified: / 14-03-2012 / 17:16:12 / jv" |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
146 |
! |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
147 |
|
665 | 148 |
checkinClass:aClass fileName:classFileName directory:packageDir module:moduleDir source:sourceFile logMessage:logMessage force:force |
149 |
"checkin of a class into the source repository. |
|
150 |
Return true if ok, false if not." |
|
151 |
||
955 | 152 |
| repo | |
153 |
repo := SVN::RepositoryManager repositoryForModule: moduleDir directory: packageDir. |
|
154 |
repo ifNil:[^false]. |
|
155 |
||
156 |
self shouldImplement: 'Not yet finished'. |
|
157 |
||
158 |
^false |
|
159 |
||
160 |
"Modified: / 12-10-2011 / 18:50:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
665 | 161 |
! |
162 |
||
163 |
checkoutModule:aModule directory:aPackage andDo:aBlock |
|
164 |
"check out everything from a package into a temporary directory. |
|
165 |
Then evaluate aBlock, passing the name of that temp-directory. |
|
166 |
Afterwards, the tempDir is removed. |
|
167 |
Return true, if OK, false if any error occurred." |
|
168 |
||
169 |
| pkg tempDir repo workingCopy ok | |
|
170 |
pkg := (PackageId module: aModule directory: aPackage) asSymbol. |
|
171 |
repo := SVN::RepositoryManager repositoryForPackage: pkg. |
|
172 |
repo ifNil:[self error:('No repository for package %1' bindWith: pkg)]. |
|
173 |
[ok := false. |
|
174 |
tempDir := Filename newTemporaryDirectory. |
|
175 |
workingCopy := repo workingCopyIn: tempDir. |
|
176 |
workingCopy checkout. |
|
177 |
ok := true. |
|
178 |
aBlock value: tempDir] ensure: |
|
955 | 179 |
[[tempDir recursiveRemove] |
180 |
on: Error do: |
|
181 |
[:ex| |
|
956 | 182 |
OperatingSystem isMSWINDOWSlike |
955 | 183 |
ifTrue:[Delay waitForSeconds: 3.[tempDir recursiveRemove] on: Error do:["nothing"]] |
184 |
ifFalse:[ex pass]]]. |
|
665 | 185 |
^ok |
186 |
||
187 |
"Modified: / 19-04-2010 / 20:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
188 |
! |
|
189 |
||
1064
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
190 |
removeContainer:container inModule:module directory:directory |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
191 |
|
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
192 |
| repo wc | |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
193 |
repo := self repositoryForModule: module directory: directory. |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
194 |
repo isNil ifTrue:[ |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
195 |
self error:'No SVN repository'. |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
196 |
^self |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
197 |
]. |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
198 |
wc := repo workingCopy. |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
199 |
wc delete: container |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
200 |
|
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
201 |
"Created: / 23-12-2011 / 18:20:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
202 |
! |
6329f1ac5763
changed: #checkin:text:directory:module:logMessage:force:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1061
diff
changeset
|
203 |
|
665 | 204 |
streamForClass:aClass fileName:classFileName revision:revisionString directory:packageDir module:moduleDir cache:doCache |
205 |
"extract a classes source code and return an open readStream on it. |
|
206 |
A revision of nil selects the current (in image) revision. |
|
207 |
The classes source code is extracted using the revision and the sourceCodeInfo, |
|
208 |
which itself is extracted from the classes packageString." |
|
209 |
||
1061
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
210 |
| pkg repo rev revInfo | |
665 | 211 |
pkg := moduleDir , ':' , packageDir. |
212 |
repo := SVN::RepositoryManager repositoryForPackage: pkg. |
|
955 | 213 |
repo ifNil:[^nil]. |
214 |
(revisionString notNil and:[revisionString ~~ #newest]) ifTrue:[ |
|
1061
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
215 |
"JV@2012-03-13: HACK, as binaryRevision does not work reliably on |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
216 |
CVS HEAD, sigh" |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
217 |
revisionString ~= '0' ifTrue:[ |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
218 |
rev := SVN::Revision fromString: revisionString. |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
219 |
] ifFalse:[ |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
220 |
revInfo := aClass revisionInfoOfManager: self. |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
221 |
revInfo notNil ifTrue:[ |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
222 |
rev := revInfo revision |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
223 |
] ifFalse:[ |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
224 |
"Hmmm....what to se here?" |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
225 |
rev := SVN::Revision head |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
226 |
] |
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
227 |
] |
955 | 228 |
] ifFalse:[ |
229 |
rev := SVN::Revision head. |
|
230 |
]. |
|
231 |
doCache ifTrue:[ |
|
232 |
^SourceCodeCache default |
|
233 |
streamForClass:aClass |
|
234 |
fileName:classFileName |
|
235 |
revision:revisionString |
|
236 |
repository: 'svn' "TODO: Use repository ID here" |
|
237 |
module:moduleDir |
|
238 |
directory:packageDir |
|
239 |
ifAbsent: [:destination| |
|
1059
f37fb1ed1182
changed: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1021
diff
changeset
|
240 |
ActivityNotification notify: ('Checking out ', classFileName , '@' , rev asString , '...'). |
955 | 241 |
[SVN::ExportCommand new |
242 |
branch: repo branch; |
|
243 |
path: classFileName; |
|
244 |
revision: rev; |
|
245 |
destination: destination pathName; |
|
246 |
execute. |
|
247 |
destination exists ifTrue:[ |
|
248 |
destination readStream |
|
249 |
] ifFalse:[ |
|
250 |
nil |
|
251 |
] |
|
252 |
] on: SVN::SVNError do:[ |
|
253 |
nil |
|
254 |
] |
|
255 |
] |
|
256 |
] ifFalse:[ |
|
257 |
^[ |
|
258 |
(repo cat: classFileName revision: rev) readStream |
|
259 |
] on: SVN::SVNError do:[ |
|
260 |
nil |
|
261 |
] |
|
262 |
] |
|
665 | 263 |
|
1059
f37fb1ed1182
changed: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1021
diff
changeset
|
264 |
"Modified: / 13-03-2012 / 15:33:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1061
1bd5efd9d6f2
workaround for CVS HEAD libbasic: #streamForClass:fileName:revision:directory:module:cache:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1059
diff
changeset
|
265 |
"Modified: / 13-03-2012 / 18:11:10 / Jan Vrany <jan.vrany.fit.cvut.cz>" |
665 | 266 |
! ! |
267 |
||
268 |
!SVNSourceCodeManager class methodsFor:'basic administration'! |
|
269 |
||
270 |
checkForExistingContainer:fileName inModule:moduleName directory:dirName |
|
271 |
"check for a container to be present" |
|
272 |
||
955 | 273 |
| repo | |
274 |
repo := SVN::RepositoryManager repositoryForModule: moduleName directory: dirName. |
|
275 |
repo isNil ifTrue:[^self]. |
|
276 |
^repo branch exists: fileName. |
|
277 |
||
278 |
"Modified: / 11-10-2011 / 11:15:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
665 | 279 |
! |
280 |
||
281 |
checkForExistingModule:moduleName |
|
282 |
"check for a module directory to be present" |
|
283 |
||
284 |
^ self shouldImplement |
|
285 |
! |
|
286 |
||
287 |
checkForExistingModule:moduleDir directory:packageDir |
|
288 |
"check for a package directory to be present" |
|
289 |
||
955 | 290 |
| pkg repo | |
291 |
pkg := moduleDir , ':' , packageDir. |
|
292 |
repo := SVN::RepositoryManager repositoryForPackage: pkg. |
|
293 |
^repo exists |
|
294 |
||
295 |
"Modified: / 27-11-2011 / 22:46:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
665 | 296 |
! |
297 |
||
298 |
createContainerFor:aClass inModule:moduleName directory:dirName container:fileName |
|
299 |
"create a new container & check into it an initial version of aClass" |
|
300 |
||
301 |
^ self shouldImplement |
|
302 |
! |
|
303 |
||
304 |
createModule:moduleName |
|
305 |
"create a new module directory" |
|
306 |
||
307 |
^ self shouldImplement |
|
308 |
! |
|
309 |
||
310 |
createModule:module directory:directory |
|
311 |
"create a new package directory" |
|
312 |
||
313 |
^ self shouldImplement |
|
314 |
! |
|
315 |
||
316 |
initialRevisionStringFor:aClass inModule:moduleDir directory:packageDir container:fileName |
|
317 |
"return a string usable as initial revision string" |
|
318 |
||
319 |
^ self shouldImplement |
|
320 |
! |
|
321 |
||
322 |
revisionLogOf:clsOrNil fromRevision:rev1OrNil toRevision:rev2OrNil numberOfRevisions:limitOrNil fileName:classFileName directory:packageDir module:moduleDir |
|
955 | 323 |
"Actually do return a revisionLog. The main worker method." |
324 |
" |
|
325 |
If numRevisionsOrNil is notNil, it limits the number of revision records returned - |
|
326 |
only numRevions of the newest revision infos will be collected. |
|
327 |
||
328 |
The returned information is a structure (IdentityDictionary) |
|
329 |
filled with: |
|
330 |
#container -> the RCS/CVS container file name |
|
331 |
#cvsRoot -> the CVS root (repository) |
|
332 |
#filename -> the actual source file name |
|
333 |
#newestRevision -> the revisionString of the newest revision |
|
334 |
#numberOfRevisions -> the number of revisions in the container (nil for all) |
|
335 |
#revisions -> collection of per-revision info (see below) |
|
336 |
||
337 |
firstRevOrNil / lastRevOrNil specify from which revisions a logEntry is wanted: |
|
338 |
-If firstRevOrNil is nil, the first revision is the initial revision |
|
339 |
otherwise, the log starts with that revision. |
|
340 |
-If lastRevOrNil is nil, the last revision is the newest revision |
|
341 |
otherwise, the log ends with that revision. |
|
342 |
||
343 |
-If both are nil, all logEntries are extracted. |
|
344 |
-If both are 0 (not nil), no logEntries are extracted (i.e. only the header). |
|
345 |
||
346 |
per revision info consists of one record per revision: |
|
347 |
||
348 |
#revision -> the revision string |
|
349 |
#author -> who checked that revision into the repository |
|
350 |
#date -> when was it checked in |
|
351 |
#state -> the RCS state |
|
352 |
#numberOfChangedLines -> the number of changed line w.r.t the previous |
|
353 |
#logMessage -> the checkIn log message |
|
354 |
||
355 |
revisions are ordered newest first |
|
356 |
(i.e. the last entry is for the initial revision; the first for the most recent one) |
|
357 |
Attention: if state = 'dead' that revision is no longer valid. |
|
358 |
" |
|
359 |
||
360 |
| repo log rev1 rev2 limit branch info | |
|
361 |
||
362 |
repo := SVN::RepositoryManager repositoryForModule: moduleDir directory: packageDir. |
|
363 |
repo isNil ifTrue:[^nil"No repository..."]. |
|
364 |
||
365 |
(rev1OrNil == 0 and:[rev2OrNil == 0]) ifTrue:[ |
|
366 |
rev1 := SVN::Revision number:0. |
|
367 |
rev2 := SVN::Revision head. |
|
368 |
limit := 1. |
|
369 |
] ifFalse:[ |
|
370 |
(rev1OrNil == nil and:[rev2OrNil == nil]) ifTrue:[ |
|
371 |
rev1 := SVN::Revision number:0. |
|
372 |
rev2 := SVN::Revision head. |
|
373 |
limit := limitOrNil. |
|
374 |
] ifFalse:[ |
|
375 |
rev1 := SVN::Revision number: rev1OrNil ? 0. |
|
376 |
rev2 := rev1OrNil isNil ifTrue:[SVN::Revision head] ifFalse:[SVN::Revision number: rev2OrNil]. |
|
377 |
limit := limitOrNil. |
|
378 |
self breakPoint: #jv info: 'Review'. |
|
379 |
] |
|
380 |
]. |
|
381 |
branch := self branchForModule: moduleDir directory: packageDir. |
|
382 |
branch isNil ifTrue:[ |
|
383 |
self breakPoint: #jv. |
|
384 |
self error:('No branch for package %1:%2' bindWith: moduleDir with: packageDir) mayProceed: true. |
|
385 |
^self |
|
386 |
]. |
|
665 | 387 |
|
955 | 388 |
log := branch log: classFileName limit: limit revisions: (rev2 to: rev1). |
389 |
info := IdentityDictionary new. |
|
390 |
info at:#container put: classFileName. "/ -> the revision string |
|
391 |
info at:#cvsRoot put: branch url asString. "/ -> the CVS root (repository) |
|
392 |
info at:#filename put: classFileName. "/ -> the actual source file name |
|
393 |
info at:#newestRevision put: log first revision asString. "/-> the revisionString of the newest revision |
|
394 |
info at:#numberOfRevisions put: log size. "/-> the number of revisions in the container (nil for all) |
|
395 |
info at:#revisions put: (log collect:[:entry| |
|
396 |
||
397 |
| info | |
|
398 |
info := IdentityDictionary new. |
|
399 |
info at:#revision put: entry revision asString."/ -> the revision string |
|
400 |
info at:#author put: entry author."/ -> who checked that revision into the repository |
|
401 |
info at:#date put: entry date printString."/ -> when was it checked in |
|
402 |
info at:#state put: 'Exp'. "/ -> the RCS state |
|
403 |
info at:#numberOfChangedLines put: 'N/A'. "/ -> the number of changed line w.r.t the previous |
|
404 |
info at:#logMessage put: entry message."/ -> the checkIn log message. |
|
405 |
info |
|
406 |
]). |
|
407 |
||
408 |
||
409 |
^info |
|
410 |
||
411 |
" |
|
412 |
SVNSourceCodeManager revisionLogOf:Array fromRevision:0 toRevision:0. |
|
413 |
SVNSourceCodeManager revisionLogOf:Array fromRevision:'10000' toRevision:'10005' |
|
414 |
" |
|
415 |
||
416 |
"Modified: / 18-11-2011 / 16:11:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
417 |
! ! |
|
418 |
||
956 | 419 |
!SVNSourceCodeManager class methodsFor:'misc'! |
420 |
||
421 |
savePreferencesOn:aFileStream |
|
422 |
||
423 |
"Nothing to do, since my preferences are stored in |
|
424 |
UserPreferences dictionary" |
|
425 |
||
426 |
"Created: / 10-06-2011 / 14:15:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
427 |
! ! |
|
428 |
||
955 | 429 |
!SVNSourceCodeManager class methodsFor:'private'! |
430 |
||
431 |
branchForModule: module directory: directory |
|
432 |
||
433 |
| repo | |
|
434 |
repo := self repositoryForModule: module directory: directory . |
|
435 |
^repo notNil ifTrue:[ |
|
436 |
repo branch |
|
437 |
] ifFalse:[ |
|
438 |
nil |
|
439 |
] |
|
440 |
||
441 |
"Created: / 15-10-2011 / 16:26:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
442 |
! |
|
443 |
||
444 |
branchForPackage: package |
|
445 |
||
446 |
| repo | |
|
447 |
repo := SVN::RepositoryManager repositoryForPackage: package. |
|
448 |
^repo notNil ifTrue:[ |
|
449 |
repo branch |
|
450 |
] ifFalse:[ |
|
451 |
nil |
|
452 |
] |
|
453 |
||
454 |
"Created: / 15-10-2011 / 23:26:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
455 |
! |
|
456 |
||
457 |
pathInRepositoryFrom:containerPath forPackage:packageID |
|
458 |
||
459 |
^nil |
|
460 |
||
461 |
"Created: / 13-10-2011 / 11:32:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
462 |
! |
|
463 |
||
464 |
repositoryForModule: module directory: directory |
|
465 |
||
466 |
| repo | |
|
467 |
repo := SVN::RepositoryManager repositoryForModule: module directory: directory. |
|
468 |
^repo |
|
469 |
||
470 |
"Created: / 23-12-2011 / 18:57:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
665 | 471 |
! ! |
472 |
||
378 | 473 |
!SVNSourceCodeManager class methodsFor:'queries'! |
474 |
||
475 |
isExperimental |
|
665 | 476 |
^ false |
477 |
"/^ OperatingSystem getLoginName ~= 'cg'. |
|
478 |
"/^ true |
|
570 | 479 |
|
665 | 480 |
"Modified: / 05-12-2009 / 10:23:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
570 | 481 |
! |
482 |
||
665 | 483 |
isResponsibleForPackage: packageId |
484 |
||
485 |
UserPreferences current svnEnabled ifFalse:[^false]. |
|
486 |
||
487 |
^SVN::RepositoryManager current hasRepositoryForPackage: packageId |
|
488 |
||
489 |
"Created: / 05-12-2009 / 10:36:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
490 |
"Modified: / 15-09-2010 / 14:55:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
378 | 491 |
! |
492 |
||
493 |
managerTypeName |
|
665 | 494 |
^ 'SubVersion' |
495 |
||
496 |
"Modified: / 07-07-2011 / 23:11:41 / jv" |
|
378 | 497 |
! |
498 |
||
921
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
499 |
managerTypeNameShort |
956 | 500 |
|
921
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
501 |
"Answers short version manager name suitable for UI, |
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
502 |
i,e., CVS, SVN, P4. Used in cases where sorter strings |
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
503 |
are preferred. Defaults to #managerTypeName" |
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
504 |
|
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
505 |
^'SVN' |
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
506 |
|
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
507 |
"Created: / 03-10-2011 / 13:28:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
508 |
! |
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
509 |
|
378 | 510 |
nameOfVersionMethodForExtensions |
511 |
^ #'extensionsVersion_SVN' |
|
512 |
! |
|
513 |
||
514 |
nameOfVersionMethodInClasses |
|
515 |
^ #'version_SVN' |
|
586
8f0468063710
added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
571
diff
changeset
|
516 |
! |
8f0468063710
added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
571
diff
changeset
|
517 |
|
1097
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
518 |
performsCompilabilityChecks |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
519 |
"Should return true, if the manager itself performs |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
520 |
compilability checks, false otherwise." |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
521 |
|
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
522 |
"lisvn performs check if ProjectChecker is available" |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
523 |
^(ConfigurableFeatures includesFeature:#ProjectChecker) |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
524 |
|
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
525 |
" |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
526 |
SVNSourceCodeManager performsCompilabilityChecks |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
527 |
CVSSourceCodeManager performsCompilabilityChecks |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
528 |
" |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
529 |
|
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
530 |
"Created: / 11-04-2012 / 16:55:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
531 |
! |
dfb1b29688d1
added: #performsCompilabilityChecks
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1083
diff
changeset
|
532 |
|
586
8f0468063710
added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
571
diff
changeset
|
533 |
settingsApplicationClass |
587
02d7ed119335
added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
534 |
"link to my settings application (needed for the settings dialog" |
02d7ed119335
added: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
535 |
|
665 | 536 |
^ SVN::ConfigurationApp |
537 |
||
538 |
"Modified: / 07-07-2011 / 23:12:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
539 |
! |
|
540 |
||
851
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
541 |
versionMethodKeyword |
956 | 542 |
|
851
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
543 |
"Answers the keyword used by the version management system to |
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
544 |
expand a current version in a file (_without_ dollars). For |
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
545 |
CVS it is 'Header', for SVN 'Id', others may use different |
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
546 |
keywords. If nil is returned, then the version management does |
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
547 |
not use any keyword." |
665 | 548 |
|
851
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
549 |
^'Id' |
665 | 550 |
|
851
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
551 |
"Created: / 27-09-2011 / 16:46:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1083 | 552 |
! |
553 |
||
554 |
versionMethodTemplateForRubyFor:aSelector |
|
555 |
"do not make the thing below a single string - otherwise |
|
556 |
it would get expanded by the sourcecodemanager, which we do not want here" |
|
557 |
||
558 |
"Overriden here to use SubVersions fixed-width keywords" |
|
559 |
||
560 |
^ |
|
561 |
'def self.',aSelector,'() |
|
562 |
return "$' , self versionMethodKeyword , '::', (String new: 120) , '$" |
|
563 |
end' |
|
564 |
||
565 |
"Created: / 29-03-2012 / 17:50:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
566 |
! |
|
567 |
||
568 |
versionMethodTemplateForSmalltalkFor:aSelector |
|
569 |
"do not make the thing below a single string - otherwise |
|
570 |
it would get expanded by the sourcecodemanager, which we do not want here" |
|
571 |
||
572 |
^ |
|
573 |
aSelector,' |
|
574 |
^ ''$', self versionMethodKeyword , '::', (String new: 120) , '$'' |
|
575 |
' |
|
576 |
||
577 |
"Modified (comment): / 19-08-2011 / 01:19:08 / cg" |
|
578 |
"Created: / 29-03-2012 / 17:51:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
378 | 579 |
! ! |
580 |
||
539 | 581 |
!SVNSourceCodeManager class methodsFor:'source code access'! |
582 |
||
583 |
loadPackageWithId: aPackageId fromRepositoryAsAutoloaded: doLoadAsAutoloaded |
|
584 |
||
541 | 585 |
"Return true if loaded, false otherwise." |
586 |
||
540 | 587 |
| retval loadBlock | |
539 | 588 |
|
589 |
loadBlock := [ |
|
955 | 590 |
| repo packageDir manager| |
591 |
manager := SVN::RepositoryManager current. |
|
592 |
repo := manager repositoryForPackage: aPackageId. |
|
593 |
retval := (repo notNil and:[repo exists]) ifTrue:[ |
|
594 |
repo workingCopy checkout: SVN::Revision head full: true. |
|
595 |
packageDir := Smalltalk packageDirectoryForPackageId:aPackageId. |
|
596 |
"Quick and dirty hack to support old version of Smalltalk/X" |
|
597 |
(Smalltalk respondsTo: #loadPackage:fromDirectory:asAutoloaded:) |
|
598 |
ifTrue: |
|
599 |
["New API" |
|
600 |
Smalltalk |
|
601 |
loadPackage:aPackageId |
|
602 |
fromDirectory:packageDir |
|
603 |
asAutoloaded:doLoadAsAutoloaded] |
|
604 |
ifFalse: |
|
956 | 605 |
["Old API" |
955 | 606 |
Smalltalk |
607 |
loadPackageWithId:aPackageId |
|
608 |
fromDirectory:packageDir |
|
609 |
asAutoloaded:doLoadAsAutoloaded |
|
956 | 610 |
]. |
955 | 611 |
] ifFalse:[false] |
539 | 612 |
]. |
613 |
||
665 | 614 |
(SVNSourceCodeManager loadInProgressQuery query == true) |
955 | 615 |
ifTrue:[loadBlock value] |
616 |
ifFalse:[ |
|
956 | 617 |
SVNSourceCodeManager loadInProgressQuery |
618 |
answer: true |
|
955 | 619 |
do:[ |
620 |
SVN::ProgressDialog |
|
621 |
openOn: loadBlock |
|
622 |
title: ' Loading...' |
|
623 |
subtitle: aPackageId asText allItalic |
|
624 |
] |
|
539 | 625 |
]. |
626 |
||
541 | 627 |
^ retval |
539 | 628 |
|
629 |
"Created: / 09-04-2009 / 17:20:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
665 | 630 |
"Modified: / 25-04-2011 / 15:20:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
539 | 631 |
! ! |
632 |
||
571
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
633 |
!SVNSourceCodeManager class methodsFor:'source code administration'! |
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
634 |
|
665 | 635 |
getExistingContainersInModule:aModule directory:aPackage |
636 |
"{ Pragma: +optSpace }" |
|
637 |
||
638 |
^ self shouldImplement |
|
639 |
! |
|
640 |
||
641 |
getExistingDirectoriesInModule:aModule |
|
642 |
"{ Pragma: +optSpace }" |
|
643 |
||
644 |
^ self shouldImplement |
|
645 |
! |
|
646 |
||
647 |
getExistingModules |
|
648 |
"{ Pragma: +optSpace }" |
|
649 |
||
650 |
^ self shouldImplement |
|
651 |
! |
|
652 |
||
571
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
653 |
revisionInfoFromString:aString |
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
654 |
"{ Pragma: +optSpace }" |
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
655 |
|
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
656 |
"return a dictionary filled with revision info. |
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
657 |
This extracts the relevant info from aString." |
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
658 |
|
921
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
659 |
|
797
48f8701af829
changed: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
665
diff
changeset
|
660 |
^ SVNVersionInfo fromSVNString:aString |
571
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
661 |
|
921
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
662 |
|
571
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
663 |
" |
956 | 664 |
self revisionInfoFromString:(Array version_SVN) |
921
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
665 |
|
956 | 666 |
self revisionInfoFromString:(stx_libbasic2 extensionsVersion_CVS) |
571
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
667 |
" |
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
668 |
|
921
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
669 |
|
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
670 |
"Modified: / 29-01-1997 / 19:00:35 / cg" |
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
671 |
"Modified: / 03-10-2011 / 13:02:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
797
48f8701af829
changed: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
665
diff
changeset
|
672 |
"Modified (comment): / 29-09-2011 / 21:54:26 / cg" |
921
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
673 |
|
571
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
674 |
! ! |
28a4f762f3e8
added: #revisionInfoFromString:
Claus Gittinger <cg@exept.de>
parents:
570
diff
changeset
|
675 |
|
665 | 676 |
!SVNSourceCodeManager class methodsFor:'subclass responsibility'! |
677 |
||
678 |
reportHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:repositoryFilter filterModules:moduleFilter inTo:aBlock |
|
679 |
"superclass AbstractSourceCodeManager class says that I am responsible to implement this method" |
|
680 |
||
681 |
^ self shouldImplement |
|
682 |
! ! |
|
683 |
||
378 | 684 |
!SVNSourceCodeManager class methodsFor:'testing'! |
685 |
||
686 |
isSVN |
|
687 |
^ true |
|
688 |
! ! |
|
689 |
||
955 | 690 |
!SVNSourceCodeManager::Utilities methodsFor:'utilities-cvs'! |
691 |
||
692 |
checkinClass:aClass withInfo:aLogInfoOrNil withCheck:doCheckClass usingManager:aManagerOrNil |
|
693 |
"check a class into the source repository. |
|
694 |
If the argument, aLogInfoOrNil isNil, ask interactively for log-message. |
|
695 |
If doCheckClass is true, the class is checked for send of halts etc." |
|
696 |
||
697 |
^self checkinClasses:(Array with: aClass) withInfo:aLogInfoOrNil withCheck:doCheckClass usingManager:aManagerOrNil |
|
698 |
||
699 |
"Created: / 25-12-2011 / 23:45:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
700 |
! |
|
701 |
||
702 |
checkinClasses:classes withInfo:aLogInfoOrNil withCheck:doCheckClass usingManager:aManagerOrNil |
|
703 |
||
704 |
| classesPerPackage | |
|
705 |
||
706 |
doCheckClass value ifTrue:[ |
|
707 |
classes do:[:cls| |
|
708 |
"/ check if the class contains halts, error-sends etc. |
|
709 |
(self checkAndWarnAboutBadMessagesInClass:cls checkAgainHolder:doCheckClass) ifFalse:[ |
|
710 |
^ false |
|
711 |
]. |
|
712 |
]. |
|
713 |
]. |
|
714 |
||
715 |
classesPerPackage := Dictionary new. |
|
716 |
classes do: |
|
717 |
[:class| |
|
718 |
(classesPerPackage at: class theNonMetaclass package ifAbsentPut:[Set new]) |
|
719 |
add: class theNonMetaclass]. |
|
720 |
classesPerPackage keysAndValuesDo: |
|
721 |
[:package :classes| | repo | |
|
722 |
repo := SVN::RepositoryManager repositoryForPackage:package. |
|
1021
12be1fe92d15
improvements for CommitDialog2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
968
diff
changeset
|
723 |
"/SVN::CommitWizard new |
12be1fe92d15
improvements for CommitDialog2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
968
diff
changeset
|
724 |
SVN::CommitDialog2 new |
955 | 725 |
task: (repo workingCopy commitTask |
726 |
classes: classes; |
|
727 |
message: aLogInfoOrNil; |
|
728 |
extensionMethods: #() |
|
729 |
yourself); |
|
730 |
open]. |
|
731 |
^ true |
|
732 |
||
733 |
"Modified: / 06-05-2011 / 10:32:55 / cg" |
|
734 |
"Created: / 25-12-2011 / 23:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
735 |
! |
|
736 |
||
737 |
checkinPackage:packageToCheckIn classes:doClasses extensions:doExtensions buildSupport:doBuild askForMethodsInOtherPackages:askForMethodsInOtherPackages |
|
738 |
||
739 |
| repo task | |
|
740 |
repo := SVN::RepositoryManager repositoryForPackage:packageToCheckIn. |
|
741 |
repo isNil ifTrue:[ |
|
742 |
Dialog warn: (resources string: 'No repository for package %1' with: packageToCheckIn). |
|
743 |
^self |
|
744 |
]. |
|
745 |
task := repo workingCopy commitTask. |
|
746 |
task suppressClasses: doClasses not. |
|
747 |
task suppressExtensions: doExtensions not. |
|
748 |
task suppresBuildSupportFiles: doBuild not. |
|
749 |
||
1021
12be1fe92d15
improvements for CommitDialog2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
968
diff
changeset
|
750 |
"/SVN::CommitWizard new |
12be1fe92d15
improvements for CommitDialog2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
968
diff
changeset
|
751 |
SVN::CommitDialog2 new |
955 | 752 |
task: task; |
753 |
open |
|
754 |
||
755 |
"Created: / 13-10-2011 / 11:16:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
756 |
! |
|
757 |
||
956 | 758 |
compareProject:aProject withRepositoryVersionFrom:aDateOrNilForNewest |
759 |
|diffSet| |
|
760 |
||
761 |
diffSet := self diffSetOfProject:aProject againstRepositoryVersionFrom:aDateOrNilForNewest. |
|
762 |
||
763 |
(Tools::ChangeSetDiffTool new) |
|
764 |
diffset:diffSet; |
|
765 |
title:('Differences of %1' bindWith:aProject); |
|
766 |
open. |
|
767 |
||
768 |
"Created: / 18-01-2012 / 16:04:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
769 |
! |
|
770 |
||
955 | 771 |
diffSetOfProject: package againstRepositoryVersionFrom:dateOrNil |
772 |
||
773 |
| rev branch | |
|
774 |
||
775 |
rev := dateOrNil isNil ifTrue:[SVN::Revision head] ifFalse:[SVN::Revision date: dateOrNil]. |
|
776 |
branch := SVNSourceCodeManager branchForPackage: package. |
|
777 |
branch isNil ifTrue:[^nil]. |
|
778 |
^branch diffSetBetweenImageAndRevision: rev. |
|
779 |
||
780 |
"Created: / 15-10-2011 / 23:26:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
781 |
! |
|
782 |
||
783 |
tagClass:aClass as:tag |
|
784 |
||
785 |
Dialog warn: 'Individual class tagging not supported by SubVersion. Tag whole package instead'. |
|
786 |
||
787 |
"Modified: / 12-09-2006 / 13:03:59 / cg" |
|
788 |
"Created: / 15-10-2011 / 22:48:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
789 |
! |
|
790 |
||
791 |
tagClasses:classes as:tag |
|
792 |
||
793 |
Dialog warn: 'Individual class tagging not supported by SubVersion. Tag whole package instead'. |
|
794 |
||
795 |
"Modified: / 12-09-2006 / 13:03:59 / cg" |
|
796 |
"Created: / 15-10-2011 / 22:49:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
797 |
! |
|
798 |
||
799 |
tagPackage: package as:tag |
|
800 |
||
801 |
Dialog warn: 'Not yet implemented' |
|
802 |
||
803 |
"Created: / 12-09-2006 / 13:04:29 / cg" |
|
804 |
"Created: / 15-10-2011 / 22:49:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
805 |
! ! |
|
806 |
||
378 | 807 |
!SVNSourceCodeManager class methodsFor:'documentation'! |
808 |
||
851
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
809 |
version |
921
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
810 |
^ '$Header$' |
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
811 |
! |
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
812 |
|
6c3ba44ed3a5
added: #managerTypeNameShort
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
851
diff
changeset
|
813 |
version_CVS |
851
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
814 |
^ '$Header$' |
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
815 |
! |
32edde5d1f19
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
797
diff
changeset
|
816 |
|
665 | 817 |
version_SVN |
955 | 818 |
^ '§Id: SVNSourceCodeManager.st 467 2011-12-25 22:47:17Z vranyj1 §' |
378 | 819 |
! ! |