MethodChange.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 31 May 2018 10:52:50 +0100
branchjv
changeset 4330 998eb03f0736
parent 4258 e2bba335c949
permissions -rw-r--r--
Copyright updates
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
     1
"
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
4330
998eb03f0736 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4258
diff changeset
     3
 COPYRIGHT (c) 2015 Jan Vrany
998eb03f0736 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4258
diff changeset
     4
 COPYRIGHT (c) 2017 Jan Vrany
25
claus
parents: 10
diff changeset
     5
	       All Rights Reserved
4
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
     6
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
     7
 This software is furnished under a license and may be used
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
     8
 only in accordance with the terms of that license and with the
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
    10
 be provided or otherwise made available to, or used by, any
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
    11
 other person.  No title to or ownership of the software is
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
    12
 hereby transferred.
7744cd9b1453 *** empty log message ***
claus
parents: 0
diff changeset
    13
"
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
    14
"{ Package: 'stx:libbasic3' }"
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
    15
3774
927ab9fa567e class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    16
"{ NameSpace: Smalltalk }"
927ab9fa567e class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    17
0
470788421600 Initial revision
claus
parents:
diff changeset
    18
ClassChange subclass:#MethodChange
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
    19
	instanceVariableNames:'selector methodCategory privacy previousVersion'
2509
173f64701e6a class definition
Claus Gittinger <cg@exept.de>
parents: 2503
diff changeset
    20
	classVariableNames:'LastReplacementClass'
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    21
	poolDictionaries:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    22
	category:'System-Changes'
0
470788421600 Initial revision
claus
parents:
diff changeset
    23
!
470788421600 Initial revision
claus
parents:
diff changeset
    24
1325
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    25
MethodChange subclass:#NamedMethodChange
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    26
	instanceVariableNames:'changeName'
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    27
	classVariableNames:''
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    28
	poolDictionaries:''
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    29
	privateIn:MethodChange
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    30
!
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
    31
25
claus
parents: 10
diff changeset
    32
!MethodChange class methodsFor:'documentation'!
claus
parents: 10
diff changeset
    33
claus
parents: 10
diff changeset
    34
copyright
claus
parents: 10
diff changeset
    35
"
claus
parents: 10
diff changeset
    36
 COPYRIGHT (c) 1993 by Claus Gittinger
4330
998eb03f0736 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4258
diff changeset
    37
 COPYRIGHT (c) 2015 Jan Vrany
998eb03f0736 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4258
diff changeset
    38
 COPYRIGHT (c) 2017 Jan Vrany
25
claus
parents: 10
diff changeset
    39
	       All Rights Reserved
10
676ce0471de4 *** empty log message ***
claus
parents: 7
diff changeset
    40
25
claus
parents: 10
diff changeset
    41
 This software is furnished under a license and may be used
claus
parents: 10
diff changeset
    42
 only in accordance with the terms of that license and with the
claus
parents: 10
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
claus
parents: 10
diff changeset
    44
 be provided or otherwise made available to, or used by, any
claus
parents: 10
diff changeset
    45
 other person.  No title to or ownership of the software is
claus
parents: 10
diff changeset
    46
 hereby transferred.
claus
parents: 10
diff changeset
    47
"
claus
parents: 10
diff changeset
    48
!
claus
parents: 10
diff changeset
    49
45
claus
parents: 39
diff changeset
    50
documentation
claus
parents: 39
diff changeset
    51
"
claus
parents: 39
diff changeset
    52
    instances represent method-changes (as done in the browser). 
claus
parents: 39
diff changeset
    53
    They are typically held in a ChangeSet.
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    54
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    55
    [author:]
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    56
        Claus Gittinger
45
claus
parents: 39
diff changeset
    57
"
25
claus
parents: 10
diff changeset
    58
! !
10
676ce0471de4 *** empty log message ***
claus
parents: 7
diff changeset
    59
0
470788421600 Initial revision
claus
parents:
diff changeset
    60
!MethodChange class methodsFor:'instance creation'!
470788421600 Initial revision
claus
parents:
diff changeset
    61
102
3f85fe87cc58 include category in methodChanges
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    62
class:cls selector:sel source:src category:cat
3f85fe87cc58 include category in methodChanges
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    63
    ^ self basicNew class:cls selector:sel source:src category:cat
1073
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
    64
!
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
    65
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
    66
className:clsName selector:sel source:src category:cat
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
    67
    ^ self basicNew className:clsName selector:sel source:src category:cat
0
470788421600 Initial revision
claus
parents:
diff changeset
    68
! !
470788421600 Initial revision
claus
parents:
diff changeset
    69
470788421600 Initial revision
claus
parents:
diff changeset
    70
!MethodChange methodsFor:'accessing'!
470788421600 Initial revision
claus
parents:
diff changeset
    71
1073
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
    72
category
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
    73
    ^ methodCategory 
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
    74
!
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
    75
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
    76
category: aCategory
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
    77
    methodCategory := aCategory
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
    78
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
    79
    "Created: / 7.2.1998 / 19:47:53 / cg"
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
    80
!
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
    81
852
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
    82
changeMethod
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
    83
    |cls|
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
    84
3880
13c1b7cd6c1d Oops, moved #changeMethod back to stx:libbasic3.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
    85
    selector isNil ifTrue:[ ^ nil ].
852
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
    86
    cls := self changeClass.
3902
afa169d26bf8 class: MethodChange
Stefan Vogel <sv@exept.de>
parents: 3835
diff changeset
    87
    (cls isNil or:[selector isNil]) ifTrue:[^ nil].
3880
13c1b7cd6c1d Oops, moved #changeMethod back to stx:libbasic3.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
    88
    ^ cls compiledMethodAt:selector asSymbol
852
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
    89
3880
13c1b7cd6c1d Oops, moved #changeMethod back to stx:libbasic3.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
    90
    "Created: / 07-02-1998 / 19:47:53 / cg"
13c1b7cd6c1d Oops, moved #changeMethod back to stx:libbasic3.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
    91
    "Modified: / 14-07-2014 / 09:43:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
852
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
    92
!
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
    93
850
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 849
diff changeset
    94
changeSelector
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 849
diff changeset
    95
    ^ selector
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 849
diff changeset
    96
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 849
diff changeset
    97
    "Created: / 6.2.1998 / 13:29:25 / cg"
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 849
diff changeset
    98
!
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 849
diff changeset
    99
3989
0a0b87758e01 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   100
class:cls selector:sel source:src category:cat
0a0b87758e01 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   101
    self className:(cls name) selector:sel source:src category:cat
648
b7e0ef4b3781 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   102
!
b7e0ef4b3781 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   103
3443
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   104
classIsJava
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   105
    "Returns true, if this change is for Java class (i.e., if it is for
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   106
     Smalltalk method that extends Java class)"
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   107
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   108
    ^ classIsJava
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   109
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   110
    "Modified (comment): / 29-01-2013 / 14:11:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   111
!
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   112
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   113
classIsJava:aBoolean
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   114
    "Sets whether this change is for Java class (i.e., if it is for
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   115
     Smalltalk method that extends Java class)"
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   116
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   117
    classIsJava := aBoolean.
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   118
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   119
    "Modified (comment): / 29-01-2013 / 14:11:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   120
!
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   121
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   122
className
3995
46563fbc6a28 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
   123
    classIsJava == true ifTrue:[ ^ className].
46563fbc6a28 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
   124
    ^ super className
3443
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   125
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   126
    "Created: / 29-01-2013 / 14:21:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   127
    "Modified: / 30-01-2013 / 10:00:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   128
!
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   129
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   130
className:clsName selector:sel source:src category:cat
1288
a18544df474d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
   131
    self className:clsName selector:sel source:src category:cat privacy:nil
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   132
!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   133
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   134
className:clsName selector:sel source:src category:cat privacy:priv
2258
b976e8e2874e comment/format in: #selector:
Claus Gittinger <cg@exept.de>
parents: 2257
diff changeset
   135
    self assert:(src isString).
b976e8e2874e comment/format in: #selector:
Claus Gittinger <cg@exept.de>
parents: 2257
diff changeset
   136
    self assert:(sel isString or:[sel isSymbol]).
1288
a18544df474d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1234
diff changeset
   137
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   138
    className := clsName.
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   139
    selector := sel.
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   140
    source := src.
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   141
    methodCategory := cat.
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   142
    privacy := priv.
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   143
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   144
    "Created: / 16.2.1998 / 12:29:49 / cg"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   145
    "Modified: / 16.2.1998 / 14:28:12 / cg"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   146
!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 652
diff changeset
   147
2503
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   148
deltaDetail
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   149
    "Returns a delta to the current state as a ChangeDelta object"
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   150
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   151
    | mth mySource imageSource|
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   152
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   153
    self isMethodCodeChange ifFalse:[^super deltaDetail].
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   154
    mth := self changeMethod.
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   155
    mth isNil ifTrue:[^ ChangeDeltaInformation added ].
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   156
    mySource := self source.
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   157
    imageSource := mth source.
3138
0442e4f23d39 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 2944
diff changeset
   158
0442e4f23d39 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 2944
diff changeset
   159
    (self class isSource: mySource sameSourceAs: imageSource) ifTrue:[ 
0442e4f23d39 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 2944
diff changeset
   160
        ^ ChangeDeltaInformation identical 
0442e4f23d39 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 2944
diff changeset
   161
    ].
0442e4f23d39 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 2944
diff changeset
   162
    ^ ChangeDeltaInformation different
2503
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   163
bbdc31516652 added: #deltaDetail
Claus Gittinger <cg@exept.de>
parents: 2470
diff changeset
   164
    "Created: / 31-08-2011 / 10:27:58 / cg"
2369
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   165
!
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   166
2470
47bec7c32db6 Added #changeSource, #imageSource
vrany
parents: 2414
diff changeset
   167
imageSource
2846
221a345239fb comment/format in: #imageSource
Claus Gittinger <cg@exept.de>
parents: 2625
diff changeset
   168
    "return the source for the in-image version of the method"
2470
47bec7c32db6 Added #changeSource, #imageSource
vrany
parents: 2414
diff changeset
   169
47bec7c32db6 Added #changeSource, #imageSource
vrany
parents: 2414
diff changeset
   170
    | mth |
47bec7c32db6 Added #changeSource, #imageSource
vrany
parents: 2414
diff changeset
   171
2846
221a345239fb comment/format in: #imageSource
Claus Gittinger <cg@exept.de>
parents: 2625
diff changeset
   172
    self isMethodCodeChange ifFalse:[^ super imageSource].
2470
47bec7c32db6 Added #changeSource, #imageSource
vrany
parents: 2414
diff changeset
   173
    mth := self changeMethod.
2846
221a345239fb comment/format in: #imageSource
Claus Gittinger <cg@exept.de>
parents: 2625
diff changeset
   174
    ^ mth isNil 
221a345239fb comment/format in: #imageSource
Claus Gittinger <cg@exept.de>
parents: 2625
diff changeset
   175
        ifTrue: [nil] 
221a345239fb comment/format in: #imageSource
Claus Gittinger <cg@exept.de>
parents: 2625
diff changeset
   176
        ifFalse:[mth source]
2470
47bec7c32db6 Added #changeSource, #imageSource
vrany
parents: 2414
diff changeset
   177
47bec7c32db6 Added #changeSource, #imageSource
vrany
parents: 2414
diff changeset
   178
    "Created: / 19-07-2011 / 12:02:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2846
221a345239fb comment/format in: #imageSource
Claus Gittinger <cg@exept.de>
parents: 2625
diff changeset
   179
    "Modified (format): / 25-07-2012 / 17:37:52 / cg"
2470
47bec7c32db6 Added #changeSource, #imageSource
vrany
parents: 2414
diff changeset
   180
!
47bec7c32db6 Added #changeSource, #imageSource
vrany
parents: 2414
diff changeset
   181
652
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   182
methodCategory
1234
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   183
652
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   184
    ^ methodCategory
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   185
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   186
    "Created: / 7.2.1998 / 19:47:53 / cg"
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   187
!
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   188
1234
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   189
previousPackage
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   190
    | isNewMethod |
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   191
    isNewMethod := self previousVersion isNil.
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   192
    isNewMethod ifFalse:[
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   193
        ^ self previousVersion package.
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   194
    ].
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   195
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   196
    ^ nil
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   197
!
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   198
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   199
previousVersion
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   200
    "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
   201
1073
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
   202
    ^ previousVersion
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
   203
!
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   204
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   205
previousVersion:something
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   206
    "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
   207
1073
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
   208
    previousVersion := something.
627aafb2cfec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 963
diff changeset
   209
!
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 911
diff changeset
   210
1234
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   211
previousVersionSource
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   212
    "return the value of the instance variable 'previousVersion' (automatically generated)"
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   213
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   214
    previousVersion isNil ifTrue:[^ nil].
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   215
    ^ previousVersion source
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   216
!
2edbb63a70b7 james' package changes
james
parents: 1199
diff changeset
   217
2872
0d5507d570cd Merged from SVN
vrany
parents: 2846
diff changeset
   218
privacy
0d5507d570cd Merged from SVN
vrany
parents: 2846
diff changeset
   219
0d5507d570cd Merged from SVN
vrany
parents: 2846
diff changeset
   220
    ^privacy ? #public
0d5507d570cd Merged from SVN
vrany
parents: 2846
diff changeset
   221
0d5507d570cd Merged from SVN
vrany
parents: 2846
diff changeset
   222
    "Created: / 19-03-2012 / 18:16:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0d5507d570cd Merged from SVN
vrany
parents: 2846
diff changeset
   223
!
0d5507d570cd Merged from SVN
vrany
parents: 2846
diff changeset
   224
648
b7e0ef4b3781 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   225
selector
b7e0ef4b3781 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   226
    ^ selector
b7e0ef4b3781 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   227
b7e0ef4b3781 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   228
    "Created: / 6.2.1998 / 13:29:25 / cg"
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   229
!
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   230
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   231
selector:aSymbol
2257
808be4648d12 changed:
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
   232
    self assert:(aSymbol isSymbol).
808be4648d12 changed:
Claus Gittinger <cg@exept.de>
parents: 2187
diff changeset
   233
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   234
    selector := aSymbol
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   235
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 896
diff changeset
   236
    "Created: / 6.2.1998 / 13:29:25 / cg"
0
470788421600 Initial revision
claus
parents:
diff changeset
   237
! !
470788421600 Initial revision
claus
parents:
diff changeset
   238
849
d31825895bb2 preps to allow applying
Claus Gittinger <cg@exept.de>
parents: 800
diff changeset
   239
!MethodChange methodsFor:'applying'!
d31825895bb2 preps to allow applying
Claus Gittinger <cg@exept.de>
parents: 800
diff changeset
   240
d31825895bb2 preps to allow applying
Claus Gittinger <cg@exept.de>
parents: 800
diff changeset
   241
apply
d31825895bb2 preps to allow applying
Claus Gittinger <cg@exept.de>
parents: 800
diff changeset
   242
    "apply the change"
d31825895bb2 preps to allow applying
Claus Gittinger <cg@exept.de>
parents: 800
diff changeset
   243
3774
927ab9fa567e class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
   244
    |class replacementClassName suggestion oldMethodOrNil oldPackage 
927ab9fa567e class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
   245
     newPackage newMethod defClass|
1322
8ff0023c7694 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
   246
2020
5b3af99a4829 changed #apply: use #applyChange
Stefan Vogel <sv@exept.de>
parents: 1845
diff changeset
   247
    class := self changeClass.
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
   248
    class isNil ifTrue:[
2512
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   249
        "/ try the same replacement class again
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   250
        (LastReplacementClass notEmptyOrNil 
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   251
            and:[ (class := Smalltalk classNamed:LastReplacementClass) notNil
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   252
            and:[ 
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   253
                (className endsWith:' class') ifTrue:[
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   254
                    class := class theMetaclass
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   255
                ] ifFalse:[
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   256
                    class := class theNonMetaclass
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   257
                ].
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   258
                class nameWithoutPrefix = className    
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   259
            ]])
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   260
        ifFalse:[
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   261
            "/ try a replacement class in the same namespace again
3835
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   262
            (className includesString:'::') ifTrue:[
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   263
                suggestion := className copyFrom:(className lastIndexOf:$:)+1.
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   264
                (Smalltalk classNamed:suggestion) isBehavior ifFalse:[
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   265
                    suggestion := nil.
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   266
                ].
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   267
            ].
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   268
            suggestion := suggestion ? LastReplacementClass.
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   269
            
2512
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   270
            (class notNil
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   271
            and:[ (class := class nameSpace classNamed:className) notNil
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   272
            and:[ 
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   273
                (className endsWith:' class') ifTrue:[
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   274
                    class := class theMetaclass
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   275
                ] ifFalse:[
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   276
                    class := class theNonMetaclass
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   277
                ].
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   278
                class nameWithoutPrefix = className    
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   279
            ]])
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   280
            ifFalse:[
4121
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   281
                |action resources|
2516
a1fdfc5e22cd handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
   282
4121
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   283
                resources := self class projectDefinitionClass classResources.
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   284
                
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   285
                "/ ask for a repair action
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   286
                action := OptionBox
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   287
                            request:(resources stringWithCRs:'Cannot apply change for missing class: %1\\Please choose a repair action:\- choose a replacement class\- define a dummy class\- skip this change\- cancel the load operation' 
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   288
                                     with:className) 
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   289
                            buttonLabels:(resources array:#('Replace...' 'Create New...' 'Skip' 'Cancel'))
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   290
                            values:#(replace create skip cancel).
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   291
                action == #skip ifTrue:[^ self].
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   292
                action == #cancel ifTrue:[ AbortOperationRequest raise].
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   293
                action == #replace ifTrue:[
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   294
                    replacementClassName := Dialog 
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   295
                                    requestClassName:(resources 
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   296
                                                            string:'Replacement class for "%1"?' 
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   297
                                                            with:className)
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   298
                                    initialAnswer:suggestion.
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   299
                ] ifFalse:[
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   300
                    replacementClassName := Dialog 
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   301
                                    requestClassName:(resources 
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   302
                                                            stringWithCRs:'Create dummy class for "%1"?\(will be created in Namespace "%2")' 
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   303
                                                            with:className with:(Class nameSpaceQuerySignal query ? Smalltalk) name)
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   304
                                    initialAnswer:suggestion.
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   305
                ].    
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   306
                replacementClassName isEmptyOrNil ifTrue:[ AbortOperationRequest raise ].
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   307
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   308
                action == #create ifTrue:[
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   309
                    Object 
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   310
                        subclass:(replacementClassName asSymbol)
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   311
                        instanceVariableNames:''
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   312
                        classVariableNames:''
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   313
                        poolDictionaries:''
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   314
                        category:'* dummy for porting *'
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   315
                ].    
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   316
                class := Smalltalk classNamed:replacementClassName.
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   317
                class isNil ifTrue:[
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   318
                    class := (Class nameSpaceQuerySignal query ? Smalltalk) classNamed:replacementClassName.
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   319
                    class isNil ifTrue:[
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   320
                        self error:(resources string:'Cannot apply change for missing class: %1' with:replacementClassName) mayProceed:true.
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   321
                        ^ self
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   322
                    ].
2512
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   323
                ].
3835
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   324
"/                (className endsWith:' class') ifTrue:[
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   325
"/                    class := class theMetaclass
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   326
"/                ] ifFalse:[
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   327
"/                    class := class theNonMetaclass
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   328
"/                ].
4121
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   329
1a5374a80c54 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3995
diff changeset
   330
                LastReplacementClass := replacementClassName.
2512
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   331
            ]
9caca2c0b8ed changed: #apply
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   332
        ]
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1073
diff changeset
   333
    ].
4258
e2bba335c949 `MethodChange`: when applying a method change, make sure the class is loaded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4166
diff changeset
   334
    class autoload.
3214
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   335
3533
cccb70e595fb Fixes setting package when applying MethodChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3519
diff changeset
   336
    newPackage := package notNil ifTrue:[package] ifFalse:[Class packageQuerySignal query].
cccb70e595fb Fixes setting package when applying MethodChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3519
diff changeset
   337
3214
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   338
    "/ if overwriting an existing method from another package,
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   339
    "/ put the existing method into the packagessafe
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   340
    oldMethodOrNil := class compiledMethodAt:selector.
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   341
    oldMethodOrNil notNil ifTrue:[
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   342
        oldPackage := oldMethodOrNil package.
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   343
        (newPackage notNil and:[newPackage ~= oldPackage]) ifTrue:[
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   344
            defClass := oldPackage asPackageId projectDefinitionClass.
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   345
            defClass notNil ifTrue:[
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   346
                defClass rememberOverwrittenMethod:oldMethodOrNil inClass:class.
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   347
            ]
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   348
        ].
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   349
    ].
905a4976fac8 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3213
diff changeset
   350
3774
927ab9fa567e class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
   351
    newMethod := class compile:source classified:methodCategory logged:true.
927ab9fa567e class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
   352
    newMethod notNil ifTrue:[
927ab9fa567e class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
   353
        newMethod package: newPackage.
927ab9fa567e class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
   354
    ].
2509
173f64701e6a class definition
Claus Gittinger <cg@exept.de>
parents: 2503
diff changeset
   355
2516
a1fdfc5e22cd handle namespace overrides (for mc browser)
Claus Gittinger <cg@exept.de>
parents: 2512
diff changeset
   356
    "Modified: / 07-09-2011 / 21:09:19 / cg"
3533
cccb70e595fb Fixes setting package when applying MethodChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3519
diff changeset
   357
    "Modified: / 29-03-2014 / 23:29:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4258
e2bba335c949 `MethodChange`: when applying a method change, make sure the class is loaded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 4166
diff changeset
   358
    "Modified: / 19-07-2017 / 21:17:56 / jv"
849
d31825895bb2 preps to allow applying
Claus Gittinger <cg@exept.de>
parents: 800
diff changeset
   359
! !
d31825895bb2 preps to allow applying
Claus Gittinger <cg@exept.de>
parents: 800
diff changeset
   360
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   361
!MethodChange methodsFor:'comparing'!
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   362
3213
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   363
isConflict
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   364
    "true if this change is different than what is already in the image
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   365
     (i.e. it overwrites some existing code)"
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   366
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   367
    |cls mthd|
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   368
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   369
    (cls := self changeClass) isNil ifTrue:[^ false].
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   370
    (mthd := cls compiledMethodAt:selector) isNil ifTrue:[^ false].
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   371
    ^ mthd category ~= methodCategory
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   372
    or:[ mthd source ~= self source ]
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   373
!
56e4caab0075 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3179
diff changeset
   374
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   375
isForSameAs:changeB
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   376
    "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
   377
     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
   378
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   379
    "/ 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
   380
    changeB isMethodChange ifFalse:[^ false].   
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   381
1199
53f7de3f5c9b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   382
    selector ~= changeB selector ifTrue:[^ false].
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   383
    className ~= changeB className ifTrue:[^ false].
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   384
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   385
    ^ true
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   386
!
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   387
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   388
sameAs:changeB
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   389
    "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
   390
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
   391
    (self isForSameAs:changeB) ifFalse:[^ false].   
1509
e3f924fdfb6c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   392
    (self sameSourceAs:changeB) ifTrue:[^ true].
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   393
1509
e3f924fdfb6c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   394
    ^ false.
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   395
1509
e3f924fdfb6c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1487
diff changeset
   396
    "Modified: / 25-07-2006 / 11:23:27 / cg"
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   397
! !
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   398
1325
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   399
!MethodChange methodsFor:'converting'!
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   400
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   401
asNamedMethodChange
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   402
    ^ NamedMethodChange fromMethodChange:self
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   403
! !
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   404
2369
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   405
!MethodChange methodsFor:'fileout'!
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   406
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   407
basicFileOutOn: aStream
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   408
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   409
    |cat |
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   410
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   411
    self isMethodCodeChange ifFalse:[^super basicFileOutOn: aStream].
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   412
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   413
    aStream nextPutChunkSeparator.
3519
007417da21ef class: MethodChange
Stefan Vogel <sv@exept.de>
parents: 3443
diff changeset
   414
    nameSpaceName notEmptyOrNil ifTrue:[
007417da21ef class: MethodChange
Stefan Vogel <sv@exept.de>
parents: 3443
diff changeset
   415
        nameSpaceName printOn:aStream.
007417da21ef class: MethodChange
Stefan Vogel <sv@exept.de>
parents: 3443
diff changeset
   416
        aStream nextPutAll:'::'.
007417da21ef class: MethodChange
Stefan Vogel <sv@exept.de>
parents: 3443
diff changeset
   417
    ].
2369
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   418
    self className printOn:aStream.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   419
"/        self printClassNameOn:aStream.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   420
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   421
    (privacy ? #public) ~~ #public ifTrue:[
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   422
        aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   423
    ] ifFalse:[
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   424
        aStream nextPutAll:' methodsFor:'.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   425
    ].
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   426
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   427
    cat := methodCategory ? ''.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   428
    aStream nextPutAll:cat asString storeString.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   429
    aStream nextPutChunkSeparator; cr; cr.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   430
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   431
    source := self source.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   432
    source isNil ifTrue:[
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   433
        ClassDescription fileOutErrorSignal
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   434
            raiseRequestWith:self
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   435
            errorString:(' - no source for method: ' ,
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   436
                         self className , '>>' , selector).
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   437
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   438
    ] ifFalse:[
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   439
        aStream nextChunkPut:source.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   440
    ].
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   441
    aStream space.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   442
    aStream nextPutChunkSeparator.
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   443
    aStream cr; cr
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   444
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   445
    "Modified: / 05-12-2009 / 12:38:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   446
! !
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   447
963
a4fb4b9f7e72 category change
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
   448
!MethodChange methodsFor:'printing & storing'!
0
470788421600 Initial revision
claus
parents:
diff changeset
   449
7
1ec2a2047025 *** empty log message ***
claus
parents: 4
diff changeset
   450
printOn:aStream
800
3c41a8705c48 comment
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   451
    "append a user printed representation of the receiver to aStream.
3c41a8705c48 comment
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   452
     The format is suitable for a human - not meant to be read back."
3c41a8705c48 comment
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
   453
2170
3357cc27387c changed: #printOn:
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   454
    aStream
3835
2abde322db34 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3774
diff changeset
   455
        nextPutAll:(self fullClassName ? 'unnamed');
3179
f66dd0b4043c class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3156
diff changeset
   456
        nextPutAll:' >> ';
f66dd0b4043c class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3156
diff changeset
   457
        nextPutAll:(selector ? '?');
f66dd0b4043c class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3156
diff changeset
   458
        nextPutAll:' {';
f66dd0b4043c class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3156
diff changeset
   459
        nextPutAll:(methodCategory ? '?');
f66dd0b4043c class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 3156
diff changeset
   460
        nextPutAll:'}'
1512
2a7a41afb1e2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1509
diff changeset
   461
1833
cf60e3c0087e care for bad (nil) methodCategory
Claus Gittinger <cg@exept.de>
parents: 1512
diff changeset
   462
    "Modified: / 04-10-2006 / 16:46:01 / cg"
2170
3357cc27387c changed: #printOn:
Claus Gittinger <cg@exept.de>
parents: 2157
diff changeset
   463
    "Modified: / 07-11-2008 / 08:29:03 / Jan Vrany <vranyj1@fel.cvut.cz>"
779
d2c59a219cbc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   464
!
d2c59a219cbc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   465
896
035d5613a20c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
   466
printWithoutClassNameOn:aStream
035d5613a20c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
   467
    (className endsWith:' class') ifTrue:[
035d5613a20c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
   468
        aStream nextPutAll:'class '
035d5613a20c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
   469
    ].
035d5613a20c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
   470
    aStream nextPutAll:selector 
035d5613a20c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
   471
!
035d5613a20c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
   472
035d5613a20c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
   473
printWithoutOwningClassOn:aStream
2022
a498c70c0aac changed #printWithoutOwningClassOn:
Claus Gittinger <cg@exept.de>
parents: 2020
diff changeset
   474
    self breakPoint:#cg.
779
d2c59a219cbc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   475
    (className endsWith:' class') ifTrue:[
d2c59a219cbc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   476
        aStream nextPutAll:'class '
d2c59a219cbc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   477
    ].
d2c59a219cbc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   478
    aStream nextPutAll:selector 
1845
6fdd21eba549 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1833
diff changeset
   479
!
6fdd21eba549 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1833
diff changeset
   480
6fdd21eba549 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1833
diff changeset
   481
sourceForMethod
2157
281a40f3dfc9 changed: #sourceForMethod
Claus Gittinger <cg@exept.de>
parents: 2130
diff changeset
   482
    ^ '(' , className , ' compiledMethodAt:' , selector asSymbol storeString, ')'
1845
6fdd21eba549 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1833
diff changeset
   483
6fdd21eba549 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1833
diff changeset
   484
    "Created: / 09-10-2006 / 13:58:09 / cg"
0
470788421600 Initial revision
claus
parents:
diff changeset
   485
! !
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   486
3862
476566b38577 Make Change>>delta an obsolete.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3838
diff changeset
   487
2130
1f2df83288c7 added: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2119
diff changeset
   488
!MethodChange methodsFor:'testing'!
652
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   489
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   490
isMethodChange
2130
1f2df83288c7 added: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2119
diff changeset
   491
    "true if this is a method related change"
1f2df83288c7 added: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2119
diff changeset
   492
652
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   493
    ^ true
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   494
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   495
    "Created: / 7.2.1998 / 19:26:59 / cg"
2130
1f2df83288c7 added: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2119
diff changeset
   496
!
1f2df83288c7 added: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2119
diff changeset
   497
3443
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   498
isMethodChangeForCopyrightMethod
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   499
    ^self isMethodCodeChange and: [ self isForMeta and: [ self selector == #copyright ] ]
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   500
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   501
    "Created: / 01-08-2012 / 16:33:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   502
!
b10ec0baed8e merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3432
diff changeset
   503
2942
635660203429 added: #isMethodChangeForExtensionsVersionMethod
Claus Gittinger <cg@exept.de>
parents: 2872
diff changeset
   504
isMethodChangeForExtensionsVersionMethod
2944
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   505
    "true if this is a change for an extensionsVersion method"
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   506
2942
635660203429 added: #isMethodChangeForExtensionsVersionMethod
Claus Gittinger <cg@exept.de>
parents: 2872
diff changeset
   507
    ^  self isMethodCodeChange
635660203429 added: #isMethodChangeForExtensionsVersionMethod
Claus Gittinger <cg@exept.de>
parents: 2872
diff changeset
   508
    and:[ AbstractSourceCodeManager isExtensionsVersionMethodSelector:self selector ]
635660203429 added: #isMethodChangeForExtensionsVersionMethod
Claus Gittinger <cg@exept.de>
parents: 2872
diff changeset
   509
!
635660203429 added: #isMethodChangeForExtensionsVersionMethod
Claus Gittinger <cg@exept.de>
parents: 2872
diff changeset
   510
2187
b36325e3df21 added: #isMethodChangeForVersionMethod
fm
parents: 2170
diff changeset
   511
isMethodChangeForVersionMethod
2944
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   512
    "true if this is a change for a version method"
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   513
2187
b36325e3df21 added: #isMethodChangeForVersionMethod
fm
parents: 2170
diff changeset
   514
    ^  self isMethodCodeChange
b36325e3df21 added: #isMethodChangeForVersionMethod
fm
parents: 2170
diff changeset
   515
    and:[ AbstractSourceCodeManager isVersionMethodSelector:self selector ]
b36325e3df21 added: #isMethodChangeForVersionMethod
fm
parents: 2170
diff changeset
   516
!
b36325e3df21 added: #isMethodChangeForVersionMethod
fm
parents: 2170
diff changeset
   517
2130
1f2df83288c7 added: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2119
diff changeset
   518
isMethodCodeChange
1f2df83288c7 added: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2119
diff changeset
   519
    "true if this is a method's code change (not package, category etc.)"
1f2df83288c7 added: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2119
diff changeset
   520
2260
fc4873beed5b fixed: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2258
diff changeset
   521
    ^ true
652
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   522
! !
b9e4b4465a2c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 648
diff changeset
   523
2616
0eba26a9f6af visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   524
!MethodChange methodsFor:'visiting'!
0eba26a9f6af visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   525
0eba26a9f6af visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   526
acceptChangeVisitor:aVisitor
0eba26a9f6af visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   527
    ^ aVisitor visitMethodChange:self.
0eba26a9f6af visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   528
0eba26a9f6af visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   529
    "Created: / 25-11-2011 / 17:13:50 / cg"
0eba26a9f6af visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   530
! !
0eba26a9f6af visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   531
1325
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   532
!MethodChange::NamedMethodChange class methodsFor:'instance creation'!
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   533
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   534
fromMethodChange:aMethodChange
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   535
    ^ self new cloneInstanceVariablesFrom:aMethodChange
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   536
! !
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   537
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   538
!MethodChange::NamedMethodChange methodsFor:'accessing'!
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   539
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   540
changeName:something
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   541
    changeName := something.
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   542
! !
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   543
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   544
!MethodChange::NamedMethodChange methodsFor:'printing & storing'!
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   545
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   546
printOn:aStream
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   547
    changeName notNil ifTrue:[
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   548
        changeName printOn:aStream.
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   549
        ^ self.
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   550
    ].
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   551
    super printOn:aStream
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   552
! !
b874a070362e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1322
diff changeset
   553
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   554
!MethodChange class methodsFor:'documentation'!
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   555
2944
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   556
version
3902
afa169d26bf8 class: MethodChange
Stefan Vogel <sv@exept.de>
parents: 3835
diff changeset
   557
    ^ '$Header$'
2944
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   558
!
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   559
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   560
version_CVS
3902
afa169d26bf8 class: MethodChange
Stefan Vogel <sv@exept.de>
parents: 3835
diff changeset
   561
    ^ '$Header$'
2944
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   562
!
c00806fd6113 queries
Claus Gittinger <cg@exept.de>
parents: 2942
diff changeset
   563
3880
13c1b7cd6c1d Oops, moved #changeMethod back to stx:libbasic3.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   564
version_HG
13c1b7cd6c1d Oops, moved #changeMethod back to stx:libbasic3.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   565
13c1b7cd6c1d Oops, moved #changeMethod back to stx:libbasic3.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   566
    ^ '$Changeset: <not expanded> $'
13c1b7cd6c1d Oops, moved #changeMethod back to stx:libbasic3.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   567
!
13c1b7cd6c1d Oops, moved #changeMethod back to stx:libbasic3.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3862
diff changeset
   568
2369
ffbd3aa42d28 Jan's changes
vrany
parents: 2260
diff changeset
   569
version_SVN
3902
afa169d26bf8 class: MethodChange
Stefan Vogel <sv@exept.de>
parents: 3835
diff changeset
   570
    ^ '$Id$'
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   571
! !
3138
0442e4f23d39 class: MethodChange
Claus Gittinger <cg@exept.de>
parents: 2944
diff changeset
   572