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