author | Claus Gittinger <cg@exept.de> |
Thu, 25 Apr 1996 20:40:30 +0200 | |
changeset 237 | 09c4d83d5ab1 |
parent 235 | 3ebfdc6edab9 |
child 243 | 2d375fb526f6 |
permissions | -rw-r--r-- |
46 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by AEG Industry Automation |
|
3 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
4 |
All Rights Reserved |
|
5 |
||
6 |
This software is furnished under a license and may be used |
|
7 |
only in accordance with the terms of that license and with the |
|
8 |
inclusion of the above copyright notice. This software may not |
|
9 |
be provided or otherwise made available to, or used by, any |
|
10 |
other person. No title to or ownership of the software is |
|
11 |
hereby transferred. |
|
12 |
" |
|
13 |
||
120 | 14 |
Object subclass:#HistoryManager |
149
f7d66ab71259
filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents:
142
diff
changeset
|
15 |
instanceVariableNames:'historyMode' |
f7d66ab71259
filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents:
142
diff
changeset
|
16 |
classVariableNames:'TheOneAndOnlyInstance' |
f7d66ab71259
filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents:
142
diff
changeset
|
17 |
poolDictionaries:'' |
f7d66ab71259
filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents:
142
diff
changeset
|
18 |
category:'System-Changes-History' |
41 | 19 |
! |
20 |
||
21 |
!HistoryManager class methodsFor:'documentation'! |
|
22 |
||
46 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 1995 by AEG Industry Automation |
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
41 | 38 |
documentation |
39 |
" |
|
214 | 40 |
This class is part of the HistoryManagerProject. |
41 |
It helps to keep track of changes made to methods. |
|
41 | 42 |
|
214 | 43 |
All Methods and Classes in the system get a HistroyLine which |
44 |
contains a timestamp and the name of the changing user. |
|
45 |
This is acually the UniX loginname. |
|
46 |
||
47 |
The Manager registers all Classes in the system to get notifications |
|
48 |
on change, intercepts them and appends a historyLine to the methods |
|
49 |
code. |
|
50 |
||
51 |
The HistoryManager can be turned off via the Launcher menu. |
|
41 | 52 |
|
235 | 53 |
[author:] |
54 |
Robert Sailer - AEG |
|
41 | 55 |
" |
56 |
! ! |
|
57 |
||
58 |
!HistoryManager class methodsFor:'initialization'! |
|
59 |
||
87 | 60 |
initMe |
214 | 61 |
"setup theOneAndOnly instance of myself (if not already present" |
62 |
||
87 | 63 |
^self new. |
64 |
||
214 | 65 |
"Modified: 14.8.1995 / 09:02:00 / robert" |
66 |
"Modified: 20.4.1996 / 20:33:44 / cg" |
|
87 | 67 |
! |
68 |
||
41 | 69 |
initialize |
214 | 70 |
"add myself as a dependent of ObjectMemory to be told about image restarts" |
71 |
||
41 | 72 |
ObjectMemory addDependent: self. |
73 |
||
214 | 74 |
"Modified: 14.8.1995 / 09:09:06 / robert" |
75 |
"Modified: 20.4.1996 / 20:34:09 / cg" |
|
41 | 76 |
! ! |
77 |
||
78 |
!HistoryManager class methodsFor:'instance creation'! |
|
79 |
||
80 |
new |
|
46 | 81 |
"because there can be only ONE HistoryManager, new must me redefiend" |
41 | 82 |
|
83 |
TheOneAndOnlyInstance isNil ifTrue:[ |
|
84 |
TheOneAndOnlyInstance := super new initialize. |
|
85 |
HistoryLine initialize. |
|
86 |
]. |
|
87 |
||
88 |
^ TheOneAndOnlyInstance |
|
89 |
||
90 |
" |
|
91 |
||
92 |
HistoryManager new. |
|
93 |
" |
|
94 |
||
95 |
"Modified: 11.08.1995 / 17:01:29 / robert" |
|
96 |
! ! |
|
97 |
||
98 |
!HistoryManager class methodsFor:'accessing'! |
|
99 |
||
100 |
instance |
|
214 | 101 |
"return the one and only historyManager instance" |
41 | 102 |
|
214 | 103 |
^ TheOneAndOnlyInstance |
104 |
||
105 |
"Modified: 20.4.1996 / 20:31:18 / cg" |
|
41 | 106 |
! |
107 |
||
108 |
isActive |
|
214 | 109 |
"return true, if the historyManagement is activated" |
110 |
||
111 |
^ TheOneAndOnlyInstance notNil |
|
41 | 112 |
|
113 |
"Modified: 27.8.1995 / 00:32:12 / claus" |
|
214 | 114 |
"Modified: 20.4.1996 / 20:31:32 / cg" |
41 | 115 |
! ! |
116 |
||
117 |
!HistoryManager class methodsFor:'activation / deactivation'! |
|
118 |
||
119 |
activate |
|
214 | 120 |
"activate the HistoryManagement" |
121 |
||
41 | 122 |
self new "/ creating an instance activates me |
178 | 123 |
|
124 |
" |
|
125 |
HistoryManager activate |
|
126 |
" |
|
214 | 127 |
|
128 |
"Modified: 20.4.1996 / 20:31:46 / cg" |
|
41 | 129 |
! |
130 |
||
131 |
deactivate |
|
214 | 132 |
"deactivate the HistoryManagement" |
133 |
||
178 | 134 |
|mgr| |
135 |
||
136 |
mgr := TheOneAndOnlyInstance. |
|
41 | 137 |
Smalltalk allClassesDo:[:aClass | |
214 | 138 |
aClass removeDependent:mgr. |
139 |
aClass class removeDependent:mgr. |
|
41 | 140 |
]. |
141 |
TheOneAndOnlyInstance := nil. |
|
142 |
||
178 | 143 |
" |
144 |
HistoryManager deactivate |
|
145 |
" |
|
214 | 146 |
|
147 |
"Modified: 20.4.1996 / 20:31:53 / cg" |
|
41 | 148 |
! ! |
149 |
||
87 | 150 |
!HistoryManager class methodsFor:'change and update'! |
151 |
||
152 |
update: what |
|
214 | 153 |
"intercepts system restart - reinstall mySelf as dependent of all classes" |
154 |
||
87 | 155 |
(what == #restarted) ifTrue:[ |
214 | 156 |
TheOneAndOnlyInstance notNil ifTrue:[ |
157 |
" |
|
158 |
smalltalk is about to restart from an Image - |
|
159 |
" |
|
87 | 160 |
"/ 'HistoryManager initialize (via update)' infoPrintNL. |
214 | 161 |
self initMe. |
162 |
] |
|
87 | 163 |
]. |
164 |
||
165 |
"Modified: 27.8.1995 / 16:33:02 / claus" |
|
214 | 166 |
"Modified: 20.4.1996 / 20:33:02 / cg" |
87 | 167 |
! ! |
168 |
||
47 | 169 |
!HistoryManager class methodsFor:'helpers'! |
170 |
||
171 |
getAllHistoriesFrom:someString |
|
214 | 172 |
"returns anArray of HistoryLines from a string. |
173 |
Usually, the argument is a methods source code." |
|
47 | 174 |
|
175 |
|position aReadWriteStream firstFound nextFound aHistoryString rcOC h| |
|
176 |
||
177 |
"read begining from the end and look there for the first comment character. If there's none return" |
|
178 |
||
179 |
rcOC := OrderedCollection new. |
|
180 |
position := someString size. |
|
181 |
firstFound := false. |
|
182 |
nextFound := false. |
|
183 |
||
184 |
someString reverseDo:[ :aChar| |
|
214 | 185 |
position := position - 1. |
186 |
aChar == $" ifTrue:[ |
|
187 |
firstFound ifTrue:[ |
|
188 |
firstFound := false. |
|
189 |
nextFound := true. |
|
190 |
] ifFalse:[ |
|
191 |
aReadWriteStream := ReadWriteStream on: String new. |
|
192 |
firstFound := true. |
|
193 |
nextFound := false. |
|
194 |
]. |
|
195 |
]. |
|
196 |
(firstFound and: [nextFound not]) ifTrue:[ |
|
197 |
"now collect all up to the next comment character" |
|
198 |
aChar == $" ifFalse:[ |
|
199 |
aReadWriteStream nextPut: aChar. |
|
200 |
]. |
|
201 |
]. |
|
202 |
nextFound ifTrue:[ |
|
203 |
"End reached - now try to make a HistoryLine" |
|
204 |
aHistoryString := (aReadWriteStream contents) reverse. |
|
205 |
" |
|
206 |
Transcript showCr: aHistoryString. |
|
207 |
" |
|
208 |
h := HistoryLine fromString: aHistoryString at: position. |
|
209 |
h notNil ifTrue:[ |
|
210 |
rcOC add:h. |
|
211 |
]. |
|
47 | 212 |
"/ (aHistoryString startsWith: 'Modified:') ifTrue:[ |
213 |
"/ "a history line was found - now make a NewInstance of HistoryLine" |
|
214 |
"/ rcOC add: ( HistoryLine fromString: aHistoryString at: position). |
|
215 |
"/ ]. |
|
214 | 216 |
nextFound := false. |
217 |
]. |
|
47 | 218 |
]. |
219 |
||
220 |
^rcOC reverse "the OrderedCollection with HistoryLines in the right order" |
|
221 |
||
222 |
"Modified: 21.12.1993 / 18:32:30 / M.Noell" |
|
223 |
"Modified: 9.8.1995 / 22:45:30 / R.Sailer" |
|
224 |
"Modified: 8.9.1995 / 17:54:33 / claus" |
|
214 | 225 |
"Modified: 20.4.1996 / 20:33:22 / cg" |
192 | 226 |
! |
227 |
||
228 |
withoutHistoryLines:someString |
|
229 |
"given some methods sourceString, return a copy without any |
|
230 |
history lines" |
|
231 |
||
232 |
| pos sourceCode previousHistories | |
|
233 |
||
234 |
previousHistories := self getAllHistoriesFrom:someString. |
|
235 |
||
236 |
"extract source body." |
|
237 |
previousHistories isEmpty ifTrue: [ |
|
238 |
sourceCode := someString withoutSeparators. |
|
239 |
] ifFalse: [ |
|
240 |
pos := (previousHistories first) firstPositionInSourceCode. |
|
241 |
sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators. |
|
242 |
]. |
|
243 |
||
244 |
^ sourceCode |
|
245 |
||
246 |
"Created: 5.3.1996 / 15:11:12 / cg" |
|
247 |
"Modified: 6.3.1996 / 11:52:21 / cg" |
|
47 | 248 |
! ! |
249 |
||
41 | 250 |
!HistoryManager methodsFor:'accessing'! |
251 |
||
252 |
historyMode |
|
253 |
"return historyMode" |
|
254 |
||
255 |
^ historyMode |
|
256 |
||
257 |
"Modified: 11.08.1995 / 16:51:56 / robert" |
|
258 |
! |
|
259 |
||
260 |
historyMode:something |
|
261 |
"set historyMode" |
|
262 |
||
263 |
historyMode := something. |
|
264 |
||
265 |
"Modified: 11.08.1995 / 16:52:12 / robert" |
|
266 |
! ! |
|
267 |
||
268 |
!HistoryManager methodsFor:'initialization'! |
|
269 |
||
270 |
exclude |
|
46 | 271 |
"public - return an exclusionlist for some smalltalk classes which should not be notified or historisized" |
41 | 272 |
|
273 |
| oc | |
|
274 |
||
275 |
oc := OrderedCollection new. |
|
276 |
oc add: self. |
|
277 |
||
278 |
^oc |
|
279 |
||
280 |
"Modified: 11.08.1995 / 17:02:18 / robert" |
|
281 |
! |
|
282 |
||
283 |
initialize |
|
46 | 284 |
"public - make me depend on all smalltalk classes (except the exclusionList) |
285 |
to be notified later about changes. This intercepts source installation and allows |
|
286 |
be to patch the source-string with a historyLine." |
|
41 | 287 |
|
53 | 288 |
|exclusionlist| |
41 | 289 |
|
290 |
super initialize. |
|
291 |
historyMode := true. |
|
292 |
exclusionlist := self exclude. |
|
293 |
||
178 | 294 |
Smalltalk allClassesDo:[:aClass| |
41 | 295 |
"all classes should send a notification if changed" |
296 |
"aClass = self " false ifFalse: [ |
|
297 |
(exclusionlist includes: aClass) ifFalse:[ |
|
298 |
aClass addDependent: self. |
|
299 |
aClass class addDependent: self. "for class methods" |
|
300 |
]. |
|
301 |
]. |
|
302 |
]. |
|
303 |
||
304 |
^self |
|
305 |
||
306 |
"Modified: 11.08.1995 / 17:12:51 / robert" |
|
307 |
! ! |
|
308 |
||
309 |
!HistoryManager methodsFor:'updateHistory'! |
|
310 |
||
149
f7d66ab71259
filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents:
142
diff
changeset
|
311 |
addHistoryTo:someString forceModification:forceModification forceCreation:forceCreation |
41 | 312 |
"private - add a historyLine at end to the sourceCode; |
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
313 |
check for multiple lines of the same user and merge into one. |
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
314 |
If forceModification is true or a history already exists in someString, |
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
315 |
add a 'Modified' line; otherwise, add a 'Created' line." |
41 | 316 |
|
53 | 317 |
| histLines pos wStream sourceCode previousHistories |
47 | 318 |
newLine | |
41 | 319 |
|
53 | 320 |
"Check whether we want a history to be added" |
321 |
historyMode ifFalse:[ |
|
178 | 322 |
^ someString |
53 | 323 |
]. |
47 | 324 |
previousHistories := self class getAllHistoriesFrom:someString. |
41 | 325 |
|
326 |
"extract source body." |
|
327 |
previousHistories isEmpty ifTrue: [ |
|
178 | 328 |
sourceCode := someString withoutSeparators. |
329 |
forceModification ifTrue:[ |
|
330 |
newLine := (HistoryLine new) |
|
331 |
] ifFalse:[ |
|
332 |
newLine := (HistoryLine newCreated). |
|
333 |
] |
|
41 | 334 |
] ifFalse: [ |
178 | 335 |
pos := (previousHistories first) firstPositionInSourceCode. |
336 |
sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators. |
|
337 |
forceCreation ifTrue:[ |
|
338 |
newLine := (HistoryLine newCreated). |
|
339 |
] ifFalse:[ |
|
340 |
newLine := (HistoryLine new) |
|
341 |
] |
|
41 | 342 |
]. |
343 |
||
344 |
"add the actual user's historyLine." |
|
47 | 345 |
previousHistories add:newLine. |
41 | 346 |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
347 |
"Filtering historyLines (each user with one entry)." |
41 | 348 |
histLines := HistoryLine filterHistoryLines: previousHistories. |
349 |
||
350 |
"create new body with added historyLine" |
|
351 |
wStream := WriteStream on: String new. |
|
352 |
wStream nextPutAll: sourceCode; cr. |
|
353 |
||
354 |
"append the historyLines to the source" |
|
355 |
wStream cr. |
|
356 |
histLines do: [:hl | |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
357 |
wStream nextPutAll:hl printString; cr. |
41 | 358 |
]. |
359 |
||
360 |
^wStream contents. |
|
361 |
||
47 | 362 |
"Modified: 11.8.1995 / 16:51:50 / robert" |
363 |
"Modified: 8.9.1995 / 17:55:38 / claus" |
|
149
f7d66ab71259
filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents:
142
diff
changeset
|
364 |
"Modified: 13.12.1995 / 14:07:03 / cg" |
41 | 365 |
! |
366 |
||
53 | 367 |
addHistoryToHistoryMethodOf:aClass |
214 | 368 |
"private - add a historyLine at end of the classes history methods |
369 |
source - if there is one" |
|
370 |
||
53 | 371 |
|cls historyMethod oldSource newSource| |
372 |
||
373 |
aClass isMeta ifFalse:[ |
|
214 | 374 |
cls := aClass class. |
53 | 375 |
] ifTrue:[ |
214 | 376 |
cls := aClass |
53 | 377 |
]. |
378 |
historyMethod := cls compiledMethodAt: #history. |
|
379 |
historyMethod notNil ifTrue:[ |
|
214 | 380 |
oldSource := historyMethod source. |
381 |
oldSource notNil ifTrue:[ |
|
382 |
newSource := self addHistoryTo:oldSource forceModification:false forceCreation:false. |
|
383 |
historyMethod source:newSource. |
|
384 |
] |
|
53 | 385 |
] |
149
f7d66ab71259
filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents:
142
diff
changeset
|
386 |
|
214 | 387 |
"Modified: 20.4.1996 / 20:35:06 / cg" |
53 | 388 |
! |
389 |
||
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
390 |
update:something with:someArgument from:changedObject |
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
391 |
"arrive here, whenever any class changed somehow. |
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
392 |
(something contains aSymbol describing what happened)" |
41 | 393 |
|
202 | 394 |
| sourceCode newMethod fileInOrRecompiling selector oldMethod| |
41 | 395 |
|
396 |
"/ changedObject == self ifTrue:[ "for development only" |
|
397 |
"/ self halt. |
|
398 |
"/ ^self. |
|
399 |
"/ ]. |
|
46 | 400 |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
401 |
fileInOrRecompiling := Class updateChangeFileQuerySignal raise. |
41 | 402 |
|
53 | 403 |
"/ changedObject isMeta ifTrue:[ |
43 | 404 |
"/ Transcript showCr: 'metaClass = ', changedObject printString. |
53 | 405 |
"/ ]. |
41 | 406 |
|
407 |
fileInOrRecompiling ifFalse:[ |
|
42 | 408 |
"/ Transcript showCr: '* noChange in history'. |
178 | 409 |
^ self |
53 | 410 |
]. |
411 |
historyMode ifFalse:[ |
|
178 | 412 |
^ self |
41 | 413 |
]. |
414 |
||
415 |
" |
|
416 |
Class Variables |
|
417 |
" |
|
418 |
(something == #definition) ifTrue:[ |
|
178 | 419 |
"add handling for classes here ..." |
420 |
"/ self addHistoryToHistoryMethodOf:changedObject. |
|
41 | 421 |
]. |
422 |
||
423 |
"this is a sub item of #definition" |
|
424 |
(something == #classVariables) ifTrue:[ |
|
178 | 425 |
" |
426 |
Transcript showCr: 'classVariables changed'. |
|
427 |
" |
|
428 |
"/ does not yet work; |
|
429 |
"/ (someArgument does not contain the class we are interested in) |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
430 |
|
178 | 431 |
self addHistoryToHistoryMethodOf:changedObject. |
432 |
^ self |
|
41 | 433 |
]. |
434 |
||
435 |
" |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
436 |
new Class creation |
41 | 437 |
" |
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
438 |
((changedObject == Smalltalk) and:[something == #newClass]) ifTrue:[ |
178 | 439 |
"/ |
440 |
"/ add myself as dependents in order to get future change notifications |
|
441 |
"/ |
|
442 |
someArgument addDependent: self. |
|
443 |
someArgument class addDependent: self. "for class methods" |
|
444 |
someArgument history:(self addHistoryTo:String new forceModification:false forceCreation:false). "append historyString for new class" |
|
41 | 445 |
]. |
446 |
||
447 |
" |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
448 |
changed methods |
41 | 449 |
" |
450 |
changedObject isBehavior ifTrue:[ |
|
178 | 451 |
something = #methodDictionary ifTrue:[ |
452 |
someArgument isArray ifTrue:[ |
|
453 |
selector := someArgument at:1. |
|
454 |
oldMethod := someArgument at:2 |
|
455 |
] ifFalse:[ |
|
456 |
selector := someArgument |
|
457 |
]. |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
458 |
|
178 | 459 |
"/ |
460 |
"/ fetch sourceString of the method |
|
461 |
"/ |
|
462 |
sourceCode := changedObject sourceCodeAt:selector. |
|
463 |
sourceCode isNil ifTrue:[ |
|
464 |
"method has been deleted" |
|
43 | 465 |
"/ Transcript showCr: 'method has been deleted'. |
178 | 466 |
] ifFalse:[ |
467 |
newMethod := changedObject compiledMethodAt:selector. |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
468 |
|
178 | 469 |
oldMethod notNil ifTrue:[ |
470 |
(oldMethod source asString withTabsExpanded = sourceCode asString withTabsExpanded) ifTrue:[ |
|
471 |
"/ no change (accepted same code again ?) |
|
472 |
^ self |
|
473 |
]. |
|
474 |
]. |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
475 |
|
178 | 476 |
"/ |
477 |
"/ dont add historylines to documentation methods ... |
|
478 |
"/ |
|
479 |
(changedObject isMeta not |
|
480 |
or:[newMethod category ~= 'documentation']) ifTrue:[ |
|
481 |
sourceCode := self addHistoryTo:sourceCode forceModification:(oldMethod notNil) forceCreation:(oldMethod isNil). |
|
482 |
newMethod source: sourceCode. |
|
43 | 483 |
"/ Transcript showCr: 'history updated / added'. |
178 | 484 |
] |
485 |
]. |
|
486 |
^self |
|
487 |
]. |
|
41 | 488 |
|
178 | 489 |
something == #comment ifTrue:[ |
490 |
"in someArgument steht jetzt der alte kommentar" |
|
491 |
^ self. |
|
492 |
] ifFalse:[ |
|
493 |
"it is a class definition" |
|
43 | 494 |
"/ Transcript show: 'Class definition: ', changedObject printString;cr. |
178 | 495 |
self addHistoryToHistoryMethodOf:changedObject. |
496 |
]. |
|
41 | 497 |
]. |
498 |
||
499 |
^self |
|
500 |
||
43 | 501 |
"Modified: 27.8.1995 / 02:14:43 / claus" |
149
f7d66ab71259
filter out previous Created line after a copy (get 2 of them after copyCategory in browser)
Claus Gittinger <cg@exept.de>
parents:
142
diff
changeset
|
502 |
"Modified: 13.12.1995 / 14:06:20 / cg" |
41 | 503 |
! ! |
504 |
||
119 | 505 |
!HistoryManager class methodsFor:'documentation'! |
506 |
||
507 |
version |
|
237 | 508 |
^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.25 1996-04-25 18:40:30 cg Exp $' |
119 | 509 |
! ! |
41 | 510 |
HistoryManager initialize! |