author | Stefan Vogel <sv@exept.de> |
Thu, 26 Feb 2009 22:26:57 +0100 | |
changeset 2081 | a2e06c2dea4e |
parent 2062 | b2cfe78be5e1 |
child 2095 | 71dae0da5f44 |
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 |
" |
|
957 | 13 |
"{ Package: 'stx:libbasic3' }" |
14 |
||
120 | 15 |
Object subclass:#HistoryManager |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
16 |
instanceVariableNames:'historyMode fullHistoryUpdate' |
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
|
17 |
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
|
18 |
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
|
19 |
category:'System-Changes-History' |
41 | 20 |
! |
21 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
22 |
Object subclass:#HistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
23 |
instanceVariableNames:'date time user what firstPositionInSourceCode type' |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
24 |
classVariableNames:'Quote Separator ModifiedString DeletedString IndentString |
1495 | 25 |
UseGECOS CreatedString AddedString EnforcedUserName' |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
26 |
poolDictionaries:'' |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
27 |
privateIn:HistoryManager |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
28 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
29 |
|
504 | 30 |
!HistoryManager class methodsFor:'documentation'! |
41 | 31 |
|
46 | 32 |
copyright |
33 |
" |
|
34 |
COPYRIGHT (c) 1995 by AEG Industry Automation |
|
35 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
36 |
All Rights Reserved |
|
37 |
||
38 |
This software is furnished under a license and may be used |
|
39 |
only in accordance with the terms of that license and with the |
|
40 |
inclusion of the above copyright notice. This software may not |
|
41 |
be provided or otherwise made available to, or used by, any |
|
42 |
other person. No title to or ownership of the software is |
|
43 |
hereby transferred. |
|
44 |
" |
|
45 |
! |
|
46 |
||
41 | 47 |
documentation |
48 |
" |
|
214 | 49 |
This class is part of the HistoryManagerProject. |
50 |
It helps to keep track of changes made to methods. |
|
41 | 51 |
|
214 | 52 |
All Methods and Classes in the system get a HistroyLine which |
53 |
contains a timestamp and the name of the changing user. |
|
54 |
This is acually the UniX loginname. |
|
55 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
56 |
The Manager registers itself to get notifications |
214 | 57 |
on change, intercepts them and appends a historyLine to the methods |
58 |
code. |
|
59 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
60 |
The HistoryManager can be turned on/off from aprivate.rc script, |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
61 |
or via the Launcher menu. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
62 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
63 |
The methods history line is filtered, to only contain one |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
64 |
entry per modifying user, containing the date of the last change. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
65 |
If fullHistoryMode is on, the classes history-ethod is also updated for |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
66 |
every change (containing every change). |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
67 |
Full mode is enabled via: |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
68 |
HistoryManager fullHistoryUpdate:true |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
69 |
or via the Launchers compilation-settings dialog. |
41 | 70 |
|
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
71 |
claus: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
72 |
I changed things to avoid depending on every class in the system. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
73 |
Now also catch Smalltalk change messages, related to class changes. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
74 |
|
235 | 75 |
[author:] |
76 |
Robert Sailer - AEG |
|
243 | 77 |
|
78 |
[see also:] |
|
79 |
HistoryLine |
|
80 |
||
81 |
[start with:] |
|
82 |
HistoryManager activate |
|
83 |
HistoryManager deactivate |
|
84 |
||
41 | 85 |
" |
86 |
! ! |
|
87 |
||
504 | 88 |
!HistoryManager class methodsFor:'initialization'! |
41 | 89 |
|
87 | 90 |
initMe |
214 | 91 |
"setup theOneAndOnly instance of myself (if not already present" |
92 |
||
87 | 93 |
^self new. |
94 |
||
214 | 95 |
"Modified: 14.8.1995 / 09:02:00 / robert" |
96 |
"Modified: 20.4.1996 / 20:33:44 / cg" |
|
87 | 97 |
! |
98 |
||
41 | 99 |
initialize |
214 | 100 |
"add myself as a dependent of ObjectMemory to be told about image restarts" |
101 |
||
41 | 102 |
ObjectMemory addDependent: self. |
103 |
||
1504
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
104 |
"Modified: / 14-08-1995 / 09:09:06 / robert" |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
105 |
"Modified: / 05-07-2006 / 17:36:47 / cg" |
41 | 106 |
! ! |
107 |
||
504 | 108 |
!HistoryManager class methodsFor:'instance creation'! |
41 | 109 |
|
110 |
new |
|
46 | 111 |
"because there can be only ONE HistoryManager, new must me redefiend" |
41 | 112 |
|
113 |
TheOneAndOnlyInstance isNil ifTrue:[ |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
114 |
TheOneAndOnlyInstance := super new initialize. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
115 |
HistoryLine initialize. |
41 | 116 |
]. |
117 |
||
118 |
^ TheOneAndOnlyInstance |
|
119 |
||
120 |
" |
|
121 |
||
122 |
HistoryManager new. |
|
123 |
" |
|
124 |
||
125 |
"Modified: 11.08.1995 / 17:01:29 / robert" |
|
126 |
! ! |
|
127 |
||
2062 | 128 |
!HistoryManager class methodsFor:'AEG-Extensions'! |
129 |
||
130 |
getLastHistoryLineFrom:someString |
|
131 |
"returns the last HistoryLine, if no HistoryLine available, return nil" |
|
132 |
||
133 |
|hist| |
|
134 |
hist := self getAllHistoriesFrom: someString. |
|
135 |
hist isEmpty ifTrue: [ ^nil]. |
|
136 |
^hist last |
|
137 |
||
138 |
"Created: 19.1.1996 / 13:08:57 / werner" |
|
139 |
! ! |
|
140 |
||
504 | 141 |
!HistoryManager class methodsFor:'accessing'! |
41 | 142 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
143 |
fullHistoryUpdate |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
144 |
"return true, if the historyManagement does full updates" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
145 |
|
626 | 146 |
TheOneAndOnlyInstance isNil ifTrue:[^ false]. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
147 |
^ TheOneAndOnlyInstance fullHistoryUpdate |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
148 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
149 |
"Modified: / 27.8.1995 / 00:32:12 / claus" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
150 |
"Created: / 24.10.1997 / 02:24:34 / cg" |
626 | 151 |
"Modified: / 29.10.1997 / 15:48:22 / cg" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
152 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
153 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
154 |
fullHistoryUpdate:aBoolean |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
155 |
"set/clear, full updates" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
156 |
|
626 | 157 |
TheOneAndOnlyInstance isNil ifTrue:[^ self]. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
158 |
TheOneAndOnlyInstance fullHistoryUpdate:aBoolean |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
159 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
160 |
"Modified: / 27.8.1995 / 00:32:12 / claus" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
161 |
"Created: / 24.10.1997 / 02:24:58 / cg" |
626 | 162 |
"Modified: / 29.10.1997 / 15:48:36 / cg" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
163 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
164 |
|
41 | 165 |
instance |
214 | 166 |
"return the one and only historyManager instance" |
41 | 167 |
|
214 | 168 |
^ TheOneAndOnlyInstance |
169 |
||
170 |
"Modified: 20.4.1996 / 20:31:18 / cg" |
|
41 | 171 |
! |
172 |
||
173 |
isActive |
|
214 | 174 |
"return true, if the historyManagement is activated" |
175 |
||
176 |
^ TheOneAndOnlyInstance notNil |
|
41 | 177 |
|
178 |
"Modified: 27.8.1995 / 00:32:12 / claus" |
|
214 | 179 |
"Modified: 20.4.1996 / 20:31:32 / cg" |
41 | 180 |
! ! |
181 |
||
504 | 182 |
!HistoryManager class methodsFor:'activation / deactivation'! |
41 | 183 |
|
184 |
activate |
|
214 | 185 |
"activate the HistoryManagement" |
186 |
||
41 | 187 |
self new "/ creating an instance activates me |
178 | 188 |
|
189 |
" |
|
190 |
HistoryManager activate |
|
191 |
" |
|
214 | 192 |
|
193 |
"Modified: 20.4.1996 / 20:31:46 / cg" |
|
41 | 194 |
! |
195 |
||
196 |
deactivate |
|
214 | 197 |
"deactivate the HistoryManagement" |
198 |
||
178 | 199 |
|mgr| |
200 |
||
201 |
mgr := TheOneAndOnlyInstance. |
|
532 | 202 |
mgr notNil ifTrue:[ |
203 |
mgr releaseDependencies. |
|
204 |
]. |
|
41 | 205 |
TheOneAndOnlyInstance := nil. |
206 |
||
178 | 207 |
" |
208 |
HistoryManager deactivate |
|
209 |
" |
|
214 | 210 |
|
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
211 |
"Modified: 8.1.1997 / 23:09:08 / cg" |
41 | 212 |
! ! |
213 |
||
504 | 214 |
!HistoryManager class methodsFor:'change & update'! |
87 | 215 |
|
320 | 216 |
update:what with:aParameter from:changedObject |
214 | 217 |
"intercepts system restart - reinstall mySelf as dependent of all classes" |
218 |
||
87 | 219 |
(what == #restarted) ifTrue:[ |
214 | 220 |
TheOneAndOnlyInstance notNil ifTrue:[ |
221 |
" |
|
222 |
smalltalk is about to restart from an Image - |
|
223 |
" |
|
87 | 224 |
"/ 'HistoryManager initialize (via update)' infoPrintNL. |
214 | 225 |
self initMe. |
226 |
] |
|
87 | 227 |
]. |
228 |
||
229 |
"Modified: 27.8.1995 / 16:33:02 / claus" |
|
214 | 230 |
"Modified: 20.4.1996 / 20:33:02 / cg" |
320 | 231 |
"Created: 15.6.1996 / 15:25:53 / cg" |
87 | 232 |
! ! |
233 |
||
504 | 234 |
!HistoryManager class methodsFor:'helpers'! |
47 | 235 |
|
1386 | 236 |
codeForInitialHistoryMethodIn:aClass |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
237 |
"create an initial (empty) history method" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
238 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
239 |
|histStream| |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
240 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
241 |
histStream := '' writeStream. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
242 |
histStream nextPutLine:'history'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
243 |
histStream nextPutLine:(HistoryLine newCreated printString). |
1386 | 244 |
^ histStream contents |
245 |
! |
|
246 |
||
247 |
createInitialHistoryMethodIn:aClass |
|
2081 | 248 |
<resource: #obsolete> |
1386 | 249 |
"create an initial (empty) history method" |
250 |
||
251 |
self obsoleteMethodWarning. |
|
1153
049b287ff099
use CodeGeneratorTool to compile (for history)
Claus Gittinger <cg@exept.de>
parents:
1081
diff
changeset
|
252 |
CodeGeneratorTool |
1386 | 253 |
compile:(self codeForInitialHistoryMethodIn:aClass) |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
254 |
forClass:aClass |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
255 |
inCategory:'documentation'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
256 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
257 |
"Created: / 24.10.1997 / 02:41:43 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
258 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
259 |
|
47 | 260 |
getAllHistoriesFrom:someString |
214 | 261 |
"returns anArray of HistoryLines from a string. |
262 |
Usually, the argument is a methods source code." |
|
47 | 263 |
|
264 |
|position aReadWriteStream firstFound nextFound aHistoryString rcOC h| |
|
265 |
||
2062 | 266 |
rcOC := OrderedCollection new. |
267 |
||
268 |
someString isNil ifTrue:[ |
|
269 |
^ rcOC |
|
270 |
]. |
|
271 |
||
47 | 272 |
"read begining from the end and look there for the first comment character. If there's none return" |
273 |
||
274 |
position := someString size. |
|
275 |
firstFound := false. |
|
276 |
nextFound := false. |
|
277 |
||
278 |
someString reverseDo:[ :aChar| |
|
214 | 279 |
position := position - 1. |
280 |
aChar == $" ifTrue:[ |
|
281 |
firstFound ifTrue:[ |
|
282 |
firstFound := false. |
|
283 |
nextFound := true. |
|
284 |
] ifFalse:[ |
|
1807 | 285 |
aReadWriteStream := ReadWriteStream on: (someString species) new. |
214 | 286 |
firstFound := true. |
287 |
nextFound := false. |
|
288 |
]. |
|
289 |
]. |
|
290 |
(firstFound and: [nextFound not]) ifTrue:[ |
|
291 |
"now collect all up to the next comment character" |
|
292 |
aChar == $" ifFalse:[ |
|
293 |
aReadWriteStream nextPut: aChar. |
|
294 |
]. |
|
295 |
]. |
|
296 |
nextFound ifTrue:[ |
|
297 |
"End reached - now try to make a HistoryLine" |
|
298 |
aHistoryString := (aReadWriteStream contents) reverse. |
|
299 |
" |
|
258 | 300 |
Transcript showCR: aHistoryString. |
214 | 301 |
" |
302 |
h := HistoryLine fromString: aHistoryString at: position. |
|
303 |
h notNil ifTrue:[ |
|
304 |
rcOC add:h. |
|
305 |
]. |
|
47 | 306 |
"/ (aHistoryString startsWith: 'Modified:') ifTrue:[ |
307 |
"/ "a history line was found - now make a NewInstance of HistoryLine" |
|
308 |
"/ rcOC add: ( HistoryLine fromString: aHistoryString at: position). |
|
309 |
"/ ]. |
|
214 | 310 |
nextFound := false. |
311 |
]. |
|
47 | 312 |
]. |
313 |
||
314 |
^rcOC reverse "the OrderedCollection with HistoryLines in the right order" |
|
315 |
||
1807 | 316 |
"Modified: / 21-12-1993 / 18:32:30 / M.Noell" |
317 |
"Modified: / 09-08-1995 / 22:45:30 / R.Sailer" |
|
318 |
"Modified: / 08-09-1995 / 17:54:33 / claus" |
|
319 |
"Modified: / 18-09-2006 / 20:48:19 / cg" |
|
192 | 320 |
! |
321 |
||
322 |
withoutHistoryLines:someString |
|
323 |
"given some methods sourceString, return a copy without any |
|
324 |
history lines" |
|
325 |
||
326 |
| pos sourceCode previousHistories | |
|
327 |
||
245 | 328 |
someString isNil ifTrue:[^ someString]. |
329 |
||
192 | 330 |
previousHistories := self getAllHistoriesFrom:someString. |
331 |
||
332 |
"extract source body." |
|
333 |
previousHistories isEmpty ifTrue: [ |
|
334 |
sourceCode := someString withoutSeparators. |
|
335 |
] ifFalse: [ |
|
336 |
pos := (previousHistories first) firstPositionInSourceCode. |
|
337 |
sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators. |
|
338 |
]. |
|
339 |
||
340 |
^ sourceCode |
|
341 |
||
245 | 342 |
" |
343 |
HistoryManager withoutHistoryLines:nil |
|
344 |
HistoryManager withoutHistoryLines:'' |
|
345 |
HistoryManager |
|
346 |
withoutHistoryLines:(HistoryManager class |
|
347 |
compiledMethodAt:#withoutHistoryLines:) source |
|
348 |
" |
|
349 |
||
192 | 350 |
"Created: 5.3.1996 / 15:11:12 / cg" |
245 | 351 |
"Modified: 30.4.1996 / 10:57:35 / cg" |
47 | 352 |
! ! |
353 |
||
41 | 354 |
!HistoryManager methodsFor:'accessing'! |
355 |
||
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
356 |
fullHistoryUpdate |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
357 |
"return the fullHistoryUpdate; |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
358 |
if true, the classes history method is also updated." |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
359 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
360 |
^ fullHistoryUpdate |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
361 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
362 |
"Modified: 11.08.1995 / 16:52:12 / robert" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
363 |
! |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
364 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
365 |
fullHistoryUpdate:aBoolean |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
366 |
"set the fullHistoryUpdate; |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
367 |
if true, the classes history method is also updated." |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
368 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
369 |
fullHistoryUpdate := aBoolean. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
370 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
371 |
"Modified: 11.08.1995 / 16:52:12 / robert" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
372 |
! |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
373 |
|
41 | 374 |
historyMode |
375 |
"return historyMode" |
|
376 |
||
377 |
^ historyMode |
|
378 |
||
379 |
"Modified: 11.08.1995 / 16:51:56 / robert" |
|
380 |
! |
|
381 |
||
382 |
historyMode:something |
|
383 |
"set historyMode" |
|
384 |
||
385 |
historyMode := something. |
|
386 |
||
387 |
"Modified: 11.08.1995 / 16:52:12 / robert" |
|
388 |
! ! |
|
389 |
||
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
390 |
!HistoryManager methodsFor:'change & update'! |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
391 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
392 |
update:something with:someArgument from:changedObject |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
393 |
"arrive here, whenever any class changed somehow. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
394 |
(something contains aSymbol describing what happened)" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
395 |
|
1504
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
396 |
|sourceCode newMethod selector oldMethod what |
597
d8b3b9622b39
dont crash if oldSource is not available.
Claus Gittinger <cg@exept.de>
parents:
594
diff
changeset
|
397 |
changedClass whatChange oldSource| |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
398 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
399 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
400 |
"/ no action, if disabled |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
401 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
402 |
historyMode ifFalse:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
403 |
^ self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
404 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
405 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
406 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
407 |
"/ no action, if changeFile update is locked |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
408 |
"/ (since then, this may be a recompile or fileIn) |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
409 |
"/ |
1504
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
410 |
(Class updateChangeFileQuerySignal query) ifFalse:[ |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
411 |
"/ Transcript showCR: '* noChange in history'. |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
412 |
^ self |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
413 |
]. |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
414 |
Class updateHistoryLineQuerySignal query ifFalse:[ |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
415 |
"/ Transcript showCR: '* noChange in history'. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
416 |
^ self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
417 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
418 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
419 |
" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
420 |
definition, instance / classVariables of a class have changed |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
421 |
" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
422 |
(something == #definition) ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
423 |
"/ it is a class definition that has changed |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
424 |
"/ add a line to the history method; if present |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
425 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
426 |
"/ Transcript show: 'Class definition: ', changedClass printString;cr. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
427 |
fullHistoryUpdate == true ifTrue:[ |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
428 |
changedObject theMetaclass compilerClass == Compiler ifFalse:[^ self]. |
728
501a0a757440
oops - changedClass was never set in #definition-change
Claus Gittinger <cg@exept.de>
parents:
690
diff
changeset
|
429 |
self addHistory:#modification with:'class definition' toHistoryMethodOf:changedObject. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
430 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
431 |
^ self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
432 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
433 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
434 |
"this is a sub item of #definition" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
435 |
(something == #classVariables) ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
436 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
437 |
"/ Transcript showCR: 'classVariables changed'. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
438 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
439 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
440 |
"/ does not yet work; |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
441 |
"/ (someArgument does not contain the class we are interested in) |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
442 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
443 |
fullHistoryUpdate == true ifTrue:[ |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
444 |
changedObject theMetaclass compilerClass == Compiler ifFalse:[^ self]. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
445 |
self addHistory:#modification with:'class variables' toHistoryMethodOf:changedObject. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
446 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
447 |
^ self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
448 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
449 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
450 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
451 |
"/ new Class creation |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
452 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
453 |
((changedObject == Smalltalk) and:[something == #newClass]) ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
454 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
455 |
"/ add myself as dependents in order to get future change notifications |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
456 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
457 |
fullHistoryUpdate == true ifTrue:[ |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
458 |
someArgument theMetaclass compilerClass == Compiler ifFalse:[^ self]. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
459 |
self createHistoryMethodFor:someArgument. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
460 |
self addHistory:#creation with:nil toHistoryMethodOf:someArgument. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
461 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
462 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
463 |
"/ claus: old implementation |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
464 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
465 |
"/ someArgument addDependent: self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
466 |
"/ someArgument class addDependent: self. "for class methods" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
467 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
468 |
^ self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
469 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
470 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
471 |
"/ changed methods |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
472 |
"/ for backward compatibility, still handle the |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
473 |
"/ classes own change notification. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
474 |
"/ (only if I am a dependent of all classes) |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
475 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
476 |
changedObject isBehavior ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
477 |
changedClass := changedObject. |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
478 |
changedClass theMetaclass compilerClass == Compiler ifFalse:[^ self]. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
479 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
480 |
something == #methodDictionary ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
481 |
whatChange := #methodDictionary. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
482 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
483 |
someArgument isArray ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
484 |
selector := someArgument at:1. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
485 |
oldMethod := someArgument at:2 |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
486 |
] ifFalse:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
487 |
selector := someArgument |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
488 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
489 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
490 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
491 |
something == #methodInClassRemoved ifTrue:[ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
492 |
fullHistoryUpdate == true ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
493 |
changedClass := someArgument at:1. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
494 |
selector := someArgument at:2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
495 |
self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
496 |
]. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
497 |
^ self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
498 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
499 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
500 |
something == #comment ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
501 |
whatChange := #comment. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
502 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
503 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
504 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
505 |
"/ the new mechanism; I only need to depend upon |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
506 |
"/ Smalltalk, to get all method changes |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
507 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
508 |
(changedObject == Smalltalk |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
509 |
and:[something == #methodInClass]) ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
510 |
changedClass := someArgument at:1. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
511 |
selector := someArgument at:2. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
512 |
oldMethod := someArgument at:3. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
513 |
whatChange := #methodDictionary. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
514 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
515 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
516 |
changedClass notNil ifTrue:[ |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
517 |
changedClass theMetaclass compilerClass == Compiler ifFalse:[^ self]. |
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
518 |
|
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
519 |
whatChange == #methodDictionary ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
520 |
"/ ok; it is a changed method |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
521 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
522 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
523 |
"/ fetch sourceString of the method |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
524 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
525 |
sourceCode := changedClass sourceCodeAt:selector. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
526 |
sourceCode isNil ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
527 |
"method has been deleted" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
528 |
"/ Transcript showCR: 'method has been deleted'. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
529 |
fullHistoryUpdate == true ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
530 |
self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
531 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
532 |
^ self. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
533 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
534 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
535 |
newMethod := changedClass compiledMethodAt:selector. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
536 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
537 |
oldMethod notNil ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
538 |
oldSource := oldMethod source. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
539 |
oldSource notNil ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
540 |
(oldSource asString withTabsExpanded = sourceCode asString withTabsExpanded) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
541 |
"/ no change (accepted same code again ?) |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
542 |
^ self |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
543 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
544 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
545 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
546 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
547 |
"/ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
548 |
"/ dont add historylines to documentation methods ... |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
549 |
"/ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
550 |
(changedClass isMeta not |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
551 |
or:[newMethod category ~= 'documentation']) ifTrue:[ |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
552 |
oldMethod notNil ifTrue:[ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
553 |
what := #modification |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
554 |
] ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
555 |
what := #creation |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
556 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
557 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
558 |
"/ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
559 |
"/ update the history line-comment in |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
560 |
"/ the methods source |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
561 |
"/ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
562 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
563 |
sourceCode := self addHistory:what with:nil to:sourceCode filter:true. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
564 |
newMethod source: sourceCode. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
565 |
"/ Transcript showCR: 'history updated / added'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
566 |
]. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
567 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
568 |
fullHistoryUpdate == true ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
569 |
self addHistory:what with:('#' , selector) toHistoryMethodOf:changedClass. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
570 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
571 |
^self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
572 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
573 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
574 |
whatChange == #comment ifTrue:[ |
594 | 575 |
"the classes comment - we are no longer interested in that one" |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
576 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
577 |
^ self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
578 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
579 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
580 |
whatChange == #classDefinition ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
581 |
"/ it is a class definition that has changed |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
582 |
"/ add a line to the history method; if present |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
583 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
584 |
"/ Transcript show: 'Class definition: ', changedClass printString;cr. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
585 |
fullHistoryUpdate == true ifTrue:[ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
586 |
self addHistory:#modification with:'class definition' toHistoryMethodOf:changedClass. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
587 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
588 |
^self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
589 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
590 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
591 |
"/ Transcript show: 'unhandled change: ', something printString;cr. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
592 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
593 |
^self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
594 |
|
1504
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
595 |
"Modified: / 27-08-1995 / 02:14:43 / claus" |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
596 |
"Modified: / 18-03-1999 / 18:21:47 / stefan" |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
597 |
"Modified: / 13-07-2006 / 17:41:35 / cg" |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
598 |
! ! |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
599 |
|
41 | 600 |
!HistoryManager methodsFor:'initialization'! |
601 |
||
602 |
exclude |
|
46 | 603 |
"public - return an exclusionlist for some smalltalk classes which should not be notified or historisized" |
41 | 604 |
|
605 |
| oc | |
|
606 |
||
607 |
oc := OrderedCollection new. |
|
608 |
oc add: self. |
|
609 |
||
610 |
^oc |
|
611 |
||
612 |
"Modified: 11.08.1995 / 17:02:18 / robert" |
|
613 |
! |
|
614 |
||
615 |
initialize |
|
46 | 616 |
"public - make me depend on all smalltalk classes (except the exclusionList) |
617 |
to be notified later about changes. This intercepts source installation and allows |
|
618 |
be to patch the source-string with a historyLine." |
|
41 | 619 |
|
53 | 620 |
|exclusionlist| |
41 | 621 |
|
622 |
super initialize. |
|
623 |
historyMode := true. |
|
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
624 |
fullHistoryUpdate := false. |
41 | 625 |
exclusionlist := self exclude. |
626 |
||
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
627 |
"/ old implementation: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
628 |
"/ made myself a dependent of all classes ... |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
629 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
630 |
"/ Smalltalk allClassesDo:[:aClass| |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
631 |
"/ "all classes should send a notification if changed" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
632 |
"/ "aClass = self " false ifFalse: [ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
633 |
"/ (exclusionlist includes: aClass) ifFalse:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
634 |
"/ aClass addDependent: self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
635 |
"/ aClass class addDependent: self. "for class methods" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
636 |
"/ ]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
637 |
"/ ]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
638 |
"/ ]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
639 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
640 |
"/ old implementation: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
641 |
"/ Smalltalk also sends class-change notifications ... |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
642 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
643 |
Smalltalk addDependent:self. |
41 | 644 |
|
645 |
^self |
|
646 |
||
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
647 |
"Modified: 11.8.1995 / 17:12:51 / robert" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
648 |
"Modified: 8.1.1997 / 23:07:14 / cg" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
649 |
! |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
650 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
651 |
releaseDependencies |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
652 |
"no longer depend on class changes" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
653 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
654 |
"/ old implementation: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
655 |
"/ made myself a dependent of all classes ... |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
656 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
657 |
"/ Smalltalk allClassesDo:[:aClass | |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
658 |
"/ aClass removeDependent:self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
659 |
"/ aClass class removeDependent:self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
660 |
"/ ]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
661 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
662 |
"/ new implementation: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
663 |
"/ Smalltalk also sends class-change notifications ... |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
664 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
665 |
Smalltalk removeDependent:self. |
41 | 666 |
! ! |
667 |
||
668 |
!HistoryManager methodsFor:'updateHistory'! |
|
669 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
670 |
addHistory:what with:argument to:someString filter:doFilter |
41 | 671 |
"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
|
672 |
check for multiple lines of the same user and merge into one. |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
673 |
What may be one of #modification or #creation, to choose among |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
674 |
'Modified' or 'Created' lines." |
41 | 675 |
|
53 | 676 |
| histLines pos wStream sourceCode previousHistories |
47 | 677 |
newLine | |
41 | 678 |
|
53 | 679 |
"Check whether we want a history to be added" |
680 |
historyMode ifFalse:[ |
|
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
681 |
^ someString |
53 | 682 |
]. |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
683 |
|
47 | 684 |
previousHistories := self class getAllHistoriesFrom:someString. |
41 | 685 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
686 |
newLine := HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
687 |
|
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
688 |
what == #creation ifTrue:[ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
689 |
newLine isForCreation. |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
690 |
] ifFalse:[ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
691 |
what == #deletion ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
692 |
newLine isForDeletion. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
693 |
] ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
694 |
what == #addition ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
695 |
newLine isForAddition. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
696 |
] ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
697 |
what == #modification ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
698 |
newLine isForModification. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
699 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
700 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
701 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
702 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
703 |
argument notNil ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
704 |
newLine what:argument |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
705 |
]. |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
706 |
|
41 | 707 |
"extract source body." |
708 |
previousHistories isEmpty ifTrue: [ |
|
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
709 |
sourceCode := someString withoutSeparators. |
41 | 710 |
] ifFalse: [ |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
711 |
pos := (previousHistories first) firstPositionInSourceCode. |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
712 |
sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators. |
41 | 713 |
]. |
714 |
||
715 |
"add the actual user's historyLine." |
|
47 | 716 |
previousHistories add:newLine. |
41 | 717 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
718 |
doFilter ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
719 |
"Filtering historyLines (each user with one entry)." |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
720 |
histLines := HistoryLine filterHistoryLines: previousHistories. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
721 |
] ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
722 |
histLines := previousHistories |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
723 |
]. |
41 | 724 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
725 |
"create new method body with added historyLine" |
1807 | 726 |
wStream := WriteStream on: (sourceCode species) new. |
41 | 727 |
wStream nextPutAll: sourceCode; cr. |
728 |
||
729 |
"append the historyLines to the source" |
|
730 |
wStream cr. |
|
731 |
histLines do: [:hl | |
|
512
d38e6339cddb
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
504
diff
changeset
|
732 |
wStream nextPutLine:hl printString. |
41 | 733 |
]. |
734 |
||
512
d38e6339cddb
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
504
diff
changeset
|
735 |
^ wStream contents. |
41 | 736 |
|
1807 | 737 |
"Modified: / 11-08-1995 / 16:51:50 / robert" |
738 |
"Modified: / 08-09-1995 / 17:55:38 / claus" |
|
739 |
"Created: / 24-10-1997 / 00:16:38 / cg" |
|
740 |
"Modified: / 18-09-2006 / 20:48:58 / cg" |
|
41 | 741 |
! |
742 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
743 |
addHistory:what with:arg toHistoryMethodOf:aClass |
214 | 744 |
"private - add a historyLine at end of the classes history methods |
745 |
source - if there is one" |
|
746 |
||
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
747 |
|meta historyMethod oldSource newSource| |
53 | 748 |
|
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
749 |
meta := aClass theMetaclass. |
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
750 |
|
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
751 |
historyMethod := meta compiledMethodAt: #history. |
53 | 752 |
historyMethod notNil ifTrue:[ |
214 | 753 |
oldSource := historyMethod source. |
754 |
oldSource notNil ifTrue:[ |
|
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
755 |
newSource := self |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
756 |
addHistory:what |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
757 |
with:arg |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
758 |
to:oldSource |
1397 | 759 |
filter:true. |
214 | 760 |
historyMethod source:newSource. |
761 |
] |
|
53 | 762 |
] |
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
|
763 |
|
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
764 |
"Created: / 12-10-1996 / 20:31:50 / cg" |
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
765 |
"Modified: / 01-09-2004 / 19:04:18 / janfrog" |
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
766 |
"Modified: / 13-07-2006 / 17:42:03 / cg" |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
767 |
! |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
768 |
|
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
769 |
createHistoryMethodFor:aClass |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
770 |
"private - create a history method" |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
771 |
|
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
772 |
|meta| |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
773 |
|
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
774 |
meta := aClass theMetaclass. |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
775 |
|
1413
b9087201c7aa
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
1398
diff
changeset
|
776 |
(Class updateChangeFileQuerySignal, Class updateChangeListQuerySignal) answer:false do:[ |
b9087201c7aa
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
1398
diff
changeset
|
777 |
Compiler |
b9087201c7aa
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
1398
diff
changeset
|
778 |
compile:'history' |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
779 |
forClass:meta |
1413
b9087201c7aa
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
1398
diff
changeset
|
780 |
inCategory:'documentation' |
497
abebd0d145e5
dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents:
494
diff
changeset
|
781 |
]. |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
782 |
|
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
783 |
"Modified: / 13-07-2006 / 17:42:25 / cg" |
41 | 784 |
! ! |
785 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
786 |
!HistoryManager::HistoryLine class methodsFor:'converting'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
787 |
|
1958 | 788 |
convertStringToDate: aString |
789 |
"kludge" |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
790 |
|
690 | 791 |
| s day month year coll | |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
792 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
793 |
"delete delimiter from the date string" |
1958 | 794 |
coll := aString asCollectionOfSubstringsSeparatedByAny:'.-/'. |
795 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
796 |
day := (coll at: 1) asNumber. |
1383
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
797 |
month := Number readFrom:(coll at: 2 ) onError:nil. |
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
798 |
month isNil ifTrue:[ |
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
799 |
month := Date indexOfMonth:(coll at:2) language:#en. |
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
800 |
month == 0 ifTrue:[ |
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
801 |
month := Date indexOfMonth:(coll at:2). |
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
802 |
]. |
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
803 |
month == 0 ifTrue:[ |
1384
4e05f325b284
handle bad month in history line
Claus Gittinger <cg@exept.de>
parents:
1383
diff
changeset
|
804 |
self halt:'invalid month in history line'. |
4e05f325b284
handle bad month in history line
Claus Gittinger <cg@exept.de>
parents:
1383
diff
changeset
|
805 |
^ Date today. |
1383
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
806 |
]. |
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
807 |
]. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
808 |
year := (coll at: 3 ) asNumber. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
809 |
|
1192
5aea356953d7
Senders use Userpreference setting to choose conversion
Claus Gittinger <cg@exept.de>
parents:
1153
diff
changeset
|
810 |
(year between:0 and:99) ifTrue:[ |
5aea356953d7
Senders use Userpreference setting to choose conversion
Claus Gittinger <cg@exept.de>
parents:
1153
diff
changeset
|
811 |
year := UserPreferences current twoDigitDateHandler value:year. |
5aea356953d7
Senders use Userpreference setting to choose conversion
Claus Gittinger <cg@exept.de>
parents:
1153
diff
changeset
|
812 |
]. |
739 | 813 |
^ Date newDay:day month:month year:year. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
814 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
815 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
816 |
HistoryLine convertAStringToADate:'18.10.1995' |
1958 | 817 |
HistoryLine convertAStringToADate:'18.10.95' |
818 |
HistoryLine convertAStringToADate:'18.10.01' |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
819 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
820 |
|
1382 | 821 |
"Modified: / 23-08-1995 / 21:28:58 / robert" |
822 |
"Modified: / 16-09-1997 / 14:35:03 / stefan" |
|
1958 | 823 |
"Created: / 06-03-2007 / 17:04:34 / cg" |
824 |
"Modified: / 06-03-2007 / 18:28:57 / cg" |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
825 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
826 |
|
1958 | 827 |
convertStringToTime: aString |
828 |
"kludge" |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
829 |
|
739 | 830 |
|h m s| |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
831 |
|
1953 | 832 |
h := Number readFromString:(aString copyFrom:1 to:2) onError:[^ Time now]. |
833 |
m := Number readFromString:(aString copyFrom:4 to:5) onError:[^ Time now]. |
|
1511 | 834 |
aString size >= 8 ifTrue:[ |
835 |
s := (aString copyFrom:7 to:8) asNumber. |
|
836 |
] ifFalse:[ |
|
837 |
s := 0. |
|
838 |
]. |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
839 |
|
739 | 840 |
^Time hours:h minutes:m seconds:s. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
841 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
842 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
843 |
HistoryLine convertAStringToATime:'18:23:15' |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
844 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
845 |
|
1511 | 846 |
"Modified: / 15-08-1995 / 18:56:18 / robert" |
1958 | 847 |
"Created: / 06-03-2007 / 17:05:03 / cg" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
848 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
849 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
850 |
!HistoryManager::HistoryLine class methodsFor:'documentation'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
851 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
852 |
copyright |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
853 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
854 |
COPYRIGHT (c) 1995 by AEG Industry Automation |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
855 |
COPYRIGHT (c) 1995 by Claus Gittinger |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
856 |
All Rights Reserved |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
857 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
858 |
This software is furnished under a license and may be used |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
859 |
only in accordance with the terms of that license and with the |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
860 |
inclusion of the above copyright notice. This software may not |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
861 |
be provided or otherwise made available to, or used by, any |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
862 |
other person. No title to or ownership of the software is |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
863 |
hereby transferred. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
864 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
865 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
866 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
867 |
documentation |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
868 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
869 |
The class HistoryLine is part of the HistoryManagerProjcet. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
870 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
871 |
HistoryLine knows how to compose and parse comment lines which are |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
872 |
used to keep track of changes. These historyLines are added at the end of |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
873 |
a methods source code and to the special history classmethod. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
874 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
875 |
HistoryLine and HistoryManager where generously provided by AEG for inclusion into the |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
876 |
ST/X class delivery. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
877 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
878 |
[see also:] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
879 |
HistoryManager |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
880 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
881 |
[author:] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
882 |
Robert Sailer - AEG |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
883 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
884 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
885 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
886 |
examples |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
887 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
888 |
HistoryLine initialize. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
889 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
890 |
HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
891 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
892 |
HistoryLine for: 'R.Sailer'. for integration purposes ONLY |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
893 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
894 |
HistoryLine deleted. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
895 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
896 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
897 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
898 |
version |
2081 | 899 |
^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.69 2009-02-26 21:26:57 stefan Exp $' |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
900 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
901 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
902 |
!HistoryManager::HistoryLine class methodsFor:'filtering'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
903 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
904 |
filterHistoryLines: aCollectionOfHistoryLines |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
905 |
"check the collection against multiple occurrence of the same user, |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
906 |
and remove all but the youngest (per user)." |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
907 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
908 |
|newCollection| |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
909 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
910 |
newCollection := OrderedCollection new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
911 |
aCollectionOfHistoryLines keysAndValuesDo:[:index :histLine | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
912 |
|skip| |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
913 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
914 |
skip := false. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
915 |
histLine isModified ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
916 |
"/ if there is another one, skip this |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
917 |
aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine | |
1398 | 918 |
((anotherHistLine isModified |
919 |
and: [anotherHistLine user = histLine user]) |
|
920 |
and:[anotherHistLine what = histLine what]) |
|
921 |
ifTrue:[skip := true] |
|
922 |
]. |
|
923 |
skip ifFalse: [ |
|
924 |
aCollectionOfHistoryLines do: [:anotherHistLine | |
|
925 |
(anotherHistLine isCreated and: [anotherHistLine user = histLine user]) |
|
926 |
ifTrue: [ |
|
1430 | 927 |
((Timestamp |
1398 | 928 |
fromDate: histLine date |
1981 | 929 |
andTime: histLine time) secondDeltaFrom: |
1430 | 930 |
(Timestamp |
1398 | 931 |
fromDate: anotherHistLine date |
932 |
andTime: anotherHistLine time)) < self modificationLimit |
|
933 |
ifTrue: [skip := true] |
|
934 |
] |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
935 |
] |
1398 | 936 |
] |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
937 |
] ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
938 |
"/ filter out multiple created messages |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
939 |
"/ (this only occurs if a method was copied from ClassA to ClassB) |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
940 |
histLine isCreated ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
941 |
aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine | |
1398 | 942 |
(anotherHistLine isCreated and:[anotherHistLine what = histLine what]) |
943 |
ifTrue:[skip := true] |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
944 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
945 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
946 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
947 |
skip ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
948 |
newCollection add:histLine. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
949 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
950 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
951 |
^ newCollection. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
952 |
|
1981 | 953 |
"Modified: / 08-09-1995 / 17:20:40 / claus" |
954 |
"Modified: / 20-06-2004 / 16:36:00 / masca" |
|
955 |
"Modified: / 01-09-2004 / 20:20:42 / janfrog" |
|
956 |
"Modified: / 12-01-2008 / 10:37:25 / cg" |
|
1398 | 957 |
! |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
958 |
|
1398 | 959 |
modificationLimit |
960 |
"Answer the number of seconds between creation and |
|
961 |
modifcation of a method within which the modification |
|
962 |
line won't be added." |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
963 |
|
1398 | 964 |
^ 3600 "/one hour |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
965 |
|
1398 | 966 |
"Created: / 20.6.2004 / 16:32:35 / masca" |
967 |
"Modified: / 2.9.2004 / 15:33:09 / janfrog" |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
968 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
969 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
970 |
!HistoryManager::HistoryLine class methodsFor:'initialization'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
971 |
|
1495 | 972 |
enforcedUserName:aStringOrNil |
973 |
EnforcedUserName := aStringOrNil |
|
974 |
||
975 |
" |
|
976 |
self enforcedUserName:'fm' |
|
977 |
self enforcedUserName:nil |
|
978 |
" |
|
979 |
||
980 |
"Modified: / 20-06-2006 / 13:27:44 / fm" |
|
981 |
! |
|
982 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
983 |
initialize |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
984 |
"setup class variables" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
985 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
986 |
Quote isNil ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
987 |
Quote := '"'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
988 |
Separator := '/'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
989 |
ModifiedString := 'Modified:'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
990 |
DeletedString := 'Deleted:'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
991 |
CreatedString := 'Created:'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
992 |
AddedString := 'Added:'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
993 |
IndentString := ' '. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
994 |
UseGECOS := false. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
995 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
996 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
997 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
998 |
HistoryLine initialize |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
999 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1000 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1001 |
"Modified: 23.8.1995 / 22:14:03 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1002 |
"Modified: 20.4.1996 / 20:23:29 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1003 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1004 |
"Modified: 24.10.1997 / 01:18:56 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1005 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1006 |
"Modified: / 24.10.1997 / 02:01:20 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1007 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1008 |
"Modified: 24.10.1997 02:07:16 cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1009 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1010 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1011 |
!HistoryManager::HistoryLine class methodsFor:'instance creation'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1012 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1013 |
fromString: aString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1014 |
"parses the argument, aString; |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1015 |
create & return a new Instance with the values" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1016 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1017 |
^ self fromString: aString at: 0. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1018 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1019 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1020 |
HistoryLine fromString: 'Modified: 01.12.93 / 18:32:30 / M.Noell' |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1021 |
HistoryLine fromString: 'Created: 01.12.93 / 18:32:30 / M.Noell' |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1022 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1023 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1024 |
"Modified: 23.8.1995 / 22:14:13 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1025 |
"Modified: 20.4.1996 / 20:24:47 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1026 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1027 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1028 |
fromString: aString at: position |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1029 |
"parses the String and creates a new Instance with the values. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1030 |
The positionvalue is normally used to remove the HistoryLines from the sourceCode. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1031 |
Claus: return nil, if the string is not a valid historyString." |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1032 |
|
728
501a0a757440
oops - changedClass was never set in #definition-change
Claus Gittinger <cg@exept.de>
parents:
690
diff
changeset
|
1033 |
| inst anArray type aTime aDate userName idx what| |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1034 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1035 |
inst := self basicNew. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1036 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1037 |
anArray := aString asArrayOfSubstrings. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1038 |
anArray size < 5 ifTrue:[^ nil]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1039 |
anArray := anArray collect:[:word | word withoutSpaces]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1040 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1041 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1042 |
Modified / Deleted / Created |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1043 |
[what] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1044 |
Separator |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1045 |
date asString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1046 |
Separator |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1047 |
time asString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1048 |
Separator |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1049 |
UserName ... |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1050 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1051 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1052 |
type := anArray at:1. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1053 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1054 |
((Array |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1055 |
with:ModifiedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1056 |
with:DeletedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1057 |
with:CreatedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1058 |
with:AddedString) includes:type) ifFalse:[^ nil]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1059 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1060 |
inst type:type. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1061 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1062 |
"/ sigh backward compatibility ... |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1063 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1064 |
(anArray at:2) first isDigit ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1065 |
"/ date follows ... |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1066 |
idx := 2 |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1067 |
] ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1068 |
idx := anArray indexOf:Separator startingAt:2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1069 |
idx == 0 ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1070 |
"/ not a valid history string |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1071 |
^ nil |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1072 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1073 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1074 |
idx ~~ 2 ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1075 |
what := (anArray copyFrom:2 to:(idx-1)) asStringWith:(Character space). |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1076 |
inst what:what. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1077 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1078 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1079 |
idx := idx + 1. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1080 |
]. |
1958 | 1081 |
aDate := self convertStringToDate: (anArray at: idx). |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1082 |
inst date: aDate. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1083 |
(anArray at:idx+1) ~= Separator ifTrue:[^ nil]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1084 |
idx := idx + 2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1085 |
|
1958 | 1086 |
aTime := self convertStringToTime: (anArray at: idx). |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1087 |
inst time: aTime. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1088 |
(anArray at:idx+1) ~= Separator ifTrue:[^ nil]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1089 |
idx := idx + 2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1090 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1091 |
"the user's name may be more that one word" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1092 |
userName := (anArray copyFrom:idx) asStringWith:Character space. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1093 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1094 |
inst user:userName. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1095 |
inst firstPositionInSourceCode:position. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1096 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1097 |
^ inst |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1098 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1099 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1100 |
HistoryLine fromString: 'Modified: 21.12.93 / 18:32:30 / R.Sailer' |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1101 |
HistoryLine fromString: 'Created: 21.12.1993 / 18:32:30 / Felicitas Gabriele Felger' |
1204 | 1102 |
HistoryLine fromString: 'Deleted: 21.12.93 / 18:32:30 / Astrid Weisseise' |
1103 |
HistoryLine fromString: 'Deleted: foo bar / 21.12.93 / 18:32:30 / Astrid Weisseise' |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1104 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1105 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1106 |
"Modified: / 23.8.1995 / 22:24:47 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1107 |
"Modified: / 19.9.1995 / 14:14:48 / claus" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1108 |
"Modified: / 24.10.1997 / 02:10:01 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1109 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1110 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1111 |
new |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1112 |
"get a new history line. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1113 |
Preinitialize it as a modified-Line for the current user" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1114 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1115 |
^ self type:ModifiedString what:nil |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1116 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1117 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1118 |
newCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1119 |
"public - get a new created-Line for the current user" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1120 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1121 |
^ self type:CreatedString what:nil |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1122 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1123 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1124 |
HistoryLine newCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1125 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1126 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1127 |
"Modified: 23.8.1995 / 22:14:24 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1128 |
"Modified: 24.10.1997 / 00:18:30 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1129 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1130 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1131 |
!HistoryManager::HistoryLine class methodsFor:'private'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1132 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1133 |
currentUserName |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1134 |
"return the current users name - |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1135 |
thats either the userInfos-gecos field, or the users login name." |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1136 |
|
1495 | 1137 |
EnforcedUserName notNil ifTrue:[ |
1138 |
^ EnforcedUserName |
|
1139 |
]. |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1140 |
UseGECOS == true ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1141 |
^ OperatingSystem getFullUserName. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1142 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1143 |
^ (OperatingSystem getLoginName). |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1144 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1145 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1146 |
HistoryLine currentUserName |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1147 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1148 |
|
1495 | 1149 |
"Modified: / 15-07-1996 / 12:43:14 / cg" |
1150 |
"Modified: / 20-06-2006 / 13:26:49 / User" |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1151 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1152 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1153 |
type:type what:what |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1154 |
"private - for integration purposes only" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1155 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1156 |
| inst | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1157 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1158 |
inst := self basicNew. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1159 |
inst date: Date today. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1160 |
inst time: Time now. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1161 |
inst firstPositionInSourceCode: 0. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1162 |
inst user:(self currentUserName). |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1163 |
inst type:type. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1164 |
inst what:what. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1165 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1166 |
^ inst |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1167 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1168 |
"Modified: 23.08.1995 / 21:35:44 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1169 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1170 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1171 |
!HistoryManager::HistoryLine methodsFor:'accessing'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1172 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1173 |
date |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1174 |
"return the date" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1175 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1176 |
^ date |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1177 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1178 |
"Modified: 20.4.1996 / 20:22:12 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1179 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1180 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1181 |
date:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1182 |
"set the date" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1183 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1184 |
date := something. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1185 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1186 |
"Modified: 20.4.1996 / 20:22:16 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1187 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1188 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1189 |
firstPositionInSourceCode |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1190 |
"return firstPositionInSourceCode" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1191 |
|
1081 | 1192 |
^ firstPositionInSourceCode |
1193 |
! |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1194 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1195 |
firstPositionInSourceCode:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1196 |
"set firstPositionInSourceCode" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1197 |
|
1081 | 1198 |
firstPositionInSourceCode := something. |
1199 |
! |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1200 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1201 |
isForAddition |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1202 |
type := AddedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1203 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1204 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1205 |
isForCreation |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1206 |
type := CreatedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1207 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1208 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1209 |
isForDeletion |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1210 |
type := DeletedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1211 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1212 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1213 |
isForModification |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1214 |
type := ModifiedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1215 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1216 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1217 |
time |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1218 |
"return the time" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1219 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1220 |
^ time |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1221 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1222 |
"Modified: 20.4.1996 / 20:22:04 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1223 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1224 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1225 |
time:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1226 |
"set the time" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1227 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1228 |
time := something. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1229 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1230 |
"Modified: 20.4.1996 / 20:21:58 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1231 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1232 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1233 |
type |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1234 |
"return the type" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1235 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1236 |
^ type |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1237 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1238 |
"Modified: 20.4.1996 / 20:21:54 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1239 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1240 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1241 |
type:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1242 |
"set the type" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1243 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1244 |
type := something. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1245 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1246 |
"Modified: 20.4.1996 / 20:21:39 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1247 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1248 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1249 |
user |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1250 |
"return the user" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1251 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1252 |
^ user |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1253 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1254 |
"Modified: 20.4.1996 / 20:21:45 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1255 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1256 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1257 |
user:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1258 |
"set the user" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1259 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1260 |
user := something. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1261 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1262 |
"Modified: 20.4.1996 / 20:21:48 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1263 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1264 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1265 |
what |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1266 |
"return the what-changed info" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1267 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1268 |
^ what |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1269 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1270 |
"Modified: 20.4.1996 / 20:21:54 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1271 |
"Created: 24.10.1997 / 00:20:33 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1272 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1273 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1274 |
what:someStringOrSelector |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1275 |
"set the what-changed info" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1276 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1277 |
what := someStringOrSelector |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1278 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1279 |
"Modified: 20.4.1996 / 20:21:54 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1280 |
"Created: 24.10.1997 / 00:21:00 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1281 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1282 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1283 |
!HistoryManager::HistoryLine methodsFor:'comparing'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1284 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1285 |
= aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1286 |
"compares two instances of HistoryLine" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1287 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1288 |
(aHistoryLine user = self user) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1289 |
(aHistoryLine date = self date) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1290 |
(aHistoryLine time = self time) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1291 |
(aHistoryLine type = self type) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1292 |
(aHistoryLine what = self what) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1293 |
^ true |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1294 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1295 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1296 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1297 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1298 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1299 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1300 |
^ false |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1301 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1302 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1303 |
| h1 h2 | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1304 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1305 |
h1 := HistoryLine for: OperatingSystem getLoginName. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1306 |
h2 := h1 copy. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1307 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1308 |
h1 = h2 ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1309 |
InfoBox new title: 'users are equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1310 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1311 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1312 |
h2 := HistoryLine for: OperatingSystem getLoginName. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1313 |
h1 = h2 ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1314 |
InfoBox new title: 'users are not equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1315 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1316 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1317 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1318 |
"Modified: 23.8.1995 / 22:26:40 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1319 |
"Modified: 24.10.1997 / 00:22:09 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1320 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1321 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1322 |
hash |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1323 |
"return a hash key for the receiver" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1324 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1325 |
^user hash |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1326 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1327 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1328 |
Check hashCode |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1329 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1330 |
|h1 h2 oc | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1331 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1332 |
h1 := HistoryLine new hash. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1333 |
h2 := HistoryLine new hash. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1334 |
oc := OrderedCollection new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1335 |
oc add: h1. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1336 |
oc add: h2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1337 |
^oc |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1338 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1339 |
using hash in a set: |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1340 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1341 |
| h1 h2 aSet oc | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1342 |
h1 := HistoryLine new hash. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1343 |
h2 := HistoryLine new hash. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1344 |
oc := OrderedCollection new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1345 |
oc add: h1. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1346 |
oc add: h2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1347 |
aSet := oc asSet. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1348 |
^aSet |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1349 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1350 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1351 |
"Modified: 23.08.1995 / 22:26:44 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1352 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1353 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1354 |
sameDate: aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1355 |
"returns true if aUserName = user in preperation for a SortedCollection of HistoryLines" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1356 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1357 |
^aHistoryLine date = date |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1358 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1359 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1360 |
| h1 h2 | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1361 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1362 |
h1 := HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1363 |
h2 := h1 copy. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1364 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1365 |
(h1 sameDate: h2) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1366 |
InfoBox new title: 'Dates are equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1367 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1368 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1369 |
h2 := HistoryLine for: 'R.Sailer'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1370 |
h2 date: (Date day: 12 month: 6 year:1981). |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1371 |
(h1 sameDate: h2) ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1372 |
InfoBox new title: 'users are not equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1373 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1374 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1375 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1376 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1377 |
"Modified: 23.08.1995 / 22:26:47 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1378 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1379 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1380 |
sameType: aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1381 |
"returns true if the Type = type in preperation for a SortedCollection of HistoryLines" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1382 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1383 |
^aHistoryLine type = type |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1384 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1385 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1386 |
| h1 h2 | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1387 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1388 |
h1 := HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1389 |
h2 := h1 copy. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1390 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1391 |
(h1 sameType: h2) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1392 |
InfoBox new title: 'Types are equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1393 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1394 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1395 |
h2 := HistoryLine createdBy: 'R.Sailer'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1396 |
(h1 sameType: h2) ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1397 |
InfoBox new title: 'Types are not equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1398 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1399 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1400 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1401 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1402 |
"Modified: 23.08.1995 / 22:26:49 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1403 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1404 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1405 |
sameUser: aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1406 |
"returns true if aUserName = user in preperation for a SortedCollection of HistoryLines" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1407 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1408 |
^aHistoryLine user = user |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1409 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1410 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1411 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1412 |
| h1 h2 | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1413 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1414 |
h1 := HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1415 |
h2 := h1 copy. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1416 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1417 |
(h1 sameUser: h2) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1418 |
InfoBox new title: 'users are equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1419 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1420 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1421 |
h2 := HistoryLine for: 'R.Sailer'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1422 |
(h1 sameUser: h2) ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1423 |
InfoBox new title: 'users are not equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1424 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1425 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1426 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1427 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1428 |
"Modified: 23.08.1995 / 22:26:51 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1429 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1430 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1431 |
sameWhat: aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1432 |
"returns true if the what = type in preperation for a SortedCollection of HistoryLines" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1433 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1434 |
^aHistoryLine what = what |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1435 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1436 |
"Created: 24.10.1997 / 00:21:46 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1437 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1438 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1439 |
!HistoryManager::HistoryLine methodsFor:'printing & storing'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1440 |
|
643
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1441 |
printOn:aStream |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1442 |
"return a printed representation of a HistoryLine as a string" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1443 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1444 |
aStream nextPutAll:IndentString. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1445 |
aStream nextPutAll:Quote. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1446 |
aStream nextPutAll:type. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1447 |
what notNil ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1448 |
aStream space. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1449 |
aStream nextPutAll:what. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1450 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1451 |
aStream space; nextPutAll:Separator; space. |
1371
e537165f5215
date printing (language specifics)
Claus Gittinger <cg@exept.de>
parents:
1204
diff
changeset
|
1452 |
date printOn:aStream language:#en. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1453 |
aStream space; nextPutAll:Separator; space. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1454 |
time print24HourFormatOn:aStream. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1455 |
aStream space; nextPutAll:Separator; space. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1456 |
aStream nextPutAll:user. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1457 |
aStream nextPutAll:Quote. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1458 |
|
643
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1459 |
" |
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1460 |
self new printOn:Transcript |
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1461 |
" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1462 |
|
643
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1463 |
"Modified: / 24.10.1997 / 02:07:23 / cg" |
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1464 |
"Modified: / 20.1.1998 / 12:58:53 / stefan" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1465 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1466 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1467 |
!HistoryManager::HistoryLine methodsFor:'queries'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1468 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1469 |
isCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1470 |
"returns true if the bodytext is CreatedString" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1471 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1472 |
^type = CreatedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1473 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1474 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1475 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1476 |
HistoryLine new isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1477 |
(HistoryLine for: 'R.Sailer') isCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1478 |
(HistoryLine createdBy: 'R.Sailer') isCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1479 |
HistoryLine deleted isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1480 |
(HistoryLine deletedBy: 'M.Noell') isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1481 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1482 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1483 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1484 |
"Modified: 23.8.1995 / 22:30:23 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1485 |
"Modified: 20.4.1996 / 20:20:36 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1486 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1487 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1488 |
isDeleted |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1489 |
"returns true if the bodytext is DeletedString" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1490 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1491 |
^type = DeletedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1492 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1493 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1494 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1495 |
HistoryLine deleted isDeleted |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1496 |
HistoryLine new isDeleted |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1497 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1498 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1499 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1500 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1501 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1502 |
"Modified: 20.4.1996 / 20:20:32 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1503 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1504 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1505 |
isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1506 |
"returns true if the bodytext is ModifiedString" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1507 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1508 |
^type = ModifiedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1509 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1510 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1511 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1512 |
HistoryLine new isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1513 |
(HistoryLine for: 'R.Sailer') isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1514 |
HistoryLine deleted isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1515 |
(HistoryLine deletedBy: 'M.Noell') isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1516 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1517 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1518 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1519 |
"Modified: 20.4.1996 / 20:20:29 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1520 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1521 |
|
504 | 1522 |
!HistoryManager class methodsFor:'documentation'! |
119 | 1523 |
|
1524 |
version |
|
2081 | 1525 |
^ '$Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.69 2009-02-26 21:26:57 stefan Exp $' |
119 | 1526 |
! ! |
1192
5aea356953d7
Senders use Userpreference setting to choose conversion
Claus Gittinger <cg@exept.de>
parents:
1153
diff
changeset
|
1527 |
|
41 | 1528 |
HistoryManager initialize! |
1192
5aea356953d7
Senders use Userpreference setting to choose conversion
Claus Gittinger <cg@exept.de>
parents:
1153
diff
changeset
|
1529 |
HistoryManager::HistoryLine initialize! |