MethodCategoryChange.st
author Claus Gittinger <cg@exept.de>
Thu, 05 Mar 2020 11:17:28 +0100
changeset 4561 eace75531554
parent 4268 84291a251c17
permissions -rw-r--r--
#UI_ENHANCEMENT by cg class: SourceCodeManagerUtilities changed: #compareClassWithRepository:askForRevision: typos: genitive of class is class's - not classes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
claus
parents: 15
diff changeset
     1
"
claus
parents: 15
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
claus
parents: 15
diff changeset
     3
	       All Rights Reserved
claus
parents: 15
diff changeset
     4
claus
parents: 15
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents: 15
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents: 15
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents: 15
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents: 15
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents: 15
diff changeset
    10
 hereby transferred.
claus
parents: 15
diff changeset
    11
"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 852
diff changeset
    13
3984
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
    14
"{ NameSpace: Smalltalk }"
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
    15
15
639ae882da27 Initial revision
claus
parents:
diff changeset
    16
MethodChange subclass:#MethodCategoryChange
2873
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    17
	instanceVariableNames:'origin'
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    18
	classVariableNames:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    19
	poolDictionaries:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    20
	category:'System-Changes'
15
639ae882da27 Initial revision
claus
parents:
diff changeset
    21
!
639ae882da27 Initial revision
claus
parents:
diff changeset
    22
25
claus
parents: 15
diff changeset
    23
!MethodCategoryChange class methodsFor:'documentation'!
claus
parents: 15
diff changeset
    24
claus
parents: 15
diff changeset
    25
copyright
claus
parents: 15
diff changeset
    26
"
claus
parents: 15
diff changeset
    27
 COPYRIGHT (c) 1993 by Claus Gittinger
claus
parents: 15
diff changeset
    28
	       All Rights Reserved
claus
parents: 15
diff changeset
    29
claus
parents: 15
diff changeset
    30
 This software is furnished under a license and may be used
claus
parents: 15
diff changeset
    31
 only in accordance with the terms of that license and with the
claus
parents: 15
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
claus
parents: 15
diff changeset
    33
 be provided or otherwise made available to, or used by, any
claus
parents: 15
diff changeset
    34
 other person.  No title to or ownership of the software is
claus
parents: 15
diff changeset
    35
 hereby transferred.
claus
parents: 15
diff changeset
    36
"
claus
parents: 15
diff changeset
    37
!
claus
parents: 15
diff changeset
    38
45
claus
parents: 39
diff changeset
    39
documentation
claus
parents: 39
diff changeset
    40
"
claus
parents: 39
diff changeset
    41
    instances represent method-category changes (as done in the browser). 
claus
parents: 39
diff changeset
    42
    They are typically held in a ChangeSet.
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    43
2873
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    44
    Change origin.
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    45
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    46
    When a changeset diff is generated, two MethodChanges that 
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    47
    represent the same method (code is the same) might differ only in
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    48
    category/ Such changes are transformed to MethodCategoruChanges.
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    49
    In that case, origin keeps the reference to original MethodChange.
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    50
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    51
    [author:]
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    52
        Claus Gittinger
2873
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    53
        Jan Vrany
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    54
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    55
    [instance variables:]
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    56
        origin      <MethodChange>  Change that cause this category
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    57
                                    change to be created. See comment.
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    58
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    59
45
claus
parents: 39
diff changeset
    60
"
25
claus
parents: 15
diff changeset
    61
! !
claus
parents: 15
diff changeset
    62
3984
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
    63
!MethodCategoryChange class methodsFor:'instance creation'!
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
    64
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
    65
class:cls selector:sel category:cat 
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
    66
    ^ self basicNew class:cls selector:sel category:cat
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
    67
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
    68
3986
0ab93d6d6c20 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
    69
!
3984
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
    70
3986
0ab93d6d6c20 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
    71
className:clsName selector:sel category:cat 
0ab93d6d6c20 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
    72
    ^ self basicNew className:clsName selector:sel category:cat
2873
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    73
3986
0ab93d6d6c20 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
    74
    "Created: / 12-11-2006 / 15:54:25 / cg"
2873
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    75
! !
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    76
15
639ae882da27 Initial revision
claus
parents:
diff changeset
    77
!MethodCategoryChange methodsFor:'accessing'!
639ae882da27 Initial revision
claus
parents:
diff changeset
    78
639ae882da27 Initial revision
claus
parents:
diff changeset
    79
class:cls selector:sel category:cat
1902
20db5f942dbd changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
    80
    self className:cls name selector:sel category:cat
15
639ae882da27 Initial revision
claus
parents:
diff changeset
    81
1902
20db5f942dbd changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents: 1846
diff changeset
    82
    "Modified: / 12-11-2006 / 15:55:11 / cg"
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    83
!
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    84
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    85
className:clsName selector:sel category:cat
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    86
    className := clsName.
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    87
    selector := sel.
852
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
    88
    methodCategory := cat
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    89
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    90
    "Created: / 16.2.1998 / 14:14:16 / cg"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    91
!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    92
2873
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    93
origin
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    94
    ^ origin
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    95
!
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    96
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    97
origin:aMethodChange
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    98
    origin := aMethodChange.
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
    99
!
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   100
1052
cc84f5e27bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1009
diff changeset
   101
prettyPrintedSource
1846
c0f8e12c9611 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1052
diff changeset
   102
    ^ self sourceForMethod, Character cr 
1052
cc84f5e27bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1009
diff changeset
   103
          , '    category:' , methodCategory storeString
1846
c0f8e12c9611 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1052
diff changeset
   104
c0f8e12c9611 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1052
diff changeset
   105
    "Modified: / 09-10-2006 / 13:59:15 / cg"
1052
cc84f5e27bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1009
diff changeset
   106
!
cc84f5e27bb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1009
diff changeset
   107
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   108
source
1846
c0f8e12c9611 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1052
diff changeset
   109
    ^ self sourceForMethod , ' category:' , methodCategory storeString
852
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   110
1846
c0f8e12c9611 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1052
diff changeset
   111
    "Modified: / 09-10-2006 / 13:59:10 / cg"
2873
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   112
!
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   113
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   114
source: aString
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   115
    | expr |
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   116
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   117
    expr := Parser parseExpression: aString onError: [ self error: 'Invalid source'].
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   118
    expr isMessage ifFalse:[ self error: 'Invalid source' ].
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   119
    expr selector == #'category:' ifFalse:[ self error: 'Invalid source' ].
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   120
    methodCategory := expr arguments first value.
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   121
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   122
    "Created: / 20-03-2012 / 22:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
852
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   123
! !
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   124
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   125
!MethodCategoryChange methodsFor:'applying'!
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   126
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   127
apply
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   128
    "apply the change"
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   129
1915
d23534c8ab03 the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents: 1902
diff changeset
   130
    |mthd|
852
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   131
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   132
    mthd := self changeMethod.
1915
d23534c8ab03 the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents: 1902
diff changeset
   133
    mthd category:methodCategory asSymbol.
852
1acd7d3ed3fc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   134
1915
d23534c8ab03 the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents: 1902
diff changeset
   135
    "Modified: / 23-11-2006 / 16:59:09 / cg"
15
639ae882da27 Initial revision
claus
parents:
diff changeset
   136
! !
639ae882da27 Initial revision
claus
parents:
diff changeset
   137
4268
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   138
!MethodCategoryChange methodsFor:'fileout'!
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   139
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   140
fileOutOn: aStream
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   141
    selector isNil ifTrue:[
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   142
        Transcript show:'missing selector in method category change: '.
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   143
        Transcript showCR:self.
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   144
        ^ self
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   145
    ].    
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   146
    self removed ifFalse:[self basicFileOutOn: aStream]
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   147
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   148
    "Created: / 30-11-2017 / 13:02:57 / cg"
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   149
! !
84291a251c17 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   150
2131
0feb8bbb287d added: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2120
diff changeset
   151
!MethodCategoryChange methodsFor:'testing'!
964
64282b5e5c48 added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   152
64282b5e5c48 added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   153
isMethodCategoryChange
64282b5e5c48 added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   154
    ^ true
2263
c514b61ac1b2 fixed: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2131
diff changeset
   155
!
c514b61ac1b2 fixed: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2131
diff changeset
   156
c514b61ac1b2 fixed: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2131
diff changeset
   157
isMethodCodeChange
c514b61ac1b2 fixed: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2131
diff changeset
   158
    "true if this is a method's code change (not package, category etc.)"
c514b61ac1b2 fixed: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2131
diff changeset
   159
c514b61ac1b2 fixed: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2131
diff changeset
   160
    ^ false
964
64282b5e5c48 added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   161
! !
64282b5e5c48 added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
   162
2622
853e24f6b303 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
   163
!MethodCategoryChange methodsFor:'visiting'!
853e24f6b303 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
   164
853e24f6b303 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
   165
acceptChangeVisitor:aVisitor
853e24f6b303 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
   166
    ^ aVisitor visitMethodCategoryChange:self.
853e24f6b303 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
   167
853e24f6b303 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
   168
    "Created: / 25-11-2011 / 17:13:58 / cg"
853e24f6b303 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
   169
! !
853e24f6b303 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2263
diff changeset
   170
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   171
!MethodCategoryChange class methodsFor:'documentation'!
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   172
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   173
version
3984
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
   174
    ^ '$Header$'
2263
c514b61ac1b2 fixed: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2131
diff changeset
   175
!
c514b61ac1b2 fixed: #isMethodCodeChange
Claus Gittinger <cg@exept.de>
parents: 2131
diff changeset
   176
3986
0ab93d6d6c20 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
   177
version_CVS
0ab93d6d6c20 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
   178
    ^ '$Header$'
0ab93d6d6c20 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
   179
!
0ab93d6d6c20 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
   180
2873
384700ae948f Merged from SVN
vrany
parents: 2622
diff changeset
   181
version_SVN
3984
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
   182
    ^ '$Id$'
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   183
! !
3984
22c47fc24cd7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
   184