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