author | Claus Gittinger <cg@exept.de> |
Tue, 22 Aug 2000 13:10:19 +0200 | |
changeset 956 | 0c6c209df4e9 |
parent 911 | cecf421ee767 |
child 963 | a4fb4b9f7e72 |
permissions | -rw-r--r-- |
4 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
25 | 3 |
All Rights Reserved |
4 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
0 | 12 |
|
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
13 |
"{ Package: 'stx:libbasic3' }" |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
14 |
|
0 | 15 |
ClassChange subclass:#MethodChange |
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
16 |
instanceVariableNames:'selector methodCategory privacy previousVersion' |
235 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
19 |
category:'System-Changes' |
|
0 | 20 |
! |
21 |
||
25 | 22 |
!MethodChange class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
10 | 28 |
|
25 | 29 |
This software is furnished under a license and may be used |
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
45 | 38 |
documentation |
39 |
" |
|
40 |
instances represent method-changes (as done in the browser). |
|
41 |
They are typically held in a ChangeSet. |
|
235 | 42 |
|
43 |
[author:] |
|
44 |
Claus Gittinger |
|
45 | 45 |
" |
25 | 46 |
! ! |
10 | 47 |
|
0 | 48 |
!MethodChange class methodsFor:'instance creation'! |
49 |
||
102
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
50 |
class:cls selector:sel source:src category:cat |
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
51 |
^ self basicNew class:cls selector:sel source:src category:cat |
0 | 52 |
! ! |
53 |
||
54 |
!MethodChange methodsFor:'accessing'! |
|
55 |
||
911 | 56 |
category: aCategory |
57 |
methodCategory := aCategory |
|
58 |
||
59 |
"Created: / 7.2.1998 / 19:47:53 / cg" |
|
60 |
! |
|
61 |
||
852 | 62 |
changeMethod |
63 |
|cls| |
|
64 |
||
65 |
cls := self changeClass. |
|
66 |
cls isNil ifTrue:[^ nil]. |
|
67 |
^ cls compiledMethodAt:selector |
|
68 |
||
69 |
"Created: / 7.2.1998 / 19:47:53 / cg" |
|
70 |
! |
|
71 |
||
850 | 72 |
changeSelector |
73 |
^ selector |
|
74 |
||
75 |
"Created: / 6.2.1998 / 13:29:25 / cg" |
|
76 |
! |
|
77 |
||
102
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
78 |
class:cls selector:sel source:src category:cat |
0 | 79 |
className := cls name. |
80 |
selector := sel. |
|
102
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
81 |
source := src. |
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
82 |
methodCategory := cat |
648 | 83 |
! |
84 |
||
654 | 85 |
className:clsName selector:sel source:src category:cat |
86 |
className := clsName. |
|
87 |
selector := sel. |
|
88 |
source := src. |
|
89 |
methodCategory := cat |
|
90 |
||
91 |
"Created: / 16.2.1998 / 12:29:49 / cg" |
|
92 |
! |
|
93 |
||
94 |
className:clsName selector:sel source:src category:cat privacy:priv |
|
95 |
className := clsName. |
|
96 |
selector := sel. |
|
97 |
source := src. |
|
98 |
methodCategory := cat. |
|
99 |
privacy := priv. |
|
100 |
||
101 |
"Created: / 16.2.1998 / 12:29:49 / cg" |
|
102 |
"Modified: / 16.2.1998 / 14:28:12 / cg" |
|
103 |
! |
|
104 |
||
652 | 105 |
methodCategory |
106 |
^ methodCategory |
|
107 |
||
108 |
"Created: / 7.2.1998 / 19:47:53 / cg" |
|
109 |
! |
|
110 |
||
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
111 |
previousVersion |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
112 |
"return the value of the instance variable 'previousVersion' (automatically generated)" |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
113 |
|
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
114 |
^ previousVersion! |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
115 |
|
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
116 |
previousVersion:something |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
117 |
"set the value of the instance variable 'previousVersion' (automatically generated)" |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
118 |
|
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
119 |
previousVersion := something.! |
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
120 |
|
648 | 121 |
selector |
122 |
^ selector |
|
123 |
||
124 |
"Created: / 6.2.1998 / 13:29:25 / cg" |
|
911 | 125 |
! |
126 |
||
127 |
selector:aSymbol |
|
128 |
selector := aSymbol |
|
129 |
||
130 |
"Created: / 6.2.1998 / 13:29:25 / cg" |
|
0 | 131 |
! ! |
132 |
||
849 | 133 |
!MethodChange methodsFor:'applying'! |
134 |
||
135 |
apply |
|
136 |
"apply the change" |
|
137 |
||
138 |
|class| |
|
139 |
||
140 |
class := Smalltalk classNamed:className. |
|
141 |
class compile:source classified:methodCategory logged:true. |
|
142 |
||
143 |
||
144 |
! ! |
|
145 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
146 |
!MethodChange methodsFor:'comparing'! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
147 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
148 |
isForSameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
149 |
"return true, if the given change represents a change for the same |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
150 |
thingy as the receiver (i.e. same method, same definition etc.)." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
151 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
152 |
"/ I am a methodChange - B must be as well. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
153 |
changeB isMethodChange ifFalse:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
154 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
155 |
className ~= changeB className ifTrue:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
156 |
selector ~= changeB selector ifTrue:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
157 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
158 |
^ true |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
159 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
160 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
161 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
162 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
163 |
! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
164 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
165 |
sameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
166 |
"return true, if the given change represents the same change as the receiver." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
167 |
|
798 | 168 |
(self isForSameAs:changeB) ifFalse:[^ false]. |
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
169 |
^ self sameSourceAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
170 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
171 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
172 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
173 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
174 |
! ! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
175 |
|
0 | 176 |
!MethodChange methodsFor:'printing'! |
177 |
||
7 | 178 |
printOn:aStream |
800 | 179 |
"append a user printed representation of the receiver to aStream. |
180 |
The format is suitable for a human - not meant to be read back." |
|
181 |
||
7 | 182 |
aStream nextPutAll:className; |
800 | 183 |
space; |
184 |
nextPutAll:selector |
|
779 | 185 |
! |
186 |
||
896 | 187 |
printWithoutClassNameOn:aStream |
188 |
(className endsWith:' class') ifTrue:[ |
|
189 |
aStream nextPutAll:'class ' |
|
190 |
]. |
|
191 |
aStream nextPutAll:selector |
|
192 |
! |
|
193 |
||
194 |
printWithoutOwningClassOn:aStream |
|
195 |
self halt. |
|
779 | 196 |
(className endsWith:' class') ifTrue:[ |
197 |
aStream nextPutAll:'class ' |
|
198 |
]. |
|
199 |
aStream nextPutAll:selector |
|
0 | 200 |
! ! |
235 | 201 |
|
652 | 202 |
!MethodChange methodsFor:'queries'! |
203 |
||
204 |
isMethodChange |
|
205 |
^ true |
|
206 |
||
207 |
"Created: / 7.2.1998 / 19:26:59 / cg" |
|
208 |
! ! |
|
209 |
||
235 | 210 |
!MethodChange class methodsFor:'documentation'! |
211 |
||
212 |
version |
|
956
0c6c209df4e9
keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents:
911
diff
changeset
|
213 |
^ '$Header: /cvs/stx/stx/libbasic3/MethodChange.st,v 1.26 2000-08-22 11:10:19 cg Exp $' |
235 | 214 |
! ! |