author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 31 Mar 2012 01:14:49 +0100 | |
branch | jv |
changeset 3042 | 48e76977cdc3 |
parent 3012 | 4f40b8304d54 |
child 3044 | a3de795a9cdd |
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' |
2095 | 17 |
classVariableNames:'TheOneAndOnlyInstance EnforcedUserName' |
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
|
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 |
2394 | 25 |
UseGECOS CreatedString AddedString EnforcedUserName |
26 |
FormattedString CommentedString VariableRenamedString' |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
27 |
poolDictionaries:'' |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
28 |
privateIn:HistoryManager |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
29 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
30 |
|
504 | 31 |
!HistoryManager class methodsFor:'documentation'! |
41 | 32 |
|
46 | 33 |
copyright |
34 |
" |
|
35 |
COPYRIGHT (c) 1995 by AEG Industry Automation |
|
36 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
37 |
All Rights Reserved |
|
38 |
||
39 |
This software is furnished under a license and may be used |
|
40 |
only in accordance with the terms of that license and with the |
|
41 |
inclusion of the above copyright notice. This software may not |
|
42 |
be provided or otherwise made available to, or used by, any |
|
43 |
other person. No title to or ownership of the software is |
|
44 |
hereby transferred. |
|
45 |
" |
|
46 |
! |
|
47 |
||
41 | 48 |
documentation |
49 |
" |
|
214 | 50 |
This class is part of the HistoryManagerProject. |
51 |
It helps to keep track of changes made to methods. |
|
41 | 52 |
|
214 | 53 |
All Methods and Classes in the system get a HistroyLine which |
54 |
contains a timestamp and the name of the changing user. |
|
2394 | 55 |
This is acually the Unix loginname. |
214 | 56 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
57 |
The Manager registers itself to get notifications |
214 | 58 |
on change, intercepts them and appends a historyLine to the methods |
59 |
code. |
|
60 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
61 |
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
|
62 |
or via the Launcher menu. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
63 |
|
2394 | 64 |
The method's history line is filtered, to only contain one |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
65 |
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
|
66 |
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
|
67 |
every change (containing every change). |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
68 |
Full mode is enabled via: |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
69 |
HistoryManager fullHistoryUpdate:true |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
70 |
or via the Launchers compilation-settings dialog. |
41 | 71 |
|
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
72 |
claus: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
73 |
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
|
74 |
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
|
75 |
|
235 | 76 |
[author:] |
77 |
Robert Sailer - AEG |
|
243 | 78 |
|
79 |
[see also:] |
|
80 |
HistoryLine |
|
81 |
||
82 |
[start with:] |
|
83 |
HistoryManager activate |
|
84 |
HistoryManager deactivate |
|
85 |
||
41 | 86 |
" |
87 |
! ! |
|
88 |
||
504 | 89 |
!HistoryManager class methodsFor:'initialization'! |
41 | 90 |
|
2095 | 91 |
enforcedUserName |
92 |
^ EnforcedUserName |
|
93 |
! |
|
94 |
||
95 |
enforcedUserName:aStringOrNil |
|
96 |
EnforcedUserName := aStringOrNil |
|
97 |
||
98 |
" |
|
99 |
self enforcedUserName:'fm' |
|
100 |
self enforcedUserName:nil |
|
101 |
" |
|
102 |
! |
|
103 |
||
87 | 104 |
initMe |
214 | 105 |
"setup theOneAndOnly instance of myself (if not already present" |
106 |
||
87 | 107 |
^self new. |
108 |
||
214 | 109 |
"Modified: 14.8.1995 / 09:02:00 / robert" |
110 |
"Modified: 20.4.1996 / 20:33:44 / cg" |
|
87 | 111 |
! |
112 |
||
41 | 113 |
initialize |
214 | 114 |
"add myself as a dependent of ObjectMemory to be told about image restarts" |
115 |
||
41 | 116 |
ObjectMemory addDependent: self. |
117 |
||
1504
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
118 |
"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
|
119 |
"Modified: / 05-07-2006 / 17:36:47 / cg" |
41 | 120 |
! ! |
121 |
||
504 | 122 |
!HistoryManager class methodsFor:'instance creation'! |
41 | 123 |
|
124 |
new |
|
46 | 125 |
"because there can be only ONE HistoryManager, new must me redefiend" |
41 | 126 |
|
127 |
TheOneAndOnlyInstance isNil ifTrue:[ |
|
2641 | 128 |
TheOneAndOnlyInstance := self basicNew initialize. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
129 |
HistoryLine initialize. |
41 | 130 |
]. |
131 |
||
132 |
^ TheOneAndOnlyInstance |
|
133 |
||
134 |
" |
|
135 |
||
136 |
HistoryManager new. |
|
137 |
" |
|
138 |
||
2641 | 139 |
"Modified: / 11-08-1995 / 17:01:29 / robert" |
140 |
"Modified: / 04-12-2011 / 08:54:22 / cg" |
|
41 | 141 |
! ! |
142 |
||
504 | 143 |
!HistoryManager class methodsFor:'accessing'! |
41 | 144 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
145 |
fullHistoryUpdate |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
146 |
"return true, if the historyManagement does full updates" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
147 |
|
626 | 148 |
TheOneAndOnlyInstance isNil ifTrue:[^ false]. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
149 |
^ TheOneAndOnlyInstance fullHistoryUpdate |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
150 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
151 |
"Modified: / 27.8.1995 / 00:32:12 / claus" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
152 |
"Created: / 24.10.1997 / 02:24:34 / cg" |
626 | 153 |
"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
|
154 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
155 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
156 |
fullHistoryUpdate:aBoolean |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
157 |
"set/clear, full updates" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
158 |
|
626 | 159 |
TheOneAndOnlyInstance isNil ifTrue:[^ self]. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
160 |
TheOneAndOnlyInstance fullHistoryUpdate:aBoolean |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
161 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
162 |
"Modified: / 27.8.1995 / 00:32:12 / claus" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
163 |
"Created: / 24.10.1997 / 02:24:58 / cg" |
626 | 164 |
"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
|
165 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
166 |
|
41 | 167 |
instance |
214 | 168 |
"return the one and only historyManager instance" |
41 | 169 |
|
214 | 170 |
^ TheOneAndOnlyInstance |
171 |
||
172 |
"Modified: 20.4.1996 / 20:31:18 / cg" |
|
41 | 173 |
! |
174 |
||
175 |
isActive |
|
214 | 176 |
"return true, if the historyManagement is activated" |
177 |
||
178 |
^ TheOneAndOnlyInstance notNil |
|
41 | 179 |
|
180 |
"Modified: 27.8.1995 / 00:32:12 / claus" |
|
214 | 181 |
"Modified: 20.4.1996 / 20:31:32 / cg" |
41 | 182 |
! ! |
183 |
||
504 | 184 |
!HistoryManager class methodsFor:'activation / deactivation'! |
41 | 185 |
|
186 |
activate |
|
214 | 187 |
"activate the HistoryManagement" |
188 |
||
41 | 189 |
self new "/ creating an instance activates me |
178 | 190 |
|
191 |
" |
|
192 |
HistoryManager activate |
|
193 |
" |
|
214 | 194 |
|
195 |
"Modified: 20.4.1996 / 20:31:46 / cg" |
|
41 | 196 |
! |
197 |
||
198 |
deactivate |
|
214 | 199 |
"deactivate the HistoryManagement" |
200 |
||
178 | 201 |
|mgr| |
202 |
||
203 |
mgr := TheOneAndOnlyInstance. |
|
532 | 204 |
mgr notNil ifTrue:[ |
205 |
mgr releaseDependencies. |
|
206 |
]. |
|
41 | 207 |
TheOneAndOnlyInstance := nil. |
208 |
||
178 | 209 |
" |
210 |
HistoryManager deactivate |
|
211 |
" |
|
214 | 212 |
|
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
213 |
"Modified: 8.1.1997 / 23:09:08 / cg" |
41 | 214 |
! ! |
215 |
||
504 | 216 |
!HistoryManager class methodsFor:'change & update'! |
87 | 217 |
|
320 | 218 |
update:what with:aParameter from:changedObject |
214 | 219 |
"intercepts system restart - reinstall mySelf as dependent of all classes" |
220 |
||
87 | 221 |
(what == #restarted) ifTrue:[ |
214 | 222 |
TheOneAndOnlyInstance notNil ifTrue:[ |
223 |
" |
|
224 |
smalltalk is about to restart from an Image - |
|
225 |
" |
|
87 | 226 |
"/ 'HistoryManager initialize (via update)' infoPrintNL. |
214 | 227 |
self initMe. |
228 |
] |
|
87 | 229 |
]. |
230 |
||
231 |
"Modified: 27.8.1995 / 16:33:02 / claus" |
|
214 | 232 |
"Modified: 20.4.1996 / 20:33:02 / cg" |
320 | 233 |
"Created: 15.6.1996 / 15:25:53 / cg" |
87 | 234 |
! ! |
235 |
||
504 | 236 |
!HistoryManager class methodsFor:'helpers'! |
47 | 237 |
|
1386 | 238 |
codeForInitialHistoryMethodIn:aClass |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
239 |
"create an initial (empty) history method" |
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| |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
242 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
243 |
histStream := '' writeStream. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
244 |
histStream nextPutLine:'history'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
245 |
histStream nextPutLine:(HistoryLine newCreated printString). |
1386 | 246 |
^ histStream contents |
247 |
! |
|
248 |
||
249 |
createInitialHistoryMethodIn:aClass |
|
2081 | 250 |
<resource: #obsolete> |
1386 | 251 |
"create an initial (empty) history method" |
252 |
||
253 |
self obsoleteMethodWarning. |
|
2317
d62da5a37fc3
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
254 |
SmalltalkCodeGeneratorTool |
1386 | 255 |
compile:(self codeForInitialHistoryMethodIn:aClass) |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
256 |
forClass:aClass |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
257 |
inCategory:'documentation'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
258 |
|
2317
d62da5a37fc3
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
259 |
"Created: / 24-10-1997 / 02:41:43 / cg" |
d62da5a37fc3
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
260 |
"Modified: / 31-01-2011 / 18:28:51 / cg" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
261 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
262 |
|
47 | 263 |
getAllHistoriesFrom:someString |
214 | 264 |
"returns anArray of HistoryLines from a string. |
265 |
Usually, the argument is a methods source code." |
|
47 | 266 |
|
267 |
|position aReadWriteStream firstFound nextFound aHistoryString rcOC h| |
|
268 |
||
2062 | 269 |
rcOC := OrderedCollection new. |
270 |
||
271 |
someString isNil ifTrue:[ |
|
272 |
^ rcOC |
|
273 |
]. |
|
274 |
||
47 | 275 |
"read begining from the end and look there for the first comment character. If there's none return" |
276 |
||
277 |
position := someString size. |
|
278 |
firstFound := false. |
|
279 |
nextFound := false. |
|
280 |
||
281 |
someString reverseDo:[ :aChar| |
|
214 | 282 |
position := position - 1. |
283 |
aChar == $" ifTrue:[ |
|
284 |
firstFound ifTrue:[ |
|
285 |
firstFound := false. |
|
286 |
nextFound := true. |
|
287 |
] ifFalse:[ |
|
1807 | 288 |
aReadWriteStream := ReadWriteStream on: (someString species) new. |
214 | 289 |
firstFound := true. |
290 |
nextFound := false. |
|
291 |
]. |
|
292 |
]. |
|
293 |
(firstFound and: [nextFound not]) ifTrue:[ |
|
294 |
"now collect all up to the next comment character" |
|
295 |
aChar == $" ifFalse:[ |
|
296 |
aReadWriteStream nextPut: aChar. |
|
297 |
]. |
|
298 |
]. |
|
299 |
nextFound ifTrue:[ |
|
300 |
"End reached - now try to make a HistoryLine" |
|
301 |
aHistoryString := (aReadWriteStream contents) reverse. |
|
302 |
" |
|
258 | 303 |
Transcript showCR: aHistoryString. |
214 | 304 |
" |
305 |
h := HistoryLine fromString: aHistoryString at: position. |
|
306 |
h notNil ifTrue:[ |
|
307 |
rcOC add:h. |
|
308 |
]. |
|
47 | 309 |
"/ (aHistoryString startsWith: 'Modified:') ifTrue:[ |
310 |
"/ "a history line was found - now make a NewInstance of HistoryLine" |
|
311 |
"/ rcOC add: ( HistoryLine fromString: aHistoryString at: position). |
|
312 |
"/ ]. |
|
214 | 313 |
nextFound := false. |
314 |
]. |
|
47 | 315 |
]. |
316 |
||
317 |
^rcOC reverse "the OrderedCollection with HistoryLines in the right order" |
|
318 |
||
1807 | 319 |
"Modified: / 21-12-1993 / 18:32:30 / M.Noell" |
320 |
"Modified: / 09-08-1995 / 22:45:30 / R.Sailer" |
|
321 |
"Modified: / 08-09-1995 / 17:54:33 / claus" |
|
322 |
"Modified: / 18-09-2006 / 20:48:19 / cg" |
|
192 | 323 |
! |
324 |
||
2102 | 325 |
getLastHistoryLineFrom:someString |
326 |
"returns the last HistoryLine, if no HistoryLine available, return nil" |
|
327 |
||
328 |
|hist| |
|
329 |
||
330 |
hist := self getAllHistoriesFrom: someString. |
|
331 |
hist isEmpty ifTrue: [ ^ nil]. |
|
332 |
^ hist last |
|
333 |
||
334 |
"Created: 19.1.1996 / 13:08:57 / werner" |
|
335 |
! |
|
336 |
||
192 | 337 |
withoutHistoryLines:someString |
338 |
"given some methods sourceString, return a copy without any |
|
339 |
history lines" |
|
340 |
||
341 |
| pos sourceCode previousHistories | |
|
342 |
||
245 | 343 |
someString isNil ifTrue:[^ someString]. |
344 |
||
192 | 345 |
previousHistories := self getAllHistoriesFrom:someString. |
346 |
||
347 |
"extract source body." |
|
348 |
previousHistories isEmpty ifTrue: [ |
|
349 |
sourceCode := someString withoutSeparators. |
|
350 |
] ifFalse: [ |
|
351 |
pos := (previousHistories first) firstPositionInSourceCode. |
|
352 |
sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators. |
|
353 |
]. |
|
354 |
||
355 |
^ sourceCode |
|
356 |
||
245 | 357 |
" |
358 |
HistoryManager withoutHistoryLines:nil |
|
359 |
HistoryManager withoutHistoryLines:'' |
|
360 |
HistoryManager |
|
361 |
withoutHistoryLines:(HistoryManager class |
|
362 |
compiledMethodAt:#withoutHistoryLines:) source |
|
363 |
" |
|
364 |
||
192 | 365 |
"Created: 5.3.1996 / 15:11:12 / cg" |
245 | 366 |
"Modified: 30.4.1996 / 10:57:35 / cg" |
47 | 367 |
! ! |
368 |
||
41 | 369 |
!HistoryManager methodsFor:'accessing'! |
370 |
||
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
371 |
fullHistoryUpdate |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
372 |
"return the fullHistoryUpdate; |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
373 |
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
|
374 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
375 |
^ fullHistoryUpdate |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
376 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
377 |
"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
|
378 |
! |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
379 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
380 |
fullHistoryUpdate:aBoolean |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
381 |
"set the fullHistoryUpdate; |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
382 |
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
|
383 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
384 |
fullHistoryUpdate := aBoolean. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
385 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
386 |
"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
|
387 |
! |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
388 |
|
41 | 389 |
historyMode |
390 |
"return historyMode" |
|
391 |
||
392 |
^ historyMode |
|
393 |
||
394 |
"Modified: 11.08.1995 / 16:51:56 / robert" |
|
395 |
! |
|
396 |
||
397 |
historyMode:something |
|
398 |
"set historyMode" |
|
399 |
||
400 |
historyMode := something. |
|
401 |
||
402 |
"Modified: 11.08.1995 / 16:52:12 / robert" |
|
403 |
! ! |
|
404 |
||
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
405 |
!HistoryManager methodsFor:'change & update'! |
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 |
update:something with:someArgument from:changedObject |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
408 |
"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
|
409 |
(something contains aSymbol describing what happened)" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
410 |
|
2394 | 411 |
|selector oldMethod changedClass whatChange| |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
412 |
|
2467 | 413 |
something == #methodCoverageInfo ifTrue:[^ self]. |
414 |
something == #methodTrap ifTrue:[^ self]. |
|
415 |
||
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
416 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
417 |
"/ no action, if disabled |
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 |
historyMode ifFalse:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
420 |
^ self |
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 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
423 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
424 |
"/ 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
|
425 |
"/ (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
|
426 |
"/ |
1504
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
427 |
(Class updateChangeFileQuerySignal query) ifFalse:[ |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
428 |
"/ Transcript showCR: '* noChange in history'. |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
429 |
^ self |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
430 |
]. |
cfeab1ed934d
no history update unless done by user
Claus Gittinger <cg@exept.de>
parents:
1495
diff
changeset
|
431 |
Class updateHistoryLineQuerySignal query ifFalse:[ |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
432 |
"/ Transcript showCR: '* noChange in history'. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
433 |
^ self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
434 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
435 |
|
2394 | 436 |
" |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
437 |
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
|
438 |
" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
439 |
(something == #definition) ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
440 |
"/ 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
|
441 |
"/ add a line to the history method; if present |
2394 | 442 |
self updateAfterClassChange:'class definition' in:changedObject. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
443 |
^ self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
444 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
445 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
446 |
"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
|
447 |
(something == #classVariables) ifTrue:[ |
2394 | 448 |
self updateAfterClassChange:'class variables' in:changedObject. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
449 |
^ self |
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 |
|
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 |
"/ new Class creation |
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 |
((changedObject == Smalltalk) and:[something == #newClass]) ifTrue:[ |
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 |
"/ 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
|
458 |
"/ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
459 |
fullHistoryUpdate == true ifTrue:[ |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
460 |
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
|
461 |
self createHistoryMethodFor:someArgument. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
462 |
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
|
463 |
]. |
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 |
"/ claus: old implementation |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
466 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
467 |
"/ someArgument addDependent: self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
468 |
"/ 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
|
469 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
470 |
^ self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
471 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
472 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
473 |
"/ changed methods |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
474 |
"/ for backward compatibility, still handle the |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
475 |
"/ classes own change notification. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
476 |
"/ (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
|
477 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
478 |
changedObject isBehavior ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
479 |
changedClass := changedObject. |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
480 |
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
|
481 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
482 |
something == #methodDictionary ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
483 |
whatChange := #methodDictionary. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
484 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
485 |
someArgument isArray ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
486 |
selector := someArgument at:1. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
487 |
oldMethod := someArgument at:2 |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
488 |
] ifFalse:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
489 |
selector := someArgument |
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 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
492 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
493 |
something == #methodInClassRemoved ifTrue:[ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
494 |
fullHistoryUpdate == true ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
495 |
changedClass := someArgument at:1. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
496 |
selector := someArgument at:2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
497 |
self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
498 |
]. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
499 |
^ self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
500 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
501 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
502 |
something == #comment ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
503 |
whatChange := #comment. |
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 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
506 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
507 |
"/ 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
|
508 |
"/ Smalltalk, to get all method changes |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
509 |
|
2394 | 510 |
(changedObject == Smalltalk and:[something == #methodInClass]) ifTrue:[ |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
511 |
changedClass := someArgument at:1. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
512 |
selector := someArgument at:2. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
513 |
oldMethod := someArgument at:3. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
514 |
whatChange := #methodDictionary. |
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 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
517 |
changedClass notNil ifTrue:[ |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
518 |
changedClass theMetaclass compilerClass == Compiler ifFalse:[^ self]. |
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
519 |
|
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
520 |
whatChange == #methodDictionary ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
521 |
"/ ok; it is a changed method |
2394 | 522 |
self updateAfterMethodChange:selector from:oldMethod in:changedClass. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
523 |
^self |
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 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
526 |
whatChange == #comment ifTrue:[ |
594 | 527 |
"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
|
528 |
^ self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
529 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
530 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
531 |
whatChange == #classDefinition ifTrue:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
532 |
"/ 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
|
533 |
"/ add a line to the history method; if present |
2467 | 534 |
self updateAfterClassChange:'class definition' in:changedClass. |
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
535 |
^self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
536 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
537 |
]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
538 |
"/ 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
|
539 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
540 |
^self |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
541 |
|
2394 | 542 |
"Created: / 30-06-2011 / 16:43:46 / cg" |
543 |
! |
|
544 |
||
545 |
updateAfterClassChange:whatChange in:aClass |
|
546 |
"/ it is a class definition that has changed |
|
547 |
"/ add a line to the history method; if present |
|
548 |
"/ Transcript show: 'Class definition: ', changedClass printString;cr. |
|
549 |
||
550 |
fullHistoryUpdate == true ifTrue:[ |
|
551 |
"/ check for the programming-language... |
|
552 |
aClass theMetaclass compilerClass == Compiler ifFalse:[ |
|
553 |
^ self |
|
554 |
]. |
|
555 |
self |
|
556 |
addHistory:#modification |
|
557 |
with:whatChange |
|
558 |
toHistoryMethodOf:aClass. |
|
559 |
]. |
|
560 |
||
561 |
"Modified (Format): / 30-06-2011 / 16:27:23 / cg" |
|
562 |
"Created: / 30-06-2011 / 16:28:22 / cg" |
|
563 |
! |
|
564 |
||
565 |
updateAfterMethodChange:selector from:oldMethod in:changedClass |
|
566 |
|newSource newSourceWithoutHistory newHistories newMethod newTree newComments |
|
567 |
oldSource oldSourceWithoutHistory oldHistories oldTree oldComments |
|
568 |
renamedVariables |
|
569 |
whatChange pos| |
|
570 |
||
571 |
changedClass theMetaclass compilerClass == Compiler ifFalse:[^ self]. |
|
2452
ec6efa0f7f16
changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents:
2435
diff
changeset
|
572 |
(oldMethod notNil and:[oldMethod compilerClass ~~ Compiler]) ifTrue:[^ self]. |
2394 | 573 |
|
574 |
"/ ok; it is a changed method |
|
575 |
||
576 |
"/ |
|
577 |
"/ fetch sourceString of the method |
|
578 |
"/ |
|
579 |
newSource := changedClass sourceCodeAt:selector. |
|
580 |
newSource isNil ifTrue:[ |
|
581 |
"method has been deleted" |
|
582 |
"/ Transcript showCR: 'method has been deleted'. |
|
583 |
fullHistoryUpdate == true ifTrue:[ |
|
584 |
self addHistory:#deletion with:('#' , selector) toHistoryMethodOf:changedClass. |
|
585 |
]. |
|
586 |
^ self. |
|
587 |
]. |
|
588 |
newHistories := self class getAllHistoriesFrom:newSource. |
|
589 |
||
590 |
newMethod := changedClass compiledMethodAt:selector. |
|
2452
ec6efa0f7f16
changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents:
2435
diff
changeset
|
591 |
newMethod compilerClass == Compiler ifFalse:[^ self]. |
2394 | 592 |
|
593 |
oldMethod isNil ifTrue:[ |
|
594 |
whatChange := #creation |
|
595 |
] ifFalse:[ |
|
596 |
whatChange := #modification. |
|
597 |
||
598 |
oldSource := oldMethod source. |
|
599 |
oldSource notNil ifTrue:[ |
|
600 |
(oldSource asString withTabsExpanded = newSource asString withTabsExpanded) ifTrue:[ |
|
601 |
"/ no change (accepted same code again ?) |
|
602 |
^ self |
|
603 |
]. |
|
604 |
||
605 |
oldHistories := self class getAllHistoriesFrom:oldSource. |
|
606 |
oldHistories notEmptyOrNil ifTrue: [ |
|
607 |
"/ compare source without history... |
|
608 |
pos := (oldHistories first) firstPositionInSourceCode. |
|
609 |
oldSourceWithoutHistory := (oldSource copyFrom:1 to:pos - 1) withoutSeparators. |
|
610 |
] ifFalse:[ |
|
611 |
oldSourceWithoutHistory := oldSource |
|
612 |
]. |
|
613 |
||
614 |
newHistories notEmptyOrNil ifTrue: [ |
|
615 |
"/ compare source without history... |
|
616 |
pos := (newHistories first) firstPositionInSourceCode. |
|
617 |
newSourceWithoutHistory := (newSource copyFrom:1 to:pos - 1) withoutSeparators. |
|
618 |
] ifFalse:[ |
|
619 |
newSourceWithoutHistory := newSource |
|
620 |
]. |
|
621 |
||
622 |
(oldSourceWithoutHistory asString withTabsExpanded = newSourceWithoutHistory asString withTabsExpanded) ifTrue:[ |
|
623 |
"/ no change (except for history lines) |
|
624 |
UserPreferences current historyManagerAllowEditOfHistory ifFalse:[ |
|
625 |
newMethod source: oldSource. |
|
626 |
]. |
|
627 |
^ self |
|
628 |
]. |
|
629 |
||
630 |
RBParser notNil ifTrue:[ |
|
631 |
"/ same structure? |
|
632 |
oldTree := RBParser parseMethod:oldSourceWithoutHistory onError:[:aString :pos | nil]. |
|
633 |
newTree := RBParser parseMethod:newSourceWithoutHistory onError:[:aString :pos | nil]. |
|
2517
71374f69ec64
changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents:
2467
diff
changeset
|
634 |
(oldTree notNil |
71374f69ec64
changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents:
2467
diff
changeset
|
635 |
and:[newTree notNil |
71374f69ec64
changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents:
2467
diff
changeset
|
636 |
and:[oldTree equalTo:newTree withMapping:(renamedVariables := Dictionary new)]]) ifTrue:[ |
2394 | 637 |
"/ only formatting? |
638 |
(renamedVariables keysAndValuesSelect:[:k :v | k ~= v]) isEmpty ifTrue:[ |
|
639 |
"/ only formatting... |
|
640 |
whatChange := #formatted. |
|
641 |
oldComments := oldTree allComments. |
|
642 |
newComments := newTree allComments. |
|
643 |
(oldComments size ~= newComments size |
|
644 |
or:[ oldComments with:newComments contains:[:ca :cb | ca characters ~= cb characters]]) ifTrue:[ |
|
645 |
whatChange := #commented. |
|
646 |
]. |
|
647 |
] ifFalse:[ |
|
2423
a64020036dc3
changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents:
2405
diff
changeset
|
648 |
renamedVariables := renamedVariables associations select:[:assoc | assoc key ~= assoc value]. |
a64020036dc3
changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents:
2405
diff
changeset
|
649 |
"/ should figure out, if only local vars have been renamed; |
a64020036dc3
changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents:
2405
diff
changeset
|
650 |
"/ could make it a nicer modified(var names) then |
a64020036dc3
changed: #updateAfterMethodChange:from:in:
Claus Gittinger <cg@exept.de>
parents:
2405
diff
changeset
|
651 |
"/ renamedVariables halt. |
2394 | 652 |
] |
653 |
] |
|
654 |
] |
|
655 |
] |
|
656 |
]. |
|
657 |
||
658 |
"/ |
|
659 |
"/ don't add historylines to documentation methods on the class side... |
|
660 |
"/ |
|
661 |
(changedClass isMeta |
|
662 |
and:[newMethod category = 'documentation']) ifFalse:[ |
|
663 |
"/ |
|
664 |
"/ update the history line-comment in |
|
665 |
"/ the methods source |
|
666 |
"/ |
|
667 |
newSource := self addHistory:whatChange with:nil to:oldHistories inSource:newSource filter:true. |
|
668 |
newMethod source: newSource. |
|
669 |
"/ Transcript showCR: 'history updated / added'. |
|
670 |
]. |
|
671 |
||
672 |
fullHistoryUpdate == true ifTrue:[ |
|
673 |
self addHistory:whatChange with:('#' , selector) toHistoryMethodOf:changedClass. |
|
674 |
]. |
|
675 |
||
676 |
"Created: / 30-06-2011 / 16:51:19 / cg" |
|
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
677 |
! ! |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
678 |
|
41 | 679 |
!HistoryManager methodsFor:'initialization'! |
680 |
||
681 |
exclude |
|
46 | 682 |
"public - return an exclusionlist for some smalltalk classes which should not be notified or historisized" |
41 | 683 |
|
684 |
| oc | |
|
685 |
||
686 |
oc := OrderedCollection new. |
|
687 |
oc add: self. |
|
688 |
||
689 |
^oc |
|
690 |
||
691 |
"Modified: 11.08.1995 / 17:02:18 / robert" |
|
692 |
! |
|
693 |
||
694 |
initialize |
|
46 | 695 |
"public - make me depend on all smalltalk classes (except the exclusionList) |
696 |
to be notified later about changes. This intercepts source installation and allows |
|
697 |
be to patch the source-string with a historyLine." |
|
41 | 698 |
|
53 | 699 |
|exclusionlist| |
41 | 700 |
|
701 |
super initialize. |
|
702 |
historyMode := true. |
|
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
703 |
fullHistoryUpdate := false. |
41 | 704 |
exclusionlist := self exclude. |
705 |
||
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
706 |
"/ old implementation: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
707 |
"/ 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
|
708 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
709 |
"/ Smalltalk allClassesDo:[:aClass| |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
710 |
"/ "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
|
711 |
"/ "aClass = self " false ifFalse: [ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
712 |
"/ (exclusionlist includes: aClass) ifFalse:[ |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
713 |
"/ aClass addDependent: self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
714 |
"/ 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
|
715 |
"/ ]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
716 |
"/ ]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
717 |
"/ ]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
718 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
719 |
"/ old implementation: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
720 |
"/ Smalltalk also sends class-change notifications ... |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
721 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
722 |
Smalltalk addDependent:self. |
41 | 723 |
|
724 |
^self |
|
725 |
||
531
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
726 |
"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
|
727 |
"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
|
728 |
! |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
729 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
730 |
releaseDependencies |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
731 |
"no longer depend on class changes" |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
732 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
733 |
"/ old implementation: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
734 |
"/ 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
|
735 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
736 |
"/ Smalltalk allClassesDo:[:aClass | |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
737 |
"/ aClass removeDependent:self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
738 |
"/ aClass class removeDependent:self. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
739 |
"/ ]. |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
740 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
741 |
"/ new implementation: |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
742 |
"/ Smalltalk also sends class-change notifications ... |
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
743 |
|
b0d7a291474d
changed to no longer depend on all classes,
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
744 |
Smalltalk removeDependent:self. |
41 | 745 |
! ! |
746 |
||
747 |
!HistoryManager methodsFor:'updateHistory'! |
|
748 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
749 |
addHistory:what with:argument to:someString filter:doFilter |
41 | 750 |
"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
|
751 |
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
|
752 |
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
|
753 |
'Modified' or 'Created' lines." |
41 | 754 |
|
2394 | 755 |
|previousHistories| |
41 | 756 |
|
53 | 757 |
"Check whether we want a history to be added" |
758 |
historyMode ifFalse:[ |
|
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
759 |
^ someString |
53 | 760 |
]. |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
761 |
|
47 | 762 |
previousHistories := self class getAllHistoriesFrom:someString. |
2394 | 763 |
^ self addHistory:what with:argument to:previousHistories inSource:someString filter:doFilter |
764 |
||
765 |
"Modified: / 30-06-2011 / 16:54:27 / cg" |
|
766 |
"Modified (Format): / 30-06-2011 / 18:17:58 / cg" |
|
767 |
! |
|
768 |
||
769 |
addHistory:what with:argument to:previousHistories inSource:someString filter:doFilter |
|
770 |
"private - add a historyLine at end to the sourceCode; |
|
771 |
check for multiple lines of the same user and merge into one. |
|
772 |
What may be one of #modification or #creation, to choose among |
|
773 |
'Modified' or 'Created' lines." |
|
774 |
||
775 |
|histories histLines pos wStream sourceCode newLine | |
|
776 |
||
777 |
"Check whether we want a history to be added" |
|
778 |
historyMode ifFalse:[ |
|
779 |
^ someString |
|
780 |
]. |
|
41 | 781 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
782 |
newLine := HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
783 |
|
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
784 |
what == #creation ifTrue:[ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
785 |
newLine isForCreation. |
2394 | 786 |
] ifFalse:[ what == #deletion ifTrue:[ |
787 |
newLine isForDeletion. |
|
788 |
] ifFalse:[ what == #addition ifTrue:[ |
|
789 |
newLine isForAddition. |
|
790 |
] ifFalse:[ what == #modification ifTrue:[ |
|
791 |
newLine isForModification. |
|
792 |
] ifFalse:[ what == #formatted ifTrue:[ |
|
793 |
newLine isForFormatted. |
|
794 |
] ifFalse:[ what == #commented ifTrue:[ |
|
795 |
newLine isForCommented. |
|
796 |
] ifFalse:[ what == #variableRenamed ifTrue:[ |
|
797 |
newLine isForVariableRenamed |
|
798 |
] ifFalse:[ |
|
799 |
self breakPoint:#cg |
|
800 |
]]]]]]]. |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
801 |
argument notNil ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
802 |
newLine what:argument |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
803 |
]. |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
804 |
|
41 | 805 |
"extract source body." |
2394 | 806 |
histories := self class getAllHistoriesFrom:someString. |
807 |
histories isEmpty ifTrue: [ |
|
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
808 |
sourceCode := someString withoutSeparators. |
41 | 809 |
] ifFalse: [ |
2394 | 810 |
pos := (histories first) firstPositionInSourceCode. |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
811 |
sourceCode := (someString copyFrom: 1 to: pos - 1) withoutSeparators. |
41 | 812 |
]. |
813 |
||
814 |
"add the actual user's historyLine." |
|
2394 | 815 |
histLines := (previousHistories ? histories). |
816 |
histLines add:newLine. |
|
41 | 817 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
818 |
doFilter ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
819 |
"Filtering historyLines (each user with one entry)." |
2394 | 820 |
histLines := HistoryLine filterHistoryLines: histLines. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
821 |
]. |
41 | 822 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
823 |
"create new method body with added historyLine" |
1807 | 824 |
wStream := WriteStream on: (sourceCode species) new. |
41 | 825 |
wStream nextPutAll: sourceCode; cr. |
826 |
||
827 |
"append the historyLines to the source" |
|
828 |
wStream cr. |
|
829 |
histLines do: [:hl | |
|
512
d38e6339cddb
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
504
diff
changeset
|
830 |
wStream nextPutLine:hl printString. |
41 | 831 |
]. |
832 |
||
512
d38e6339cddb
use #nextPutLine instead of #nextPutAll; #cr
Claus Gittinger <cg@exept.de>
parents:
504
diff
changeset
|
833 |
^ wStream contents. |
41 | 834 |
|
2394 | 835 |
"Modified: / 30-06-2011 / 17:07:18 / cg" |
41 | 836 |
! |
837 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
838 |
addHistory:what with:arg toHistoryMethodOf:aClass |
214 | 839 |
"private - add a historyLine at end of the classes history methods |
840 |
source - if there is one" |
|
841 |
||
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
842 |
|meta historyMethod oldSource newSource| |
53 | 843 |
|
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
844 |
meta := aClass theMetaclass. |
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
845 |
|
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
846 |
historyMethod := meta compiledMethodAt: #history. |
53 | 847 |
historyMethod notNil ifTrue:[ |
214 | 848 |
oldSource := historyMethod source. |
849 |
oldSource notNil ifTrue:[ |
|
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
850 |
newSource := self |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
851 |
addHistory:what |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
852 |
with:arg |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
853 |
to:oldSource |
1397 | 854 |
filter:true. |
214 | 855 |
historyMethod source:newSource. |
856 |
] |
|
53 | 857 |
] |
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
|
858 |
|
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
859 |
"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
|
860 |
"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
|
861 |
"Modified: / 13-07-2006 / 17:42:03 / cg" |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
862 |
! |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
863 |
|
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
864 |
createHistoryMethodFor:aClass |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
865 |
"private - create a history method" |
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
866 |
|
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
867 |
|meta| |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
868 |
|
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
869 |
meta := aClass theMetaclass. |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
870 |
|
1413
b9087201c7aa
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
1398
diff
changeset
|
871 |
(Class updateChangeFileQuerySignal, Class updateChangeListQuerySignal) answer:false do:[ |
b9087201c7aa
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
1398
diff
changeset
|
872 |
Compiler |
b9087201c7aa
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
1398
diff
changeset
|
873 |
compile:'history' |
1505
44c303e3558a
do not add history to non-smalltalk classes
Claus Gittinger <cg@exept.de>
parents:
1504
diff
changeset
|
874 |
forClass:meta |
1413
b9087201c7aa
Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents:
1398
diff
changeset
|
875 |
inCategory:'documentation' |
497
abebd0d145e5
dont add a changeRecord for the automatically created history method.
Claus Gittinger <cg@exept.de>
parents:
494
diff
changeset
|
876 |
]. |
494
6bc61cd32f7c
historyManager no longer sends #history;
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
877 |
|
2394 | 878 |
"Modified (Format): / 30-06-2011 / 17:11:38 / cg" |
879 |
"Modified (Format): / 30-06-2011 / 17:11:42 / cg" |
|
880 |
"Modified (Format): / 30-06-2011 / 17:11:45 / cg" |
|
881 |
"Modified (Format): / 30-06-2011 / 17:11:47 / cg" |
|
41 | 882 |
! ! |
883 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
884 |
!HistoryManager::HistoryLine class methodsFor:'converting'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
885 |
|
1958 | 886 |
convertStringToDate: aString |
887 |
"kludge" |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
888 |
|
2394 | 889 |
| day month year words firstNumber | |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
890 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
891 |
"delete delimiter from the date string" |
2103 | 892 |
words := aString asCollectionOfSubstringsSeparatedByAny:'.-/'. |
1958 | 893 |
|
2394 | 894 |
"/ figure out if european or yyyy-mm-dd format |
895 |
firstNumber := Number readFromString:(words at: 1). |
|
896 |
firstNumber > 1900 ifTrue:[ |
|
897 |
year := firstNumber. |
|
898 |
month := Number readFrom:(words at: 2 ) onError:nil. |
|
899 |
day := Number readFromString:(words at: 3 ). |
|
900 |
] ifFalse:[ |
|
901 |
day := firstNumber. |
|
902 |
month := Number readFrom:(words at: 2 ) onError:nil. |
|
903 |
year := Number readFromString:(words at: 3 ). |
|
904 |
(year between:0 and:99) ifTrue:[ |
|
905 |
year := UserPreferences current twoDigitDateHandler value:year. |
|
906 |
]. |
|
907 |
]. |
|
1383
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
908 |
month isNil ifTrue:[ |
2103 | 909 |
month := Date indexOfMonth:(words at:2) language:#en. |
1383
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
910 |
month == 0 ifTrue:[ |
2103 | 911 |
month := Date indexOfMonth:(words at:2). |
1383
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
912 |
]. |
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
913 |
month == 0 ifTrue:[ |
1384
4e05f325b284
handle bad month in history line
Claus Gittinger <cg@exept.de>
parents:
1383
diff
changeset
|
914 |
self halt:'invalid month in history line'. |
4e05f325b284
handle bad month in history line
Claus Gittinger <cg@exept.de>
parents:
1383
diff
changeset
|
915 |
^ Date today. |
1383
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
916 |
]. |
e243ae633fac
handle monthname in history line
Claus Gittinger <cg@exept.de>
parents:
1382
diff
changeset
|
917 |
]. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
918 |
|
739 | 919 |
^ Date newDay:day month:month year:year. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
920 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
921 |
" |
2394 | 922 |
HistoryLine convertStringToDate:'18.10.1995' |
2103 | 923 |
HistoryLine convertStringToDate:'18.10.95' |
924 |
HistoryLine convertStringToDate:'18.10.01' |
|
2394 | 925 |
HistoryLine convertStringToDate:'2001-03-01' |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
926 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
927 |
|
1382 | 928 |
"Modified: / 23-08-1995 / 21:28:58 / robert" |
929 |
"Modified: / 16-09-1997 / 14:35:03 / stefan" |
|
1958 | 930 |
"Created: / 06-03-2007 / 17:04:34 / cg" |
2394 | 931 |
"Modified (Comment): / 30-06-2011 / 18:37:09 / cg" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
932 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
933 |
|
1958 | 934 |
convertStringToTime: aString |
935 |
"kludge" |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
936 |
|
739 | 937 |
|h m s| |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
938 |
|
1953 | 939 |
h := Number readFromString:(aString copyFrom:1 to:2) onError:[^ Time now]. |
940 |
m := Number readFromString:(aString copyFrom:4 to:5) onError:[^ Time now]. |
|
1511 | 941 |
aString size >= 8 ifTrue:[ |
2103 | 942 |
s := Number readFromString:(aString copyFrom:7 to:8). |
1511 | 943 |
] ifFalse:[ |
944 |
s := 0. |
|
945 |
]. |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
946 |
|
739 | 947 |
^Time hours:h minutes:m seconds:s. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
948 |
|
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 |
HistoryLine convertAStringToATime:'18:23:15' |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
951 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
952 |
|
1511 | 953 |
"Modified: / 15-08-1995 / 18:56:18 / robert" |
1958 | 954 |
"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
|
955 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
956 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
957 |
!HistoryManager::HistoryLine class methodsFor:'documentation'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
958 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
959 |
copyright |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
960 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
961 |
COPYRIGHT (c) 1995 by AEG Industry Automation |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
962 |
COPYRIGHT (c) 1995 by Claus Gittinger |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
963 |
All Rights Reserved |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
964 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
965 |
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
|
966 |
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
|
967 |
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
|
968 |
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
|
969 |
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
|
970 |
hereby transferred. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
971 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
972 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
973 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
974 |
documentation |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
975 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
976 |
The class HistoryLine is part of the HistoryManagerProjcet. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
977 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
978 |
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
|
979 |
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
|
980 |
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
|
981 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
982 |
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
|
983 |
ST/X class delivery. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
984 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
985 |
[see also:] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
986 |
HistoryManager |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
987 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
988 |
[author:] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
989 |
Robert Sailer - AEG |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
990 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
991 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
992 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
993 |
examples |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
994 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
995 |
HistoryLine initialize. |
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 |
HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
998 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
999 |
HistoryLine for: 'R.Sailer'. for integration purposes ONLY |
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 |
HistoryLine deleted. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1002 |
" |
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 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1005 |
version |
3042
48e76977cdc3
Added info-record processing support into changeset reader
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
1006 |
^ '$Id: HistoryManager.st 1909 2012-03-31 00:14:49Z vranyj1 $' |
624
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 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1009 |
!HistoryManager::HistoryLine class methodsFor:'filtering'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1010 |
|
2394 | 1011 |
filterHistoryLines:aCollectionOfHistoryLines |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1012 |
"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
|
1013 |
and remove all but the youngest (per user)." |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1014 |
|
2394 | 1015 |
|newCollection skipNext| |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1016 |
|
2394 | 1017 |
skipNext := false. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1018 |
newCollection := OrderedCollection new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1019 |
aCollectionOfHistoryLines keysAndValuesDo:[:index :histLine | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1020 |
|skip| |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1021 |
|
2394 | 1022 |
skip := skipNext. |
1023 |
skipNext := false. |
|
1024 |
histLine isKindOfModified ifTrue:[ |
|
1025 |
aCollectionOfHistoryLines do: [:anotherHistLine | |
|
1026 |
(anotherHistLine isCreated and: [anotherHistLine user = histLine user]) |
|
1027 |
ifTrue: [ |
|
1028 |
(self timeIsShortFrom:histLine to:anotherHistLine) ifTrue: [skip := true] |
|
1029 |
] |
|
1030 |
]. |
|
1031 |
||
1398 | 1032 |
skip ifFalse: [ |
2394 | 1033 |
"/ if there is another one, skip this |
1034 |
aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine | |
|
1035 |
(anotherHistLine isKindOfModified |
|
1036 |
and:[anotherHistLine user = histLine user |
|
1037 |
and:[anotherHistLine what = histLine what]]) |
|
1038 |
ifTrue:[ |
|
1039 |
"/ don't replace a modified by a modified format |
|
1040 |
(histLine isModified not or:[anotherHistLine isModified]) ifTrue:[ |
|
1041 |
skip := true |
|
1042 |
] ifFalse:[ |
|
1043 |
"/ remove next comment/format modification if this is a modified |
|
1044 |
(histLine isModified and:[anotherHistLine isModified not]) ifTrue:[ |
|
1045 |
(self timeIsShortFrom:histLine to:anotherHistLine) ifTrue: [skip := true] |
|
1046 |
]. |
|
1047 |
]. |
|
1048 |
] |
|
1049 |
]. |
|
1398 | 1050 |
] |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1051 |
] ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1052 |
"/ filter out multiple created messages |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1053 |
"/ (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
|
1054 |
histLine isCreated ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1055 |
aCollectionOfHistoryLines from:index+1 do:[:anotherHistLine | |
2404
9cfb670a7b72
do not remove multiple creates
Claus Gittinger <cg@exept.de>
parents:
2394
diff
changeset
|
1056 |
(anotherHistLine isCreated |
9cfb670a7b72
do not remove multiple creates
Claus Gittinger <cg@exept.de>
parents:
2394
diff
changeset
|
1057 |
and:[(anotherHistLine what = histLine what) |
9cfb670a7b72
do not remove multiple creates
Claus Gittinger <cg@exept.de>
parents:
2394
diff
changeset
|
1058 |
and:[anotherHistLine user = histLine user]]) |
2405 | 1059 |
ifTrue:[skip := true] |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1060 |
]. |
2394 | 1061 |
skip ifFalse:[ |
1062 |
"/ create followed by a modification, within the historyManagerModificationLimit: |
|
1063 |
"/ skip the modified message |
|
1064 |
(index+1) == aCollectionOfHistoryLines size ifTrue:[ |
|
1065 |
| anotherHistLine | |
|
1066 |
anotherHistLine := aCollectionOfHistoryLines at:index+1. |
|
1067 |
(anotherHistLine isKindOfModified and:[anotherHistLine user = histLine user]) |
|
1068 |
ifTrue:[skipNext := true] |
|
1069 |
]. |
|
1070 |
]. |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1071 |
]. |
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 |
skip ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1074 |
newCollection add:histLine. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1075 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1076 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1077 |
^ newCollection. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1078 |
|
1981 | 1079 |
"Modified: / 08-09-1995 / 17:20:40 / claus" |
1080 |
"Modified: / 20-06-2004 / 16:36:00 / masca" |
|
1081 |
"Modified: / 01-09-2004 / 20:20:42 / janfrog" |
|
2405 | 1082 |
"Modified: / 05-07-2011 / 23:09:01 / cg" |
1398 | 1083 |
! |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1084 |
|
1398 | 1085 |
modificationLimit |
1086 |
"Answer the number of seconds between creation and |
|
1087 |
modifcation of a method within which the modification |
|
1088 |
line won't be added." |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1089 |
|
1398 | 1090 |
^ 3600 "/one hour |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1091 |
|
1398 | 1092 |
"Created: / 20.6.2004 / 16:32:35 / masca" |
1093 |
"Modified: / 2.9.2004 / 15:33:09 / janfrog" |
|
2394 | 1094 |
! |
1095 |
||
1096 |
timeIsShortFrom:histLine1 to:histLine2 |
|
1097 |
|t1 t2| |
|
1098 |
||
1099 |
t1 := (Timestamp fromDate: histLine1 date andTime: histLine1 time). |
|
1100 |
t2 := (Timestamp fromDate: histLine2 date andTime: histLine2 time). |
|
1101 |
^ (t1 secondDeltaFrom:t2) abs < self modificationLimit |
|
1102 |
||
1103 |
"Created: / 30-06-2011 / 18:23:04 / cg" |
|
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 |
!HistoryManager::HistoryLine class methodsFor:'initialization'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1107 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1108 |
initialize |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1109 |
"setup class variables" |
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 |
Quote isNil ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1112 |
Quote := '"'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1113 |
Separator := '/'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1114 |
ModifiedString := 'Modified:'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1115 |
DeletedString := 'Deleted:'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1116 |
CreatedString := 'Created:'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1117 |
AddedString := 'Added:'. |
2394 | 1118 |
FormattedString := 'Modified (format):'. |
1119 |
CommentedString := 'Modified (comment):'. |
|
1120 |
VariableRenamedString := 'Modified (variable name):'. |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1121 |
IndentString := ' '. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1122 |
UseGECOS := false. |
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 |
|
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 |
HistoryLine initialize |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1127 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1128 |
|
2394 | 1129 |
"Modified: / 23-08-1995 / 22:14:03 / robert" |
1130 |
"Modified: / 30-06-2011 / 12:28:43 / cg" |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1131 |
! ! |
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 |
!HistoryManager::HistoryLine class methodsFor:'instance creation'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1134 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1135 |
fromString: aString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1136 |
"parses the argument, aString; |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1137 |
create & return a new Instance with the values" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1138 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1139 |
^ self fromString: aString at: 0. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1140 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1141 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1142 |
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
|
1143 |
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
|
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 |
"Modified: 23.8.1995 / 22:14:13 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1147 |
"Modified: 20.4.1996 / 20:24:47 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1148 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1149 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1150 |
fromString: aString at: position |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1151 |
"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
|
1152 |
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
|
1153 |
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
|
1154 |
|
2394 | 1155 |
|inst array type aTime aDate userName idx what| |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1156 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1157 |
inst := self basicNew. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1158 |
|
2394 | 1159 |
array := aString asArrayOfSubstrings. |
1160 |
array size < 5 ifTrue:[^ nil]. |
|
1161 |
||
1162 |
array := array collect:[:word | word withoutSpaces]. |
|
1163 |
type := array at:1. |
|
1164 |
||
1165 |
"/ kludge for the 'Modified (what)' strings |
|
1166 |
((array at:2) startsWith:'(') ifTrue:[ |
|
1167 |
type := type , ' ' , (array at:2). |
|
1168 |
array := (Array with:type) , (array copyFrom:3) |
|
1169 |
]. |
|
624
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 |
" |
2394 | 1172 |
Modified [(detail)] / Deleted / Created |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1173 |
[what] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1174 |
Separator |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1175 |
date asString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1176 |
Separator |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1177 |
time asString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1178 |
Separator |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1179 |
UserName ... |
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 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1182 |
((Array |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1183 |
with:ModifiedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1184 |
with:DeletedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1185 |
with:CreatedString |
2394 | 1186 |
with:AddedString |
1187 |
with:FormattedString |
|
1188 |
with:CommentedString |
|
1189 |
with:VariableRenamedString |
|
1190 |
) includes:type) ifFalse:[^ nil]. |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1191 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1192 |
inst type:type. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1193 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1194 |
"/ sigh backward compatibility ... |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1195 |
|
2394 | 1196 |
(array at:2) first isDigit ifTrue:[ |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1197 |
"/ date follows ... |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1198 |
idx := 2 |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1199 |
] ifFalse:[ |
2394 | 1200 |
idx := array indexOf:Separator startingAt:2. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1201 |
idx == 0 ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1202 |
"/ not a valid history string |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1203 |
^ nil |
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 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1206 |
idx ~~ 2 ifTrue:[ |
2394 | 1207 |
what := (array copyFrom:2 to:(idx-1)) asStringWith:(Character space). |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1208 |
inst what:what. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1209 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1210 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1211 |
idx := idx + 1. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1212 |
]. |
2394 | 1213 |
aDate := self convertStringToDate: (array at: idx). |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1214 |
inst date: aDate. |
2394 | 1215 |
(array at:idx+1) ~= Separator ifTrue:[^ nil]. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1216 |
idx := idx + 2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1217 |
|
2394 | 1218 |
aTime := self convertStringToTime: (array at: idx). |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1219 |
inst time: aTime. |
2394 | 1220 |
(array at:idx+1) ~= Separator ifTrue:[^ nil]. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1221 |
idx := idx + 2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1222 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1223 |
"the user's name may be more that one word" |
2394 | 1224 |
userName := (array copyFrom:idx) asStringWith:Character space. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1225 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1226 |
inst user:userName. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1227 |
inst firstPositionInSourceCode:position. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1228 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1229 |
^ inst |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1230 |
|
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 |
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
|
1233 |
HistoryLine fromString: 'Created: 21.12.1993 / 18:32:30 / Felicitas Gabriele Felger' |
1204 | 1234 |
HistoryLine fromString: 'Deleted: 21.12.93 / 18:32:30 / Astrid Weisseise' |
1235 |
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
|
1236 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1237 |
|
2394 | 1238 |
"Modified: / 23-08-1995 / 22:24:47 / robert" |
1239 |
"Modified: / 19-09-1995 / 14:14:48 / claus" |
|
1240 |
"Modified: / 30-06-2011 / 16:09:16 / cg" |
|
1241 |
"Modified (Comment): / 30-06-2011 / 19:08:22 / cg" |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1242 |
! |
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 |
new |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1245 |
"get a new history line. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1246 |
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
|
1247 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1248 |
^ self type:ModifiedString what:nil |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1249 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1250 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1251 |
newCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1252 |
"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
|
1253 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1254 |
^ self type:CreatedString what:nil |
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 |
HistoryLine newCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1258 |
" |
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 |
"Modified: 23.8.1995 / 22:14:24 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1261 |
"Modified: 24.10.1997 / 00:18:30 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1262 |
! ! |
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 |
!HistoryManager::HistoryLine class methodsFor:'private'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1265 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1266 |
currentUserName |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1267 |
"return the current users name - |
2394 | 1268 |
that's either the userInfos-gecos field, or the users login name." |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1269 |
|
2095 | 1270 |
|nm| |
1271 |
||
1272 |
(nm := HistoryManager enforcedUserName) notNil ifTrue:[ |
|
1273 |
^ nm |
|
1495 | 1274 |
]. |
2435
68d8d3b3db29
HistoryManager fixes (takes user signature from preferences)
vrany
parents:
2423
diff
changeset
|
1275 |
|
68d8d3b3db29
HistoryManager fixes (takes user signature from preferences)
vrany
parents:
2423
diff
changeset
|
1276 |
(nm := UserPreferences current historyManagerSignature) notNil ifTrue:[ |
68d8d3b3db29
HistoryManager fixes (takes user signature from preferences)
vrany
parents:
2423
diff
changeset
|
1277 |
^ nm |
68d8d3b3db29
HistoryManager fixes (takes user signature from preferences)
vrany
parents:
2423
diff
changeset
|
1278 |
]. |
68d8d3b3db29
HistoryManager fixes (takes user signature from preferences)
vrany
parents:
2423
diff
changeset
|
1279 |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1280 |
UseGECOS == true ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1281 |
^ OperatingSystem getFullUserName. |
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 |
^ (OperatingSystem getLoginName). |
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 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1286 |
HistoryLine currentUserName |
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 |
|
1495 | 1289 |
"Modified: / 15-07-1996 / 12:43:14 / cg" |
1290 |
"Modified: / 20-06-2006 / 13:26:49 / User" |
|
2435
68d8d3b3db29
HistoryManager fixes (takes user signature from preferences)
vrany
parents:
2423
diff
changeset
|
1291 |
"Modified: / 08-07-2011 / 10:24:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1292 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1293 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1294 |
type:type what:what |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1295 |
"private - for integration purposes only" |
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 |
| inst | |
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 |
inst := self basicNew. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1300 |
inst date: Date today. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1301 |
inst time: Time now. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1302 |
inst firstPositionInSourceCode: 0. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1303 |
inst user:(self currentUserName). |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1304 |
inst type:type. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1305 |
inst what:what. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1306 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1307 |
^ inst |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1308 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1309 |
"Modified: 23.08.1995 / 21:35:44 / robert" |
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 |
!HistoryManager::HistoryLine methodsFor:'accessing'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1313 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1314 |
date |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1315 |
"return the date" |
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 |
^ date |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1318 |
|
2394 | 1319 |
"Modified (Format): / 30-06-2011 / 16:23:15 / cg" |
624
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 |
date:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1323 |
"set the date" |
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 |
date := something. |
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 |
"Modified: 20.4.1996 / 20:22:16 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1328 |
! |
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 |
firstPositionInSourceCode |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1331 |
"return firstPositionInSourceCode" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1332 |
|
1081 | 1333 |
^ firstPositionInSourceCode |
1334 |
! |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1335 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1336 |
firstPositionInSourceCode:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1337 |
"set firstPositionInSourceCode" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1338 |
|
1081 | 1339 |
firstPositionInSourceCode := something. |
1340 |
! |
|
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1341 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1342 |
isForAddition |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1343 |
type := AddedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1344 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1345 |
|
2394 | 1346 |
isForCommented |
1347 |
type := CommentedString |
|
1348 |
||
1349 |
"Created: / 30-06-2011 / 12:24:22 / cg" |
|
1350 |
! |
|
1351 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1352 |
isForCreation |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1353 |
type := CreatedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1354 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1355 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1356 |
isForDeletion |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1357 |
type := DeletedString |
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 |
|
2394 | 1360 |
isForFormatted |
1361 |
type := FormattedString |
|
1362 |
||
1363 |
"Created: / 30-06-2011 / 12:24:11 / cg" |
|
1364 |
! |
|
1365 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1366 |
isForModification |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1367 |
type := ModifiedString |
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 |
|
2394 | 1370 |
isForVariableRenamed |
1371 |
type := VariableRenamedString |
|
1372 |
||
1373 |
"Created: / 30-06-2011 / 12:24:36 / cg" |
|
1374 |
"Modified (Format): / 30-06-2011 / 12:28:27 / cg" |
|
1375 |
! |
|
1376 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1377 |
time |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1378 |
"return the time" |
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 |
^ time |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1381 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1382 |
"Modified: 20.4.1996 / 20:22:04 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1383 |
! |
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 |
time:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1386 |
"set the time" |
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 |
time := something. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1389 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1390 |
"Modified: 20.4.1996 / 20:21:58 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1391 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1392 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1393 |
type |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1394 |
"return the type" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1395 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1396 |
^ type |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1397 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1398 |
"Modified: 20.4.1996 / 20:21:54 / cg" |
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 |
type:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1402 |
"set the type" |
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 |
type := something. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1405 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1406 |
"Modified: 20.4.1996 / 20:21:39 / cg" |
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 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1409 |
user |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1410 |
"return the user" |
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 |
^ user |
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 |
"Modified: 20.4.1996 / 20:21:45 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1415 |
! |
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 |
user:something |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1418 |
"set the user" |
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 |
user := something. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1421 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1422 |
"Modified: 20.4.1996 / 20:21:48 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1423 |
! |
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 |
what |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1426 |
"return the what-changed info" |
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 |
^ what |
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 |
"Modified: 20.4.1996 / 20:21:54 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1431 |
"Created: 24.10.1997 / 00:20:33 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1432 |
! |
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 |
what:someStringOrSelector |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1435 |
"set the what-changed info" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1436 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1437 |
what := someStringOrSelector |
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 |
"Modified: 20.4.1996 / 20:21:54 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1440 |
"Created: 24.10.1997 / 00:21:00 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1441 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1442 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1443 |
!HistoryManager::HistoryLine methodsFor:'comparing'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1444 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1445 |
= aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1446 |
"compares two instances of HistoryLine" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1447 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1448 |
(aHistoryLine user = self user) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1449 |
(aHistoryLine date = self date) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1450 |
(aHistoryLine time = self time) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1451 |
(aHistoryLine type = self type) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1452 |
(aHistoryLine what = self what) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1453 |
^ true |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1454 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1455 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1456 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1457 |
] |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1458 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1459 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1460 |
^ false |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1461 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1462 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1463 |
| h1 h2 | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1464 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1465 |
h1 := HistoryLine for: OperatingSystem getLoginName. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1466 |
h2 := h1 copy. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1467 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1468 |
h1 = h2 ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1469 |
InfoBox new title: 'users are equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1470 |
]. |
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 |
h2 := HistoryLine for: OperatingSystem getLoginName. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1473 |
h1 = h2 ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1474 |
InfoBox new title: 'users are not equal'; show. |
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 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1477 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1478 |
"Modified: 23.8.1995 / 22:26:40 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1479 |
"Modified: 24.10.1997 / 00:22:09 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1480 |
! |
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 |
hash |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1483 |
"return a hash key for the receiver" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1484 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1485 |
^user hash |
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 |
Check hashCode |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1489 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1490 |
|h1 h2 oc | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1491 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1492 |
h1 := HistoryLine new hash. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1493 |
h2 := HistoryLine new hash. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1494 |
oc := OrderedCollection new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1495 |
oc add: h1. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1496 |
oc add: h2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1497 |
^oc |
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 |
using hash in a set: |
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 |
| h1 h2 aSet oc | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1502 |
h1 := HistoryLine new hash. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1503 |
h2 := HistoryLine new hash. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1504 |
oc := OrderedCollection new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1505 |
oc add: h1. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1506 |
oc add: h2. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1507 |
aSet := oc asSet. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1508 |
^aSet |
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 |
"Modified: 23.08.1995 / 22:26:44 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1512 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1513 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1514 |
sameDate: aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1515 |
"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
|
1516 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1517 |
^aHistoryLine date = date |
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 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1520 |
| h1 h2 | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1521 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1522 |
h1 := HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1523 |
h2 := h1 copy. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1524 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1525 |
(h1 sameDate: h2) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1526 |
InfoBox new title: 'Dates are equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1527 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1528 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1529 |
h2 := HistoryLine for: 'R.Sailer'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1530 |
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
|
1531 |
(h1 sameDate: h2) ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1532 |
InfoBox new title: 'users are not equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1533 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1534 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1535 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1536 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1537 |
"Modified: 23.08.1995 / 22:26:47 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1538 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1539 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1540 |
sameType: aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1541 |
"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
|
1542 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1543 |
^aHistoryLine type = type |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1544 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1545 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1546 |
| h1 h2 | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1547 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1548 |
h1 := HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1549 |
h2 := h1 copy. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1550 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1551 |
(h1 sameType: h2) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1552 |
InfoBox new title: 'Types are equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1553 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1554 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1555 |
h2 := HistoryLine createdBy: 'R.Sailer'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1556 |
(h1 sameType: h2) ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1557 |
InfoBox new title: 'Types are not equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1558 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1559 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1560 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1561 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1562 |
"Modified: 23.08.1995 / 22:26:49 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1563 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1564 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1565 |
sameUser: aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1566 |
"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
|
1567 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1568 |
^aHistoryLine user = user |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1569 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1570 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1571 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1572 |
| h1 h2 | |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1573 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1574 |
h1 := HistoryLine new. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1575 |
h2 := h1 copy. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1576 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1577 |
(h1 sameUser: h2) ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1578 |
InfoBox new title: 'users are equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1579 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1580 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1581 |
h2 := HistoryLine for: 'R.Sailer'. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1582 |
(h1 sameUser: h2) ifFalse:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1583 |
InfoBox new title: 'users are not equal'; show. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1584 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1585 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1586 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1587 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1588 |
"Modified: 23.08.1995 / 22:26:51 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1589 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1590 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1591 |
sameWhat: aHistoryLine |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1592 |
"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
|
1593 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1594 |
^aHistoryLine what = what |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1595 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1596 |
"Created: 24.10.1997 / 00:21:46 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1597 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1598 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1599 |
!HistoryManager::HistoryLine methodsFor:'printing & storing'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1600 |
|
643
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1601 |
printOn:aStream |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1602 |
"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
|
1603 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1604 |
aStream nextPutAll:IndentString. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1605 |
aStream nextPutAll:Quote. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1606 |
aStream nextPutAll:type. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1607 |
what notNil ifTrue:[ |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1608 |
aStream space. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1609 |
aStream nextPutAll:what. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1610 |
]. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1611 |
aStream space; nextPutAll:Separator; space. |
1371
e537165f5215
date printing (language specifics)
Claus Gittinger <cg@exept.de>
parents:
1204
diff
changeset
|
1612 |
date printOn:aStream language:#en. |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1613 |
aStream space; nextPutAll:Separator; space. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1614 |
time print24HourFormatOn:aStream. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1615 |
aStream space; nextPutAll:Separator; space. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1616 |
aStream nextPutAll:user. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1617 |
aStream nextPutAll:Quote. |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1618 |
|
643
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1619 |
" |
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1620 |
self new printOn:Transcript |
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1621 |
" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1622 |
|
643
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1623 |
"Modified: / 24.10.1997 / 02:07:23 / cg" |
360e30f96f4b
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
635
diff
changeset
|
1624 |
"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
|
1625 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1626 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1627 |
!HistoryManager::HistoryLine methodsFor:'queries'! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1628 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1629 |
isCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1630 |
"returns true if the bodytext is CreatedString" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1631 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1632 |
^type = CreatedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1633 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1634 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1635 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1636 |
HistoryLine new isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1637 |
(HistoryLine for: 'R.Sailer') isCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1638 |
(HistoryLine createdBy: 'R.Sailer') isCreated |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1639 |
HistoryLine deleted isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1640 |
(HistoryLine deletedBy: 'M.Noell') isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1641 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1642 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1643 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1644 |
"Modified: 23.8.1995 / 22:30:23 / robert" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1645 |
"Modified: 20.4.1996 / 20:20:36 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1646 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1647 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1648 |
isDeleted |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1649 |
"returns true if the bodytext is DeletedString" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1650 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1651 |
^type = DeletedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1652 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1653 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1654 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1655 |
HistoryLine deleted isDeleted |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1656 |
HistoryLine new isDeleted |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1657 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1658 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1659 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1660 |
" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1661 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1662 |
"Modified: 20.4.1996 / 20:20:32 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1663 |
! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1664 |
|
2394 | 1665 |
isKindOfModified |
1666 |
"returns true if the bodytext is ModifiedString" |
|
1667 |
||
1668 |
^ self isModified |
|
1669 |
or:[ type = CommentedString |
|
1670 |
or:[ type = FormattedString |
|
1671 |
or:[ type = VariableRenamedString ]]] |
|
1672 |
||
1673 |
" |
|
1674 |
HistoryLine new isModified |
|
1675 |
(HistoryLine for: 'R.Sailer') isModified |
|
1676 |
HistoryLine deleted isModified |
|
1677 |
(HistoryLine deletedBy: 'M.Noell') isModified |
|
1678 |
" |
|
1679 |
||
1680 |
"Created: / 30-06-2011 / 17:15:12 / cg" |
|
1681 |
! |
|
1682 |
||
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1683 |
isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1684 |
"returns true if the bodytext is ModifiedString" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1685 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1686 |
^type = ModifiedString |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1687 |
|
2394 | 1688 |
" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1689 |
HistoryLine new isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1690 |
(HistoryLine for: 'R.Sailer') isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1691 |
HistoryLine deleted isModified |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1692 |
(HistoryLine deletedBy: 'M.Noell') isModified |
2394 | 1693 |
" |
624
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1694 |
|
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1695 |
"Modified: 20.4.1996 / 20:20:29 / cg" |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1696 |
! ! |
93c286b0509a
much better history in history method
Claus Gittinger <cg@exept.de>
parents:
597
diff
changeset
|
1697 |
|
504 | 1698 |
!HistoryManager class methodsFor:'documentation'! |
119 | 1699 |
|
2317
d62da5a37fc3
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
1700 |
version_CVS |
3011
1997ff6e7e55
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2641
diff
changeset
|
1701 |
^ '§Header: /cvs/stx/stx/libbasic3/HistoryManager.st,v 1.82 2011/12/04 14:45:34 cg Exp §' |
3012 | 1702 |
! |
1703 |
||
1704 |
version_SVN |
|
3042
48e76977cdc3
Added info-record processing support into changeset reader
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
1705 |
^ '$Id: HistoryManager.st 1909 2012-03-31 00:14:49Z vranyj1 $' |
119 | 1706 |
! ! |
1192
5aea356953d7
Senders use Userpreference setting to choose conversion
Claus Gittinger <cg@exept.de>
parents:
1153
diff
changeset
|
1707 |
|
41 | 1708 |
HistoryManager initialize! |
3012 | 1709 |
HistoryManager::HistoryLine initialize! |