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