ChangeSet.st
author Claus Gittinger <cg@exept.de>
Thu, 08 Nov 2001 19:32:34 +0100
changeset 1097 88c7c0313286
parent 1096 4a949a840bb3
child 1098 420a868fd606
permissions -rw-r--r--
change notification
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     1
"
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
16
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
     3
	      All Rights Reserved
3
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     4
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     5
 This software is furnished under a license and may be used
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     6
 only in accordance with the terms of that license and with the
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     8
 be provided or otherwise made available to, or used by, any
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     9
 other person.  No title to or ownership of the software is
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    10
 hereby transferred.
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    11
"
0
470788421600 Initial revision
claus
parents:
diff changeset
    12
921
fa4db05c887b oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents: 916
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
fa4db05c887b oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents: 916
diff changeset
    14
0
470788421600 Initial revision
claus
parents:
diff changeset
    15
OrderedCollection subclass:#ChangeSet
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    16
	instanceVariableNames:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    17
	classVariableNames:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    18
	poolDictionaries:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    19
	category:'System-Changes'
0
470788421600 Initial revision
claus
parents:
diff changeset
    20
!
470788421600 Initial revision
claus
parents:
diff changeset
    21
625
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
    22
!ChangeSet class methodsFor:'documentation'!
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    23
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    24
copyright
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    25
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    26
 COPYRIGHT (c) 1993 by Claus Gittinger
16
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
    27
	      All Rights Reserved
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    28
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    29
 This software is furnished under a license and may be used
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    30
 only in accordance with the terms of that license and with the
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    32
 be provided or otherwise made available to, or used by, any
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    33
 other person.  No title to or ownership of the software is
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    34
 hereby transferred.
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    35
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    36
!
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    37
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    38
documentation
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    39
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    40
    used in the changes management to keep track of changes
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    41
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
    42
    [author:]
879
bfd06666f6c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
    43
	Claus Gittinger
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    44
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    45
! !
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    46
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
    47
!ChangeSet class methodsFor:'instance creation'!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
    48
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    49
changesFromParseTree:aTree andStream:aStream lineNumber:initialLineNumberOrNil position:initialPositionOrNil do:aBlock
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    50
    "given a parse-tree (from parsing some changes source/chunk),
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    51
     create changes and evaluate aBlock on each.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    52
     The block is invoked with the change and a lineNumberOrNil as
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    53
     arg; the lineNumber is only valid, if the underlying stream 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    54
     provides line-numbers; otherwise, nil is passed."
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    55
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    56
    |changes sel className categoryName 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    57
     methodSource methodSelector change parser
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    58
     oldName newName priv receiver receiverVarName
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    59
     receiverSelector receiverReceiver primSource
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    60
     nameSpace lineNumberOrNil posOrNil|
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    61
931
c18bf52cffd4 linenumber fix
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
    62
     lineNumberOrNil := initialLineNumberOrNil.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
    63
     posOrNil := initialPositionOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    64
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    65
"/    nameSpace := Class nameSpaceQuerySignal query.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    66
"/    nameSpace isNil ifTrue:[nameSpace := Smalltalk].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    67
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    68
    sel := aTree selector.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    69
    receiver := aTree receiver.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    70
    receiver isMessage ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    71
        receiverSelector := receiver selector.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    72
        receiverReceiver := receiver receiver.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    73
    ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    74
        receiver isVariable ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    75
            receiverVarName := receiver name
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    76
        ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    77
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    78
960
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
    79
    (sel == #'methods'
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
    80
    or:[(sel == #'methodsFor:')
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
    81
    or:[(sel == #'publicMethodsFor:')
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
    82
    or:[(sel == #'privateMethodsFor:')
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
    83
    or:[(sel == #'methodsFor:stamp:')
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
    84
    or:[(sel == #'ignoredMethodsFor:')]]]]]) ifTrue:[
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    85
        (sel == #'ignoredMethodsFor:') ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    86
            priv := #ignored.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    87
        ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    88
            priv := nil
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    89
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    90
        (receiver isUnaryMessage 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    91
        and:[receiverSelector == #class]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    92
            className := (receiverReceiver name) , ' class'.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    93
        ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    94
            className := (receiver name).
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    95
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    96
"/        nameSpace ~~ Smalltalk ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    97
"/            className := nameSpace name , '::' , className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
    98
"/        ].
960
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
    99
        sel == #'methods' ifTrue:[
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
   100
            categoryName := 'uncategorized'
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
   101
        ] ifFalse:[
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
   102
            categoryName := (aTree arguments at:1) evaluate.
9b0994b92e10 parse v'age, squeak and stv changesets
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
   103
        ].
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   104
        aStream skipSeparators.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   105
        lineNumberOrNil := aStream lineNumber.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   106
        posOrNil := aStream position.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   107
        methodSource := aStream nextChunk.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   108
        changes := OrderedCollection new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   109
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   110
        [methodSource notEmpty] whileTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   111
            parser := Parser
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   112
                        parseMethodArgAndVarSpecification:methodSource 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   113
                        in:nil 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   114
                        ignoreErrors:true 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   115
                        ignoreWarnings:true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   116
                        parseBody:false.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   117
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   118
            parser isNil ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   119
                "/ something wierd ...
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   120
                methodSelector := '????'.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   121
            ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   122
                methodSelector := parser selector.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   123
            ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   124
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   125
            change := MethodChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   126
            change 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   127
                className:className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   128
                selector:methodSelector
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   129
                source:methodSource
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   130
                category:categoryName
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   131
                privacy:priv.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   132
            aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   133
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   134
            aStream skipSeparators.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   135
            lineNumberOrNil := aStream lineNumber.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   136
            posOrNil := aStream position.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   137
            methodSource := aStream nextChunk.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   138
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   139
        ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   140
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   141
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   142
    sel == #'removeSelector:' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   143
        (receiver isUnaryMessage 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   144
        and:[receiverSelector == #class]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   145
            className := (receiverReceiver name) , ' class'.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   146
        ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   147
            className := (receiver name).
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   148
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   149
"/        nameSpace ~~ Smalltalk ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   150
"/            className := nameSpace name , '::' , className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   151
"/        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   152
        methodSelector := (aTree arguments at:1) evaluate.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   153
        change := MethodRemoveChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   154
        change 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   155
            className:className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   156
            selector:methodSelector.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   157
        aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   158
        ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   159
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   160
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   161
    "/ any subclass definiton selector ?
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   162
    (Behavior definitionSelectors includes:sel)
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   163
    ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   164
        className := (aTree arguments at:1) evaluate.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   165
"/        nameSpace ~~ Smalltalk ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   166
"/            className := nameSpace name , '::' , className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   167
"/        ].
1045
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   168
        nameSpace := Class nameSpaceQuerySignal query.
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   169
        nameSpace ~~ Smalltalk ifTrue:[
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   170
            className := nameSpace name , '::' , className
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   171
        ].
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   172
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   173
        change := ClassDefinitionChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   174
        change 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   175
            className:className;
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   176
            source:(aTree printString).
1045
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   177
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   178
"/        nameSpace ~~ Smalltalk ifTrue:[
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   179
"/            change nameSpaceName:(nameSpace name).
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   180
"/        ].
1b2aa47f9dc5 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1042
diff changeset
   181
"/
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   182
        aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   183
        ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   184
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   185
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   186
    sel == #'renameCategory:to:' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   187
        (receiver isUnaryMessage 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   188
        and:[receiverSelector == #class]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   189
            className := (receiverReceiver name) , ' class'.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   190
        ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   191
            className := (receiver name).
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   192
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   193
"/        nameSpace ~~ Smalltalk ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   194
"/            className := nameSpace name , '::' , className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   195
"/        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   196
        change := MethodCategoryRenameChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   197
        change 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   198
            className:className;
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   199
            oldCategoryName:(aTree arguments at:1) evaluate
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   200
            newCategoryName:(aTree arguments at:2) evaluate.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   201
        aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   202
        ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   203
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   204
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   205
    (sel == #'category:' 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   206
    or:[sel == #'privacy:']) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   207
        (receiver isMessage
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   208
        and:[receiverSelector == #'compiledMethodAt:']) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   209
            (receiverReceiver isUnaryMessage 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   210
            and:[receiverReceiver selector == #class]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   211
                className := (receiverReceiver receiver name) , ' class'.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   212
            ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   213
                className := (receiverReceiver name).
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   214
            ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   215
"/            nameSpace ~~ Smalltalk ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   216
"/                className := nameSpace name , '::' , className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   217
"/            ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   218
            methodSelector := (receiver arguments at:1) evaluate.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   219
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   220
            sel == #'category:' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   221
                change := MethodCategoryChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   222
                change 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   223
                    className:className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   224
                    selector:methodSelector
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   225
                    category:(aTree arguments at:1) evaluate.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   226
            ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   227
                change := MethodPrivacyChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   228
                change 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   229
                    className:className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   230
                    selector:methodSelector
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   231
                    privacy:(aTree arguments at:1) evaluate.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   232
            ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   233
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   234
            aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   235
            ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   236
        ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   237
            self halt:'unexpected change'
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   238
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   239
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   240
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   241
    sel == #'comment:' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   242
        (receiver isUnaryMessage 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   243
        and:[receiverSelector == #class]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   244
            className := (receiverReceiver name) , ' class'.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   245
        ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   246
            className := (receiver name).
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   247
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   248
"/        nameSpace ~~ Smalltalk ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   249
"/            className := nameSpace name , '::' , className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   250
"/        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   251
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   252
        change := ClassCommentChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   253
        change 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   254
            className:className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   255
            comment:(aTree arguments at:1) evaluate.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   256
        change source:(aTree printString).
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   257
        aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   258
        ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   259
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   260
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   261
    sel == #'instanceVariableNames:' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   262
        (receiver isUnaryMessage 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   263
        and:[receiverSelector == #class]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   264
            className := (receiverReceiver name) , ' class'.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   265
        ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   266
            className := (receiver name).
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   267
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   268
"/        nameSpace ~~ Smalltalk ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   269
"/            className := nameSpace name , '::' , className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   270
"/        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   271
        change := ClassInstVarDefinitionChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   272
        change className:className.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   273
        change source:(aTree printString).
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   274
        aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   275
        ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   276
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   277
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   278
    sel == #'removeClass:' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   279
        (receiverVarName == #Smalltalk) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   280
            className := (aTree arguments at:1) name.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   281
"/            nameSpace ~~ Smalltalk ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   282
"/                className := nameSpace name , '::' , className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   283
"/            ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   284
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   285
            change := ClassRemoveChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   286
            change className:className.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   287
            aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   288
            ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   289
        ] ifFalse:[
939
3d9db91f992a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
   290
            self halt:'unexpected receiver in #name: message'
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   291
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   292
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   293
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   294
    sel == #'renameClass:to:' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   295
        (receiverVarName == #Smalltalk) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   296
            oldName := (aTree arguments at:1) name.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   297
            newName := (aTree arguments at:2) evaluate.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   298
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   299
            change := ClassRenameChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   300
            change oldName:oldName newName:newName.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   301
            aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   302
            ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   303
        ] ifFalse:[
939
3d9db91f992a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
   304
            self halt:'unexpected receiver in #name: message'
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   305
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   306
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   307
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   308
    sel == #'name:' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   309
        ((receiverVarName == #Namespace) 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   310
        or:[receiverVarName == #NameSpace]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   311
            className := (aTree arguments at:1) evaluate.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   312
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   313
            change := NameSpaceCreationChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   314
            change name:className.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   315
            aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   316
            ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   317
        ] ifFalse:[
939
3d9db91f992a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 931
diff changeset
   318
            self halt:'unexpected receiver in #name: message'
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   319
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   320
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   321
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   322
    (sel == #'primitiveDefinitions'
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   323
    or:[sel == #'primitiveFunctions'
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   324
    or:[sel == #'primitiveVariables']]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   325
        (receiver isUnaryMessage 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   326
        and:[receiverSelector == #class]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   327
            className := (receiverReceiver name) , ' class'.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   328
        ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   329
            className := (receiver name).
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   330
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   331
"/        nameSpace ~~ Smalltalk ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   332
"/            className := nameSpace name , '::' , className
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   333
"/        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   334
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   335
        aStream skipSeparators.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   336
        primSource := aStream nextChunk.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   337
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   338
        sel == #'primitiveDefinitions' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   339
            change := ClassPrimitiveDefinitionsChange new
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   340
        ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   341
            sel == #'primitiveFunctions' ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   342
                change := ClassPrimitiveFunctionsChange new
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   343
            ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   344
                change := ClassPrimitiveVariablesChange new
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   345
            ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   346
        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   347
        change class:className source:primSource.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   348
        aBlock value:change value:lineNumberOrNil value:posOrNil.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   349
        ^ true
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   350
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   351
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   352
    ^ false
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   353
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   354
    "Created: / 16.2.1998 / 13:42:40 / cg"
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   355
    "Modified: / 15.12.1999 / 00:29:06 / cg"
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   356
!
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   357
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   358
changesFromStream:aStream do:aBlock
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   359
    "enumerate changes from a stream and invoke aBlock on each.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   360
     The block is invoked with the change and a lineNumberOrNil as
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   361
     arg; the lineNumber is only valid, if the underlying stream 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   362
     provides line-numbers; otherwise, nil is passed."
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   363
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   364
    |chunk sawExcla lastTimeStamp s change nameSpace changes
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   365
     lineNumber pos|
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   366
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   367
    nameSpace := Smalltalk.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   368
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   369
    [aStream atEnd] whileFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   370
        aStream skipSeparators.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   371
        sawExcla := aStream peekFor:$!!.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   372
        lineNumber := aStream lineNumber.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   373
        pos := aStream position.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   374
        chunk := aStream nextChunk.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   375
        (chunk notNil and:[chunk notEmpty]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   376
            Class nameSpaceQuerySignal answer:nameSpace do:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   377
                |parser tree ns|
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   378
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   379
                parser := Parser for:chunk.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   380
                tree := parser 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   381
                            parseExpressionWithSelf:nil 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   382
                            notifying:nil 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   383
                            ignoreErrors:true 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   384
                            ignoreWarnings:true 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   385
                            inNameSpace:nameSpace.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   386
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   387
                tree == #Error ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   388
                    change := DoItChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   389
                    change source:chunk.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   390
                    aBlock value:change value:lineNumber value:pos.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   391
                ] ifFalse:[    
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   392
                    (tree notNil and:[tree ~~ #Error]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   393
                        "/ if there is any nameSpace directive in there, extract it.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   394
                        ((ns := parser currentNameSpace) notNil 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   395
                        and:[ns ~~ nameSpace]) ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   396
                            "/ self halt.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   397
                            nameSpace := ns
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   398
                        ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   399
                        Class nameSpaceQuerySignal answer:nameSpace do:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   400
                            "/
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   401
                            "/ what type of chunk is this ...
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   402
                            "/
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   403
                            tree isConstant ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   404
                                (s := tree evaluate) isString ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   405
                                    (s startsWith:'---- timestamp ') ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   406
                                        lastTimeStamp := s.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   407
                                    ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   408
                                ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   409
                                    self halt:'unexpected change-chunk'
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   410
                                ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   411
                            ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   412
                                tree isMessage ifTrue:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   413
                                    (self 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   414
                                            changesFromParseTree:tree 
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   415
                                            andStream:aStream
931
c18bf52cffd4 linenumber fix
Claus Gittinger <cg@exept.de>
parents: 930
diff changeset
   416
                                            lineNumber:lineNumber
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   417
                                            position:pos
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   418
                                            do:aBlock) ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   419
                                        change := DoItChange new.
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   420
                                        change source:chunk.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   421
                                        aBlock value:change value:lineNumber value:pos.
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   422
                                    ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   423
                                ] ifFalse:[
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   424
                                    self halt:'unexpected change-chunk'
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   425
                                ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   426
                            ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   427
                        ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   428
                    ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   429
                ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   430
            ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   431
        ]
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   432
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   433
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   434
    "
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   435
     ChangeSet fromStream:('changes' asFilename readStream)
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   436
     ChangeSet fromStream:('patches' asFilename readStream)
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   437
     ChangeSet fromStream:(Object source asString readStream)
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   438
    "
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   439
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   440
    "Created: / 16.2.1998 / 12:19:34 / cg"
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   441
    "Modified: / 14.12.1999 / 15:23:16 / cg"
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   442
!
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   443
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   444
forExistingClass:aClass
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   445
    "build a changeSet for some given class.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   446
     That does of course not give deltas, but instead reflects the current
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   447
     state of the given class.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   448
     It is useful in conjunction with the other utility methods,
965
38bc91ec40c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   449
     for example, when building patchLists, diffSets etc."
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   450
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   451
    |changeSet chunk sawExcla lastTimeStamp s change nameSpace|
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   452
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   453
    changeSet := self new.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   454
    nameSpace := Smalltalk.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   455
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   456
    "/ first, a classDefinition change ...
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   457
    changeSet addClassDefinitionChangeFor:aClass.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   458
    "/ are there any class-instVars ?
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   459
    aClass class instVarNames size > 0 ifTrue:[
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   460
        changeSet addInstVarDefinitionChangeFor:aClass class.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   461
    ].
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   462
    "/ a comment ?
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   463
    aClass comment size > 0 ifTrue:[
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   464
        changeSet addClassCommentChangeFor:aClass.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   465
    ].
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   466
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   467
    "/ class methods first ...
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   468
    aClass class methodDictionary keysAndValuesDo:[:sel :mthd |
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   469
        changeSet addMethodChange:mthd in:aClass class. 
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   470
    ].
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   471
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   472
    "/ instance methods ...
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   473
    aClass methodDictionary keysAndValuesDo:[:sel :mthd |
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   474
        changeSet addMethodChange:mthd in:aClass.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   475
    ].
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   476
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   477
    ^ changeSet
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   478
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   479
    "
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   480
     ChangeSet forExistingClass:ChangeSet
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   481
    "
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   482
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   483
    "Created: / 16.2.1998 / 12:19:34 / cg"
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   484
    "Modified: / 14.12.1999 / 15:23:16 / cg"
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   485
!
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   486
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   487
fromStream:aStream
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   488
    "build a changeSet from a stream, containing chunks.
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   489
     (i.e. either a classes sourceFile or a change-file).
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   490
     Return the changeSet."
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   491
1041
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   492
    ^ self fromStream:aStream while:[:thisChange | true]
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   493
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   494
    "
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   495
     ChangeSet fromStream:('changes' asFilename readStream)
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   496
     ChangeSet fromStream:('patches' asFilename readStream)
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   497
     ChangeSet fromStream:(Object source asString readStream)
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   498
    "
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   499
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   500
    "Created: / 16.2.1998 / 12:19:34 / cg"
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   501
    "Modified: / 14.12.1999 / 15:23:16 / cg"
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   502
!
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   503
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   504
fromStream:aStream while:aConditionBlock
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   505
    "build a changeSet from a stream, containing chunks.
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   506
     (i.e. either a classes sourceFile or a change-file).
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   507
     Return the changeSet."
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   508
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   509
    |changeSet|
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   510
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   511
    changeSet := self new.
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   512
    self changesFromStream:aStream do:[:aChange :lineNumberOrNil :posOrNil |
1041
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   513
        changeSet add:aChange.
99e1503f93fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1034
diff changeset
   514
        (aConditionBlock value:aChange) ifFalse:[^ changeSet].
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   515
    ].
921
fa4db05c887b oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents: 916
diff changeset
   516
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   517
    ^ changeSet
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   518
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   519
    "
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   520
     ChangeSet fromStream:('changes' asFilename readStream)
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   521
     ChangeSet fromStream:('patches' asFilename readStream)
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   522
     ChangeSet fromStream:(Object source asString readStream)
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   523
    "
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   524
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   525
    "Created: / 16.2.1998 / 12:19:34 / cg"
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
   526
    "Modified: / 14.12.1999 / 15:23:16 / cg"
916
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   527
!
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   528
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   529
fromXMLStream:aStream
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   530
    "build a changeSet from an XML stream, containing XML definitions.
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   531
     Return the changeSet."
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   532
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   533
    |changeSet builder nameSpace|
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   534
1042
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   535
    aStream isNil ifTrue:[^ nil].
702a30f7c328 chance to track change-chunks positions
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   536
916
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   537
    changeSet := self new.
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   538
    nameSpace := Smalltalk.
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   539
965
38bc91ec40c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   540
    builder := XML::SourceScannerNodeBuilder new.
916
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   541
    builder scanFile:aStream
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   542
            do:[:change | changeSet add: change. ].
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   543
    ^ changeSet
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   544
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   545
    "
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   546
     ChangeSet fromXMLStream:('../../goodies/xml-vw/xmlFileInTests/XMLParser.xml' asFilename readStream)
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   547
     ChangeSetBrowser 
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   548
        openOn:(ChangeSet fromXMLStream:('../../goodies/xml-vw/xmlFileInTests/XMLParser.xml' asFilename readStream))
fff32b43ac7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   549
    "
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   550
! !
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   551
883
1d1fd75b36e5 category renamining
Claus Gittinger <cg@exept.de>
parents: 879
diff changeset
   552
!ChangeSet class methodsFor:'Compatibility - ST80'!
625
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   553
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   554
patches
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   555
    ^ #()
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   556
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   557
    "Created: / 27.10.1997 / 13:52:54 / cg"
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   558
! !
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   559
1083
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   560
!ChangeSet class methodsFor:'Compatibility - VW'!
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   561
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   562
component: component definition: anObject change: changeSymbol
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   563
    "Include indication that a class/namespace was added or removed
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   564
     from a CodeComponent." 
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   565
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   566
    self 
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   567
        changed:#'component:definition:change:'
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   568
        with:
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   569
            ( Array 
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   570
                    with: component
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   571
                    with: anObject
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   572
                    with: changeSymbol
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   573
            )
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   574
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   575
! !
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   576
625
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   577
!ChangeSet class methodsFor:'queries'!
27
claus
parents: 16
diff changeset
   578
claus
parents: 16
diff changeset
   579
current
claus
parents: 16
diff changeset
   580
    "ST-80 compatibility: return the current changeSet"
claus
parents: 16
diff changeset
   581
claus
parents: 16
diff changeset
   582
    |p|
claus
parents: 16
diff changeset
   583
claus
parents: 16
diff changeset
   584
    (Project notNil and:[(p := Project current) notNil]) ifTrue:[
959
ca4fff926135 ChangeSet current: return empty collection if there is no changeSet
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
   585
        ^ p changeSet
ca4fff926135 ChangeSet current: return empty collection if there is no changeSet
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
   586
    ].
ca4fff926135 ChangeSet current: return empty collection if there is no changeSet
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
   587
    ^ #()
27
claus
parents: 16
diff changeset
   588
claus
parents: 16
diff changeset
   589
    "
claus
parents: 16
diff changeset
   590
     ChangeSet current 
claus
parents: 16
diff changeset
   591
    "
claus
parents: 16
diff changeset
   592
! !
claus
parents: 16
diff changeset
   593
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
   594
!ChangeSet methodsFor:'Compatibility - ST80'!
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   595
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
   596
changeClass:aClass
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
   597
    "dummy here"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   598
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
   599
    "Created: / 4.2.2000 / 18:30:59 / cg"
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   600
!
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   601
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   602
component:component definition:anObject change:changeSymbol
1083
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   603
    "Include indication that a class/namespace was added or removed
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   604
     from a CodeComponent." 
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   605
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   606
    self 
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   607
        changed:#'component:definition:change:'
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   608
        with:
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   609
            ( Array 
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   610
                    with: component
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   611
                    with: anObject
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   612
                    with: changeSymbol
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   613
            )
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   614
!
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
   615
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   616
reorganizeSystem
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   617
    "dummy here"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   618
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   619
    "Created: / 6.2.2000 / 20:45:10 / cg"
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   620
! !
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   621
985
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   622
!ChangeSet methodsFor:'change & update'!
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   623
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   624
changed:anAspectSymbol with:aParameter 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   625
    "Allow objects to depend on the ChangeSet class instead of a particular instance 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   626
    of ChangeSet (which may be switched using projects)."
985
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   627
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   628
    ChangeSet changed:anAspectSymbol with:aParameter.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   629
    super changed:anAspectSymbol with:aParameter
985
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   630
! !
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   631
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   632
!ChangeSet methodsFor:'changes management'!
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   633
1097
88c7c0313286 change notification
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
   634
add:aChange
88c7c0313286 change notification
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
   635
    super add:aChange.
88c7c0313286 change notification
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
   636
    self changed:#addChange with:aChange.
88c7c0313286 change notification
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
   637
!
88c7c0313286 change notification
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
   638
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   639
addClassCommentChangeFor:aClass
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   640
    "add a classComment change to the receiver"
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   641
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   642
    |newChange|
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   643
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   644
    newChange := ClassCommentChange class:aClass.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   645
    newChange comment:aClass comment.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   646
    self add:newChange
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   647
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   648
    "Modified: 15.7.1996 / 09:27:05 / cg"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   649
!
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   650
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   651
addClassDefinitionChangeFor:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   652
    "add a classDefinition change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   653
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   654
    |newChange|
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   655
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   656
    newChange := ClassDefinitionChange class:aClass source:(aClass definition).
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   657
    self add:newChange 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   658
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   659
    "Modified: 15.7.1996 / 09:27:05 / cg"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   660
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   661
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   662
addClassRemoveChange:oldClassName
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   663
    "add a classRemove change to the receiver"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   664
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   665
    |newChange|
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   666
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   667
    newChange := ClassRemoveChange new className:oldClassName.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   668
    self add:newChange 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   669
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   670
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   671
addClassRenameChangeFrom:oldName to:newName
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   672
    "add a classRename change to the receiver"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   673
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   674
    |newChange|
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   675
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   676
    newChange := ClassRenameChange new oldName:oldName newName:newName.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   677
    self add:newChange 
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   678
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   679
    "Modified: 15.7.1996 / 09:27:05 / cg"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   680
!
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   681
1081
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
   682
addDoIt:aString
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
   683
    "add a doIt to the receiver"
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
   684
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
   685
    |newChange|
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
   686
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   687
    newChange := DoItChange new source:aString.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   688
    self add:newChange.
1081
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
   689
!
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
   690
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   691
addInstVarDefinitionChangeFor:aClass
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   692
    "add an instVarDefinition change to the receiver"
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   693
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   694
    |newChange|
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   695
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   696
    newChange := ClassInstVarDefinitionChange 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   697
                        class:aClass
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   698
                        source:(aClass name , ' instanceVariableNames:' , aClass instanceVariableString storeString).
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   699
    self add:newChange
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   700
!
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
   701
16
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
   702
addMethodCategoryChange:aMethod category:newCategory in:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   703
    "add a methodCategory change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   704
16
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
   705
    |newChange|
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
   706
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   707
    newChange := MethodCategoryChange 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   708
                        class:aClass
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   709
                        selector:(aClass selectorAtMethod:aMethod)
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   710
                        category:newCategory.
16
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
   711
    self add:newChange
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
   712
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   713
    "Modified: 15.7.1996 / 09:27:15 / cg"
44
claus
parents: 39
diff changeset
   714
!
claus
parents: 39
diff changeset
   715
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   716
addMethodChange:aMethod fromOld:oldMethod in:aClass
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   717
    "add a method change to the receiver"
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   718
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   719
    |newChange|
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   720
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   721
    newChange := MethodChange 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   722
                        class:aClass
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   723
                        selector:aMethod selector
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   724
                        source:aMethod source
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   725
                        category:aMethod category.
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   726
    oldMethod notNil ifTrue:[
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   727
        newChange previousVersion:oldMethod source.
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   728
    ].
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   729
    self add:newChange.
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   730
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   731
    "Modified: 15.7.1996 / 09:27:21 / cg"
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   732
!
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   733
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   734
addMethodChange:aMethod in:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   735
    "add a method change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   736
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   737
    |newChange|
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   738
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   739
    newChange := MethodChange 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   740
                        class:aClass
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   741
                        selector:aMethod selector
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   742
                        source:aMethod source
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   743
                        category:aMethod category.
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   744
    self add:newChange
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   745
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   746
    "Modified: 15.7.1996 / 09:27:21 / cg"
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   747
!
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   748
44
claus
parents: 39
diff changeset
   749
addMethodPrivacyChange:aMethod in:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   750
    "add a methodPrivacy change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   751
44
claus
parents: 39
diff changeset
   752
    |newChange|
claus
parents: 39
diff changeset
   753
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   754
    newChange := MethodPrivacyChange 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   755
                        class:aClass
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   756
                        selector:(aClass selectorAtMethod:aMethod)
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   757
                        privacy:aMethod privacy.
44
claus
parents: 39
diff changeset
   758
    self add:newChange
claus
parents: 39
diff changeset
   759
claus
parents: 39
diff changeset
   760
    "Modified: 27.8.1995 / 22:55:22 / claus"
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   761
    "Modified: 15.7.1996 / 09:27:28 / cg"
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   762
!
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   763
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   764
addPrimitiveDefinitionsChangeFor:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   765
    "add a primitiveDefinitions change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   766
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   767
    |newChange|
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   768
783
90ffa6f0a86b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   769
    newChange := ClassPrimitiveDefinitionsChange new
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   770
                        class:aClass name source:(aClass primitiveDefinitionsString).
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   771
    self add:newChange
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   772
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   773
    "Modified: 15.7.1996 / 09:27:40 / cg"
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   774
!
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   775
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   776
addPrimitiveFunctionsChangeFor:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   777
    "add a primitiveFunctions change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   778
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   779
    |newChange|
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   780
783
90ffa6f0a86b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   781
    newChange := ClassPrimitiveFunctionsChange new
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   782
                        class:aClass name source:(aClass primitiveFunctionsString).
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   783
    self add:newChange
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   784
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   785
    "Modified: 15.7.1996 / 09:27:47 / cg"
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   786
!
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   787
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   788
addPrimitiveVariablesChangeFor:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   789
    "add a primitiveVariables change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   790
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   791
    |newChange|
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   792
783
90ffa6f0a86b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   793
    newChange := ClassPrimitiveVariablesChange new
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   794
                         class:aClass name source:(aClass primitiveVariablesString).
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   795
    self add:newChange
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   796
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   797
    "Modified: 15.7.1996 / 09:27:55 / cg"
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   798
!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   799
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   800
addRemoveSelectorChange:aSelector in:aClass
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   801
    "add a method-remove change to the receiver"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   802
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   803
    |newChange|
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   804
1081
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
   805
    newChange := MethodRemoveChange class:aClass selector:aSelector.
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   806
    self add:newChange
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   807
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   808
    "Modified: / 27.8.1995 / 22:55:22 / claus"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   809
    "Modified: / 15.7.1996 / 09:27:28 / cg"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   810
    "Created: / 16.2.1998 / 12:47:07 / cg"
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   811
!
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   812
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   813
addRenameCategoryChangeIn:aClass from:oldCategory to:newCategory
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   814
    "add a category rename change to the receiver"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   815
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   816
    |newChange|
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   817
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   818
    newChange := MethodCategoryRenameChange class:aClass.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   819
    newChange oldCategoryName:oldCategory newCategoryName:newCategory.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   820
    self add:newChange
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   821
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
   822
    "Modified: / 6.2.2000 / 02:30:30 / cg"
0
470788421600 Initial revision
claus
parents:
diff changeset
   823
! !
470788421600 Initial revision
claus
parents:
diff changeset
   824
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   825
!ChangeSet methodsFor:'misc'!
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   826
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   827
addPatch:nameOfPatch
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   828
    "ignored for now - allows fileIn of ST-80 patch stuff .."
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   829
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   830
    ^ self
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   831
! !
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   832
1034
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
   833
!ChangeSet methodsFor:'queries'!
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
   834
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
   835
includesChangeForClass:aClass
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   836
    |nameOfClass|
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   837
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   838
    nameOfClass := aClass theNonMetaclass name.
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   839
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   840
    ^ self contains:[:aChange | 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   841
                                aChange className = nameOfClass
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   842
                    ]
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   843
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   844
    "
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   845
     ChangeSet current includesChangeForClass:ChangeSet
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   846
     ChangeSet current includesChangeForClass:ChangeSet class
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   847
    "
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   848
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   849
    "Modified: / 31.10.2001 / 10:58:40 / cg"
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   850
!
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   851
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   852
includesChangeForClass:aClass selector:selector
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   853
    |nameOfClass|
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   854
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   855
    nameOfClass := aClass name.
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   856
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   857
    ^ self contains:[:aChange | 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   858
                        aChange selector = selector
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   859
                        ifFalse:[
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   860
                            false
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   861
                        ] ifTrue:[
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   862
                            aChange className = nameOfClass 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   863
                        ]
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   864
                    ]
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   865
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   866
    "
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   867
     ChangeSet current includesChangeForClass:ChangeSet selector:#includesChangeForClass:
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   868
    "
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   869
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   870
    "Created: / 31.10.2001 / 10:26:31 / cg"
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
   871
    "Modified: / 31.10.2001 / 10:59:49 / cg"
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   872
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   873
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   874
includesChangeForClassOrMetaclass:aClass
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   875
    |nameOfClass nameOfMetaclass|
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   876
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   877
    nameOfClass := aClass theNonMetaclass name.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   878
    nameOfMetaclass := aClass theMetaclass name.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   879
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   880
    ^ self contains:[:aChange | 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   881
                        |changeClassName|
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   882
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   883
                        changeClassName := aChange className.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   884
                        changeClassName = nameOfClass or:[changeClassName = nameOfMetaclass]
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   885
                    ]
1034
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
   886
! !
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
   887
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   888
!ChangeSet methodsFor:'utilities'!
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   889
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   890
apply
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   891
    "apply all changes in the receivers changeSet"
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   892
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   893
    self do:[:aChange |
879
bfd06666f6c1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   894
	aChange apply
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   895
    ]
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   896
!
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   897
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   898
condenseChangesForClass:aClass 
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   899
    "remove all changes for aClass
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   900
     (i.e. leave changes for other classes)."
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   901
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   902
    self condenseChangesForClass:aClass package:nil
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   903
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   904
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   905
condenseChangesForClass:aClass package:aPackageSymbol
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   906
    "remove all changes for aClass and aPackageSymbol
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   907
     (i.e. leave methodChanges for other packages).
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   908
     This is invoked when a class is checked into the repository."
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   909
945
f9e349d38d49 care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
   910
    |changesToRemove className metaClassName chgCls|
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   911
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   912
    changesToRemove := OrderedCollection new.
945
f9e349d38d49 care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
   913
    className := aClass theNonMetaclass name.
f9e349d38d49 care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
   914
    metaClassName := aClass theMetaclass name.
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   915
    self do:[:aChange | 
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   916
        |chgClassName chgClass removeThis mClass mthd|
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   917
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   918
        removeThis := false.
945
f9e349d38d49 care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
   919
        chgClassName := aChange className.
f9e349d38d49 care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
   920
        (chgClassName = className
f9e349d38d49 care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
   921
        or:[chgClassName = metaClassName]) ifTrue:[
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   922
            removeThis := true.
944
f4cb7e9b034b when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   923
        ] ifFalse:[
f4cb7e9b034b when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   924
            chgCls := aChange changeClass.
f4cb7e9b034b when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   925
            (chgCls notNil
f4cb7e9b034b when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   926
            and:[chgCls isPrivate
f4cb7e9b034b when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   927
            and:[chgCls owningClass == aClass]]) ifTrue:[
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   928
                removeThis := true
944
f4cb7e9b034b when condensing, also care for private classes
Claus Gittinger <cg@exept.de>
parents: 939
diff changeset
   929
            ]
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   930
        ].
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   931
        removeThis ifTrue:[
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   932
            aChange isMethodChange ifTrue:[
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   933
                mClass := aChange changeClass.
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   934
                mClass notNil ifTrue:[
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   935
                    mthd := mClass compiledMethodAt:(aChange selector).
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   936
                    mthd isNil ifTrue:[
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   937
                        "/ mthd does no longer exist
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   938
                        aPackageSymbol notNil ifTrue:[
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   939
                            removeThis := false
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   940
                        ]
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   941
                    ] ifFalse:[
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   942
                        (aPackageSymbol notNil and:[mthd package ~= aPackageSymbol]) ifTrue:[
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   943
                            removeThis := false
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   944
                        ]
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   945
                    ]
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   946
                ]
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   947
            ].
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   948
        ].
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   949
        removeThis ifTrue:[
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   950
            changesToRemove add:aChange
887
3cfdf7d2ba89 oops - must care for unloaded/nonExistent/removed/renamed classes
Claus Gittinger <cg@exept.de>
parents: 883
diff changeset
   951
        ]
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   952
    ].
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   953
    self removeAll:changesToRemove
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   954
1088
6575d464d900 condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1087
diff changeset
   955
    "Modified: / 5.11.2001 / 14:29:22 / cg"
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   956
!
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   957
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   958
condenseChangesForExtensionsInPackage:aPackageSymbol
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   959
    "remove all changes for aClass and aPackageSymbol
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   960
     (i.e. leave methodChanges for other packages).
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   961
     This is invoked when a class is checked into the repository."
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   962
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   963
    |changesToRemove|
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   964
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   965
    changesToRemove := OrderedCollection new.
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   966
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   967
    self do:[:aChange | 
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   968
        |removeThis mClass mthd|
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   969
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   970
        aChange isMethodChange ifTrue:[
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   971
            removeThis := false.
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   972
            mClass := aChange changeClass.
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   973
            mClass notNil ifTrue:[
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   974
                mthd := mClass compiledMethodAt:(aChange selector).
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   975
                mthd package ~= aPackageSymbol ifTrue:[
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   976
                    removeThis := false
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   977
                ]
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   978
            ].
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   979
            removeThis ifTrue:[
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   980
                changesToRemove add:aChange
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   981
            ]
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   982
        ].
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   983
    ].
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   984
    self removeAll:changesToRemove
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   985
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   986
    "Modified: / 5.11.2001 / 14:11:45 / cg"
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
   987
    "Created: / 5.11.2001 / 14:21:17 / cg"
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   988
!
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
   989
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   990
diffSetsAgainst:anotherChangeSet
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   991
    "walk over the receiver and anotherChangeSet,
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   992
     add all changes to one of the tree lists:
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
   993
        onlyInReceiver, onlyInArg or changed,
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
   994
     each being a changeSet containing corresponding changes.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
   995
     WARNING: destructive; could modify both the receiver and the argument"
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   996
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   997
    |onlyInReceiver onlyInArg changedMethods
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   998
     indexFromChangedMethodsToA indexFromChangedMethodsToB
864
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
   999
     "info" ret|
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1000
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1001
    onlyInReceiver := ChangeSet new.
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1002
    onlyInArg      := ChangeSet new.
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1003
    changedMethods := ChangeSet new.
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1004
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1005
    indexFromChangedMethodsToA := OrderedCollection new.
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1006
    indexFromChangedMethodsToB := OrderedCollection new.
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1007
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1008
    self keysAndValuesDo:[:idxA :aChangeInA |
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1009
        |anyFound ch|
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1010
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1011
        anyFound := false.
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1012
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1013
        anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB |
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1014
            (aChangeInA isForSameAs:aChangeInB) ifTrue:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1015
                anyFound := true.
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1016
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1017
                "/ also in B - is it different ?
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1018
                (aChangeInA sameAs:aChangeInB) ifFalse:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1019
                    changedMethods add:aChangeInA.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1020
                    indexFromChangedMethodsToA add:idxA.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1021
                    indexFromChangedMethodsToB add:idxB.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1022
                ] ifTrue:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1023
                    aChangeInA isMethodChange ifTrue:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1024
                        aChangeInA methodCategory ~= aChangeInB methodCategory ifTrue:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1025
                            "/ only the category is different;
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1026
                            "/ make it a MethodCategory changes.
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1027
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1028
                            ch := MethodCategoryChange new
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1029
                                    className:aChangeInA className
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1030
                                    selector:aChangeInA selector
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1031
                                    category:aChangeInA methodCategory.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1032
                            self at:idxA put:ch.
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1033
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1034
                            ch := MethodCategoryChange new
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1035
                                    className:aChangeInB className
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1036
                                    selector:aChangeInB selector
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1037
                                    category:aChangeInB methodCategory.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1038
                            anotherChangeSet at:idxB put:ch.
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1039
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1040
                            changedMethods add:aChangeInA.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1041
                            indexFromChangedMethodsToA add:idxA.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1042
                            indexFromChangedMethodsToB add:idxB.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1043
                        ]
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1044
                    ].
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1045
                ]
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1046
            ] ifFalse:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1047
                (aChangeInA sameAs:aChangeInB) ifTrue:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1048
                    anyFound := true.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1049
                ] ifFalse:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1050
                ]
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1051
            ]
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1052
        ].
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1053
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1054
        anyFound ifFalse:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1055
            onlyInReceiver add:aChangeInA.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1056
        ]
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1057
    ].
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1058
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1059
    anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB |
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1060
        |anyFound|
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1061
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1062
        anyFound := false.
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1063
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1064
        self do:[:aChangeInA |
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1065
            |idxM|
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1066
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1067
            (aChangeInA isForSameAs:aChangeInB) ifTrue:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1068
                anyFound := true.
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1069
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1070
                "/ also in B - is it different ?
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1071
                (aChangeInA sameAs:aChangeInB) ifFalse:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1072
                    "/ already there ?
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1073
                    idxM := changedMethods findFirst:[:c | c isForSameAs:aChangeInB].
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1074
                    idxM == 0 ifTrue:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1075
                        changedMethods add:aChangeInB.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1076
                        indexFromChangedMethodsToB add:idxB.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1077
                    ] ifFalse:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1078
                        indexFromChangedMethodsToB at:idxM put:idxB
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1079
                    ]
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1080
                ]
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1081
            ] ifFalse:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1082
                (aChangeInA sameAs:aChangeInB) ifTrue:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1083
                    anyFound := true.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1084
                ] ifFalse:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1085
                ]
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1086
            ]
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1087
        ].
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1088
        anyFound ifFalse:[
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1089
            onlyInArg add:aChangeInB.
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1090
        ]
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1091
    ].
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1092
864
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  1093
"/    info := OrderedCollection new:(changedMethods size).
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  1094
"/    changedMethods keysAndValuesDo:[:idx :changedMethod |
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  1095
"/        info add:(Array 
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  1096
"/                        with:(indexFromChangedMethodsToA at:idx)
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  1097
"/                        with:(indexFromChangedMethodsToB at:idx)
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  1098
"/                 )
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  1099
"/    ].
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1100
    changedMethods := (1 to:changedMethods size) collect:[:idx |
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1101
                        |cA cB|
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1102
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1103
                        cA := self at:(indexFromChangedMethodsToA at:idx).
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1104
                        cB := anotherChangeSet at:(indexFromChangedMethodsToB at:idx).
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1105
                        Array with:cA with:cB
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  1106
                      ].
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1107
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1108
    ret := IdentityDictionary new.
864
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  1109
"/    ret at:#info           put:info.
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1110
    ret at:#changed        put:changedMethods.
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1111
    ret at:#onlyInReceiver put:onlyInReceiver.
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1112
    ret at:#onlyInArg      put:onlyInArg.
864
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  1113
    ^ret
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1114
! !
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1115
625
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
  1116
!ChangeSet class methodsFor:'documentation'!
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1117
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1118
version
1097
88c7c0313286 change notification
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1119
    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSet.st,v 1.67 2001-11-08 18:32:34 cg Exp $'
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1120
! !