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