516
|
1 |
"{ Package: 'stx:libsvn' }"!
|
102
|
2 |
|
230
|
3 |
!ChangeSet methodsFor:'queries'!
|
102
|
4 |
|
|
5 |
changesForPackage:aPackageSymbol
|
|
6 |
|
|
7 |
"
|
105
|
8 |
ChangeSet current changesForPackage:#'stx:goodies/libsvn'.
|
102
|
9 |
|
|
10 |
"
|
|
11 |
|
105
|
12 |
^(self select:[:aChange |
|
|
13 |
|removeThis mClass mthd|
|
102
|
14 |
|
105
|
15 |
removeThis := false.
|
|
16 |
(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[
|
|
17 |
mClass := aChange changeClass.
|
|
18 |
mClass notNil ifTrue:[
|
|
19 |
mthd := mClass compiledMethodAt:(aChange selector).
|
|
20 |
mthd isNil ifTrue:[
|
|
21 |
aChange isMethodRemoveChange ifTrue:[
|
|
22 |
removeThis := (mClass package = aPackageSymbol)
|
|
23 |
].
|
|
24 |
] ifFalse:[
|
|
25 |
removeThis := (mthd package = aPackageSymbol)
|
|
26 |
]
|
|
27 |
].
|
|
28 |
] ifFalse:[
|
|
29 |
(aChange isClassChange) ifTrue:[
|
|
30 |
(aChange changeClass notNil) ifTrue:[
|
|
31 |
removeThis := (aChange changeClass package = aPackageSymbol)
|
|
32 |
].
|
|
33 |
].
|
|
34 |
].
|
|
35 |
removeThis
|
102
|
36 |
])
|
|
37 |
|
|
38 |
"Created: / 05-11-2001 / 14:21:17 / cg"
|
|
39 |
"Modified: / 12-10-2006 / 16:51:27 / cg"
|
|
40 |
"Modified: / 22-10-2008 / 13:25:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
41 |
! !
|
|
42 |
|
230
|
43 |
!ChangeSet methodsFor:'utilities'!
|
102
|
44 |
|
|
45 |
condenseChanges
|
|
46 |
|
|
47 |
| changesToRemove changesToKeep |
|
|
48 |
changesToKeep := self class new.
|
|
49 |
changesToRemove := self class new.
|
|
50 |
self reverseDo:
|
105
|
51 |
[:change|
|
|
52 |
(changesToKeep anySatisfy:[:each|each isForSameAs: change])
|
|
53 |
ifTrue:[changesToRemove add: change]
|
|
54 |
ifFalse:[changesToKeep add: change]
|
|
55 |
].
|
102
|
56 |
self condenseChanges: changesToRemove.
|
|
57 |
|
|
58 |
"Created: / 22-10-2008 / 13:05:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
59 |
! !
|
|
60 |
|
230
|
61 |
!ChangeSet methodsFor:'utilities'!
|
102
|
62 |
|
|
63 |
condenseChangesForPackage2:aPackageSymbol
|
|
64 |
"remove more changes for aPackageSymbol
|
|
65 |
This is invoked when a project is checked into the repository."
|
|
66 |
|
|
67 |
|changesToRemove|
|
|
68 |
|
105
|
69 |
changesToRemove := self select:[:aChange |
|
|
70 |
|removeThis mClass mthd|
|
102
|
71 |
|
105
|
72 |
removeThis := false.
|
|
73 |
(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[
|
|
74 |
mClass := aChange changeClass.
|
|
75 |
mClass notNil ifTrue:[
|
|
76 |
mthd := mClass compiledMethodAt:(aChange selector).
|
|
77 |
mthd isNil ifTrue:[
|
|
78 |
removeThis := (mClass package = aPackageSymbol)
|
|
79 |
] ifFalse:[
|
|
80 |
removeThis := (mthd package = aPackageSymbol)
|
|
81 |
]
|
|
82 |
].
|
|
83 |
] ifFalse:[
|
|
84 |
(aChange isClassChange) ifTrue:[
|
|
85 |
(aChange changeClass notNil) ifTrue:[
|
|
86 |
removeThis := (aChange changeClass package = aPackageSymbol)
|
|
87 |
].
|
|
88 |
].
|
|
89 |
].
|
|
90 |
removeThis
|
102
|
91 |
].
|
|
92 |
|
|
93 |
self condenseChanges:changesToRemove
|
|
94 |
|
|
95 |
"Modified: / 12-10-2006 / 16:51:27 / cg"
|
|
96 |
"Created: / 09-08-2009 / 14:29:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
97 |
! !
|
|
98 |
|
230
|
99 |
!ChangeSet methodsFor:'utilities'!
|
102
|
100 |
|
|
101 |
diffSetsAgainstImage
|
|
102 |
|
|
103 |
|imageChangeSet|
|
|
104 |
|
|
105 |
imageChangeSet := self class new.
|
|
106 |
self changedClasses do:
|
105
|
107 |
[:class|
|
|
108 |
(class isMetaclass or:[class isPrivate]) ifFalse:
|
|
109 |
[imageChangeSet addAll:
|
|
110 |
(self class fromStream: class source asString readStream)]].
|
102
|
111 |
^self diffSetsAgainst: imageChangeSet
|
|
112 |
|
|
113 |
"Created: / 04-12-2007 / 16:03:28 / janfrog"
|
|
114 |
! !
|
|
115 |
|
230
|
116 |
!ChangeSet class methodsFor:'instance creation'!
|
102
|
117 |
|
|
118 |
forPackage: package
|
|
119 |
|
|
120 |
^self forPackage: package ignoreAutoloaded: false.
|
|
121 |
|
|
122 |
"Created: / 20-05-2008 / 17:56:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
123 |
"Modified: / 12-08-2009 / 14:23:15 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
124 |
! !
|
|
125 |
|
230
|
126 |
!ChangeSet class methodsFor:'instance creation'!
|
102
|
127 |
|
|
128 |
forPackage: package ignoreAutoloaded: ignoreAutoloaded
|
|
129 |
"build a changeSet for a given package"
|
|
130 |
|
|
131 |
|changeSet packageClasses packageExtensions|
|
|
132 |
|
|
133 |
packageClasses := ProjectDefinition searchForClassesWithProject: package.
|
|
134 |
packageExtensions := ProjectDefinition searchForExtensionsWithProject: package.
|
|
135 |
changeSet := self forExistingMethods: packageExtensions.
|
|
136 |
packageClasses do:
|
105
|
137 |
[:cls|
|
|
138 |
(ignoreAutoloaded not and:[cls isLoaded not])
|
|
139 |
ifTrue:[cls autoload].
|
|
140 |
cls isLoaded
|
|
141 |
ifTrue:
|
|
142 |
[changeSet addAll:
|
|
143 |
(self
|
|
144 |
forExistingClass:cls
|
|
145 |
withExtensions:false
|
|
146 |
extensionsOnly:false)]].
|
102
|
147 |
^changeSet
|
|
148 |
|
|
149 |
"Created: / 12-08-2009 / 14:22:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
150 |
! !
|
|
151 |
|
230
|
152 |
!Class methodsFor:'fileOut'!
|
102
|
153 |
|
|
154 |
fileOutAsMethodIn: class selector: selector
|
|
155 |
|
|
156 |
^self fileOutAsMethodIn: class selector: selector category: 'sources'
|
|
157 |
|
|
158 |
"Created: / 08-04-2009 / 20:58:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
159 |
! !
|
|
160 |
|
230
|
161 |
!Class methodsFor:'accessing'!
|
102
|
162 |
|
|
163 |
svnRepository
|
|
164 |
|
|
165 |
^SVN::RepositoryManager repositoryForPackage: self package
|
|
166 |
|
|
167 |
"Created: / 19-04-2008 / 18:24:54 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
168 |
! !
|
|
169 |
|
230
|
170 |
!Filename methodsFor:'reading-directories'!
|
102
|
171 |
|
|
172 |
directoryContentsAsFilenamesMatching: patternOrCollectionOfThose
|
|
173 |
|
|
174 |
"
|
105
|
175 |
Same as directoryContentsAsFilenames, but returns only files
|
|
176 |
that matches given patterns. This uses String>>matches:
|
|
177 |
for pattern matching
|
102
|
178 |
"
|
|
179 |
|
|
180 |
|names|
|
|
181 |
|
|
182 |
names := self directoryContentsMatching: patternOrCollectionOfThose .
|
|
183 |
names isNil ifTrue:[^ nil].
|
|
184 |
^ names asOrderedCollection collect:[:entry | self construct:entry].
|
|
185 |
|
|
186 |
"
|
105
|
187 |
'/etc' asFilename
|
|
188 |
directoryContentsAsFilenamesMatching: 'pass*'
|
102
|
189 |
|
105
|
190 |
'/etc' asFilename
|
|
191 |
directoryContentsAsFilenamesMatching: #('pass*' 'nsswitch.conf')
|
102
|
192 |
"
|
|
193 |
|
|
194 |
"Created: / 03-06-2009 / 09:57:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
195 |
! !
|
|
196 |
|
230
|
197 |
!Filename methodsFor:'reading-directories'!
|
102
|
198 |
|
|
199 |
directoryContentsMatching: patternOrCollectionOfThose
|
|
200 |
|
|
201 |
"
|
105
|
202 |
Same as directoryContants, but returns only files
|
|
203 |
that matches given patterns. This uses String>>matches:
|
|
204 |
for pattern matching
|
102
|
205 |
"
|
|
206 |
|
|
207 |
| names patterns |
|
|
208 |
patterns := patternOrCollectionOfThose isString
|
105
|
209 |
ifTrue: [Array with: patternOrCollectionOfThose]
|
|
210 |
ifFalse:[patternOrCollectionOfThose].
|
102
|
211 |
names := self directoryContents.
|
|
212 |
names ifNil:[^nil].
|
|
213 |
^names select:
|
105
|
214 |
[:e|patterns anySatisfy:[:pattern|e matches: pattern]]
|
102
|
215 |
|
|
216 |
"
|
105
|
217 |
'/etc' asFilename
|
|
218 |
directoryContentsMatching: 'pass*'
|
102
|
219 |
|
105
|
220 |
'/etc' asFilename
|
|
221 |
directoryContentsMatching: #('pass*' 'nsswitch.conf')
|
102
|
222 |
|
105
|
223 |
'/etc' asFilename
|
|
224 |
directoryContentsMatching: #('does-not-exists.txt')
|
102
|
225 |
|
|
226 |
"
|
|
227 |
|
|
228 |
"Created: / 03-06-2009 / 09:52:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
229 |
! !
|
|
230 |
|
230
|
231 |
!Method methodsFor:'accessing'!
|
102
|
232 |
|
|
233 |
makeSourceFileAbsolute
|
|
234 |
|
|
235 |
"
|
105
|
236 |
Makes a source file reference absolute.
|
|
237 |
This is required by SVN, because svn working copy
|
|
238 |
is in package path, so it's existence may corrupt source
|
|
239 |
files.
|
102
|
240 |
"
|
|
241 |
|
|
242 |
| fileStream |
|
105
|
243 |
|
102
|
244 |
"check whether my source is in external file. If not, this is noop"
|
|
245 |
sourcePosition ifNil:[^nil].
|
|
246 |
"already absolute"
|
|
247 |
source asFilename isAbsolute ifTrue:[^self].
|
|
248 |
fileStream := self rawSourceStream.
|
|
249 |
fileStream isFileStream ifTrue:
|
105
|
250 |
[source := fileStream fileName asAbsoluteFilename pathName].
|
102
|
251 |
|
|
252 |
"
|
105
|
253 |
(Method compiledMethodAt:#mclass:)
|
|
254 |
makeSourceFileAbsolute
|
102
|
255 |
"
|
|
256 |
|
|
257 |
"Created: / 21-08-2009 / 17:24:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
258 |
! !
|
|
259 |
|
230
|
260 |
!MethodChange methodsFor:'queries'!
|
102
|
261 |
|
|
262 |
isForGeneratedSubject
|
|
263 |
"
|
|
264 |
Answers true iff subject of this method is somewhat
|
|
265 |
auto-generated by some tool - just like version methods
|
|
266 |
are.
|
|
267 |
"
|
|
268 |
|
366
|
269 |
^self isForMeta
|
|
270 |
and:[((self selector) == #version)
|
|
271 |
or:[self selector startsWith:'version_' ]
|
|
272 |
]
|
102
|
273 |
|
|
274 |
"Created: / 17-08-2009 / 18:56:59 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
275 |
! !
|
|
276 |
|
230
|
277 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'!
|
102
|
278 |
|
|
279 |
classMenuSubversionCommit
|
|
280 |
|
|
281 |
| classesPerPackage |
|
|
282 |
classesPerPackage := Dictionary new.
|
|
283 |
self selectedClasses value do:
|
105
|
284 |
[:class|
|
|
285 |
(classesPerPackage at: class theNonMetaclass package ifAbsentPut:[Set new])
|
|
286 |
add: class theNonMetaclass].
|
102
|
287 |
classesPerPackage keysAndValuesDo:
|
105
|
288 |
[:package :classes| | repo |
|
|
289 |
repo := SVN::RepositoryManager repositoryForPackage:package.
|
|
290 |
SVN::CommitWizard new
|
|
291 |
task: (repo workingCopy commitTask
|
|
292 |
classes: classes;
|
|
293 |
extensionMethods: #()
|
|
294 |
yourself);
|
|
295 |
open]
|
102
|
296 |
|
|
297 |
"Modified: / 16-06-2009 / 21:05:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
298 |
! !
|
|
299 |
|
230
|
300 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'!
|
102
|
301 |
|
|
302 |
classMenuSubversionCompareImageWithRevision
|
|
303 |
|
|
304 |
| cls branch revisionLog revision |
|
|
305 |
cls := self theSingleSelectedClass theNonMetaclass.
|
|
306 |
branch := cls theNonMetaclass svnRepository branch.
|
|
307 |
revisionLog := branch log: cls.
|
|
308 |
revision := SVN::RevisionSelectionDialog openOn: revisionLog.
|
|
309 |
self classMenuSubversionCompareImageWithRevision: revision
|
|
310 |
|
|
311 |
"Created: / 19-04-2008 / 18:38:15 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
312 |
! !
|
|
313 |
|
230
|
314 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'!
|
102
|
315 |
|
|
316 |
classMenuSubversionCompareImageWithRevision: revision
|
|
317 |
|
241
|
318 |
| cls branch diffSet tool smalltalkDiffToolClass|
|
102
|
319 |
revision ifNil:[^self].
|
|
320 |
cls := self theSingleSelectedClass theNonMetaclass.
|
|
321 |
branch := cls theNonMetaclass svnRepository branch.
|
105
|
322 |
SVN::ProgressDialog
|
366
|
323 |
openOn:[diffSet := branch diffSetForClass: cls betweenImageAndRevision: revision]
|
|
324 |
title: 'Creating diffset for class ', cls fullName asText allItalic
|
|
325 |
subtitle:
|
|
326 |
('Package: ' , branch package asText allItalic ,
|
|
327 |
' Revision ' , revision asString).
|
241
|
328 |
|
|
329 |
smalltalkDiffToolClass := Smalltalk classNamed:#'Tools::SmalltalkDiffTool'.
|
|
330 |
|
|
331 |
tool := (smalltalkDiffToolClass notNil
|
366
|
332 |
and:[smalltalkDiffToolClass isLoaded])
|
|
333 |
ifTrue:[ smalltalkDiffToolClass ]
|
|
334 |
ifFalse:[ VersionDiffBrowser ].
|
241
|
335 |
tool
|
366
|
336 |
openOnDiffSet:diffSet
|
|
337 |
labelA: 'Image'
|
|
338 |
labelB: 'r',revision printString
|
|
339 |
title: 'Differences of ',cls fullName,' between image and revision ',revision printString.
|
102
|
340 |
|
|
341 |
"Created: / 19-04-2008 / 18:54:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
342 |
"Modified: / 09-08-2009 / 14:14:37 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
343 |
! !
|
|
344 |
|
230
|
345 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'!
|
102
|
346 |
|
|
347 |
classMenuSubversionCompareImageWithRevisionHead
|
|
348 |
|
|
349 |
self classMenuSubversionCompareImageWithRevision: SVN::Revision head
|
|
350 |
|
|
351 |
"Created: / 19-04-2008 / 18:56:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
352 |
! !
|
|
353 |
|
230
|
354 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-class'!
|
102
|
355 |
|
|
356 |
classMenuSubversionUpdate
|
|
357 |
"automatically generated by UIEditor ..."
|
|
358 |
|
|
359 |
"*** the code below performs no action"
|
|
360 |
"*** (except for some feedback on the Transcript)"
|
|
361 |
"*** Please change as required and accept in the browser."
|
|
362 |
"*** (and replace this comment by something more useful ;-)"
|
|
363 |
|
|
364 |
"action to be added ..."
|
|
365 |
|
|
366 |
Transcript showCR:self class name, ': action for #classMenuSubversionUpdate ...'.
|
|
367 |
! !
|
|
368 |
|
239
|
369 |
!Tools::NewSystemBrowser methodsFor:'aspects-queries'!
|
|
370 |
|
|
371 |
hasSingleClassAndSubversionRepositoryExists
|
|
372 |
^ self hasSingleClassSelected
|
366
|
373 |
and:[self hasSubversionRepositoryFor: self theSingleSelectedClass package]
|
239
|
374 |
|
|
375 |
"Created: / 19-04-2008 / 17:40:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
376 |
! !
|
|
377 |
|
230
|
378 |
!Tools::NewSystemBrowser methodsFor:'menus-dynamic'!
|
102
|
379 |
|
|
380 |
projectMenuSubversionBranches
|
|
381 |
|
|
382 |
<resource: #programMenu >
|
|
383 |
|
|
384 |
| menu repository |
|
|
385 |
menu := Menu new.
|
|
386 |
repository := self selectedProjectSubversionRepository.
|
|
387 |
repository branches do:
|
105
|
388 |
[:branch|
|
|
389 |
menu addItem:
|
|
390 |
(MenuItem new
|
|
391 |
label: branch name;
|
|
392 |
choiceValue: branch;
|
|
393 |
choice:(repository workingCopy branch);
|
|
394 |
enabled:(repository workingCopy branch) = branch;
|
|
395 |
yourself)
|
|
396 |
].
|
102
|
397 |
|
|
398 |
^menu
|
|
399 |
|
|
400 |
"Created: / 19-04-2008 / 11:06:15 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
401 |
! !
|
|
402 |
|
230
|
403 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
404 |
|
|
405 |
projectMenuSubversionBrowseWorkingCopy
|
|
406 |
|
|
407 |
self selectedProjects value do:
|
105
|
408 |
[:package|
|
|
409 |
| pkg repo |
|
|
410 |
pkg := self theSingleSelectedProject.
|
|
411 |
repo := (SVN::RepositoryManager repositoryForPackage: pkg) .
|
|
412 |
FileBrowserV2 openOn: repo workingCopy path]
|
102
|
413 |
|
|
414 |
"Created: / 09-04-2009 / 13:19:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
415 |
! !
|
|
416 |
|
230
|
417 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
418 |
|
|
419 |
projectMenuSubversionCommit
|
|
420 |
|
|
421 |
self selectedProjects value do:
|
105
|
422 |
[:package|
|
|
423 |
| repo |
|
|
424 |
repo := SVN::RepositoryManager repositoryForPackage:package.
|
|
425 |
SVN::CommitWizard new
|
|
426 |
task: repo workingCopy commitTask;
|
|
427 |
open]
|
102
|
428 |
|
|
429 |
"Created: / 01-04-2008 / 19:02:42 / janfrog"
|
|
430 |
"Modified: / 16-08-2009 / 19:17:15 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
431 |
! !
|
|
432 |
|
230
|
433 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
434 |
|
|
435 |
projectMenuSubversionCommitMode
|
|
436 |
|
|
437 |
^(PluggableAdaptor on: self theSingleSelectedProject)
|
105
|
438 |
getBlock:
|
|
439 |
[:prjHolder| | wc |
|
|
440 |
wc := SVN::RepositoryManager workingCopyForPackage: self theSingleSelectedProject value.
|
|
441 |
wc ifNotNil:[wc commitMode] ifNil:[nil]]
|
|
442 |
putBlock:
|
|
443 |
[:prjHolder :value| | wc |
|
|
444 |
wc := SVN::RepositoryManager workingCopyForPackage: self theSingleSelectedProject value.
|
|
445 |
wc ifNotNil:[wc commitMode:value]]
|
|
446 |
updateBlock:
|
|
447 |
[:prjHolder :aspect :value|true].
|
102
|
448 |
|
|
449 |
"Created: / 13-08-2009 / 15:05:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
450 |
! !
|
|
451 |
|
230
|
452 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
453 |
|
|
454 |
projectMenuSubversionCompareExtensionsInImageWithRevision
|
|
455 |
|
|
456 |
| pkg branch revisionLog revision |
|
|
457 |
pkg := self theSingleSelectedProject.
|
|
458 |
branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch.
|
|
459 |
revisionLog := branch log:(branch repository containerNameForExtensions).
|
|
460 |
revision := SVN::RevisionSelectionDialog openOn: revisionLog.
|
|
461 |
self projectMenuSubversionCompareExtensionsInImageWithRevision: revision
|
|
462 |
|
|
463 |
"Created: / 19-04-2008 / 19:13:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
464 |
! !
|
|
465 |
|
230
|
466 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
467 |
|
|
468 |
projectMenuSubversionCompareExtensionsInImageWithRevision: revision
|
|
469 |
|
240
|
470 |
| pkg diffSet branch tool smalltalkDiffToolClass|
|
102
|
471 |
revision ifNil:[^self].
|
|
472 |
pkg := self theSingleSelectedProject.
|
|
473 |
branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch.
|
105
|
474 |
SVN::ProgressDialog
|
366
|
475 |
openOn:[diffSet := branch diffSetForExtensionsBetweenImageAndRevision: revision.]
|
|
476 |
title: 'Creating diffset for extensions'
|
|
477 |
subtitle:
|
|
478 |
('Package: ' , branch package asText allItalic ,
|
|
479 |
' Revision ' , revision asString).
|
240
|
480 |
|
|
481 |
smalltalkDiffToolClass := Smalltalk classNamed:#'Tools::SmalltalkDiffTool'.
|
|
482 |
|
|
483 |
tool := (smalltalkDiffToolClass notNil
|
366
|
484 |
and:[smalltalkDiffToolClass isLoaded])
|
|
485 |
ifTrue:[ smalltalkDiffToolClass ]
|
|
486 |
ifFalse:[ VersionDiffBrowser ].
|
240
|
487 |
tool
|
366
|
488 |
openOnDiffSet:diffSet
|
|
489 |
labelA: 'Image'
|
|
490 |
labelB: 'r',revision printString
|
|
491 |
title: 'Differences of extensions for ',pkg,' between image and revision ',revision printString.
|
102
|
492 |
|
|
493 |
"Created: / 19-04-2008 / 19:13:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
494 |
"Modified: / 09-08-2009 / 14:14:15 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
495 |
! !
|
|
496 |
|
230
|
497 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
498 |
|
|
499 |
projectMenuSubversionCompareImageWithRevision
|
|
500 |
|
|
501 |
| pkg branch revisionLog revision |
|
|
502 |
pkg := self theSingleSelectedProject.
|
|
503 |
branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch.
|
|
504 |
revisionLog := branch log:'.'.
|
|
505 |
revision := SVN::RevisionSelectionDialog openOn: revisionLog.
|
|
506 |
self projectMenuSubversionCompareImageWithRevision: revision
|
|
507 |
|
|
508 |
"Created: / 20-05-2008 / 18:09:20 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
509 |
! !
|
|
510 |
|
230
|
511 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
512 |
|
|
513 |
projectMenuSubversionCompareImageWithRevision: revision
|
|
514 |
|
241
|
515 |
| pkg diffSet branch tool smalltalkDiffToolClass|
|
102
|
516 |
revision ifNil:[^self].
|
|
517 |
pkg := self theSingleSelectedProject.
|
|
518 |
branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch.
|
105
|
519 |
SVN::ProgressDialog
|
366
|
520 |
openOn:[diffSet := branch diffSetBetweenImageAndRevision: revision]
|
|
521 |
title: 'Creating diffset'
|
|
522 |
subtitle:
|
|
523 |
('Package: ' , branch package asText allItalic ,
|
|
524 |
' Revision ' , revision asString).
|
241
|
525 |
|
|
526 |
smalltalkDiffToolClass := Smalltalk classNamed:#'Tools::SmalltalkDiffTool'.
|
102
|
527 |
|
241
|
528 |
tool := (smalltalkDiffToolClass notNil
|
366
|
529 |
and:[smalltalkDiffToolClass isLoaded])
|
|
530 |
ifTrue:[ smalltalkDiffToolClass ]
|
|
531 |
ifFalse:[ VersionDiffBrowser ].
|
241
|
532 |
tool
|
366
|
533 |
openOnDiffSet:diffSet
|
|
534 |
labelA: 'Image'
|
|
535 |
labelB: 'r',revision printString
|
|
536 |
title: 'Differences for ',pkg,' between image and revision ',revision printString.
|
102
|
537 |
|
|
538 |
"Created: / 20-05-2008 / 18:09:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
539 |
"Modified: / 09-08-2009 / 14:14:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
540 |
! !
|
|
541 |
|
230
|
542 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
543 |
|
|
544 |
projectMenuSubversionCompareImageWithRevisionHEAD
|
|
545 |
|
|
546 |
self projectMenuSubversionCompareImageWithRevision: SVN::Revision head
|
|
547 |
|
|
548 |
"Created: / 20-05-2008 / 18:10:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
549 |
! !
|
|
550 |
|
230
|
551 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
552 |
|
|
553 |
projectMenuSubversionLoadRevision
|
|
554 |
|
|
555 |
^self projectMenuSubversionLoadRevision: nil
|
|
556 |
|
|
557 |
"Created: / 22-10-2008 / 11:49:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
558 |
"Modified: / 09-04-2009 / 09:38:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
559 |
! !
|
|
560 |
|
230
|
561 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
562 |
|
|
563 |
projectMenuSubversionLoadRevision: aRevision
|
|
564 |
|
|
565 |
self selectedProjects value do:
|
105
|
566 |
[:package|
|
|
567 |
| pkg task |
|
|
568 |
pkg := self theSingleSelectedProject.
|
|
569 |
task := (SVN::RepositoryManager repositoryForPackage: pkg) updateTask.
|
|
570 |
task revision: aRevision.
|
|
571 |
SVN::UpdateWizard openOn: task]
|
102
|
572 |
|
|
573 |
"Created: / 09-04-2009 / 09:38:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
574 |
! !
|
|
575 |
|
230
|
576 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
577 |
|
|
578 |
projectMenuSubversionMergeImageWithRevision
|
|
579 |
|
|
580 |
| pkg branch revisionLog revision |
|
|
581 |
pkg := self theSingleSelectedProject.
|
|
582 |
branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch.
|
|
583 |
revisionLog := branch log:'.'.
|
|
584 |
revision := SVN::RevisionSelectionDialog openOn: revisionLog.
|
|
585 |
self projectMenuSubversionMergeImageWithRevision: revision
|
|
586 |
|
|
587 |
"Created: / 20-05-2008 / 23:41:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
588 |
! !
|
|
589 |
|
230
|
590 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
591 |
|
|
592 |
projectMenuSubversionMergeImageWithRevision: revision
|
|
593 |
|
241
|
594 |
| pkg diffSet branch smalltalkMergeToolClass|
|
102
|
595 |
revision ifNil:[^self].
|
|
596 |
pkg := self theSingleSelectedProject.
|
|
597 |
branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch.
|
105
|
598 |
SVN::ProgressDialog
|
366
|
599 |
openOn:[diffSet := branch diffSetBetweenImageAndRevision: revision]
|
|
600 |
title: 'Creating diffset'
|
|
601 |
subtitle:
|
|
602 |
('Package: ' , branch package asText allItalic ,
|
|
603 |
' Revision ' , revision asString).
|
241
|
604 |
|
|
605 |
smalltalkMergeToolClass := Smalltalk classNamed:#'Tools::SmalltalkMergeTool'.
|
102
|
606 |
|
241
|
607 |
(smalltalkMergeToolClass notNil
|
366
|
608 |
and:[smalltalkMergeToolClass isLoaded]) not ifTrue:[
|
|
609 |
Dialog warn: 'Merge is not possible. Tools::SmalltalkMergeTool class is not present'.
|
|
610 |
^ self.
|
241
|
611 |
].
|
|
612 |
|
|
613 |
smalltalkMergeToolClass
|
366
|
614 |
openOnDiffSet:diffSet
|
|
615 |
labelA: 'Image'
|
|
616 |
labelB: 'r',revision printString
|
|
617 |
title: 'Merge ',pkg,' revision ',revision printString, ' into image'
|
102
|
618 |
|
|
619 |
"Created: / 20-05-2008 / 23:44:22 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
620 |
"Modified: / 09-08-2009 / 14:15:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
621 |
! !
|
|
622 |
|
230
|
623 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
624 |
|
|
625 |
projectMenuSubversionMergeImageWithRevisionHEAD
|
|
626 |
|
|
627 |
self projectMenuSubversionMergeImageWithRevision: SVN::Revision head
|
|
628 |
|
|
629 |
"Created: / 20-05-2008 / 23:44:46 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
630 |
! !
|
|
631 |
|
230
|
632 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
633 |
|
|
634 |
projectMenuSubversionRemoveWorkingCopy
|
|
635 |
|
|
636 |
self selectedProjects value do:
|
105
|
637 |
[:package|
|
|
638 |
| pkg repo |
|
|
639 |
pkg := self theSingleSelectedProject.
|
|
640 |
repo := (SVN::RepositoryManager repositoryForPackage: pkg) .
|
|
641 |
repo workingCopy path asFilename recursiveRemove]
|
102
|
642 |
|
|
643 |
"Created: / 09-04-2009 / 13:19:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
644 |
! !
|
|
645 |
|
230
|
646 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
647 |
|
|
648 |
projectMenuSubversionShowRevisionLog
|
|
649 |
|
|
650 |
| pkg branch revisionLog revision |
|
|
651 |
pkg := self theSingleSelectedProject.
|
|
652 |
branch := (SVN::RepositoryManager repositoryForPackage: pkg) branch.
|
|
653 |
revisionLog := branch log:'.'.
|
|
654 |
revision := SVN::RevisionLogBrowser openOn: revisionLog.
|
|
655 |
|
|
656 |
"Created: / 21-05-2008 / 09:37:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
657 |
"Modified: / 21-10-2008 / 19:52:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
658 |
! !
|
|
659 |
|
230
|
660 |
!Tools::NewSystemBrowser methodsFor:'menu actions-subversion-project'!
|
102
|
661 |
|
|
662 |
projectMenuSubversionUpdate
|
|
663 |
|
|
664 |
^self projectMenuSubversionLoadRevision: SVN::Revision head
|
|
665 |
|
|
666 |
"Created: / 22-10-2008 / 11:49:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
667 |
"Modified: / 09-04-2009 / 09:38:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
668 |
! !
|
|
669 |
|
230
|
670 |
!Tools::NewSystemBrowser methodsFor:'private-helpers'!
|
102
|
671 |
|
|
672 |
selectedProjectSubversionRepository
|
|
673 |
|
|
674 |
self selectedProjects value size ~= 1 ifTrue:[^nil].
|
|
675 |
^SVN::RepositoryManager repositoryForPackage: self selectedProjects value anyOne.
|
|
676 |
|
|
677 |
"Created: / 19-04-2008 / 11:09:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
678 |
! !
|
|
679 |
|
264
|
680 |
!Tools::NewSystemBrowser class methodsFor:'menu specs-subversion'!
|
239
|
681 |
|
|
682 |
classMenuSubversion
|
|
683 |
"This resource specification was automatically generated
|
|
684 |
by the MenuEditor of ST/X."
|
|
685 |
|
|
686 |
"Do not manually edit this!! If it is corrupted,
|
|
687 |
the MenuEditor may not be able to read the specification."
|
|
688 |
|
|
689 |
"
|
|
690 |
MenuEditor new openOnClass:Tools::NewSystemBrowser andSelector:#classMenuSubversion
|
|
691 |
(Menu new fromLiteralArrayEncoding:(Tools::NewSystemBrowser classMenuSubversion)) startUp
|
|
692 |
"
|
|
693 |
|
|
694 |
<resource: #menu>
|
|
695 |
|
366
|
696 |
^
|
239
|
697 |
#(Menu
|
366
|
698 |
(
|
|
699 |
(MenuItem
|
|
700 |
label: 'Commit'
|
|
701 |
itemValue: classMenuSubversionCommit
|
|
702 |
translateLabel: true
|
|
703 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' commit 'Commit')
|
|
704 |
)
|
|
705 |
(MenuItem
|
|
706 |
enabled: false
|
|
707 |
label: 'Update'
|
|
708 |
itemValue: classMenuSubversionUpdate
|
|
709 |
translateLabel: true
|
|
710 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' update 'Update')
|
|
711 |
)
|
|
712 |
(MenuItem
|
|
713 |
label: '-'
|
|
714 |
)
|
|
715 |
(MenuItem
|
|
716 |
label: 'Compare with revision HEAD'
|
|
717 |
itemValue: classMenuSubversionCompareImageWithRevisionHead
|
|
718 |
translateLabel: true
|
|
719 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' compare 'Compare with revision HEAD')
|
|
720 |
)
|
|
721 |
(MenuItem
|
|
722 |
label: 'Compare with revision'
|
|
723 |
itemValue: classMenuSubversionCompareImageWithRevision
|
|
724 |
translateLabel: true
|
|
725 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' compare 'Compare with revision')
|
|
726 |
)
|
|
727 |
)
|
|
728 |
nil
|
|
729 |
nil
|
239
|
730 |
)
|
|
731 |
! !
|
|
732 |
|
264
|
733 |
!Tools::NewSystemBrowser class methodsFor:'menu specs-subversion'!
|
239
|
734 |
|
|
735 |
projectMenuSubversion
|
|
736 |
"This resource specification was automatically generated
|
|
737 |
by the MenuEditor of ST/X."
|
|
738 |
|
|
739 |
"Do not manually edit this!! If it is corrupted,
|
|
740 |
the MenuEditor may not be able to read the specification."
|
|
741 |
|
|
742 |
"
|
|
743 |
MenuEditor new openOnClass:Tools::NewSystemBrowser andSelector:#projectMenuSubversion
|
|
744 |
(Menu new fromLiteralArrayEncoding:(Tools::NewSystemBrowser projectMenuSubversion)) startUp
|
|
745 |
"
|
|
746 |
|
|
747 |
<resource: #menu>
|
|
748 |
|
366
|
749 |
^
|
239
|
750 |
#(Menu
|
366
|
751 |
(
|
|
752 |
(MenuItem
|
|
753 |
enabled: false
|
|
754 |
label: 'Branch'
|
|
755 |
translateLabel: true
|
|
756 |
submenuChannel: projectMenuSubversionBranches
|
|
757 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' checkout 'Branch')
|
|
758 |
keepLinkedMenu: true
|
|
759 |
)
|
|
760 |
(MenuItem
|
|
761 |
label: 'Commit'
|
|
762 |
itemValue: projectMenuSubversionCommit
|
|
763 |
translateLabel: true
|
|
764 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' commit 'Commit')
|
|
765 |
)
|
|
766 |
(MenuItem
|
|
767 |
label: 'Update'
|
|
768 |
itemValue: projectMenuSubversionUpdate
|
|
769 |
translateLabel: true
|
|
770 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' update 'Update')
|
|
771 |
)
|
|
772 |
(MenuItem
|
|
773 |
label: '-'
|
|
774 |
)
|
|
775 |
(MenuItem
|
|
776 |
label: 'Browse revision log'
|
|
777 |
itemValue: projectMenuSubversionShowRevisionLog
|
|
778 |
translateLabel: true
|
|
779 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' log 'Browse revision log')
|
|
780 |
)
|
|
781 |
(MenuItem
|
|
782 |
label: 'Browse working copy'
|
|
783 |
itemValue: projectMenuSubversionBrowseWorkingCopy
|
|
784 |
translateLabel: true
|
|
785 |
)
|
|
786 |
(MenuItem
|
|
787 |
label: '-'
|
|
788 |
)
|
|
789 |
(MenuItem
|
|
790 |
label: 'Compare with revision HEAD'
|
|
791 |
itemValue: projectMenuSubversionCompareImageWithRevisionHEAD
|
|
792 |
translateLabel: true
|
|
793 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' compare 'Compare with revision HEAD')
|
|
794 |
)
|
|
795 |
(MenuItem
|
|
796 |
label: 'Compare with revision'
|
|
797 |
itemValue: projectMenuSubversionCompareImageWithRevision
|
|
798 |
translateLabel: true
|
|
799 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' compare 'Compare with revision')
|
|
800 |
)
|
|
801 |
(MenuItem
|
|
802 |
label: '-'
|
|
803 |
)
|
|
804 |
(MenuItem
|
|
805 |
label: 'Merge with revision HEAD'
|
|
806 |
itemValue: projectMenuSubversionMergeImageWithRevisionHEAD
|
|
807 |
translateLabel: true
|
|
808 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' merge 'Merge with revision HEAD')
|
|
809 |
)
|
|
810 |
(MenuItem
|
|
811 |
label: 'Merge with revision'
|
|
812 |
itemValue: projectMenuSubversionMergeImageWithRevision
|
|
813 |
translateLabel: true
|
|
814 |
labelImage: (ResourceRetriever #'SVN::IconLibrary' merge 'Merge with revision')
|
|
815 |
)
|
|
816 |
(MenuItem
|
|
817 |
label: '-'
|
|
818 |
)
|
|
819 |
(MenuItem
|
|
820 |
label: 'More'
|
|
821 |
translateLabel: true
|
|
822 |
submenu:
|
|
823 |
(Menu
|
|
824 |
(
|
|
825 |
(MenuItem
|
|
826 |
label: 'Load revision...'
|
|
827 |
itemValue: projectMenuSubversionLoadRevision
|
|
828 |
translateLabel: true
|
|
829 |
)
|
|
830 |
(MenuItem
|
|
831 |
label: '-'
|
|
832 |
)
|
|
833 |
(MenuItem
|
|
834 |
label: 'Remove working copy'
|
|
835 |
itemValue: projectMenuSubversionRemoveWorkingCopy
|
|
836 |
translateLabel: true
|
|
837 |
)
|
|
838 |
(MenuItem
|
|
839 |
label: '-'
|
|
840 |
)
|
|
841 |
(MenuItem
|
|
842 |
enabled: hasSingleProjectSelected
|
|
843 |
label: 'Fast commit'
|
|
844 |
translateLabel: true
|
|
845 |
choice: projectMenuSubversionCommitMode
|
|
846 |
choiceValue: fast
|
|
847 |
)
|
|
848 |
(MenuItem
|
|
849 |
enabled: hasSingleProjectSelected
|
|
850 |
label: 'Full commit'
|
|
851 |
translateLabel: true
|
|
852 |
choice: projectMenuSubversionCommitMode
|
|
853 |
choiceValue: full
|
|
854 |
)
|
|
855 |
)
|
|
856 |
nil
|
|
857 |
nil
|
|
858 |
)
|
|
859 |
)
|
|
860 |
)
|
|
861 |
nil
|
|
862 |
nil
|
239
|
863 |
)
|
|
864 |
! !
|
|
865 |
|
230
|
866 |
!URL methodsFor:'queries'!
|
102
|
867 |
|
|
868 |
isValidSvnRepositoryUrl
|
|
869 |
|
|
870 |
^#('file' 'http' 'https' 'svn' 'svn+ssh')
|
105
|
871 |
includes: self method
|
102
|
872 |
|
|
873 |
"Created: / 16-08-2009 / 16:39:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
874 |
! !
|
|
875 |
|
230
|
876 |
!XML::NodeSet methodsFor:'navigation'!
|
102
|
877 |
|
105
|
878 |
@ attributeName
|
102
|
879 |
"XPath like processing - if singleton set, answer an value of
|
|
880 |
atribute named attributeName, error otherwise.
|
|
881 |
This method is used in libsvn"
|
|
882 |
|
|
883 |
self size = 1 ifTrue:[^self first @ attributeName].
|
|
884 |
self error:'More than one element in node set'
|
|
885 |
! !
|
516
|
886 |
|
|
887 |
!stx_libsvn class methodsFor:'documentation'!
|
|
888 |
|
|
889 |
extensionsVersion_CVS
|
|
890 |
^ '$Header$'
|
|
891 |
! ! |