author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 31 Mar 2012 01:14:49 +0100 | |
branch | jv |
changeset 3042 | 48e76977cdc3 |
parent 3034 | c892671f3e2a |
child 3069 | 89d2cfee177f |
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 |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
45 |
represent the same method (code is the same) but differ in |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
46 |
category, those two methods are transformed to MethodCategoruChanges. |
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 |
|
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
51 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
52 |
[instance variables:] |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
53 |
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
|
54 |
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
|
55 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
56 |
|
45 | 57 |
" |
25 | 58 |
! ! |
59 |
||
15 | 60 |
!MethodCategoryChange methodsFor:'accessing'! |
61 |
||
62 |
class:cls selector:sel category:cat |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
63 |
self className:cls name selector:sel category:cat |
15 | 64 |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
65 |
"Modified: / 12-11-2006 / 15:55:11 / cg" |
85 | 66 |
! |
67 |
||
654 | 68 |
className:clsName selector:sel category:cat |
69 |
className := clsName. |
|
70 |
selector := sel. |
|
852 | 71 |
methodCategory := cat |
654 | 72 |
|
73 |
"Created: / 16.2.1998 / 14:14:16 / cg" |
|
74 |
! |
|
75 |
||
3034
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
76 |
origin |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
77 |
^ origin |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
78 |
! |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
79 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
80 |
origin:aMethodChange |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
81 |
origin := aMethodChange. |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
82 |
! |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
83 |
|
1052 | 84 |
prettyPrintedSource |
1846 | 85 |
^ self sourceForMethod, Character cr |
1052 | 86 |
, ' category:' , methodCategory storeString |
1846 | 87 |
|
88 |
"Modified: / 09-10-2006 / 13:59:15 / cg" |
|
1052 | 89 |
! |
90 |
||
85 | 91 |
source |
1846 | 92 |
^ self sourceForMethod , ' category:' , methodCategory storeString |
852 | 93 |
|
1846 | 94 |
"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
|
95 |
! |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
96 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
97 |
source: aString |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
98 |
| expr | |
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
99 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
100 |
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
|
101 |
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
|
102 |
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
|
103 |
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
|
104 |
|
c892671f3e2a
Improvements in merge tool - npw it could merge libtool3
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
105 |
"Created: / 20-03-2012 / 22:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
852 | 106 |
! ! |
107 |
||
108 |
!MethodCategoryChange methodsFor:'applying'! |
|
109 |
||
110 |
apply |
|
111 |
"apply the change" |
|
85 | 112 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
113 |
|mthd| |
852 | 114 |
|
115 |
mthd := self changeMethod. |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
116 |
mthd category:methodCategory asSymbol. |
852 | 117 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
118 |
"Modified: / 23-11-2006 / 16:59:09 / cg" |
15 | 119 |
! ! |
120 |
||
2131 | 121 |
!MethodCategoryChange methodsFor:'testing'! |
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
122 |
|
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
123 |
isMethodCategoryChange |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
124 |
^ true |
2263 | 125 |
! |
126 |
||
127 |
isMethodCodeChange |
|
128 |
"true if this is a method's code change (not package, category etc.)" |
|
129 |
||
130 |
^ false |
|
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
131 |
! ! |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
132 |
|
2622
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
133 |
!MethodCategoryChange methodsFor:'visiting'! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
134 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
135 |
acceptChangeVisitor:aVisitor |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
136 |
^ aVisitor visitMethodCategoryChange:self. |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
137 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
138 |
"Created: / 25-11-2011 / 17:13:58 / cg" |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
139 |
! ! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
140 |
|
235 | 141 |
!MethodCategoryChange class methodsFor:'documentation'! |
142 |
||
143 |
version |
|
3042
48e76977cdc3
Added info-record processing support into changeset reader
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3034
diff
changeset
|
144 |
^ '$Id: MethodCategoryChange.st 1909 2012-03-31 00:14:49Z vranyj1 $' |
2263 | 145 |
! |
146 |
||
147 |
version_CVS |
|
3011
1997ff6e7e55
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2622
diff
changeset
|
148 |
^ '§Header: /cvs/stx/stx/libbasic3/MethodCategoryChange.st,v 1.21 2011/11/25 16:45:29 cg Exp §' |
3012 | 149 |
! |
150 |
||
151 |
version_SVN |
|
3042
48e76977cdc3
Added info-record processing support into changeset reader
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3034
diff
changeset
|
152 |
^ '$Id: MethodCategoryChange.st 1909 2012-03-31 00:14:49Z vranyj1 $' |
3012 | 153 |
! ! |