30
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
45
|
3 |
All Rights Reserved
|
30
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
ChangesBrowser subclass:#ChangeSetBrowser
|
1470
|
14 |
instanceVariableNames:'changeSet originalChangeSet'
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Interface-Browsers'
|
30
|
18 |
!
|
|
19 |
|
|
20 |
!ChangeSetBrowser class methodsFor:'documentation'!
|
|
21 |
|
|
22 |
copyright
|
|
23 |
"
|
|
24 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
45
|
25 |
All Rights Reserved
|
30
|
26 |
|
|
27 |
This software is furnished under a license and may be used
|
|
28 |
only in accordance with the terms of that license and with the
|
|
29 |
inclusion of the above copyright notice. This software may not
|
|
30 |
be provided or otherwise made available to, or used by, any
|
|
31 |
other person. No title to or ownership of the software is
|
|
32 |
hereby transferred.
|
|
33 |
"
|
|
34 |
!
|
|
35 |
|
|
36 |
documentation
|
|
37 |
"
|
|
38 |
like a changesBrowser, but manipulates the per-project change-lists.
|
|
39 |
"
|
|
40 |
! !
|
|
41 |
|
|
42 |
!ChangeSetBrowser class methodsFor:'instance creation'!
|
|
43 |
|
40
|
44 |
openOn:aChangeSet
|
30
|
45 |
"create c changes browser on a change set"
|
|
46 |
|
45
|
47 |
^ ((self new label:'ChangeSet Browser') changeSet:aChangeSet) open
|
30
|
48 |
! !
|
|
49 |
|
1470
|
50 |
!ChangeSetBrowser class methodsFor:'defaults'!
|
|
51 |
|
|
52 |
defaultLabel
|
|
53 |
^ 'ChangeSet Browser'
|
|
54 |
|
|
55 |
"Created: / 6.2.1998 / 13:25:47 / cg"
|
|
56 |
! !
|
|
57 |
|
30
|
58 |
!ChangeSetBrowser methodsFor:'initialize / release'!
|
|
59 |
|
224
|
60 |
changeListMenu
|
|
61 |
|labels selectors|
|
30
|
62 |
|
224
|
63 |
labels := #(
|
|
64 |
'apply change'
|
|
65 |
'apply changes to end'
|
|
66 |
'apply all changes'
|
|
67 |
'-'
|
|
68 |
'delete'
|
|
69 |
'delete to end'
|
|
70 |
'delete changes for this class to end'
|
|
71 |
'delete all changes for this class'
|
|
72 |
'-'
|
|
73 |
'update'
|
|
74 |
"/ 'compress'
|
|
75 |
'compare with current version'
|
|
76 |
'-'
|
|
77 |
'make change a patch'
|
|
78 |
"/ 'update sourcefile from change'
|
|
79 |
'-'
|
|
80 |
'saveback changeSet'
|
|
81 |
).
|
30
|
82 |
|
224
|
83 |
selectors := #(
|
|
84 |
doApply
|
|
85 |
doApplyRest
|
|
86 |
doApplyAll
|
|
87 |
nil
|
|
88 |
doDelete
|
|
89 |
doDeleteRest
|
|
90 |
doDeleteClassRest
|
|
91 |
doDeleteClassAll
|
|
92 |
nil
|
|
93 |
doUpdate
|
|
94 |
"/ doCompress
|
|
95 |
doCompare
|
|
96 |
nil
|
|
97 |
doMakePatch
|
|
98 |
"/ doMakePermanent
|
|
99 |
nil
|
|
100 |
doSaveBack
|
|
101 |
).
|
|
102 |
|
|
103 |
^ PopUpMenu
|
|
104 |
labels:labels
|
|
105 |
selectors:selectors
|
|
106 |
receiver:self
|
|
107 |
|
|
108 |
"Created: 3.12.1995 / 18:06:35 / cg"
|
|
109 |
"Modified: 3.12.1995 / 18:13:06 / cg"
|
30
|
110 |
! !
|
|
111 |
|
1474
|
112 |
!ChangeSetBrowser ignoredMethodsFor:'private'!
|
|
113 |
|
|
114 |
applyChange:changeNr
|
|
115 |
"fileIn a change"
|
|
116 |
|
|
117 |
|nm applyAction|
|
|
118 |
|
|
119 |
nm := self classNameOfChange:changeNr.
|
|
120 |
nm notNil ifTrue:[
|
|
121 |
|cls|
|
|
122 |
|
|
123 |
cls := Smalltalk at:(nm asSymbol) ifAbsent:[].
|
|
124 |
cls notNil ifTrue:[
|
|
125 |
cls isLoaded ifFalse:[
|
|
126 |
cls autoload
|
|
127 |
]
|
|
128 |
]
|
|
129 |
].
|
|
130 |
|
|
131 |
changeNrProcessed := changeNr.
|
|
132 |
|
|
133 |
applyAction := [
|
|
134 |
|sig|
|
|
135 |
|
|
136 |
(skipSignal notNil) ifTrue:[
|
|
137 |
sig := skipSignal
|
|
138 |
] ifFalse:[
|
|
139 |
sig := Object abortSignal
|
|
140 |
].
|
|
141 |
sig catch:[
|
|
142 |
|change reader doItChunk methodsForChunk|
|
|
143 |
|
|
144 |
(changeSet at:changeNr) applyChange.
|
|
145 |
].
|
|
146 |
changeNrProcessed := nil.
|
|
147 |
].
|
|
148 |
|
|
149 |
"/
|
|
150 |
"/ if I am showing the changes file, dont update it
|
|
151 |
"/
|
|
152 |
changeFileName = ObjectMemory nameForChanges ifTrue:[
|
|
153 |
Class withoutUpdatingChangesDo:applyAction
|
|
154 |
] ifFalse:[
|
|
155 |
applyAction value
|
|
156 |
].
|
|
157 |
|
|
158 |
"Created: / 7.2.1998 / 19:32:35 / cg"
|
|
159 |
"Modified: / 7.2.1998 / 19:35:11 / cg"
|
|
160 |
! !
|
|
161 |
|
30
|
162 |
!ChangeSetBrowser methodsFor:'private'!
|
|
163 |
|
1470
|
164 |
changeIsFollowupMethodChange:changeNr
|
|
165 |
^ false
|
|
166 |
|
|
167 |
"Created: / 6.2.1998 / 13:04:59 / cg"
|
1474
|
168 |
"Modified: / 7.2.1998 / 19:28:52 / cg"
|
1470
|
169 |
!
|
|
170 |
|
30
|
171 |
changeSet:aChangeSet
|
|
172 |
originalChangeSet := aChangeSet.
|
|
173 |
changeSet := OrderedCollection new.
|
106
|
174 |
originalChangeSet notNil ifTrue:[
|
|
175 |
originalChangeSet do:[:aChange |
|
|
176 |
changeSet add:aChange
|
|
177 |
].
|
30
|
178 |
].
|
|
179 |
!
|
|
180 |
|
222
|
181 |
checkIfFileHasChanged
|
|
182 |
Processor removeTimedBlock:checkBlock.
|
|
183 |
changeSet size ~= originalChangeSet size ifTrue:[
|
|
184 |
self newLabel:'(outdated)'.
|
|
185 |
autoUpdate ifTrue:[
|
|
186 |
self doUpdate
|
|
187 |
]
|
|
188 |
] ifFalse:[
|
|
189 |
self newLabel:''
|
|
190 |
].
|
|
191 |
Processor addTimedBlock:checkBlock afterSeconds:5.
|
|
192 |
|
|
193 |
"Created: 3.12.1995 / 13:52:30 / cg"
|
|
194 |
"Modified: 3.12.1995 / 14:15:06 / cg"
|
|
195 |
!
|
|
196 |
|
224
|
197 |
classNameOfChange:nr
|
1474
|
198 |
^ (changeSet at:nr) className
|
224
|
199 |
|
1474
|
200 |
"Created: / 3.12.1995 / 18:15:56 / cg"
|
|
201 |
"Modified: / 7.2.1998 / 19:24:29 / cg"
|
224
|
202 |
!
|
|
203 |
|
1470
|
204 |
fullClassNameOfChange:nr
|
|
205 |
^ (changeSet at:nr) className
|
|
206 |
|
|
207 |
"Created: / 6.2.1998 / 13:02:25 / cg"
|
|
208 |
"Modified: / 6.2.1998 / 13:07:02 / cg"
|
|
209 |
!
|
|
210 |
|
224
|
211 |
numberOfChanges
|
|
212 |
^ changeSet size
|
|
213 |
|
|
214 |
"Created: 3.12.1995 / 18:15:56 / cg"
|
|
215 |
!
|
|
216 |
|
222
|
217 |
queryCloseText
|
|
218 |
^ 'Quit without updating changeSet ?'
|
|
219 |
!
|
|
220 |
|
45
|
221 |
readChangesFileInBackground:dummy
|
30
|
222 |
"read the changeSet, create a list of header-lines"
|
|
223 |
|
|
224 |
changeSet size == 0 ifTrue:[^ nil].
|
|
225 |
|
224
|
226 |
self newLabel:'updating ...'.
|
30
|
227 |
self withCursor:(Cursor read) do:[
|
45
|
228 |
changeChunks := OrderedCollection new.
|
|
229 |
changeHeaderLines := OrderedCollection new.
|
30
|
230 |
|
45
|
231 |
changeSet do:[:aChange |
|
|
232 |
changeChunks add:(aChange printString).
|
|
233 |
changeHeaderLines add:(aChange printString)
|
|
234 |
].
|
|
235 |
changeClassNames := OrderedCollection new:(changeChunks size).
|
|
236 |
anyChanges := false
|
224
|
237 |
].
|
|
238 |
self newLabel:''.
|
|
239 |
|
|
240 |
"Created: 3.12.1995 / 18:02:39 / cg"
|
30
|
241 |
!
|
|
242 |
|
|
243 |
saveBackChanges
|
|
244 |
"save back the change set"
|
|
245 |
|
|
246 |
[originalChangeSet isEmpty] whileFalse:[
|
45
|
247 |
originalChangeSet removeLast
|
30
|
248 |
].
|
|
249 |
changeSet do:[:aChange |
|
45
|
250 |
originalChangeSet add:aChange
|
30
|
251 |
]
|
|
252 |
!
|
|
253 |
|
1470
|
254 |
selectorOfMethodChange:changeNr
|
|
255 |
^ (changeSet at:changeNr) selector
|
|
256 |
|
|
257 |
"Created: / 6.2.1998 / 13:28:20 / cg"
|
|
258 |
"Modified: / 6.2.1998 / 13:29:59 / cg"
|
|
259 |
!
|
|
260 |
|
30
|
261 |
silentDeleteChange:changeNr
|
|
262 |
"delete a change do not update changeListView"
|
|
263 |
|
1474
|
264 |
changeSet removeIndex:changeNr.
|
|
265 |
super silentDeleteChange:changeNr.
|
|
266 |
|
|
267 |
"Created: / 3.12.1995 / 18:14:17 / cg"
|
|
268 |
"Modified: / 7.2.1998 / 19:57:57 / cg"
|
|
269 |
!
|
224
|
270 |
|
1474
|
271 |
silentDeleteInternalChange:changeNr
|
|
272 |
"delete a change do not update changeListView"
|
|
273 |
|
|
274 |
changeSet removeIndex:changeNr.
|
|
275 |
super silentDeleteInternalChange:changeNr.
|
|
276 |
|
|
277 |
"Modified: / 7.2.1998 / 19:44:45 / cg"
|
|
278 |
"Created: / 7.2.1998 / 19:58:02 / cg"
|
222
|
279 |
!
|
|
280 |
|
|
281 |
streamForChange:changeNr
|
|
282 |
"answer a stream for change"
|
|
283 |
|
1474
|
284 |
|change s|
|
222
|
285 |
|
|
286 |
change := changeSet at:changeNr.
|
|
287 |
change isNil ifTrue:[^nil].
|
1474
|
288 |
change isMethodChange ifTrue:[
|
|
289 |
s := '!!' , change className ,
|
|
290 |
' methodsFor:''' , change methodCategory , '''!!\' withCRs ,
|
|
291 |
change source , '\' withCRs , '!! !!\' withCRs.
|
|
292 |
^ ReadStream on:s
|
|
293 |
].
|
222
|
294 |
^ ReadStream on:(change source)
|
1474
|
295 |
|
|
296 |
"Modified: / 7.2.1998 / 19:52:44 / cg"
|
30
|
297 |
! !
|
|
298 |
|
|
299 |
!ChangeSetBrowser methodsFor:'user actions'!
|
|
300 |
|
|
301 |
doSaveBack
|
|
302 |
anyChanges ifTrue:[
|
45
|
303 |
self saveBackChanges.
|
|
304 |
self doUpdate
|
30
|
305 |
]
|
222
|
306 |
!
|
|
307 |
|
|
308 |
doUpdate
|
|
309 |
changeSet := OrderedCollection new.
|
|
310 |
originalChangeSet notNil ifTrue:[
|
|
311 |
originalChangeSet do:[:aChange |
|
|
312 |
changeSet add:aChange
|
|
313 |
].
|
|
314 |
].
|
|
315 |
super doUpdate
|
|
316 |
|
|
317 |
"Created: 3.12.1995 / 13:54:14 / cg"
|
30
|
318 |
! !
|
222
|
319 |
|
|
320 |
!ChangeSetBrowser class methodsFor:'documentation'!
|
|
321 |
|
|
322 |
version
|
1474
|
323 |
^ '$Header: /cvs/stx/stx/libtool/ChangeSetBrowser.st,v 1.13 1998-02-07 19:01:32 cg Exp $'
|
222
|
324 |
! !
|