author | Claus Gittinger <cg@exept.de> |
Tue, 30 Apr 1996 11:10:15 +0200 | |
changeset 245 | f475bf72217a |
parent 243 | 2d375fb526f6 |
child 258 | bf9fd9ad4687 |
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 |
||
245 | 242 |
someString isNil ifTrue:[^ someString]. |
243 |
||
192 | 244 |
previousHistories := self getAllHistoriesFrom:someString. |
245 |
||
246 |
"extract source body." |
|
247 |
previousHistories isEmpty ifTrue: [ |
|
248 |
sourceCode := someString withoutSeparators. |
|
249 |
] ifFalse: [ |
|
250 |
pos := (previousHistories first) firstPositionInSourceCode. |
|
251 |
sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators. |
|
252 |
]. |
|
253 |
||
254 |
^ sourceCode |
|
255 |
||
245 | 256 |
" |
257 |
HistoryManager withoutHistoryLines:nil |
|
258 |
HistoryManager withoutHistoryLines:'' |
|
259 |
HistoryManager |
|
260 |
withoutHistoryLines:(HistoryManager class |
|
261 |
compiledMethodAt:#withoutHistoryLines:) source |
|
262 |
" |
|
263 |
||
192 | 264 |
"Created: 5.3.1996 / 15:11:12 / cg" |
245 | 265 |
"Modified: 30.4.1996 / 10:57:35 / cg" |
47 | 266 |
! ! |
267 |
||
41 | 268 |
!HistoryManager methodsFor:'accessing'! |
269 |
||
270 |
historyMode |
|
271 |
"return historyMode" |
|
272 |
||
273 |
^ historyMode |
|
274 |
||
275 |
"Modified: 11.08.1995 / 16:51:56 / robert" |
|
276 |
! |
|
277 |
||
278 |
historyMode:something |
|
279 |
"set historyMode" |
|
280 |
||
281 |
historyMode := something. |
|
282 |
||
283 |
"Modified: 11.08.1995 / 16:52:12 / robert" |
|
284 |
! ! |
|
285 |
||
286 |
!HistoryManager methodsFor:'initialization'! |
|
287 |
||
288 |
exclude |
|
46 | 289 |
"public - return an exclusionlist for some smalltalk classes which should not be notified or historisized" |
41 | 290 |
|
291 |
| oc | |
|
292 |
||
293 |
oc := OrderedCollection new. |
|
294 |
oc add: self. |
|
295 |
||
296 |
^oc |
|
297 |
||
298 |
"Modified: 11.08.1995 / 17:02:18 / robert" |
|
299 |
! |
|
300 |
||
301 |
initialize |
|
46 | 302 |
"public - make me depend on all smalltalk classes (except the exclusionList) |
303 |
to be notified later about changes. This intercepts source installation and allows |
|
304 |
be to patch the source-string with a historyLine." |
|
41 | 305 |
|
53 | 306 |
|exclusionlist| |
41 | 307 |
|
308 |
super initialize. |
|
309 |
historyMode := true. |
|
310 |
exclusionlist := self exclude. |
|
311 |
||
178 | 312 |
Smalltalk allClassesDo:[:aClass| |
41 | 313 |
"all classes should send a notification if changed" |
314 |
"aClass = self " false ifFalse: [ |
|
315 |
(exclusionlist includes: aClass) ifFalse:[ |
|
316 |
aClass addDependent: self. |
|
317 |
aClass class addDependent: self. "for class methods" |
|
318 |
]. |
|
319 |
]. |
|
320 |
]. |
|
321 |
||
322 |
^self |
|
323 |
||
324 |
"Modified: 11.08.1995 / 17:12:51 / robert" |
|
325 |
! ! |
|
326 |
||
327 |
!HistoryManager methodsFor:'updateHistory'! |
|
328 |
||
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
|
329 |
addHistoryTo:someString forceModification:forceModification forceCreation:forceCreation |
41 | 330 |
"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
|
331 |
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
|
332 |
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
|
333 |
add a 'Modified' line; otherwise, add a 'Created' line." |
41 | 334 |
|
53 | 335 |
| histLines pos wStream sourceCode previousHistories |
47 | 336 |
newLine | |
41 | 337 |
|
53 | 338 |
"Check whether we want a history to be added" |
339 |
historyMode ifFalse:[ |
|
178 | 340 |
^ someString |
53 | 341 |
]. |
47 | 342 |
previousHistories := self class getAllHistoriesFrom:someString. |
41 | 343 |
|
344 |
"extract source body." |
|
345 |
previousHistories isEmpty ifTrue: [ |
|
178 | 346 |
sourceCode := someString withoutSeparators. |
347 |
forceModification ifTrue:[ |
|
348 |
newLine := (HistoryLine new) |
|
349 |
] ifFalse:[ |
|
350 |
newLine := (HistoryLine newCreated). |
|
351 |
] |
|
41 | 352 |
] ifFalse: [ |
178 | 353 |
pos := (previousHistories first) firstPositionInSourceCode. |
354 |
sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators. |
|
355 |
forceCreation ifTrue:[ |
|
356 |
newLine := (HistoryLine newCreated). |
|
357 |
] ifFalse:[ |
|
358 |
newLine := (HistoryLine new) |
|
359 |
] |
|
41 | 360 |
]. |
361 |
||
362 |
"add the actual user's historyLine." |
|
47 | 363 |
previousHistories add:newLine. |
41 | 364 |
|
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 |
"Filtering historyLines (each user with one entry)." |
41 | 366 |
histLines := HistoryLine filterHistoryLines: previousHistories. |
367 |
||
368 |
"create new body with added historyLine" |
|
369 |
wStream := WriteStream on: String new. |
|
370 |
wStream nextPutAll: sourceCode; cr. |
|
371 |
||
372 |
"append the historyLines to the source" |
|
373 |
wStream cr. |
|
374 |
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
|
375 |
wStream nextPutAll:hl printString; cr. |
41 | 376 |
]. |
377 |
||
378 |
^wStream contents. |
|
379 |
||
47 | 380 |
"Modified: 11.8.1995 / 16:51:50 / robert" |
381 |
"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
|
382 |
"Modified: 13.12.1995 / 14:07:03 / cg" |
41 | 383 |
! |
384 |
||
53 | 385 |
addHistoryToHistoryMethodOf:aClass |
214 | 386 |
"private - add a historyLine at end of the classes history methods |
387 |
source - if there is one" |
|
388 |
||
53 | 389 |
|cls historyMethod oldSource newSource| |
390 |
||
391 |
aClass isMeta ifFalse:[ |
|
214 | 392 |
cls := aClass class. |
53 | 393 |
] ifTrue:[ |
214 | 394 |
cls := aClass |
53 | 395 |
]. |
396 |
historyMethod := cls compiledMethodAt: #history. |
|
397 |
historyMethod notNil ifTrue:[ |
|
214 | 398 |
oldSource := historyMethod source. |
399 |
oldSource notNil ifTrue:[ |
|
400 |
newSource := self addHistoryTo:oldSource forceModification:false forceCreation:false. |
|
401 |
historyMethod source:newSource. |
|
402 |
] |
|
53 | 403 |
] |
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
|
404 |
|
214 | 405 |
"Modified: 20.4.1996 / 20:35:06 / cg" |
53 | 406 |
! |
407 |
||
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
408 |
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
|
409 |
"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
|
410 |
(something contains aSymbol describing what happened)" |
41 | 411 |
|
202 | 412 |
| sourceCode newMethod fileInOrRecompiling selector oldMethod| |
41 | 413 |
|
414 |
"/ changedObject == self ifTrue:[ "for development only" |
|
415 |
"/ self halt. |
|
416 |
"/ ^self. |
|
417 |
"/ ]. |
|
46 | 418 |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
419 |
fileInOrRecompiling := Class updateChangeFileQuerySignal raise. |
41 | 420 |
|
53 | 421 |
"/ changedObject isMeta ifTrue:[ |
43 | 422 |
"/ Transcript showCr: 'metaClass = ', changedObject printString. |
53 | 423 |
"/ ]. |
41 | 424 |
|
425 |
fileInOrRecompiling ifFalse:[ |
|
42 | 426 |
"/ Transcript showCr: '* noChange in history'. |
178 | 427 |
^ self |
53 | 428 |
]. |
429 |
historyMode ifFalse:[ |
|
178 | 430 |
^ self |
41 | 431 |
]. |
432 |
||
433 |
" |
|
434 |
Class Variables |
|
435 |
" |
|
436 |
(something == #definition) ifTrue:[ |
|
178 | 437 |
"add handling for classes here ..." |
438 |
"/ self addHistoryToHistoryMethodOf:changedObject. |
|
41 | 439 |
]. |
440 |
||
441 |
"this is a sub item of #definition" |
|
442 |
(something == #classVariables) ifTrue:[ |
|
178 | 443 |
" |
444 |
Transcript showCr: 'classVariables changed'. |
|
445 |
" |
|
446 |
"/ does not yet work; |
|
447 |
"/ (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
|
448 |
|
178 | 449 |
self addHistoryToHistoryMethodOf:changedObject. |
450 |
^ self |
|
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 |
new Class creation |
41 | 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 |
((changedObject == Smalltalk) and:[something == #newClass]) ifTrue:[ |
178 | 457 |
"/ |
458 |
"/ add myself as dependents in order to get future change notifications |
|
459 |
"/ |
|
460 |
someArgument addDependent: self. |
|
461 |
someArgument class addDependent: self. "for class methods" |
|
462 |
someArgument history:(self addHistoryTo:String new forceModification:false forceCreation:false). "append historyString for new class" |
|
41 | 463 |
]. |
464 |
||
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 |
changed methods |
41 | 467 |
" |
468 |
changedObject isBehavior ifTrue:[ |
|
178 | 469 |
something = #methodDictionary ifTrue:[ |
470 |
someArgument isArray ifTrue:[ |
|
471 |
selector := someArgument at:1. |
|
472 |
oldMethod := someArgument at:2 |
|
473 |
] ifFalse:[ |
|
474 |
selector := someArgument |
|
475 |
]. |
|
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 |
"/ |
478 |
"/ fetch sourceString of the method |
|
479 |
"/ |
|
480 |
sourceCode := changedObject sourceCodeAt:selector. |
|
481 |
sourceCode isNil ifTrue:[ |
|
482 |
"method has been deleted" |
|
43 | 483 |
"/ Transcript showCr: 'method has been deleted'. |
178 | 484 |
] ifFalse:[ |
485 |
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
|
486 |
|
178 | 487 |
oldMethod notNil ifTrue:[ |
488 |
(oldMethod source asString withTabsExpanded = sourceCode asString withTabsExpanded) ifTrue:[ |
|
489 |
"/ no change (accepted same code again ?) |
|
490 |
^ self |
|
491 |
]. |
|
492 |
]. |
|
140
8c22b3cf100d
changed methods which had no history get a Modified string (instead of Created)
Claus Gittinger <cg@exept.de>
parents:
120
diff
changeset
|
493 |
|
178 | 494 |
"/ |
495 |
"/ dont add historylines to documentation methods ... |
|
496 |
"/ |
|
497 |
(changedObject isMeta not |
|
498 |
or:[newMethod category ~= 'documentation']) ifTrue:[ |
|
499 |
sourceCode := self addHistoryTo:sourceCode forceModification:(oldMethod notNil) forceCreation:(oldMethod isNil). |
|
500 |
newMethod source: sourceCode. |
|
43 | 501 |
"/ Transcript showCr: 'history updated / added'. |
178 | 502 |
] |
503 |
]. |
|
504 |
^self |
|
505 |
]. |
|
41 | 506 |
|
178 | 507 |
something == #comment ifTrue:[ |
508 |
"in someArgument steht jetzt der alte kommentar" |
|
509 |
^ self. |
|
510 |
] ifFalse:[ |
|
511 |
"it is a class definition" |
|
43 | 512 |
"/ Transcript show: 'Class definition: ', changedObject printString;cr. |
178 | 513 |
self addHistoryToHistoryMethodOf:changedObject. |
514 |
]. |
|
41 | 515 |
]. |
516 |
||
517 |
^self |
|
518 |
||
43 | 519 |
"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
|
520 |
"Modified: 13.12.1995 / 14:06:20 / cg" |
41 | 521 |
! ! |
522 |
||
119 | 523 |
!HistoryManager class methodsFor:'documentation'! |
524 |
||
525 |
version |
|
245 | 526 |
^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.27 1996-04-30 09:10:15 cg Exp $' |
119 | 527 |
! ! |
41 | 528 |
HistoryManager initialize! |