author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 12 Mar 2013 10:31:15 +0000 | |
branch | jv |
changeset 3125 | 08d6603c4fe9 |
parent 3078 | 3f5abbdcbde9 |
child 3128 | 87750af738dc |
permissions | -rw-r--r-- |
25 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
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 |
" |
|
957 | 12 |
"{ Package: 'stx:libbasic3' }" |
13 |
||
15 | 14 |
MethodChange subclass:#MethodCategoryChange |
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
15 |
instanceVariableNames:'origin' |
235 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'System-Changes' |
|
15 | 19 |
! |
20 |
||
25 | 21 |
!MethodCategoryChange class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
45 | 37 |
documentation |
38 |
" |
|
39 |
instances represent method-category changes (as done in the browser). |
|
40 |
They are typically held in a ChangeSet. |
|
235 | 41 |
|
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
42 |
Change origin. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
43 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
44 |
When a changeset diff is generated, two MethodChanges that |
3069 | 45 |
represent the same method (code is the same) might differ only in |
46 |
category/ Such changes are transformed to MethodCategoruChanges. |
|
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
47 |
In that case, origin keeps the reference to original MethodChange. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
48 |
|
235 | 49 |
[author:] |
50 |
Claus Gittinger |
|
3069 | 51 |
Jan Vrany |
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
52 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
53 |
[instance variables:] |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
54 |
origin <MethodChange> Change that cause this category |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
55 |
change to be created. See comment. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
56 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
57 |
|
45 | 58 |
" |
25 | 59 |
! ! |
60 |
||
3078 | 61 |
!MethodCategoryChange class methodsFor:'others'! |
62 |
||
63 |
version_CVS |
|
64 |
^ '§Header: /cvs/stx/stx/libbasic3/MethodCategoryChange.st,v 1.22 2012/07/31 12:27:40 vrany Exp §' |
|
65 |
! ! |
|
66 |
||
15 | 67 |
!MethodCategoryChange methodsFor:'accessing'! |
68 |
||
69 |
class:cls selector:sel category:cat |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
70 |
self className:cls name selector:sel category:cat |
15 | 71 |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
72 |
"Modified: / 12-11-2006 / 15:55:11 / cg" |
85 | 73 |
! |
74 |
||
654 | 75 |
className:clsName selector:sel category:cat |
76 |
className := clsName. |
|
77 |
selector := sel. |
|
852 | 78 |
methodCategory := cat |
654 | 79 |
|
80 |
"Created: / 16.2.1998 / 14:14:16 / cg" |
|
81 |
! |
|
82 |
||
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
83 |
origin |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
84 |
^ origin |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
85 |
! |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
86 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
87 |
origin:aMethodChange |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
88 |
origin := aMethodChange. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
89 |
! |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
90 |
|
1052 | 91 |
prettyPrintedSource |
1846 | 92 |
^ self sourceForMethod, Character cr |
1052 | 93 |
, ' category:' , methodCategory storeString |
1846 | 94 |
|
95 |
"Modified: / 09-10-2006 / 13:59:15 / cg" |
|
1052 | 96 |
! |
97 |
||
85 | 98 |
source |
1846 | 99 |
^ self sourceForMethod , ' category:' , methodCategory storeString |
852 | 100 |
|
1846 | 101 |
"Modified: / 09-10-2006 / 13:59:10 / cg" |
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
102 |
! |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
103 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
104 |
source: aString |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
105 |
| expr | |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
106 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
107 |
expr := Parser parseExpression: aString onError: [ self error: 'Invalid source']. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
108 |
expr isMessage ifFalse:[ self error: 'Invalid source' ]. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
109 |
expr selector == #'category:' ifFalse:[ self error: 'Invalid source' ]. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
110 |
methodCategory := expr arguments first value. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
111 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
112 |
"Created: / 20-03-2012 / 22:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
852 | 113 |
! ! |
114 |
||
115 |
!MethodCategoryChange methodsFor:'applying'! |
|
116 |
||
117 |
apply |
|
118 |
"apply the change" |
|
85 | 119 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
120 |
|mthd| |
852 | 121 |
|
122 |
mthd := self changeMethod. |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
123 |
mthd category:methodCategory asSymbol. |
852 | 124 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
125 |
"Modified: / 23-11-2006 / 16:59:09 / cg" |
15 | 126 |
! ! |
127 |
||
2131 | 128 |
!MethodCategoryChange methodsFor:'testing'! |
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
129 |
|
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
130 |
isMethodCategoryChange |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
131 |
^ true |
2263 | 132 |
! |
133 |
||
134 |
isMethodCodeChange |
|
135 |
"true if this is a method's code change (not package, category etc.)" |
|
136 |
||
137 |
^ false |
|
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
138 |
! ! |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
139 |
|
2622
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
140 |
!MethodCategoryChange methodsFor:'visiting'! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
141 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
142 |
acceptChangeVisitor:aVisitor |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
143 |
^ aVisitor visitMethodCategoryChange:self. |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
144 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
145 |
"Created: / 25-11-2011 / 17:13:58 / cg" |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
146 |
! ! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
147 |
|
235 | 148 |
!MethodCategoryChange class methodsFor:'documentation'! |
149 |
||
150 |
version |
|
3078 | 151 |
^ '$Header: /cvs/stx/stx/libbasic3/MethodCategoryChange.st,v 1.22 2012/07/31 12:27:40 vrany Exp $' |
3012 | 152 |
! |
153 |
||
3125
08d6603c4fe9
New check in ProjectChecker.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
154 |
version_HG |
08d6603c4fe9
New check in ProjectChecker.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
155 |
|
08d6603c4fe9
New check in ProjectChecker.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
156 |
^ '$Changeset: <not expanded> $' |
08d6603c4fe9
New check in ProjectChecker.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
157 |
! |
08d6603c4fe9
New check in ProjectChecker.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
158 |
|
3012 | 159 |
version_SVN |
3078 | 160 |
^ '$Id: MethodCategoryChange.st 1957 2012-09-05 11:45:38Z vranyj1 $' |
3012 | 161 |
! ! |
3125
08d6603c4fe9
New check in ProjectChecker.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3078
diff
changeset
|
162 |