ChangeSet.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 15:21:52 +0200
changeset 4455 af2a675e0f32
parent 4445 c6a9179c1637
child 4461 dc5e1bc4696d
permissions -rw-r--r--
#FEATURE by exept class: ProjectChecker class definition added: #skipCheckClasses: changed: #checkClasses #initialize
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4397
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
     1
"{ Encoding: utf8 }"
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
     2
3
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     3
"
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     4
 COPYRIGHT (c) 1993 by Claus Gittinger
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
     5
	      All Rights Reserved
3
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     6
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     7
 This software is furnished under a license and may be used
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     8
 only in accordance with the terms of that license and with the
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    10
 be provided or otherwise made available to, or used by, any
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    11
 other person.  No title to or ownership of the software is
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    12
 hereby transferred.
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    13
"
921
fa4db05c887b oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents: 916
diff changeset
    14
"{ Package: 'stx:libbasic3' }"
fa4db05c887b oops - nameSpace prefix handling needed fix due
Claus Gittinger <cg@exept.de>
parents: 916
diff changeset
    15
3697
2fa150de2ee1 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3696
diff changeset
    16
"{ NameSpace: Smalltalk }"
2fa150de2ee1 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3696
diff changeset
    17
0
470788421600 Initial revision
claus
parents:
diff changeset
    18
OrderedCollection subclass:#ChangeSet
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    19
	instanceVariableNames:'changedClasses changeSelectors name'
4305
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
    20
	classVariableNames:'CurrentIfNoCurrentProject'
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    21
	poolDictionaries:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    22
	category:'System-Changes'
0
470788421600 Initial revision
claus
parents:
diff changeset
    23
!
470788421600 Initial revision
claus
parents:
diff changeset
    24
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
    25
Object subclass:#ChangeFileReader
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    26
	instanceVariableNames:'inputStream parseTree changeAction changeSet selector receiver
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    27
		arguments receiverSelector receiverReceiver lineNumber position
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
    28
		className methodSelector nameSpaceOverride chunk timestamp
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
    29
		classIsJava'
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    30
	classVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    31
	poolDictionaries:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    32
	privateIn:ChangeSet
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
    33
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
    34
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
    35
ChangeSet::ChangeFileReader subclass:#BeeChangeFileReader
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
    36
	instanceVariableNames:''
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
    37
	classVariableNames:''
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
    38
	poolDictionaries:''
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
    39
	privateIn:ChangeSet
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
    40
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
    41
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
    42
Object subclass:#ChangeFileWriter
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
    43
	instanceVariableNames:''
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
    44
	classVariableNames:''
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
    45
	poolDictionaries:''
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
    46
	privateIn:ChangeSet
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
    47
!
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
    48
2256
b98137d2aa30 changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
    49
Error subclass:#ChangeProcessingError
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    50
	instanceVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    51
	classVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    52
	poolDictionaries:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    53
	privateIn:ChangeSet
2256
b98137d2aa30 changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
    54
!
b98137d2aa30 changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
    55
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    56
SmalltalkChunkFileSourceWriter subclass:#ClassSourceWriter
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
    57
	instanceVariableNames:'changeSetBeingSaved packageName namespaceName topClassName
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
    58
		classInfos metaInfos'
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    59
	classVariableNames:''
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    60
	poolDictionaries:''
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    61
	privateIn:ChangeSet
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    62
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    63
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    64
Object subclass:#ClassInfo
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
    65
	instanceVariableNames:'name superclass definition comment methods methodDictionary
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
    66
		namespace primitiveDefinitions primitiveVariables
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
    67
		primitiveFunctions'
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    68
	classVariableNames:''
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    69
	poolDictionaries:''
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    70
	privateIn:ChangeSet::ClassSourceWriter
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    71
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    72
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
    73
Object subclass:#DiffSet
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
    74
	instanceVariableNames:'changed onlyInReceiver onlyInArg same'
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    75
	classVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    76
	poolDictionaries:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    77
	privateIn:ChangeSet
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
    78
!
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
    79
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
    80
ChangeSet::ChangeFileReader subclass:#DolphinPACFileReader
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    81
	instanceVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    82
	classVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    83
	poolDictionaries:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
    84
	privateIn:ChangeSet
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
    85
!
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
    86
4397
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
    87
ChangeSet::ChangeFileReader subclass:#GNUSmalltalkFileReader
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
    88
	instanceVariableNames:'parser'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
    89
	classVariableNames:''
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
    90
	poolDictionaries:''
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
    91
	privateIn:ChangeSet
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
    92
!
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
    93
4428
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
    94
ChangeSet::ChangeFileReader subclass:#GithubPharoSmalltalkFileReader
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
    95
	instanceVariableNames:'parser'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
    96
	classVariableNames:''
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
    97
	poolDictionaries:''
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
    98
	privateIn:ChangeSet
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
    99
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   100
2256
b98137d2aa30 changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
   101
ChangeSet::ChangeProcessingError subclass:#InvalidChangeChunkError
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   102
	instanceVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   103
	classVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   104
	poolDictionaries:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   105
	privateIn:ChangeSet
2256
b98137d2aa30 changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
   106
!
b98137d2aa30 changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
   107
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   108
ChangeSet::ChangeFileReader subclass:#SIFChangeFileReader
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   109
	instanceVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   110
	classVariableNames:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   111
	poolDictionaries:''
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   112
	privateIn:ChangeSet
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   113
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   114
625
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   115
!ChangeSet class methodsFor:'documentation'!
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   116
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   117
copyright
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   118
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   119
 COPYRIGHT (c) 1993 by Claus Gittinger
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   120
	      All Rights Reserved
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   121
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   122
 This software is furnished under a license and may be used
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   123
 only in accordance with the terms of that license and with the
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   124
 inclusion of the above copyright notice.   This software may not
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   125
 be provided or otherwise made available to, or used by, any
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   126
 other person.  No title to or ownership of the software is
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   127
 hereby transferred.
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   128
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   129
!
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   130
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   131
documentation
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   132
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   133
    used in the changes management to keep track of changes
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   134
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
   135
    [author:]
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   136
	Claus Gittinger
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   137
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   138
! !
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
   139
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   140
!ChangeSet class methodsFor:'instance creation'!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
   141
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   142
forExistingClass:aClass
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
   143
    "build a changeSet for some given class, all of its private classes
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   144
     and all extensions if any.
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
   145
     I.e. a changeSet which represents the existing class in the image.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   146
     That does of course not give deltas, but instead reflects the current
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   147
     state of the given class.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   148
     It is useful in conjunction with the other utility methods,
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
   149
     for example, when building patchLists, diffSets, comparing etc."
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   150
1954
521fa986be30 Fix if method does not exist in change
Stefan Vogel <sv@exept.de>
parents: 1920
diff changeset
   151
    |changeSet s changeObject|
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   152
2633
5a5460e5231a comment/format in:
Claus Gittinger <cg@exept.de>
parents: 2626
diff changeset
   153
    "/ kludge: could do this much faster...
1188
a4594193f884 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1187
diff changeset
   154
    s := ReadWriteStream on:''.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   155
    aClass fileOutOn:s.
1188
a4594193f884 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1187
diff changeset
   156
    s reset.
a4594193f884 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1187
diff changeset
   157
    changeSet := self fromStream:s.
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   158
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
   159
    "/ fetch the real package info...
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   160
    changeSet do:[:eachChange |
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   161
	eachChange isMethodChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   162
	    changeObject := eachChange changeMethod.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   163
	    changeObject notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   164
		eachChange package:changeObject package
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   165
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   166
	] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   167
	    eachChange isClassChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   168
		changeObject := eachChange changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   169
		changeObject notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   170
		    eachChange package:changeObject package
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   171
		].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   172
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   173
	].
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   174
    ].
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   175
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   176
    ^ changeSet
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   177
1188
a4594193f884 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1187
diff changeset
   178
"/    |source changeSet chunk sawExcla lastTimeStamp s change nameSpace|
a4594193f884 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1187
diff changeset
   179
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   180
"/    changeSet := self new.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   181
"/
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   182
"/    "/ first, a classDefinition change ...
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   183
"/    changeSet addClassDefinitionChangeFor:aClass.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   184
"/    "/ are there any class-instVars ?
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   185
"/    aClass class instVarNames size > 0 ifTrue:[
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   186
"/        changeSet addInstVarDefinitionChangeFor:aClass class.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   187
"/    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   188
"/    "/ a comment ?
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   189
"/    aClass comment size > 0 ifTrue:[
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   190
"/        changeSet addClassCommentChangeFor:aClass.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   191
"/    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   192
"/
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   193
"/    "/ class methods first ...
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   194
"/    aClass class methodDictionary keysAndValuesDo:[:sel :mthd |
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   195
"/        changeSet addMethodChange:mthd in:aClass class.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   196
"/    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   197
"/
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   198
"/    "/ instance methods ...
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   199
"/    aClass methodDictionary keysAndValuesDo:[:sel :mthd |
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   200
"/        changeSet addMethodChange:mthd in:aClass.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   201
"/    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   202
"/
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   203
"/    ^ changeSet
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   204
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   205
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   206
    "
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   207
     ChangeSet forExistingClass:ChangeSet
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
   208
     ChangeSet forExistingClass:A
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   209
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   210
     Rectangle hasExtensions
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   211
     ChangeSet forExistingClass:Rectangle
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   212
    "
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   213
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   214
    "Created: / 16-02-1998 / 12:19:34 / cg"
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
   215
    "Modified: / 12-10-2006 / 23:45:14 / cg"
2633
5a5460e5231a comment/format in:
Claus Gittinger <cg@exept.de>
parents: 2626
diff changeset
   216
    "Modified (format): / 01-12-2011 / 19:10:22 / cg"
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   217
!
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   218
2940
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   219
forExistingClass:aClass withExtensions:withExtensions
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   220
    "build a changeSet for some given full class with or without extensions.
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   221
     That does of course not give deltas, but instead reflects the current
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   222
     state of the given class.
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   223
     It is useful in conjunction with the other utility methods,
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   224
     for example, when building patchLists, diffSets etc."
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   225
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   226
    ^ self
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   227
	forExistingClass:aClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   228
	withExtensions:withExtensions
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   229
	withLooseMethods:false
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   230
	extensionsOnly:false
2940
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   231
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   232
    "
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   233
     Object hasExtensions
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   234
     Object extensions size
2940
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   235
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   236
     (ChangeSet forExistingClass:Object) size
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   237
     (ChangeSet forExistingClass:Object withExtensions:false) size
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   238
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   239
     (ChangeSet forExistingClass:stx_libbasic3 withExtensions:false)
2940
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   240
    "
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   241
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   242
    "Created: / 12-10-2006 / 18:13:02 / cg"
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   243
    "Modified: / 12-10-2006 / 23:46:05 / cg"
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   244
!
a81457cc5d01 added: #forExistingClass:withExtensions:
Claus Gittinger <cg@exept.de>
parents: 2934
diff changeset
   245
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   246
forExistingClass:aClass withExtensions:withExtensions extensionsOnly:extensionsOnly
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
   247
    "build a changeSet for some given full class, the base-class or the extensions only,
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
   248
     as specified by the with-arguments.
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   249
     That does of course not give deltas, but instead reflects the current
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   250
     state of the given class.
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   251
     It is useful in conjunction with the other utility methods,
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   252
     for example, when building patchLists, diffSets etc."
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   253
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   254
    ^ self
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   255
	forExistingClass:aClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   256
	withExtensions:withExtensions
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   257
	withLooseMethods:false
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   258
	extensionsOnly:extensionsOnly
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   259
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   260
    "
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   261
     ChangeSet forExistingClass:ChangeSet
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   262
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   263
     Rectangle hasExtensions
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   264
     Rectangle extensions
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   265
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   266
     ChangeSet forExistingClass:Rectangle withExtensions:true extensionsOnly:false
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   267
     ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:false
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   268
     ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:true
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   269
    "
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   270
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   271
    "Created: / 12-10-2006 / 18:13:02 / cg"
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   272
    "Modified: / 12-10-2006 / 23:46:05 / cg"
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   273
!
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   274
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   275
forExistingClass:aClass withExtensions:withExtensions withLooseMethods:withLooseMethods
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   276
    "build a changeSet for some given full class with or without extensions.
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   277
     That does of course not give deltas, but instead reflects the current
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   278
     state of the given class.
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   279
     It is useful in conjunction with the other utility methods,
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   280
     for example, when building patchLists, diffSets etc."
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   281
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   282
    ^ self
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   283
	forExistingClass:aClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   284
	withExtensions:withExtensions
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   285
	withLooseMethods:withLooseMethods
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   286
	extensionsOnly:false
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   287
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   288
    "
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   289
     Object hasExtensions
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   290
     Object extensions size
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   291
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   292
     (ChangeSet forExistingClass:Object) size
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   293
     (ChangeSet forExistingClass:Object withExtensions:false) size
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   294
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   295
     (ChangeSet forExistingClass:stx_libbasic3 withExtensions:false)
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   296
    "
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   297
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   298
    "Created: / 12-10-2006 / 18:13:02 / cg"
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   299
    "Modified: / 12-10-2006 / 23:46:05 / cg"
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   300
!
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   301
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   302
forExistingClass:aClass withExtensions:withExtensions withLooseMethods:withLooseMethods extensionsOnly:extensionsOnly
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   303
    "build a changeSet for some given full class, the base-class or the extensions only,
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   304
     as specified by the with-arguments.
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   305
     That does of course not give deltas, but instead reflects the current
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   306
     state of the given class.
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   307
     It is useful in conjunction with the other utility methods,
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   308
     for example, when building patchLists, diffSets etc."
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   309
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   310
    |changeSet classPackage notInClassesPackage realExtensions looseMethods|
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   311
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   312
    changeSet := self forExistingClass:aClass.
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   313
    classPackage := aClass package.
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   314
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   315
    notInClassesPackage :=
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   316
		[:change |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   317
		    change isMethodChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   318
		    and:[ change package ~= classPackage ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   319
		].
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   320
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   321
    realExtensions :=
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   322
		[:change |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   323
		    change isMethodChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   324
		    and:[ change package ~= classPackage
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   325
		    and:[ change package ~~ PackageId noProjectID ]]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   326
		].
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   327
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   328
    looseMethods :=
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   329
		[:change |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   330
		    change isMethodChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   331
		    and:[change package == PackageId noProjectID ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   332
		].
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   333
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   334
    extensionsOnly ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   335
	withLooseMethods ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   336
	    ^ changeSet select:notInClassesPackage
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   337
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   338
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   339
	^ changeSet select:realExtensions.
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   340
    ].
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   341
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   342
    withExtensions ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   343
	withLooseMethods ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   344
	    ^ changeSet reject:notInClassesPackage
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   345
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   346
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   347
	^ changeSet reject:realExtensions.
2943
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   348
    ].
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   349
Claus Gittinger <cg@exept.de>
parents: 2941
diff changeset
   350
    withLooseMethods ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   351
	^ changeSet reject:looseMethods.
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   352
    ].
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   353
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   354
    ^ changeSet
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   355
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   356
    "
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   357
     ChangeSet forExistingClass:ChangeSet
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   358
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   359
     Rectangle hasExtensions
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   360
     Rectangle extensions
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   361
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   362
     ChangeSet forExistingClass:Rectangle withExtensions:true extensionsOnly:false
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   363
     ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:false
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   364
     ChangeSet forExistingClass:Rectangle withExtensions:false extensionsOnly:true
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   365
    "
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   366
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
   367
    "Created: / 12-10-2006 / 18:13:02 / cg"
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
   368
    "Modified: / 12-10-2006 / 23:46:05 / cg"
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   369
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   370
1292
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   371
forExistingMethods:aCollectionOfMethods
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   372
    "build a changeSet for a collection of methods in the image.
1292
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   373
     That does of course not give deltas, but instead reflects the current
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   374
     state of the given set of methods.
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   375
     It is useful in conjunction with the other utility methods,
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   376
     for example, when building patchLists, diffSets etc."
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   377
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   378
    |changeSet stream previousPackage|
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   379
2244
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   380
    changeSet := self new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   381
    aCollectionOfMethods do:[:eachMethod |
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   382
        |change source|
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   383
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   384
        source := eachMethod source.
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   385
        source isNil ifTrue:[
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   386
            Transcript showCR:'oops - no source for ',eachMethod whoString.
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   387
        ].
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   388
        change := MethodDefinitionChange new.
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   389
        eachMethod mclass notNil ifTrue:[ change className:eachMethod mclass name ].
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   390
        source notNil ifTrue:[ change source:source ].
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   391
        change selector:eachMethod selector.
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   392
        change package:(eachMethod package).
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   393
        change category:(eachMethod category).
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   394
        changeSet add:change.
1292
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   395
    ].
2244
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   396
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   397
"/    stream := ReadWriteStream on:''.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   398
"/    aCollectionOfMethods do:[:eachMethod |
2244
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   399
"/        previousPackage ~= eachMethod package ifTrue:[
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   400
"/            stream nextPutAll:'"{ Package: '''.
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   401
"/            stream nextPutAll:eachMethod package asString.
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   402
"/            stream nextPutAll:''' }"'; cr; cr.
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   403
"/        ].
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   404
"/        eachMethod mclass fileOutMethod:eachMethod on:stream
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   405
"/    ].
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   406
"/    stream reset.
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   407
"/    changeSet := self fromStream:stream.
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   408
"/    changeSet do:[:eachChange |
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   409
"/        eachChange package:(eachChange changeMethod package).
83dade66e325 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   410
"/    ].
1292
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   411
    ^ changeSet
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   412
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   413
    "
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   414
     ChangeSet forExistingMethods:(Array with:(Array compiledMethodAt:#at:)
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   415
                                         with:(Object compiledMethodAt:#at:)
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   416
                                         with:(Behavior compiledMethodAt:#compiledMethodAt:) )
1292
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   417
    "
1872
7a1f2a26bf90 changes for compare-project functionality
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   418
2524
309a3ec3f7d1 changed: #forExistingMethods:
Claus Gittinger <cg@exept.de>
parents: 2519
diff changeset
   419
    "Modified: / 17-09-2011 / 10:26:03 / cg"
1292
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   420
!
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
   421
3619
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   422
forPackage: pkg
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   423
    "build a changeSet for a given package in the image"
3619
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   424
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   425
    ^self forPackage: pkg ignoreAutoloaded: false.
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   426
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   427
    "Created: / 20-05-2008 / 17:56:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   428
    "Modified: / 12-08-2009 / 14:23:15 / Jan Vrany <vranyj1@fel.cvut.cz>"
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   429
!
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   430
3619
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   431
forPackage: pkg ignoreAutoloaded: ignoreAutoloaded
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   432
    "build a changeSet for a given package in the image"
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   433
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   434
    |changeSet packageClasses packageExtensions|
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   435
3619
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   436
    packageClasses := ProjectDefinition searchForClassesWithProject: pkg.
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   437
    packageClasses := packageClasses select:[:each | each programmingLanguage isSmalltalk ].
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   438
    packageExtensions := ProjectDefinition searchForExtensionsWithProject: pkg.
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   439
    packageExtensions := packageExtensions select:[:each | each programmingLanguage isSmalltalk ].
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   440
    changeSet := self forExistingMethods: packageExtensions.
2941
6bb8b3184650 formatting: #forPackage:ignoreAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 2940
diff changeset
   441
    packageClasses do:[:cls|
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   442
        (ignoreAutoloaded not and:[cls isLoaded not]) ifTrue:[cls autoload].
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   443
        cls isLoaded ifTrue: [
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   444
            changeSet addAll: (self forExistingClass:cls withExtensions:false)
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   445
        ]
2941
6bb8b3184650 formatting: #forPackage:ignoreAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 2940
diff changeset
   446
    ].
3619
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   447
    changeSet name: 'Package ' , pkg.
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   448
    ^changeSet
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   449
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   450
    "Created: / 12-08-2009 / 14:22:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
3619
e2a5752d7e1d Fix in ChangeSet>>#forPackage:ignoreAutoloaded: - ignore non-Smalltalk classes and methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3593
diff changeset
   451
    "Modified: / 31-07-2014 / 09:51:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   452
!
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   453
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   454
fromBeeStream:aStream
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   455
    "build a changeSet from a Bee Smalltalk .bsc format stream, containing chunks.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   456
     Return the changeSet."
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   457
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   458
    ^ self fromBeeStream:aStream while:[:thisChange | true]
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   459
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   460
    "Created: / 21-08-2014 / 18:34:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   461
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   462
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   463
fromBeeStream:aStream while:aConditionBlock
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   464
    "build a changeSet from a Bee Smalltalk .bsc stream, containing chunks
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   465
     Pass each change to the conditionBlock and stop whenever that
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   466
     returns false. This allows skipping reamaining chunks, and speeding up
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   467
     reading, if only parts need to be extracted
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   468
     (for example: only documentation methods).
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   469
     Return the changeSet."
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   470
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   471
    |changeSet|
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   472
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   473
    changeSet := self new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   474
    self
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   475
	changesFromStream:aStream
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   476
	for:changeSet
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   477
	reader:(BeeChangeFileReader new)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   478
	do:[:aChange :lineNumberOrNil :posOrNil |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   479
	    changeSet add:aChange.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   480
	    (aConditionBlock value:aChange) ifFalse:[^ changeSet].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   481
	].
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   482
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   483
    ^ changeSet
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   484
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   485
    "Created: / 21-08-2014 / 18:34:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   486
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   487
2321
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   488
fromDiffSet:aDiffSet
2322
c5ebd3b56e54 comment/format in: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2321
diff changeset
   489
    "build a changeSet from a given diffSet. This can be used as a patchSet,
c5ebd3b56e54 comment/format in: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2321
diff changeset
   490
     to update the first-version in the diffSet to the second-version"
2321
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   491
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   492
    |changeSet|
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   493
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   494
    changeSet := self new.
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
   495
    "/ class definitions first...
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
   496
    changeSet addAll:((aDiffSet changed collect:[:eachPair | eachPair second]) select:[:ch | ch isClassDefinitionChange]).
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
   497
    changeSet addAll:((aDiffSet onlyInArg) select:[:ch | ch isClassDefinitionChange]).
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
   498
2321
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   499
    "/ first add new methods...
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
   500
    changeSet addAll:((aDiffSet onlyInArg) reject:[:ch | ch isClassDefinitionChange]).
2321
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   501
    "/ then, changed methods...
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
   502
    changeSet addAll:((aDiffSet changed collect:[:eachPair | eachPair second]) reject:[:ch | ch isClassDefinitionChange]).
2321
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   503
    "/ then, removed methods...
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   504
    aDiffSet onlyInReceiver do:[:each |
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   505
	|ch|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   506
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   507
	ch := MethodRemoveChange className:(each className) selector:(each selector).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   508
	changeSet add:ch.
2321
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   509
    ].
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   510
    ^ changeSet
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   511
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   512
    "Created: / 08-02-2011 / 10:48:36 / cg"
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   513
!
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   514
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   515
fromDirectory: aStringOfFilename
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   516
    "Read all .st files (non-recursively) from `aStringOrFilename`.
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   517
     Return the resuling ChangeSet"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   518
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   519
    ^ self fromDirectory: aStringOfFilename asSmalltalkXPackage: false.
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   520
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   521
    "Created: / 02-04-2011 / 00:54:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   522
    "Modified: / 02-12-2013 / 17:36:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   523
!
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   524
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   525
fromDirectory: aStringOfFilename asSmalltalkXPackage: isSmalltalkXPackage
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   526
    "Read all .st files (non-recursively) from `aStringOrFilename`
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   527
     Return the resuling ChangeSet.
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   528
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   529
     If `isSmalltalkXPacklage` is true, then treat directory as Smalltalk/X
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   530
     package directory as checked out from a VCS. Read only those files
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   531
     present in abbrev.stc (if present)."
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   532
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   533
    | directory abbrevFile filter |
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   534
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   535
    directory := aStringOfFilename asFilename.
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   536
    (isSmalltalkXPackage and:[(abbrevFile := directory asFilename / 'abbrev.stc') exists]) ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   537
	| files |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   538
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   539
	files := OrderedCollection new.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   540
	files add:'extensions.st'.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   541
	(directory asFilename / 'abbrev.stc') readingFileDo:[:s |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   542
	    Smalltalk withAbbreviationsFromStream: s do:[:className :abbrev :pkg  | files add: (abbrev , '.st')]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   543
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   544
	filter := [:filename | files includes: filename baseName ]
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   545
    ] ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   546
	filter := [:filename | filename  suffix = 'st' ]
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   547
    ].
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   548
    ^ self fromDirectory: aStringOfFilename filter: filter
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   549
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   550
    "Created: / 02-12-2013 / 17:36:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3483
e2eff8ad70c3 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3445
diff changeset
   551
    "Modified: / 05-02-2014 / 19:05:14 / cg"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   552
!
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   553
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   554
fromDirectory: aStringOrFilename filter: filter
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   555
    "Read all files (non-recursively) from `aStringOrFilename` for which the
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   556
     filter return true. Return the resuling ChangeSet"
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   557
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   558
    | d cs files step |
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   559
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   560
    d := aStringOrFilename asFilename.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   561
    cs := self new.
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   562
    files := (d directoryContentsAsFilenames) select:filter.
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   563
    step :=  100 / files size.
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   564
    files withIndexDo: [:each :index |
4417
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   565
        ProgressNotification notify: 'Reading ', each baseName progress: (step * (index - 1)).
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   566
        [
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   567
            cs addAll: (self fromFileOrDirectory: each)
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   568
        ] on: ProgressNotification do:[:ex |
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   569
            ex proceed.
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   570
        ].
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   571
    ].
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   572
    ProgressNotification notify: nil progress: 100.
4417
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   573
    cs name: aStringOrFilename asFilename pathName.
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   574
    ^cs
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   575
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   576
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   577
    "
4417
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   578
        ChangeSet fromDirectory: (Smalltalk getPackageDirectoryForPackage:'stx:libbasic')
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   579
    "
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   580
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   581
    "Created: / 12-11-2013 / 15:24:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4417
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   582
    "Modified: / 11-04-2019 / 18:03:51 / Stefan Vogel"
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   583
!
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   584
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   585
fromDolphinPACStream:aStream
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   586
    "build a changeSet from a stream, containing dolphin pac file chunks."
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   587
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   588
    ^ self fromDolphinPACStream:aStream while:[:thisChange | true]
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   589
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   590
!
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   591
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   592
fromDolphinPACStream:aStream while:aConditionBlock
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   593
    "build a changeSet from a stream, containing dolphin pac file chunks.
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   594
     Pass each change to the conditionBlock and stop whenever that
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   595
     returns false. This allows skipping reamaining chunks, and speeding up
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   596
     reading, if only parts need to be extracted
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   597
     (for example: only documentation methods)."
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   598
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   599
    |changeSet|
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   600
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   601
    changeSet := self new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   602
    self
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   603
	changesFromStream:aStream
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   604
	for:changeSet
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   605
	reader:(DolphinPACFileReader new)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   606
	do:[:aChange :lineNumberOrNil :posOrNil |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   607
	    changeSet add:aChange.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   608
	    (aConditionBlock value:aChange) ifFalse:[^ changeSet].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   609
	].
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   610
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   611
    ^ changeSet
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   612
!
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   613
2894
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   614
fromFile:filenameOrString
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   615
    "build a changeSet from a file, which contains chunks.
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   616
     (i.e. either a classes sourceFile or a change-file).
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   617
     Return the changeSet."
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   618
2894
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   619
    |filename mime stream changeSet|
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   620
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   621
    filename := filenameOrString asFilename.
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   622
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   623
    filename suffix = 'bsc' ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   624
	filename readingFileDo:[:stream |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   625
	    changeSet := self fromBeeStream:stream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   626
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   627
	changeSet name: filename baseName.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   628
	^ changeSet
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   629
    ].
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   630
2894
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   631
    mime := MIMETypes mimeTypeForFilename:filename.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   632
    mime isNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   633
	mime := filename mimeTypeOfContents.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   634
	mime isNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   635
	    "/ self error:'unknown MIME type for file' mayProceed:true.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   636
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   637
	    "/ assume chunk format
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   638
	    mime := 'text/plain'.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   639
	].
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   640
    ].
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   641
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   642
    [
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   643
	stream := filename readStream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   644
	mime = 'text/xml' ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   645
	    changeSet := self fromXMLStream:stream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   646
	] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   647
	    mime = 'application/x-smalltalk-source-sif' ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   648
		changeSet := self fromSIFStream:stream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   649
	    ] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   650
		mime = 'application/x-smalltalk-dolphin-package' ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   651
		    changeSet := self fromDolphinPACStream:stream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   652
		] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   653
		    stream := EncodedStream decodedStreamFor:stream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   654
		    changeSet := self fromStream:stream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   655
		]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   656
	    ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   657
	]
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   658
    ] ensure:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   659
	stream notNil ifTrue:[stream close].
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   660
    ].
2894
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   661
    changeSet name: filename baseName.
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   662
    ^ changeSet
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   663
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   664
    "
2894
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   665
     ChangeSet fromFile: 'st.chg'
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   666
     ChangeSet fromFile: 'patches'
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   667
    "
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   668
2868
bee17299d228 changed:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
   669
    "Created: / 16-02-1998 / 12:19:34 / cg"
2894
ccd13e91583d changed: #fromFile:
vrany
parents: 2893
diff changeset
   670
    "Modified (comment): / 28-07-2012 / 09:41:40 / cg"
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
   671
    "Modified: / 21-08-2014 / 18:38:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   672
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   673
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   674
fromFileOrDirectory: fileOrDirectory
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   675
    "Read either a single .st-file, or all .st files (non-recursively) in a directory.
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   676
     Return the resuling ChangeSet"
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   677
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   678
    | f changeSet|
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   679
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   680
    f := fileOrDirectory asFilename.
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   681
    changeSet := 
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   682
        f isDirectory
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   683
            ifTrue:[self fromDirectory: f]
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   684
            ifFalse:[self fromFile: f].
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   685
    changeSet name: f pathName.
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   686
    ^ changeSet
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   687
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   688
    "
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   689
     ChangeSet fromFileOrDirectory: (Smalltalk getPackageDirectoryForPackage:'stx:libbasic')
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   690
    "
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   691
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   692
    "Created: / 02-04-2011 / 00:50:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   693
!
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
   694
4397
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   695
fromGNUSmalltalkStream:aStream
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   696
    "build a changeSet from a GNU Smalltalk .gst format stream, containing a class definition.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   697
     Return the changeSet."
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   698
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   699
    |changeSet|
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   700
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   701
    changeSet := self new.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   702
    GNUSmalltalkFileReader new
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   703
        changesFromStream:aStream
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   704
        for:changeSet
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   705
        do:[:aChange :lineNumberOrNil :posOrNil |
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   706
            changeSet add:aChange.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   707
        ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   708
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   709
    ^ changeSet
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   710
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   711
    "Created: / 10-02-2019 / 16:18:31 / Claus Gittinger"
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   712
!
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
   713
4428
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   714
fromGithubPharoSmalltalkStream:aStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   715
    "build a changeSet from a Pharo GitHub format stream, 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   716
     containing a class or extension definition.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   717
         See https://github.com/bouraqadi/PharoJS/Pharo
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   718
     as an example.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   719
     Return the changeSet."
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   720
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   721
    |changeSet|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   722
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   723
    changeSet := self new.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   724
    GithubPharoSmalltalkFileReader new
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   725
        changesFromStream:aStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   726
        for:changeSet
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   727
        do:[:aChange :lineNumberOrNil :posOrNil |
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   728
            changeSet add:aChange.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   729
        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   730
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   731
    ^ changeSet
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   732
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   733
    "
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   734
     self fromGithubPharoSmalltalkStream:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   735
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsBridgeTest/PjBasicTest.class.st'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   736
             asFilename readStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   737
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   738
     self fromGithubPharoSmalltalkStream:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   739
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   740
             asFilename readStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   741
    "
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   742
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   743
    "Created: / 25-05-2019 / 22:53:58 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   744
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
   745
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   746
fromSIFStream:aStream
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   747
    "build a changeSet from a SIF stream, containing chunks
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   748
     in smalltalk interchange format.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   749
     Return the changeSet."
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   750
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   751
    ^ self fromSIFStream:aStream while:[:thisChange | true]
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   752
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   753
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   754
fromSIFStream:aStream while:aConditionBlock
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   755
    "build a changeSet from a SIF stream, containing chunks
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   756
     in smalltalk interchange format.
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   757
     Pass each change to the conditionBlock and stop whenever that
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   758
     returns false. This allows skipping reamaining chunks, and speeding up
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   759
     reading, if only parts need to be extracted
3732
f3bf00a70315 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   760
     (for example: only documentation methods).
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   761
     Return the changeSet."
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   762
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   763
    |changeSet|
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   764
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   765
    changeSet := self new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   766
    self
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   767
	changesFromStream:aStream
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   768
	for:changeSet
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   769
	reader:(SIFChangeFileReader new)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   770
	do:[:aChange :lineNumberOrNil :posOrNil |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   771
	    changeSet add:aChange.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   772
	    (aConditionBlock value:aChange) ifFalse:[^ changeSet].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   773
	].
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   774
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   775
    ^ changeSet
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   776
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   777
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   778
fromStream:aStream
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   779
    "build a changeSet from a stream, containing chunks.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   780
     (i.e. either a classes sourceFile or a change-file).
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   781
     Return the changeSet."
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   782
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   783
    ^ self fromStream:aStream while:[:thisChange | true]
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   784
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   785
    "
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   786
     ChangeSet fromStream:('changes' asFilename readStream)
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   787
     ChangeSet fromStream:('patches' asFilename readStream)
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   788
     ChangeSet fromStream:(Object source asString readStream)
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   789
    "
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   790
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   791
    "Created: / 16.2.1998 / 12:19:34 / cg"
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   792
    "Modified: / 14.12.1999 / 15:23:16 / cg"
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   793
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   794
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   795
fromStream:aStream while:aConditionBlock
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   796
    "build a changeSet from a stream, containing chunks.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   797
     (i.e. either a classes sourceFile or a change-file).
3856
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   798
     Pass each change to the conditionBlock and stop whenever that returns false. 
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   799
     This allows skipping reamaining chunks, 
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   800
     and thus speeding up reading, if only parts need to be extracted
3869
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   801
     (for example: only documentation methods, 
a478633d4558 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   802
      or espcially if only class definition changes up to the first method change are required).
3856
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   803
     Returns the changeSet."
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   804
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   805
    |changeSet|
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   806
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   807
    changeSet := self new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   808
    self
3856
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   809
        changesFromStream:aStream
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   810
        for:changeSet
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   811
        reader:(ChangeFileReader new)
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   812
        do:[:aChange :lineNumberOrNil :posOrNil |
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   813
            (aConditionBlock value:aChange) ifFalse:[^ changeSet].
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   814
            changeSet add:aChange.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
   815
        ].
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   816
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   817
    ^ changeSet
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   818
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   819
    "
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   820
     ChangeSet fromStream:('changes' asFilename readStream)
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   821
     ChangeSet fromStream:('patches' asFilename readStream)
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   822
     ChangeSet fromStream:(Object source asString readStream)
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
   823
     ChangeSet fromStream:(XWorkstation source asString readStream)
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   824
    "
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   825
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
   826
    "Created: / 16-02-1998 / 12:19:34 / cg"
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
   827
    "Modified: / 14-12-1999 / 15:23:16 / cg"
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
   828
    "Modified (comment): / 01-08-2012 / 15:24:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   829
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   830
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   831
fromXMLStream:aStream
3868
9a006429e942 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
   832
    "build a changeSet from an XML stream, containing XML change definitions in VisualWorks XML change file format.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   833
     Return the changeSet."
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   834
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   835
    |changeSet builder nameSpace|
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   836
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   837
    aStream isNil ifTrue:[^ nil].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   838
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   839
    changeSet := self new.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   840
    nameSpace := Smalltalk.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   841
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   842
    builder := XML::SourceScannerNodeBuilder new.
1475
934d20073adb more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
   843
    builder scanFile:aStream do:[:change | changeSet add: change. ].
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   844
    ^ changeSet
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   845
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   846
    "
1247
be7277706e48 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1232
diff changeset
   847
     ChangeSet fromXMLStream:('../../goodies/xml/vw/xmlFileInTests/XMLParser.xml' asFilename readStream)
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   848
     ChangeSetBrowser
3868
9a006429e942 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3860
diff changeset
   849
        openOn:(ChangeSet fromXMLStream:('../../goodies/xml/vw/xmlFileInTests/XMLParser.xml' asFilename readStream))
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   850
    "
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   851
! !
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   852
1281
6aeafe46d0ad category;
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
   853
!ChangeSet class methodsFor:'Compatibility-ST80'!
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   854
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   855
patches
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   856
    ^ #()
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   857
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   858
    "Created: / 27.10.1997 / 13:52:54 / cg"
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   859
! !
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   860
4417
815732df18e8 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4409
diff changeset
   861
1281
6aeafe46d0ad category;
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
   862
!ChangeSet class methodsFor:'Compatibility-VW'!
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   863
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   864
component: component definition: anObject change: changeSymbol
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   865
    "Include indication that a class/namespace was added or removed
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   866
     from a CodeComponent."
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   867
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   868
    self
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   869
	changed:#'component:definition:change:'
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   870
	with:
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   871
	    ( Array
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   872
		    with: component
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   873
		    with: anObject
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   874
		    with: changeSymbol
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   875
	    )
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   876
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   877
! !
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   878
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   879
!ChangeSet class methodsFor:'instance creation-private'!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   880
1191
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   881
changesFromStream:aStream do:aBlock
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   882
    "enumerate changes from a stream and invoke aBlock on each.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   883
     The block is invoked with the change, a lineNumberOrNil and streamPosition arguments.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   884
     The lineNumber is only valid, if the underlying stream
1191
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   885
     provides line-numbers; otherwise, nil is passed."
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   886
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   887
    ^ self
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   888
	changesFromStream:aStream
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   889
	for:(self new)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   890
	reader:nil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   891
	do:aBlock
1191
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   892
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   893
    "
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   894
     ChangeSet
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   895
	changesFromStream:('changes' asFilename readStream)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   896
	do:[:chg | Transcript showCR:chg]
1191
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   897
    "
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   898
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   899
    "Created: / 16.2.1998 / 12:19:34 / cg"
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   900
    "Modified: / 14.12.1999 / 15:23:16 / cg"
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   901
!
a63c8b5e4c6d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
   902
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   903
changesFromStream:aStream for:aChangeSet reader:aReader do:aBlock
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   904
    "enumerate changes from a stream and invoke aBlock on each.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   905
     The block is invoked with the change, a lineNumberOrNil and streamPosition arguments.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   906
     The lineNumber is only valid, if the underlying stream
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   907
     provides line-numbers; otherwise, nil is passed."
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   908
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   909
    |encodedStream chunk s change currentNameSpace currentPackage
3520
13a17b7c03ba Fixed reading ChangeSet from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3518
diff changeset
   910
     lineNumber pos reader reportProgress size |
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
   911
3593
b50ee8847a7e class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3578
diff changeset
   912
    aStream isNil ifTrue:[^ self].
b50ee8847a7e class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3578
diff changeset
   913
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   914
    currentNameSpace := Smalltalk.
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   915
    currentPackage := Class packageQuerySignal query.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   916
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
   917
    (reader := aReader) isNil ifTrue:[
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   918
        reader := ChangeFileReader new.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   919
    ].
2893
5dfcb7f9f0da Fix in reading changeset from file (for EncodedStream)
vrany
parents: 2892
diff changeset
   920
3521
6e43c118d860 Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3520
diff changeset
   921
    aStream isEncodedStream ifTrue:[
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   922
        encodedStream := aStream
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   923
    ] ifFalse:[
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   924
        aStream isPositionable ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   925
            encodedStream := EncodedStream decodedStreamFor: aStream
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   926
        ] ifFalse:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   927
            encodedStream := EncodedStream stream: aStream encoder: CharacterEncoder nullEncoderInstance
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   928
        ].
3521
6e43c118d860 Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3520
diff changeset
   929
    ].
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
   930
    reportProgress := encodedStream stream isPositionable
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   931
                        and:[ ProgressNotification notNil
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   932
                        and:[ ProgressNotification isHandled ]].
3520
13a17b7c03ba Fixed reading ChangeSet from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3518
diff changeset
   933
    reportProgress ifTrue:[
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   934
        size := encodedStream stream size.
3520
13a17b7c03ba Fixed reading ChangeSet from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3518
diff changeset
   935
    ].
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
   936
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
   937
    reader changeSet:aChangeSet.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
   938
    reader changeAction:aBlock.
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   939
    reader inputStream:encodedStream.
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   940
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
   941
    [encodedStream atEnd] whileFalse:[
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   942
        encodedStream skipSeparators.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   943
        lineNumber := encodedStream lineNumber.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   944
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   945
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   946
        reportProgress ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   947
            pos := encodedStream position + 1.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   948
            ProgressNotification notify: nil progress:(100 / size) * pos.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   949
        ].
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   950
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   951
        chunk := encodedStream nextChunk.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   952
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   953
        (chunk notEmptyOrNil) ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   954
            Class nameSpaceQuerySignal handle:[:ex| ex proceedWith:currentNameSpace] do:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   955
                Class packageQuerySignal handle:[:ex| ex proceedWith:currentPackage] do:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   956
                    |parser tree ns pkg|
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   957
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   958
                    parser := Parser for:chunk.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   959
                    "/ parser parseForCode.
4321
bd3d209082c3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4305
diff changeset
   960
                    ParseError handle:[:ex |
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   961
                        Transcript showCR:'ChangeSet: error while reading: ',ex description.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   962
                        tree := #Error.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   963
                    ] do:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   964
                        tree := parser
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   965
                                parseExpressionWithSelf:nil
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   966
                                notifying:nil
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   967
                                ignoreErrors:true
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   968
                                ignoreWarnings:true
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   969
                                inNameSpace:currentNameSpace.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   970
                    ].
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   971
                    tree ~~ #Error ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   972
                        tree isNil ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   973
                            "/ Hmm....it could be package-definition chunk in extensions container...
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   974
                            "/ if there is any package directive in there, extract it.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   975
                            ((pkg := parser currentPackage) notNil
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   976
                            and:[pkg ~~ currentPackage]) ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   977
                                currentPackage := pkg
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   978
                            ] ifFalse:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   979
                                "/ if there is any nameSpace directive in there, extract it.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   980
                                ((ns := parser currentNameSpace) notNil
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   981
                                and:[ns ~~ currentNameSpace]) ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   982
                                    currentNameSpace := ns
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   983
                                ] ifFalse:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   984
                                    change := DoItChange new.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   985
                                    change source:chunk.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   986
                                    aBlock valueWithOptionalArgument:change and:lineNumber and:pos.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   987
                                ].
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   988
                            ].
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   989
                        ] ifFalse:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   990
                            "/ if there is any nameSpace directive in there, extract it.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   991
                            ((ns := parser currentNameSpace) notNil
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   992
                            and:[ns ~~ currentNameSpace]) ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   993
                                currentNameSpace := ns
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   994
                            ].
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   995
                            "/ if there is any package directive in there, extract it.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   996
                            ((pkg := parser currentPackage) notNil
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   997
                            and:[pkg ~~ currentPackage]) ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   998
                                currentPackage := pkg
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
   999
                            ].
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1000
                            "/
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1001
                            "/ what type of chunk is this ...
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1002
                            "/
4011
d60ab5e3030f #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3981
diff changeset
  1003
                            tree isLiteral ifTrue:[
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1004
                                (s := tree evaluate) isString ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1005
                                    (s startsWith:'---- ') ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1006
                                        reader inputStream: s readStream.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1007
                                        reader processInfo: s.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1008
                                        reader inputStream: encodedStream.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1009
                                    ].
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1010
                                ] ifFalse:[
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  1011
                                    self proceedableError:'unexpected change-chunk'
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1012
                                ]
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1013
                            ] ifFalse:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1014
                                tree isMessage ifTrue:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1015
                                    (reader
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1016
                                        changesFromParseTree:tree
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1017
                                        lineNumber:lineNumber
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1018
                                        position:pos
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1019
                                        chunk: chunk
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1020
                                    ) ifFalse:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1021
                                        change := DoItChange new.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1022
                                        change source:chunk.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1023
                                        aBlock valueWithOptionalArgument:change and:lineNumber and:pos.
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1024
                                    ]
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1025
                                ] ifFalse:[
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1026
                                    InvalidChangeChunkError
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1027
                                        raiseRequestErrorString:('unexpected change-chunk in or around line %1' bindWith:lineNumber)
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1028
                                ]
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1029
                            ]
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1030
                        ]
4430
561bdbdc6c77 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  1031
                    ] ifFalse:[
561bdbdc6c77 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  1032
                        "/ an error occurred - add it as a doit chunk
561bdbdc6c77 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  1033
                        Logger warning:'ChangeSet: parse error while reading'.
561bdbdc6c77 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  1034
                        "/ CUIS Smalltalk?
561bdbdc6c77 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  1035
                        "/ not sure, if the following is a good idea...
561bdbdc6c77 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  1036
                        "/ change := InvalidChange new source:chunk.
561bdbdc6c77 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  1037
                        "/ aBlock valueWithOptionalArgument:change and:lineNumber and:pos.
561bdbdc6c77 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  1038
                    ].    
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1039
                ]
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1040
            ]
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  1041
        ]
930
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1042
    ].
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1043
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1044
    "
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1045
     ChangeSet fromStream:('changes' asFilename readStream)
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1046
     ChangeSet fromStream:('patches' asFilename readStream)
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1047
     ChangeSet fromStream:(Object source asString readStream)
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1048
    "
ca4ce60fea8b lineNumber support
Claus Gittinger <cg@exept.de>
parents: 924
diff changeset
  1049
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  1050
    "Created: / 16-02-1998 / 12:19:34 / cg"
3360
f823605e7ccd class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3359
diff changeset
  1051
    "Modified: / 30-07-2013 / 21:34:16 / cg"
3521
6e43c118d860 Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3520
diff changeset
  1052
    "Modified: / 14-03-2014 / 16:39:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4430
561bdbdc6c77 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4428
diff changeset
  1053
    "Modified: / 27-05-2019 / 17:20:00 / Claus Gittinger"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  1054
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  1055
625
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
  1056
!ChangeSet class methodsFor:'queries'!
27
claus
parents: 16
diff changeset
  1057
claus
parents: 16
diff changeset
  1058
current
claus
parents: 16
diff changeset
  1059
    "ST-80 compatibility: return the current changeSet"
claus
parents: 16
diff changeset
  1060
claus
parents: 16
diff changeset
  1061
    |p|
claus
parents: 16
diff changeset
  1062
claus
parents: 16
diff changeset
  1063
    (Project notNil and:[(p := Project current) notNil]) ifTrue:[
4305
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1064
        ^ p changeSet
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1065
    ] ifFalse:[
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1066
        CurrentIfNoCurrentProject isNil ifTrue:[
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1067
            CurrentIfNoCurrentProject := self new.
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1068
        ].
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1069
        ^ CurrentIfNoCurrentProject
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1070
    ]
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1071
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1072
    "
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1073
     ChangeSet current
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1074
    "
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1075
!
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1076
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1077
current:aChangeSet
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1078
    "ST-80 compatibility: set the current changeSet"
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1079
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1080
    |p|
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1081
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1082
    (Project notNil and:[(p := Project current) notNil]) ifTrue:[
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1083
        p changeSet:aChangeSet
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1084
    ] ifFalse:[
c6267418f19e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4303
diff changeset
  1085
        CurrentIfNoCurrentProject := aChangeSet.
959
ca4fff926135 ChangeSet current: return empty collection if there is no changeSet
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
  1086
    ].
27
claus
parents: 16
diff changeset
  1087
claus
parents: 16
diff changeset
  1088
    "
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1089
     ChangeSet current
27
claus
parents: 16
diff changeset
  1090
    "
claus
parents: 16
diff changeset
  1091
! !
claus
parents: 16
diff changeset
  1092
3578
b01e1b81271a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3576
diff changeset
  1093
!ChangeSet class methodsFor:'signal access'!
b01e1b81271a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3576
diff changeset
  1094
b01e1b81271a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3576
diff changeset
  1095
invalidChangeChunkError
b01e1b81271a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3576
diff changeset
  1096
    ^ InvalidChangeChunkError
b01e1b81271a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3576
diff changeset
  1097
! !
b01e1b81271a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3576
diff changeset
  1098
2246
3ce37b8e4967 changed: #decodedStreamFor:
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1099
!ChangeSet class methodsFor:'utilities'!
3ce37b8e4967 changed: #decodedStreamFor:
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1100
3ce37b8e4967 changed: #decodedStreamFor:
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1101
decodedStreamFor:aStream
2247
1ff6d78eb96c code move
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  1102
    <resource: #obsolete>
1ff6d78eb96c code move
Claus Gittinger <cg@exept.de>
parents: 2246
diff changeset
  1103
    ^ EncodedStream decodedStreamFor:aStream
2246
3ce37b8e4967 changed: #decodedStreamFor:
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1104
! !
3ce37b8e4967 changed: #decodedStreamFor:
Claus Gittinger <cg@exept.de>
parents: 2244
diff changeset
  1105
1264
3d1fc5d40ab4 method category rename
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
  1106
!ChangeSet methodsFor:'Compatibility-ST80'!
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1107
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
  1108
changeClass:aClass
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  1109
899
7b65d6f2b0f0 more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 894
diff changeset
  1110
    "dummy here"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1111
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  1112
    "Created: / 04-02-2000 / 18:30:59 / cg"
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  1113
    "Modified (format): / 05-09-2012 / 16:39:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1114
!
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1115
1476
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1116
changeSelectors
3946
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1117
    "return a collection (a set) of all selectors for which changes are in this changeSet"
1476
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1118
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1119
    |selectors|
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1120
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1121
    changeSelectors isNil ifTrue:[
3946
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1122
        selectors := IdentitySet new.
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1123
        self do:[:chg |
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1124
            |sel|
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1125
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1126
            chg notNil ifTrue:[
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1127
                chg isMethodChange ifTrue:[
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1128
                    sel := chg selector.
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1129
                    sel notNil ifTrue:[
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1130
                        selectors add:sel
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1131
                    ]
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1132
                ]
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1133
            ]
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1134
        ].
3cfa9e40ac69 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3904
diff changeset
  1135
        changeSelectors := selectors.
1476
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1136
    ].
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1137
    ^ changeSelectors.
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1138
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1139
    "
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1140
     ChangeSet current changeSelectors
1476
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1141
    "
1967
18cf73f144e4 care for nil selectors.
Claus Gittinger <cg@exept.de>
parents: 1954
diff changeset
  1142
18cf73f144e4 care for nil selectors.
Claus Gittinger <cg@exept.de>
parents: 1954
diff changeset
  1143
    "Modified: / 30-05-2007 / 12:12:32 / cg"
1476
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1144
!
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1145
1102
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1146
changedClasses
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  1147
    "return a collection of all classes for which changes are in this changeSet"
1102
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1148
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1149
    |classes|
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1150
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1151
    changedClasses isNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1152
	classes := IdentitySet new.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1153
	self do:[:chg |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1154
	    |cls|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1155
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1156
	    chg notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1157
		cls := chg changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1158
		cls notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1159
		    cls isRealNameSpace ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1160
			classes add:cls
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1161
		    ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1162
		]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1163
	    ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1164
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1165
	changedClasses := classes.
1102
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1166
    ].
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1167
    ^ changedClasses.
1102
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1168
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1169
    "
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1170
     ChangeSet current changedClasses
1791
746e0b3aa286 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1718
diff changeset
  1171
     ChangeSet current flushChangedClassesCache
1102
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1172
    "
1791
746e0b3aa286 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1718
diff changeset
  1173
1898
325fa7fbb3e3 use isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 1885
diff changeset
  1174
    "Modified: / 10-11-2006 / 17:17:26 / cg"
1102
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1175
!
4763b34e4c0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1099
diff changeset
  1176
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1177
component:component definition:anObject change:changeSymbol
1083
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
  1178
    "Include indication that a class/namespace was added or removed
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1179
     from a CodeComponent."
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1180
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1181
    self
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1182
	changed:#'component:definition:change:'
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1183
	with:
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1184
	    ( Array
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1185
		    with: component
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1186
		    with: anObject
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1187
		    with: changeSymbol
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1188
	    )
1083
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
  1189
!
e3ac808d06e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1081
diff changeset
  1190
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1191
reorganizeSystem
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1192
    "dummy here"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1193
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1194
    "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
  1195
! !
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1196
2235
3078dab499ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2234
diff changeset
  1197
!ChangeSet methodsFor:'accessing'!
3078dab499ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2234
diff changeset
  1198
3078dab499ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2234
diff changeset
  1199
name
3078dab499ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2234
diff changeset
  1200
    ^ name
3078dab499ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2234
diff changeset
  1201
!
3078dab499ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2234
diff changeset
  1202
2868
bee17299d228 changed:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
  1203
name:aString
bee17299d228 changed:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
  1204
    name := aString.
bee17299d228 changed:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
  1205
bee17299d228 changed:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
  1206
    "Modified (format): / 28-07-2012 / 09:34:52 / cg"
2235
3078dab499ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2234
diff changeset
  1207
! !
2234
f5af55bd08cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2186
diff changeset
  1208
985
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
  1209
!ChangeSet methodsFor:'change & update'!
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
  1210
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1211
changed:anAspectSymbol with:aParameter
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1212
    "Allow objects to depend on the ChangeSet class instead of a particular instance
1099
bd76198721aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1098
diff changeset
  1213
     of ChangeSet (which may be switched using projects)."
985
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
  1214
4183
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1215
    self == self class current ifTrue:[
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1216
        self class changed:anAspectSymbol with:aParameter.
1475
934d20073adb more support for alien namespaces (VW7)
Claus Gittinger <cg@exept.de>
parents: 1471
diff changeset
  1217
    ].
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1218
    super changed:anAspectSymbol with:aParameter
985
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
  1219
! !
d6e52410ac8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
  1220
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1221
!ChangeSet methodsFor:'changes management'!
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1222
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1223
addClassCommentChangeFor:aClass
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1224
    "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
  1225
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1226
    |newChange|
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1227
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1228
    newChange := ClassCommentChange class:aClass.
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1229
    newChange comment:aClass comment.
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1230
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1231
    self addChange:newChange
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1232
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1233
    "Modified: / 14.11.2001 / 13:35:34 / cg"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1234
!
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1235
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1236
addClassDefinitionChangeFor:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1237
    "add a classDefinition change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1238
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1239
    |newChange|
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1240
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1241
    newChange := ClassDefinitionChange class:aClass source:(aClass definition).
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1242
    newChange package:aClass package.
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1243
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1244
    self addChange:newChange
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1245
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1246
    "
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1247
     (ChangeSet new addClassDefinitionChangeFor:ChangeSet) inspect
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1248
    "
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1249
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1250
    "Modified: / 12-10-2006 / 18:17:02 / cg"
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1251
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1252
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1253
addClassRemoveChange:oldClass
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1254
    "add a classRemove change to the receiver"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1255
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1256
    |newChange|
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1257
1232
58d1ebc59df5 added #addClassRemoveChange:
james
parents: 1209
diff changeset
  1258
    newChange := ClassRemoveChange new className:oldClass name.
1281
6aeafe46d0ad category;
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
  1259
    self rememberChangedClass:oldClass.
1421
eeb8f1c9b6b4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
  1260
    oldClass isPrivate ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1261
	self rememberChangedClass:oldClass topOwningClass.
1421
eeb8f1c9b6b4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
  1262
    ].
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1263
    ClassRemoveChange::ClassBeingRemovedQuery
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1264
	answer:oldClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1265
	do:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1266
	    self addChange:newChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1267
	]
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1268
    "Modified: / 14.11.2001 / 13:35:39 / cg"
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1269
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1270
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1271
addClassRenameChangeFrom:oldName to:newName
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1272
    "add a classRename change to the receiver"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1273
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1274
    |newChange|
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1275
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1276
    newChange := ClassRenameChange new oldName:oldName newName:newName.
1281
6aeafe46d0ad category;
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
  1277
    self rememberChangedClass:(Smalltalk at:newName).
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1278
    self addChange:newChange
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1279
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1280
    "Modified: / 14.11.2001 / 13:35:41 / cg"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1281
!
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  1282
1081
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
  1283
addDoIt:aString
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
  1284
    "add a doIt to the receiver"
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
  1285
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
  1286
    |newChange|
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
  1287
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1288
    newChange := DoItChange new source:aString.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1289
    self addChange:newChange.
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1290
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1291
    "Modified: / 14.11.2001 / 13:35:44 / cg"
1081
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
  1292
!
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
  1293
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1294
addInstVarDefinitionChangeFor:aClass
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1295
    "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
  1296
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1297
    |newChange|
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1298
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1299
    newChange := ClassInstVarDefinitionChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1300
			class:aClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1301
			source:(aClass name , ' instanceVariableNames:' , aClass instanceVariableString storeString).
2617
a9e632776c57 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2524
diff changeset
  1302
    newChange classInstVarNames:aClass instanceVariableString asCollectionOfWords.
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1303
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1304
    self addChange:newChange
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1305
2617
a9e632776c57 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2524
diff changeset
  1306
    "Modified: / 25-11-2011 / 17:38:42 / cg"
889
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1307
!
6b05401d7184 more changes (comments, class-instVars) in the changeSet;
Claus Gittinger <cg@exept.de>
parents: 887
diff changeset
  1308
16
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
  1309
addMethodCategoryChange:aMethod category:newCategory in:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1310
    "add a methodCategory change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1311
16
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
  1312
    |newChange|
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
  1313
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1314
    newChange := MethodCategoryChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1315
			class:aClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1316
			selector:(aClass selectorAtMethod:aMethod)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1317
			category:newCategory.
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1318
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1319
    self addChange:newChange
16
fcbfbba03d49 *** empty log message ***
claus
parents: 10
diff changeset
  1320
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1321
    "Modified: / 14.11.2001 / 13:35:48 / cg"
44
claus
parents: 39
diff changeset
  1322
!
claus
parents: 39
diff changeset
  1323
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1324
addMethodChange:aMethod fromOld:oldMethod in:aClass
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1325
    "add a method change to the receiver"
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1326
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1327
    |newChange|
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1328
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1329
    newChange := MethodDefinitionChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1330
			class:aClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1331
			selector:aMethod selector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1332
			source:aMethod source
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1333
			category:aMethod category.
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1334
    oldMethod notNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1335
	newChange previousVersion:oldMethod.
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1336
    ].
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1337
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1338
    self addChange:newChange.
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1339
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1340
    "Modified: / 14.11.2001 / 13:35:50 / cg"
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1341
!
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1342
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1343
addMethodChange:aMethod in:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1344
    "add a method change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1345
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1346
    |newChange|
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1347
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1348
    newChange := MethodDefinitionChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1349
			class:aClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1350
			selector:aMethod selector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1351
			source:aMethod source
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1352
			category:aMethod category.
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1353
    newChange package:(aMethod package).
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1354
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1355
    self addChange:newChange
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1356
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1357
    "Modified: / 12-10-2006 / 18:15:28 / cg"
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1358
!
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1359
1842
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1360
addMethodPackageChange:aMethod package:newPackage in:aClass
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1361
    "add a methodPackage change to the receiver"
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1362
2934
487294a18ae0 changed: #addMethodPackageChange:package:in:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  1363
    |newChange selector|
487294a18ae0 changed: #addMethodPackageChange:package:in:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  1364
487294a18ae0 changed: #addMethodPackageChange:package:in:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  1365
    selector := (aClass selectorAtMethod:aMethod).
487294a18ae0 changed: #addMethodPackageChange:package:in:
Claus Gittinger <cg@exept.de>
parents: 2930
diff changeset
  1366
    selector isNil ifTrue:[^ self].
1842
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1367
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1368
    newChange := MethodPackageChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1369
			class:aClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1370
			selector:selector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1371
			package:newPackage.
1842
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1372
    self rememberChangedClass:aClass.
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1373
    self addChange:newChange
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1374
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1375
    "Created: / 09-10-2006 / 14:02:33 / cg"
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1376
!
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1377
44
claus
parents: 39
diff changeset
  1378
addMethodPrivacyChange:aMethod in:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1379
    "add a methodPrivacy change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1380
44
claus
parents: 39
diff changeset
  1381
    |newChange|
claus
parents: 39
diff changeset
  1382
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1383
    newChange := MethodPrivacyChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1384
			class:aClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1385
			selector:(aClass selectorAtMethod:aMethod)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1386
			privacy:aMethod privacy.
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1387
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1388
    self addChange:newChange
44
claus
parents: 39
diff changeset
  1389
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1390
    "Modified: / 27.8.1995 / 22:55:22 / claus"
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1391
    "Modified: / 14.11.2001 / 13:35:55 / cg"
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1392
!
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1393
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1394
addPrimitiveDefinitionsChangeFor:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1395
    "add a primitiveDefinitions change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1396
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1397
    |newChange|
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1398
783
90ffa6f0a86b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1399
    newChange := ClassPrimitiveDefinitionsChange new
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1400
			class:aClass source:(aClass primitiveDefinitionsString).
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1401
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1402
    self addChange:newChange
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1403
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1404
    "Modified: / 14.11.2001 / 13:35:57 / cg"
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1405
!
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1406
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1407
addPrimitiveFunctionsChangeFor:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1408
    "add a primitiveFunctions change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1409
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1410
    |newChange|
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1411
783
90ffa6f0a86b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1412
    newChange := ClassPrimitiveFunctionsChange new
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1413
			class:aClass source:(aClass primitiveFunctionsString).
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1414
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1415
    self addChange:newChange
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1416
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1417
    "Modified: / 14.11.2001 / 13:35:59 / cg"
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1418
!
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1419
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1420
addPrimitiveVariablesChangeFor:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1421
    "add a primitiveVariables change to the receiver"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1422
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1423
    |newChange|
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 102
diff changeset
  1424
783
90ffa6f0a86b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1425
    newChange := ClassPrimitiveVariablesChange new
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1426
			 class:aClass source:(aClass primitiveVariablesString).
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1427
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1428
    self addChange:newChange
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1429
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1430
    "Modified: / 14.11.2001 / 13:36:01 / cg"
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  1431
!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  1432
1164
cecaa2229cab removeSelector change: remember methods previous version
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  1433
addRemoveSelectorChange:aSelector fromOld:oldMethod in:aClass
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  1434
    "add a method-remove change to the receiver"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  1435
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  1436
    |newChange|
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  1437
1081
5d8001052312 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1045
diff changeset
  1438
    newChange := MethodRemoveChange class:aClass selector:aSelector.
1164
cecaa2229cab removeSelector change: remember methods previous version
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  1439
    oldMethod notNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1440
	newChange previousVersion:oldMethod.
1164
cecaa2229cab removeSelector change: remember methods previous version
Claus Gittinger <cg@exept.de>
parents: 1156
diff changeset
  1441
    ].
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1442
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1443
    self addChange:newChange
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  1444
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  1445
    "Modified: / 27.8.1995 / 22:55:22 / claus"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  1446
    "Created: / 16.2.1998 / 12:47:07 / cg"
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1447
    "Modified: / 14.11.2001 / 13:36:04 / cg"
901
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1448
!
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1449
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1450
addRenameCategoryChangeIn:aClass from:oldCategory to:newCategory
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1451
    "add a category rename change to the receiver"
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1452
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1453
    |newChange|
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1454
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1455
    newChange := MethodCategoryRenameChange class:aClass.
8fd26c5e8e8f more VW compatibility
Claus Gittinger <cg@exept.de>
parents: 899
diff changeset
  1456
    newChange oldCategoryName:oldCategory newCategoryName:newCategory.
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1457
    self rememberChangedClass:aClass.
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1458
    self addChange:newChange
1105
b27c0d72d7d0 avoid useless change notifications from #collect:, #select: etc.
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  1459
1111
d4f353ffaa53 oops - species must be ChangeSet; add: should not send notifications.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1460
    "Modified: / 14.11.2001 / 13:36:06 / cg"
1105
b27c0d72d7d0 avoid useless change notifications from #collect:, #select: etc.
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  1461
! !
b27c0d72d7d0 avoid useless change notifications from #collect:, #select: etc.
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
  1462
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1463
!ChangeSet methodsFor:'enumerating'!
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1464
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1465
rejectAllVersionMethodChanges
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1466
    "Return a new ChangeSet without version_XXX methods"
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1467
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1468
    ^ self reject:[:each | each isMethodCodeChange and:[(AbstractSourceCodeManager isVersionMethodSelector: each selector) ]].
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1469
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1470
    "Created: / 06-01-2014 / 21:13:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1471
! !
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  1472
3688
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1473
!ChangeSet methodsFor:'fileIn / fileOut'!
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1474
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1475
fileInFrom:aStream
3688
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1476
    self fileInFrom:aStream while:[:change | true]
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1477
!
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1478
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1479
fileInFrom:aStream while:aConditionBlock
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1480
    self class
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1481
	changesFromStream:aStream
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1482
	for:self
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1483
	reader:(ChangeFileReader new)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1484
	do:[:aChange :lineNumberOrNil :posOrNil |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1485
	    self add:aChange.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1486
	    (aConditionBlock value:aChange) ifFalse:[^ self].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1487
	].
3688
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1488
!
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1489
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1490
fileOutAs: aStringOrFilename
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1491
    | stream |
4115
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1492
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1493
    stream := aStringOrFilename asFilename writeStream.
4115
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1494
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1495
    stream nextPutLine:'''---- encoding: utf8 ----''!!'.
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1496
    stream := EncodedStream stream:stream encoder:(CharacterEncoder encoderForUTF8).
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1497
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1498
    [ 
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1499
        self fileOutOn: stream 
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1500
    ] ensure: [
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1501
        stream close
da8c2dc0d1b7 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4073
diff changeset
  1502
    ]
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1503
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1504
    "Created: / 05-12-2009 / 12:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1505
!
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1506
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1507
fileOutOn: stream
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1508
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1509
    self do:[:chg|chg fileOutOn: stream]
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1510
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1511
    "Created: / 05-12-2009 / 12:32:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1512
! !
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  1513
3518
1b770a65ef66 Fix in namespace handling when filing out chunked changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3483
diff changeset
  1514
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1515
!ChangeSet methodsFor:'misc'!
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1516
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1517
addPatch:nameOfPatch
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1518
    "ignored for now - allows fileIn of ST-80 patch stuff .."
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1519
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1520
    ^ self
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1521
! !
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
  1522
3518
1b770a65ef66 Fix in namespace handling when filing out chunked changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3483
diff changeset
  1523
1263
14ef737d93a8 method category rename
Claus Gittinger <cg@exept.de>
parents: 1247
diff changeset
  1524
!ChangeSet methodsFor:'private-accessing'!
1098
420a868fd606 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1525
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1526
addChange:aChange
2053
590bf720dfd4 dont add nil to a set
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1527
    |changeClass|
590bf720dfd4 dont add nil to a set
Claus Gittinger <cg@exept.de>
parents: 2046
diff changeset
  1528
1898
325fa7fbb3e3 use isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 1885
diff changeset
  1529
    aChange timeOfChangeIfKnown isNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1530
	aChange timeStamp:(Timestamp now).
1898
325fa7fbb3e3 use isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 1885
diff changeset
  1531
    ].
325fa7fbb3e3 use isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 1885
diff changeset
  1532
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1533
    self add:aChange.
1471
d3a32a4b689b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1453
diff changeset
  1534
    changedClasses notNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1535
	(changeClass := aChange changeClass) notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1536
	    changedClasses add:changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1537
	].
1471
d3a32a4b689b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1453
diff changeset
  1538
    ].
1476
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1539
    changeSelectors notNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1540
	aChange isMethodChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1541
	    changeSelectors add:aChange selector.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1542
	].
1476
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1543
    ].
1232
58d1ebc59df5 added #addClassRemoveChange:
james
parents: 1209
diff changeset
  1544
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1545
"/    aChange sendChangeNotificationThroughSmalltalk.
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1546
    self changed:#addChange: with:aChange.
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1547
1898
325fa7fbb3e3 use isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 1885
diff changeset
  1548
    "Created: / 14-11-2001 / 13:35:11 / cg"
325fa7fbb3e3 use isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 1885
diff changeset
  1549
    "Modified: / 10-11-2006 / 16:47:13 / cg"
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1550
!
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1551
1479
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1552
flushChangedClassesCache
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1553
    changedClasses := changeSelectors := nil
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1554
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1555
    "
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1556
     ChangeSet current flushChangedClassesCache
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1557
    "
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1558
!
Claus Gittinger <cg@exept.de>
parents: 1478
diff changeset
  1559
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1560
rememberChangedClass:aClass
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1561
    changedClasses notNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1562
	changedClasses add:aClass
1128
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1563
    ].
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1564
!
9e213e86c212 cache changed classes (speedup browser)
Claus Gittinger <cg@exept.de>
parents: 1127
diff changeset
  1565
1098
420a868fd606 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1566
removeAll:aCollection
1301
b747d11e7ff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
  1567
    aCollection notEmpty ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1568
	super removeAll:aCollection.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1569
	changedClasses := changeSelectors := nil.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1570
	self changed:#removeAll: with:aCollection.
1301
b747d11e7ff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1292
diff changeset
  1571
    ]
1421
eeb8f1c9b6b4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
  1572
!
eeb8f1c9b6b4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
  1573
eeb8f1c9b6b4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
  1574
unrememberChangedClasses
eeb8f1c9b6b4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1415
diff changeset
  1575
    changedClasses := nil
1098
420a868fd606 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1576
! !
420a868fd606 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  1577
1034
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
  1578
!ChangeSet methodsFor:'queries'!
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
  1579
2160
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1580
changedPackages
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1581
    "return a collection of all packages for which changes are in this changeSet"
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1582
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1583
    |classes changedPackages|
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1584
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1585
    changedPackages := Set new.
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1586
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1587
    self do:[:chg |
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1588
	|p mthd cls|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1589
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1590
	p := chg package.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1591
	p isNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1592
	    chg isMethodChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1593
		mthd := chg changeMethod.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1594
		mthd notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1595
		    p := mthd package.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1596
		] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1597
		    cls := chg changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1598
		    cls notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1599
			p := cls package.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1600
		    ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1601
		]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1602
	    ] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1603
		chg isClassChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1604
		    cls := chg changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1605
		    cls notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1606
			p := cls package.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1607
		    ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1608
		]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1609
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1610
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1611
	p notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1612
	    changedPackages add:p.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1613
	]
2160
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1614
    ].
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1615
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1616
"/    self changedClasses do:[:cls |
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1617
"/        |p|
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1618
"/
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1619
"/        (p := cls package) notNil ifTrue:[
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1620
"/            changedPackages add:p.
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1621
"/        ]
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1622
"/    ].
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1623
    ^ changedPackages.
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1624
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1625
    "
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1626
     ChangeSet current changedPackages
2160
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1627
    "
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1628
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1629
    "Created: / 22-09-2006 / 16:37:40 / cg"
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1630
    "Modified: / 13-10-2006 / 01:20:48 / cg"
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1631
!
831832c4c164 oops: fm lost #changedPackages
Claus Gittinger <cg@exept.de>
parents: 2138
diff changeset
  1632
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1633
changesForPackage:aPackageSymbol
2852
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  1634
    ^(self select:[:aChange |
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1635
	|includeThis mClass mthd|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1636
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1637
	includeThis := false.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1638
	(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1639
	    mClass := aChange changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1640
	    mClass notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1641
		mthd := mClass compiledMethodAt:(aChange selector).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1642
		mthd isNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1643
		    aChange isMethodRemoveChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1644
			includeThis := (mClass package = aPackageSymbol)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1645
		    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1646
		] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1647
		    includeThis := (mthd package = aPackageSymbol)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1648
		]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1649
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1650
	] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1651
	    (aChange isClassChange) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1652
		(aChange changeClass notNil) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1653
		    includeThis := (aChange changeClass package = aPackageSymbol)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1654
		].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1655
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1656
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1657
	includeThis
2852
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  1658
    ])
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1659
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1660
    "
2852
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  1661
     ChangeSet current changesForPackage:#'stx:goodies/libsvn'
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  1662
    "
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1663
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1664
    "Created: / 05-11-2001 / 14:21:17 / cg"
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1665
    "Modified: / 12-10-2006 / 16:51:27 / cg"
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1666
    "Modified: / 22-10-2008 / 13:25:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
2852
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  1667
    "Modified (comment): / 26-07-2012 / 11:54:00 / cg"
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1668
!
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1669
3688
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1670
classDefinitionChanges
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1671
    ^ self select:[:chg | chg isClassDefinitionChange] as:OrderedCollection.
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1672
!
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1673
1034
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
  1674
includesChangeForClass:aClass
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1675
    |nameOfClass|
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1676
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1677
    nameOfClass := aClass theNonMetaclass name.
3309
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1678
    ^ self includesChangeForClassNamed:nameOfClass
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1679
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1680
    "
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1681
     ChangeSet current includesChangeForClass:ChangeSet
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1682
     ChangeSet current includesChangeForClass:ChangeSet class
1686
7d2c1f9f63e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1683
     ChangeSet current includesChangeForClass:SourceCodeManagerUtilities
1918
1f3fcb411307 do not check for identical class being in changeSet -
boris
parents: 1898
diff changeset
  1684
     ChangeSet current includesChangeForClass:(Expecco::ExpeccoXMLDecoder::ObjectCreator)
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1685
    "
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1686
1842
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1687
    "Modified: / 09-10-2006 / 13:39:22 / cg"
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1688
!
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1689
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1690
includesChangeForClass:aClass selector:selector
1918
1f3fcb411307 do not check for identical class being in changeSet -
boris
parents: 1898
diff changeset
  1691
    |nameOfNonMetaClass nameOfClass|
1f3fcb411307 do not check for identical class being in changeSet -
boris
parents: 1898
diff changeset
  1692
1478
400bfb0e4ea9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
  1693
    (self changeSelectors includes:selector) ifFalse:[^ false].
1476
d8938e5b253e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1475
diff changeset
  1694
1918
1f3fcb411307 do not check for identical class being in changeSet -
boris
parents: 1898
diff changeset
  1695
    nameOfNonMetaClass := aClass theNonMetaclass name.
2973
312e2e952094 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 2954
diff changeset
  1696
    (self changedClasses contains:[:someClass | someClass theNonMetaclass name = nameOfNonMetaClass]) ifFalse:[^ false].
1918
1f3fcb411307 do not check for identical class being in changeSet -
boris
parents: 1898
diff changeset
  1697
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1698
    nameOfClass := aClass name.
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1699
4269
f6986d6bd37d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4251
diff changeset
  1700
    ^ self contains:[:aChange | aChange notNil and:[(selector = aChange selector) and:[nameOfClass = aChange className]]]
1085
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1701
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1702
    "
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1703
     ChangeSet current includesChangeForClass:ChangeSet selector:#includesChangeForClass:
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1704
    "
e4912b831447 includesChangeFor...
Claus Gittinger <cg@exept.de>
parents: 1083
diff changeset
  1705
4269
f6986d6bd37d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4251
diff changeset
  1706
    "Created: / 31-10-2001 / 10:26:31 / cg"
f6986d6bd37d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4251
diff changeset
  1707
    "Modified: / 30-11-2017 / 18:00:38 / cg"
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1708
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1709
3309
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1710
includesChangeForClassNamed:aClassName
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1711
    (self changedClasses contains:[:aClass | aClass theNonMetaclass name = aClassName]) ifFalse:[^ false].
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1712
    ^ self contains:[:aChange | aChange className = aClassName]
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1713
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1714
    "
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1715
     ChangeSet current includesChangeForClassNamed:'ChangeSet'
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1716
    "
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1717
!
8815cc2ad038 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3269
diff changeset
  1718
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1719
includesChangeForClassOrMetaclass:aClass
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1720
    |nameOfClass nameOfMetaclass|
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1721
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1722
    nameOfClass := aClass theNonMetaclass name.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1723
    nameOfMetaclass := aClass theMetaclass name.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1724
1920
4365130e896f bad spelling of methodname
Stefan Vogel <sv@exept.de>
parents: 1918
diff changeset
  1725
    (self changedClasses contains:[:eachClass | eachClass theNonMetaclass name = nameOfClass]) ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1726
	^ false.
1918
1f3fcb411307 do not check for identical class being in changeSet -
boris
parents: 1898
diff changeset
  1727
    ].
1f3fcb411307 do not check for identical class being in changeSet -
boris
parents: 1898
diff changeset
  1728
1f3fcb411307 do not check for identical class being in changeSet -
boris
parents: 1898
diff changeset
  1729
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1730
    ^ self contains:[:eachChange |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1731
			|changeClassName|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1732
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1733
			changeClassName := eachChange className.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1734
			changeClassName = nameOfClass or:[changeClassName = nameOfMetaclass]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1735
		    ]
1842
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1736
6ca4e98df305 method-package change record added
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  1737
    "Modified: / 09-10-2006 / 13:40:29 / cg"
1127
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1738
!
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1739
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1740
includesChangeForClassOrMetaclassOrPrivateClassOf:aClass
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1741
    |nameOfClass nameOfMetaclass|
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1742
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1743
    nameOfClass := aClass theNonMetaclass name.
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1744
    nameOfMetaclass := aClass theMetaclass name.
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1745
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1746
    self do:[:aChange |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1747
	|changeClassName changeClass|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1748
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1749
	changeClassName := aChange className.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1750
	(changeClassName = nameOfClass) ifTrue:[^ true].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1751
	(changeClassName = nameOfMetaclass) ifTrue:[^ true].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1752
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1753
	changeClass := aChange changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1754
	(changeClass notNil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1755
	and:[changeClass isPrivate
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1756
	and:[changeClass owningClass == aClass]]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1757
	    ^ true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1758
	]
1127
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1759
    ].
b009373b0feb +includesChangeForClassOrMetaclassOrPrivateClassOf
Claus Gittinger <cg@exept.de>
parents: 1115
diff changeset
  1760
    ^ false
2845
914991e2dbd7 added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2819
diff changeset
  1761
914991e2dbd7 added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2819
diff changeset
  1762
    "Modified (format): / 25-07-2012 / 16:50:26 / cg"
1885
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1763
!
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1764
2519
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1765
includesChangeForClassOrMetaclassOrPrivateClassOfAny:aCollectionOfClasses
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1766
    |namesOfClasses namesOfMetaclasses|
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1767
3176
bf3e3ac08152 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 3174
diff changeset
  1768
    namesOfClasses := (aCollectionOfClasses collect:[:eachClass | eachClass theNonMetaclass name]) asArray.
bf3e3ac08152 Don't do collect:[] as:Array and select:[] as:Array
Stefan Vogel <sv@exept.de>
parents: 3174
diff changeset
  1769
    namesOfMetaclasses := (aCollectionOfClasses collect:[:eachClass | eachClass theMetaclass name]) asArray.
2519
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1770
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1771
    self do:[:aChange |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1772
	|changeClassName changeClass|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1773
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1774
	changeClassName := aChange className.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1775
	(namesOfClasses includes:changeClassName) ifTrue:[^ true].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1776
	(namesOfMetaclasses includes:changeClassName) ifTrue:[^ true].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1777
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1778
	changeClass := aChange changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1779
	(changeClass notNil and:[changeClass isPrivate]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1780
	    (aCollectionOfClasses includes:changeClass owningClass) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1781
		^ true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1782
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1783
	]
2519
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1784
    ].
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1785
    ^ false
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1786
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1787
    "Created: / 08-09-2011 / 04:24:26 / cg"
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1788
!
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1789
1885
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1790
includesChangeForPackage:aPackageID
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1791
    ^ self changedPackages includes:aPackageID
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1792
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1793
"/    ^ self contains:[:aChange | aChange package = aPackageID]
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1794
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1795
    "
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1796
     ChangeSet current includesChangeForPackage:'stx:libbasic'
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1797
    "
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1798
b77dd687e497 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1883
diff changeset
  1799
    "Created: / 25-10-2006 / 18:06:55 / cg"
2519
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1800
!
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1801
3688
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1802
methodDefinitionChangesForClassNamed:aClassName
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1803
    ^ self select:[:chg | chg isMethodDefinitionChange and:[chg className = aClassName]] as:OrderedCollection.
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1804
!
4a8a1af9c89d class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3648
diff changeset
  1805
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1806
selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:aCollectionOfClasses
3378
905a79f03901 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3376
diff changeset
  1807
    "return the set of classes from a given collection, for which I have changes."
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1808
2845
914991e2dbd7 added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2819
diff changeset
  1809
    |selected alreadyProcessed classes prev|
914991e2dbd7 added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2819
diff changeset
  1810
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1811
    classes := (aCollectionOfClasses
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1812
	    collect:[:eachClass | eachClass theNonMetaclass]) as:IdentitySet.
3378
905a79f03901 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3376
diff changeset
  1813
905a79f03901 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3376
diff changeset
  1814
    selected := IdentitySet new.
905a79f03901 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3376
diff changeset
  1815
    alreadyProcessed := IdentitySet new.
2845
914991e2dbd7 added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2819
diff changeset
  1816
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1817
    self do:[:eachChange |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1818
	|changeClassName changeClass isIn|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1819
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1820
	changeClass := eachChange changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1821
	(changeClass notNil and:[changeClass ~~ prev]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1822
	    changeClass := changeClass theNonMetaclass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1823
	    (alreadyProcessed includes:changeClass) ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1824
		(classes includes:changeClass) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1825
		    selected add:changeClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1826
		].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1827
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1828
		"/ Care for private classes. If one of its owningClass
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1829
		"/ is in the given collection, add **that owningClass** into
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1830
		"/ result too!!!!
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1831
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1832
		changeClass isPrivate ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1833
		    |owner|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1834
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1835
		    owner := changeClass owningClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1836
		    [owner notNil] whileTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1837
			(classes includes:owner) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1838
			    selected add:owner.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1839
			    owner := nil.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1840
			] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1841
			    owner := owner owningClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1842
			].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1843
		    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1844
		].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1845
		alreadyProcessed add: changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1846
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1847
	    prev := changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1848
	].
2845
914991e2dbd7 added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2819
diff changeset
  1849
    ].
914991e2dbd7 added: #changesForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2819
diff changeset
  1850
    ^ selected.
2519
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1851
2907
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1852
    "Created: / 04-09-2012 / 14:01:37 / cg"
3378
905a79f03901 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3376
diff changeset
  1853
    "Modified: / 09-08-2013 / 12:40:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2907
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1854
!
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1855
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1856
selectForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:aCollectionOfClasses
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1857
    "select changes for one of a given class.
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1858
     Returns a collection of changes"
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1859
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1860
    |selected  classes |
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1861
4183
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1862
    classes := aCollectionOfClasses collect:[:eachClass | eachClass theNonMetaclass] as:Array.
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1863
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1864
    selected := self class new.
2907
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1865
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1866
    self do:[:eachChange |
4183
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1867
        |changeClassName changeClass isIn|
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1868
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1869
        changeClass := eachChange changeClass.
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1870
        (changeClass notNil) ifTrue:[
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1871
            changeClass := changeClass theNonMetaclass.
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1872
            ((classes includes:changeClass)
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1873
                or: [
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1874
                    changeClass isPrivate
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1875
                    and: [ (classes includes:changeClass owningClass) ]
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1876
                ]
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1877
            ) ifTrue:[
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1878
                selected add: eachChange
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1879
            ].
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  1880
        ]
2907
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1881
    ].
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1882
    ^ selected.
dd00eb010669 added: #selectClassesForWhichIncludesChangeForClassOrMetaclassOrPrivateClassFrom:
Claus Gittinger <cg@exept.de>
parents: 2902
diff changeset
  1883
2519
Claus Gittinger <cg@exept.de>
parents: 2491
diff changeset
  1884
    "Created: / 08-09-2011 / 04:38:32 / cg"
1034
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
  1885
! !
cdc9ddc19155 added query for a class being in a changeSet
Claus Gittinger <cg@exept.de>
parents: 985
diff changeset
  1886
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1887
!ChangeSet methodsFor:'utilities'!
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  1888
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  1889
apply
3222
a6996f259211 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3218
diff changeset
  1890
    "apply all changes in the receiver's changeSet"
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  1891
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  1892
    self do:[:aChange |
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1893
	aChange apply
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  1894
    ]
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  1895
!
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  1896
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1897
condenseChanges
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1898
    | changesToRemove changesToKeep |
2951
fb2a78a9064a changed: #condenseChanges:
Claus Gittinger <cg@exept.de>
parents: 2943
diff changeset
  1899
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1900
    changesToKeep := self class new.
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1901
    changesToRemove := self class new.
2951
fb2a78a9064a changed: #condenseChanges:
Claus Gittinger <cg@exept.de>
parents: 2943
diff changeset
  1902
    self reverseDo:[:change|
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1903
	(changesToKeep anySatisfy:[:each|each isForSameAs: change])
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1904
	    ifTrue:[changesToRemove add: change]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1905
	    ifFalse:[changesToKeep add: change]
2951
fb2a78a9064a changed: #condenseChanges:
Claus Gittinger <cg@exept.de>
parents: 2943
diff changeset
  1906
    ].
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1907
    self condenseChanges: changesToRemove.
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1908
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1909
    "Created: / 22-10-2008 / 13:05:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1910
!
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  1911
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1912
condenseChanges:changesToRemove
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1913
    "remove the given changes - a helper for the rest of the condense protocol"
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1914
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1915
    changesToRemove notEmpty ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1916
	changedClasses := changeSelectors := nil.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1917
	self removeAll:changesToRemove.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1918
	"/ self changed. "/  -- removeAll already sends out a notification
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1919
	Smalltalk changed:#currentChangeSet with:self.
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1920
    ].
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1921
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1922
    "Created: / 12-10-2006 / 16:51:11 / cg"
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1923
!
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1924
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1925
condenseChangesForClass:aClass
3825
ca84b0805d36 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
  1926
    "remove all changes for aClass (and its metaclass)
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1927
     (i.e. leave changes for other classes)."
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1928
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1929
    self condenseChangesForClass:aClass package:nil
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1930
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
  1931
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  1932
condenseChangesForClass:aClass package:aPackageSymbol
3825
ca84b0805d36 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
  1933
    "remove all changes for aClass (and its metaclass) and aPackageSymbol
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  1934
     (i.e. leave methodChanges for other packages).
956
0c6c209df4e9 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  1935
     This is invoked when a class is checked into the repository."
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  1936
1186
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1937
    self condenseChangesForClass:aClass selector:nil package:aPackageSymbol
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1938
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1939
    "Modified: / 5.11.2001 / 14:29:22 / cg"
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1940
!
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1941
1830
a44c9beee9a6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  1942
condenseChangesForClass:aClass selector:aSelector
a44c9beee9a6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  1943
    "remove all changes for aClass >> selector."
a44c9beee9a6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  1944
a44c9beee9a6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  1945
    self condenseChangesForClass:aClass selector:aSelector package:nil
a44c9beee9a6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  1946
a44c9beee9a6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  1947
    "Created: / 26-09-2006 / 17:22:59 / cg"
a44c9beee9a6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  1948
!
a44c9beee9a6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  1949
1186
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1950
condenseChangesForClass:aClass selector:selectorOrNil package:aPackageSymbol
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1951
    "remove all changes for aClass/selector and aPackageSymbol
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1952
     (i.e. leave methodChanges for other packages).
3825
ca84b0805d36 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3824
diff changeset
  1953
     If selectorOrNil is nil, all changes for that class (or metaclass) are removed;
1186
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1954
     otherwise, only changes for the given selector.
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1955
     This is invoked when a class is checked into the repository."
a47e1a5770c2 condensing after an extensions-checkin fixed
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
  1956
945
f9e349d38d49 care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  1957
    |changesToRemove className metaClassName chgCls|
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  1958
945
f9e349d38d49 care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  1959
    className := aClass theNonMetaclass name.
f9e349d38d49 care for metaclasses when condensing changeSet
Claus Gittinger <cg@exept.de>
parents: 944
diff changeset
  1960
    metaClassName := aClass theMetaclass name.
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  1961
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1962
    changesToRemove :=
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1963
	self select:[:aChange |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1964
	    |chgClassName chgClass removeThis mClass mthd|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1965
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1966
	    removeThis := false.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1967
	    chgClassName := aChange className.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1968
	    (chgClassName = className or:[chgClassName = metaClassName]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1969
		removeThis := true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1970
	    ] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1971
		chgCls := aChange changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1972
		chgCls isNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1973
		    (chgClassName startsWith:(aClass name,':')) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1974
			"a change for a private class of a no-longer present one..."
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1975
			    removeThis := true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1976
		    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1977
		].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1978
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1979
		(chgCls notNil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1980
		and:[chgCls isPrivate
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1981
		and:[chgCls topOwningClass == aClass]]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1982
		    removeThis := true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1983
		]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1984
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1985
	    selectorOrNil notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1986
		(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1987
		    removeThis := false.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1988
		] ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1989
		    aChange selector = selectorOrNil ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1990
			removeThis := false.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1991
		    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1992
		]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1993
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1994
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1995
	    removeThis ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1996
		aChange isMethodChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1997
		    mClass := aChange changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1998
		    mClass notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  1999
			mthd := mClass compiledMethodAt:(aChange selector).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2000
			mthd isNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2001
			    "/ mthd does no longer exist
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2002
			    "/ I no longer understand what this was meant for .. (sigh)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2003
			    "/                        aPackageSymbol notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2004
			    "/                            removeThis := false
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2005
			    "/                        ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2006
			] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2007
			    (aPackageSymbol notNil and:[mthd package ~= aPackageSymbol]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2008
				removeThis := false
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2009
			    ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2010
			]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2011
		    ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2012
		].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2013
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2014
	    removeThis
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2015
	].
1187
f63ecc7dbaff condenseChange fixes (if baseClass or extensions are checked in)
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
  2016
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2017
    self condenseChanges:changesToRemove
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2018
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2019
    "Modified: / 12-10-2006 / 16:51:38 / cg"
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2020
!
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2021
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2022
condenseChangesForExtensionsInPackage:aPackageSymbol
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2023
    "remove all changes for aClass and aPackageSymbol
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2024
     (i.e. leave methodChanges for other packages).
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2025
     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
  2026
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2027
    |changesToRemove|
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2028
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2029
    changesToRemove := OrderedCollection new.
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2030
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2031
    changesToRemove := self select:[:aChange |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2032
	|removeThis mClass mthd|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2033
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2034
	(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2035
	    removeThis := false.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2036
	    mClass := aChange changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2037
	    (mClass notNil and:[mClass package ~= aPackageSymbol]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2038
		mthd := mClass compiledMethodAt:(aChange selector).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2039
		mthd isNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2040
		    aChange isMethodRemoveChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2041
			removeThis := true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2042
		    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2043
		] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2044
		    mthd package = aPackageSymbol ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2045
			removeThis := true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2046
		    ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2047
		]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2048
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2049
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2050
	removeThis
1087
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2051
    ].
5aaf7da2882d condense changes for extensions
Claus Gittinger <cg@exept.de>
parents: 1085
diff changeset
  2052
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2053
    self condenseChanges:changesToRemove
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2054
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2055
    "Created: / 05-11-2001 / 14:21:17 / cg"
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2056
    "Modified: / 12-10-2006 / 16:51:32 / cg"
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2057
!
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2058
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2059
condenseChangesForPackage:aPackageSymbol
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2060
    "remove all changes for aPackageSymbol
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2061
     This is invoked when a project is checked into the repository."
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2062
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2063
    |changesToRemove|
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2064
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2065
    changesToRemove := self select:[:aChange |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2066
	|removeThis mClass mthd|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2067
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2068
	removeThis := false.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2069
	(aChange isMethodChange or:[aChange isMethodRemoveChange]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2070
	    mClass := aChange changeClass.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2071
	    mClass notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2072
		mthd := mClass compiledMethodAt:(aChange selector).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2073
		mthd isNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2074
		    aChange isMethodRemoveChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2075
			removeThis := (mClass package = aPackageSymbol)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2076
		    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2077
		] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2078
		    removeThis := (mthd package = aPackageSymbol)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2079
		]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2080
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2081
	] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2082
	    (aChange isClassChange) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2083
		(aChange changeClass notNil) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2084
		    removeThis := (aChange changeClass package = aPackageSymbol)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2085
		].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2086
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2087
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2088
	removeThis
1521
ea6cb41e4523 send out a change notification, when I condensed
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  2089
    ].
ea6cb41e4523 send out a change notification, when I condensed
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  2090
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2091
    self condenseChanges:changesToRemove
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2092
1521
ea6cb41e4523 send out a change notification, when I condensed
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
  2093
    "Created: / 05-11-2001 / 14:21:17 / cg"
1865
89d9aef483b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1842
diff changeset
  2094
    "Modified: / 12-10-2006 / 16:51:27 / cg"
878
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  2095
!
99583ccfe415 *** empty log message ***
ps
parents: 877
diff changeset
  2096
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2097
diffSetsAgainst:anotherChangeSet
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2098
    "walk over the receiver and anotherChangeSet,
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2099
     add all changes to one of the tree lists:
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2100
        onlyInReceiver, onlyInArg or changed,
946
11f09459b0f5 comment
Claus Gittinger <cg@exept.de>
parents: 945
diff changeset
  2101
     each being a changeSet containing corresponding changes.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2102
     WARNING:
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2103
        destructive; could modify both the receiver and the argument by possibly
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2104
        changing methodChanges into categoryChanges"
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2105
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2106
    ^ self diffSetsAgainst:anotherChangeSet comparingDifferentClasses:false    
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2107
!
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2108
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2109
diffSetsAgainst:anotherChangeSet comparingDifferentClasses:comparingDifferentClasses
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2110
    "walk over the receiver and anotherChangeSet,
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2111
     add all changes to one of the tree lists:
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2112
        onlyInReceiver, onlyInArg or changed,
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2113
     each being a changeSet containing corresponding changes.
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2114
     If comparingDifferentClasses is false, changes to different classes will 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2115
     generate onlyInA/onlyInB changes; eg. changes for the same selector will be
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2116
     listed on either side.
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2117
     If it is true, we are comparing two different classes, and selectors present in 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2118
     both will be listed as different (or even as the same).
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2119
     
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2120
     WARNING:
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2121
        destructive; could modify both the receiver and the argument by possibly
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2122
        changing methodChanges into categoryChanges."
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2123
1200
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2124
    |otherChangeIndicesBySelector otherNonMethodChangeIndices changeIndicesBySelector nonMethodChangeIndices
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2125
     onlyInReceiver onlyInArg changedMethods same
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2126
     indexFromChangedMethodsToA indexFromChangedMethodsToB
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2127
     "info" ret isForSame isSame|
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2128
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2129
    comparingDifferentClasses ifTrue:[
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2130
        isForSame := [:aChangeInA :aChangeInB |
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2131
                        |isForSame|
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2132
                        
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2133
                        isForSame := false.
4120
99449d5ce3f8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4115
diff changeset
  2134
                        (aChangeInA isMethodChange 
99449d5ce3f8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4115
diff changeset
  2135
                            and:[aChangeInB isMethodChange
99449d5ce3f8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4115
diff changeset
  2136
                            and:[aChangeInA changeSelector = aChangeInB changeSelector
99449d5ce3f8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4115
diff changeset
  2137
                            and:[aChangeInA changeClass isMeta = aChangeInB changeClass isMeta]]])
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2138
                        ifTrue:[
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2139
                            isForSame := true.
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2140
                        ] ifFalse:[
4120
99449d5ce3f8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4115
diff changeset
  2141
                            (aChangeInA isClassChange 
99449d5ce3f8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4115
diff changeset
  2142
                                and:[aChangeInB isClassChange 
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2143
                                and:[aChangeInA changeClass nameWithoutNameSpacePrefix 
4120
99449d5ce3f8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4115
diff changeset
  2144
                                     = aChangeInB changeClass nameWithoutNameSpacePrefix]])
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2145
                            ifTrue:[
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2146
                                isForSame := true.
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2147
                            ]
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2148
                        ].
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2149
                        isForSame
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2150
                     ].
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2151
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2152
        isSame := [:aChangeInA :aChangeInB | 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2153
                        (aChangeInA source = aChangeInB source) 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2154
                  ]. 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2155
    ] ifFalse:[
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2156
        isForSame := [:aChangeInA :aChangeInB | 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2157
                        (aChangeInA isForSameAs:aChangeInB) 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2158
                     ].
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2159
                     
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2160
        isSame := [:aChangeInA :aChangeInB | 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2161
                        (aChangeInA sameAs:aChangeInB) 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2162
                  ]. 
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2163
    ].    
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2164
4183
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  2165
    onlyInReceiver := self class new.
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  2166
    onlyInArg      := self class new.
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  2167
    changedMethods := self class new.
4963225764b6 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4120
diff changeset
  2168
    same           := self class new.
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2169
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2170
    indexFromChangedMethodsToA := OrderedCollection new.
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2171
    indexFromChangedMethodsToB := OrderedCollection new.
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2172
1200
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2173
    otherChangeIndicesBySelector := Dictionary new.
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2174
    otherNonMethodChangeIndices := OrderedCollection new.
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2175
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2176
    "/ these caches reduces square runtime to almost linear...
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2177
    anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB |
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2178
        |setOfOtherChangeIndicesForThisSelector|
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2179
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2180
        aChangeInB isMethodChange ifTrue:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2181
            setOfOtherChangeIndicesForThisSelector := otherChangeIndicesBySelector at:(aChangeInB selector) ifAbsentPut:[OrderedCollection new].
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2182
            setOfOtherChangeIndicesForThisSelector add:idxB.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2183
        ] ifFalse:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2184
            otherNonMethodChangeIndices add:idxB
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2185
        ].
1200
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2186
    ].
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2187
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2188
    self keysAndValuesDo:[:idxA :aChangeInA |
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2189
        |indicesOfChangesToExplore anyFound ch|
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2190
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2191
        anyFound := false.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2192
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2193
        aChangeInA isMethodChange ifTrue:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2194
            indicesOfChangesToExplore := otherChangeIndicesBySelector at:(aChangeInA selector) ifAbsent:#()
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2195
        ] ifFalse:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2196
            indicesOfChangesToExplore := otherNonMethodChangeIndices.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2197
        ].
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2198
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2199
        indicesOfChangesToExplore do:[:idxB |
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2200
            |aChangeInB|
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2201
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2202
            aChangeInB := anotherChangeSet at:idxB.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2203
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2204
            (isForSame value:aChangeInA value:aChangeInB) ifTrue:[
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2205
                "/ these two are for the same class/selector
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2206
                anyFound := true.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2207
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2208
                "/ also in B - is it different?
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2209
                (isSame value:aChangeInA value:aChangeInB) ifFalse:[
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2210
                    changedMethods add:aChangeInA.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2211
                    indexFromChangedMethodsToA add:idxA.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2212
                    indexFromChangedMethodsToB add:idxB.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2213
                ] ifTrue:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2214
                    aChangeInA isMethodChange ifTrue:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2215
                        aChangeInA methodCategory ~= aChangeInB methodCategory ifTrue:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2216
                            "/ only the category is different;
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2217
                            "/ make it a MethodCategory changes.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2218
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2219
                            ch := MethodCategoryChange new
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2220
                                    className:aChangeInA className
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2221
                                    selector:aChangeInA selector
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2222
                                    category:aChangeInA methodCategory;
4385
9cdb4caaec37 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4337
diff changeset
  2223
                                    nameSpaceName:aChangeInA nameSpaceName;
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2224
                                    "JV@2012-03-20: Also keeps origin, required by merge tool"
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2225
                                    origin: aChangeInA.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2226
                            self at:idxA put:ch.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2227
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2228
                            ch := MethodCategoryChange new
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2229
                                    className:aChangeInB className
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2230
                                    selector:aChangeInB selector
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2231
                                    category:aChangeInB methodCategory;
4385
9cdb4caaec37 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4337
diff changeset
  2232
                                    nameSpaceName:aChangeInB nameSpaceName;
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2233
                                    "JV@2012-03-20: Also keeps origin, required by merge tool"
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2234
                                    origin: aChangeInB.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2235
                            anotherChangeSet at:idxB put:ch.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2236
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2237
                            changedMethods add:aChangeInA.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2238
                            indexFromChangedMethodsToA add:idxA.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2239
                            indexFromChangedMethodsToB add:idxB.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2240
                        ]
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2241
                    ].
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2242
                ]
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2243
            ] ifFalse:[
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2244
                (isSame value:aChangeInA value:aChangeInB) ifTrue:[
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2245
                    anyFound := true.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2246
                ] ifFalse:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2247
                ]
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2248
            ]
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2249
        ].
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2250
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2251
        anyFound ifFalse:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2252
            onlyInReceiver add:aChangeInA.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2253
        ]
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2254
    ].
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2255
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2256
    "/ these caches reduce square runtime to almost linear...
1200
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2257
    changeIndicesBySelector := Dictionary new.
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2258
    nonMethodChangeIndices := OrderedCollection new.
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2259
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2260
    self keysAndValuesDo:[:idxA :aChangeInA |
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2261
        |setOfChangeIndicesForThisSelector|
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2262
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2263
        aChangeInA isMethodChange ifTrue:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2264
            setOfChangeIndicesForThisSelector := changeIndicesBySelector at:(aChangeInA selector) ifAbsentPut:[OrderedCollection new].
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2265
            setOfChangeIndicesForThisSelector add:idxA.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2266
        ] ifFalse:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2267
            nonMethodChangeIndices add:idxA
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2268
        ].
1200
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2269
    ].
2da3e026f94d much faster diffSet generation - watch out - report bugs to cg
Claus Gittinger <cg@exept.de>
parents: 1191
diff changeset
  2270
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2271
    anotherChangeSet keysAndValuesDo:[:idxB :aChangeInB |
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2272
        |anyFound indicesOfChangesToExplore|
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2273
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2274
        anyFound := false.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2275
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2276
        aChangeInB isMethodChange ifTrue:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2277
            indicesOfChangesToExplore := changeIndicesBySelector at:(aChangeInB selector) ifAbsent:#()
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2278
        ] ifFalse:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2279
            indicesOfChangesToExplore := nonMethodChangeIndices.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2280
        ].
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2281
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2282
        indicesOfChangesToExplore do:[:idxA |
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2283
            |aChangeInA idxM|
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2284
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2285
            aChangeInA := self at:idxA.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2286
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2287
            (isForSame value:aChangeInA value:aChangeInB) ifTrue:[
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2288
                anyFound := true.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2289
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2290
                "/ also in B - is it different ?
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2291
                (isSame value:aChangeInA value:aChangeInB) ifFalse:[
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2292
                    "/ already there ?
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2293
                    idxM := changedMethods findFirst:[:c | (isForSame value:c value:aChangeInB)].
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2294
                    idxM == 0 ifTrue:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2295
                        changedMethods add:aChangeInB.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2296
                        indexFromChangedMethodsToB add:idxB.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2297
                    ] ifFalse:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2298
                        indexFromChangedMethodsToB at:idxM put:idxB
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2299
                    ]
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2300
                ]
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2301
            ] ifFalse:[
4033
27e307c5e35f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  2302
                (isSame value:aChangeInA value:aChangeInB) ifTrue:[
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2303
                    anyFound := true.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2304
                ] ifFalse:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2305
                ]
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2306
            ]
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2307
        ].
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2308
        anyFound ifFalse:[
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2309
            onlyInArg add:aChangeInB.
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2310
        ]
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2311
    ].
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2312
864
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  2313
"/    info := OrderedCollection new:(changedMethods size).
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  2314
"/    changedMethods keysAndValuesDo:[:idx :changedMethod |
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2315
"/        info add:(Array
864
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  2316
"/                        with:(indexFromChangedMethodsToA at:idx)
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  2317
"/                        with:(indexFromChangedMethodsToB at:idx)
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  2318
"/                 )
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  2319
"/    ].
1450
0ec14b2064fb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1447
diff changeset
  2320
    changedMethods := (1 to:changedMethods size) asOrderedCollection collect:[:idx |
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2321
                        |cA cB|
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2322
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2323
                        cA := self at:(indexFromChangedMethodsToA at:idx).
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2324
                        cB := anotherChangeSet at:(indexFromChangedMethodsToB at:idx).
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2325
                        Array with:cA with:cB
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2326
                      ].
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2327
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2328
    same := self reject:[:chg|(changedMethods contains:[:pair|pair first == chg]) or:[onlyInReceiver includes: chg]].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2329
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  2330
    ret := DiffSet new
3981
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2331
                changed:changedMethods
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2332
                onlyInReceiver:onlyInReceiver
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2333
                onlyInArg:onlyInArg
60a9e8dcb7d1 #DOCUMENTATION by mawalch
mawalch
parents: 3964
diff changeset
  2334
                same: same.
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  2335
"/    ret info:info.
864
4f35b96a799e checkin from browser
ps
parents: 860
diff changeset
  2336
    ^ret
1867
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2337
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  2338
    "Modified: / 12-10-2006 / 22:22:39 / cg"
2633
5a5460e5231a comment/format in:
Claus Gittinger <cg@exept.de>
parents: 2626
diff changeset
  2339
    "Modified (comment): / 01-12-2011 / 19:12:55 / cg"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2340
    "Modified: / 20-03-2012 / 22:05:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4385
9cdb4caaec37 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4337
diff changeset
  2341
    "Modified: / 06-12-2018 / 17:15:37 / Stefan Vogel"
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2342
!
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2343
2412
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2344
diffSetsAgainstImage
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2345
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2346
    |imageChangeSet|
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2347
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2348
    imageChangeSet := self class new.
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2349
    self changedClasses do:
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2350
	[:class|
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2351
	(class isMetaclass or:[class isPrivate]) ifFalse:
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2352
	    [imageChangeSet addAll:
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2353
		(self class fromStream: class source asString readStream)]].
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2354
    ^self diffSetsAgainst: imageChangeSet
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2355
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2356
    "Created: / 04-12-2007 / 16:03:28 / janfrog"
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2357
!
13197e877a9e Extension methods from libsvn
vrany
parents: 2376
diff changeset
  2358
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2359
flatten
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2360
    "return a flat changeset from a changeset which may contain compositeChanges"
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2361
    
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2362
    | flatten |
3824
df87c97ebf32 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2363
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2364
    flatten := self class new: self size.
3824
df87c97ebf32 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2365
    self do:[:ea|
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2366
        ea do:[:ea2| flatten add: ea2]
3824
df87c97ebf32 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2367
    ].
df87c97ebf32 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3760
diff changeset
  2368
    ^ flatten
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2369
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2370
    "Created: / 29-10-2010 / 14:40:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2371
!
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2372
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2373
groupBy: groupBlock labelAs: labelBlock
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2374
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2375
    "
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2376
	returns a new changeset consisting of CompositeChanges.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2377
	Changes are grouped together by value (tag) of groupBlock.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2378
	Each composite change is then labeled using label
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2379
	returned by labelBlock (called with the tag returned
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2380
	by groupBlock as arg)
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2381
    "
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2382
2491
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2383
    ^ self groupBy: groupBlock labelAs: labelBlock sort: false
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2384
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2385
    "Created: / 24-07-2009 / 23:17:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2386
    "Modified: / 25-07-2009 / 19:40:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2387
    "Modified: / 29-10-2010 / 12:45:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2388
    "Modified: / 30-08-2011 / 16:07:30 / cg"
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2389
!
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2390
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2391
groupBy: groupBlock labelAs: labelBlock sort: doSort
2626
0ac000060c44 changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2392
    "returns a new changeset consisting of CompositeChanges.
0ac000060c44 changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2393
     Changes are grouped together by value (tag) of groupBlock.
0ac000060c44 changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2394
     Each composite change is then labeled using label
0ac000060c44 changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2395
     returned by labelBlock (called with the tag returned
0ac000060c44 changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2396
     by groupBlock as arg)"
2491
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2397
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2398
    | buckets newChangeset keys |
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2399
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2400
    buckets := OrderedDictionary new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2401
    self do:[:change|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2402
	| tag |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2403
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2404
	tag := groupBlock value: change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2405
	(buckets at: tag ifAbsentPut: [self class new:4]) add: change
2852
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  2406
    ].
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  2407
    newChangeset := self class new: buckets size.
2491
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2408
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2409
    keys := buckets keys select:[:k | k notNil].
2852
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  2410
    doSort ifTrue:[ keys sort ].
2491
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2411
    keys do:[:tag |
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2412
	|changes classDefs|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2413
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2414
	changes := buckets at:tag.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2415
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2416
	"Move class definition to the front"
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2417
	classDefs := changes select:[:chg|chg isClassDefinitionChange].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2418
	changes removeAll: classDefs.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2419
	changes addAllFirst: classDefs.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2420
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2421
	tag notNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2422
	    newChangeset add:
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2423
		(CompositeChange
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2424
		    name: (labelBlock value: tag)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2425
		    changes: changes)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2426
	]
2852
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  2427
    ].
2626
0ac000060c44 changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2428
    (buckets includesKey: nil) ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2429
	newChangeset addAll: (buckets at: nil)
2626
0ac000060c44 changed: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  2430
    ].
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2431
    ^newChangeset
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2432
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2433
    "Created: / 24-07-2009 / 23:17:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2434
    "Modified: / 25-07-2009 / 19:40:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2435
    "Modified: / 29-10-2010 / 12:45:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2491
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2436
    "Created: / 30-08-2011 / 16:07:01 / cg"
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2437
!
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2438
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2439
groupByClass
2491
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2440
    |nm|
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2441
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2442
    ^self
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2443
	groupBy: [:change|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2444
	    change isClassChange ifTrue: [
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2445
		nm := change className.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2446
		(nm notNil and:[nm endsWith:' class']) ifTrue:[nm := nm copyTo: nm size - 6].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2447
		nm
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2448
	    ] ifFalse: [
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2449
		nil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2450
	    ]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2451
	]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2452
	labelAs: [:className|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2453
	    className
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2454
	]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2455
	sort: true
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2456
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2457
    "Created: / 25-07-2009 / 19:43:14 / Jan Vrany <vranyj1@fel.cvut.cz>"
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2458
    "Modified: / 24-10-2009 / 18:49:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2491
882e07ee86bd added: #groupBy:labelAs:sort:
Claus Gittinger <cg@exept.de>
parents: 2469
diff changeset
  2459
    "Modified: / 30-08-2011 / 16:08:38 / cg"
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2460
!
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2461
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2462
saveSignedToFile:aFilename
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2463
    "write the changeSet to a signed file in chunk format"
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2464
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2465
    self saveSignedToFile:aFilename format:nil
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2466
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2467
    "Created: / 08-02-2011 / 11:18:54 / cg"
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2468
!
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2469
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2470
saveSignedToFile:aFilename format:formatSymbolOrNil
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2471
    "write the changeSet to a signed file in some format.
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2472
     Sign with the exept key (which you do not have outside of exept!!).
4251
8466eb127174 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4248
diff changeset
  2473
     
8466eb127174 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4248
diff changeset
  2474
     formatSymbolOrNil is passed to saveToStream:s format:formatSymbolOrNil,
8466eb127174 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4248
diff changeset
  2475
     and specifies which fileOut format to use.
8466eb127174 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4248
diff changeset
  2476
     Nil means: chunk format (currently, the only supported)"
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2477
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2478
    |s pkcs7SignedData|
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2479
2852
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  2480
    self assert: (Smalltalk at:#'Expecco::KeyFileGenerator') notNil.
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  2481
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2482
    s := WriteStream on:(String new:2000).
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2483
    self saveToStream:s format:formatSymbolOrNil.
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2484
2852
9e670f6d2145 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
  2485
    pkcs7SignedData := (Smalltalk at:#'Expecco::KeyFileGenerator') new signExpeccoCode:s contents.
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2486
    aFilename asFilename contents:pkcs7SignedData.
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2487
4251
8466eb127174 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4248
diff changeset
  2488
    "Modified (comment): / 17-07-2017 / 10:41:44 / cg"
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2489
!
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2490
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2491
saveToFile:aFilename
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2492
    "write the changeSet to a regular file in chunk format"
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2493
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2494
    self saveToFile:aFilename format:nil
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2495
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2496
    "Created: / 08-02-2011 / 11:18:46 / cg"
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2497
!
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2498
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2499
saveToFile:aFilename format:formatSymbolOrNil
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2500
    "Writes the changeSet to a regular file in some format.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2501
     Supported formats are:
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2502
       nil ............ chunk changeset file
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2503
       #classSource ... class fileout format, assumes that
4303
e0a9b25d182e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4269
diff changeset
  2504
                        the receiver is a changeset containing
e0a9b25d182e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4269
diff changeset
  2505
                        single class (possibly with its private
e0a9b25d182e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4269
diff changeset
  2506
                        classes)
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2507
    "
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2508
4303
e0a9b25d182e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4269
diff changeset
  2509
    aFilename asFilename writingFileDo:[:s |
e0a9b25d182e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4269
diff changeset
  2510
        self saveToStream:s format:formatSymbolOrNil.
e0a9b25d182e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4269
diff changeset
  2511
    ].
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2512
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2513
    "Created: / 08-02-2011 / 11:20:06 / cg"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2514
    "Modified (comment): / 31-07-2012 / 13:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2515
!
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2516
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2517
saveToStream:aStream format:formatSymbolOrNil
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2518
    "Writes the changeSet to a stream in some format.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2519
     Supported formats are:
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2520
       nil ............ chunk changeset file format
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2521
       #classSource ... class fileout format, assumes that
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2522
			the receiver is a changeset containing
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2523
			single class (possibly with its private
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2524
			classes)
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2525
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2526
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2527
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2528
    formatSymbolOrNil isNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2529
	ChangeFileWriter new fileOut:self on:aStream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2530
	^ self.
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2531
    ].
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2532
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2533
    formatSymbolOrNil == #classSource ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2534
	ClassSourceWriter new fileOut:self on:aStream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2535
	^ self.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2536
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2537
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2538
    self error:'Unknown format, possible formats are { nil, #classSource }'
2323
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2539
3c9f00f9ca34 added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2322
diff changeset
  2540
    "Created: / 08-02-2011 / 11:25:16 / cg"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2541
    "Modified (comment): / 04-02-2014 / 18:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2542
!
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2543
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2544
sortedByClassName
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2545
    "returns a new changeset containing the changes sorted by class names"
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2546
    
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2547
    | newChangeset |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2548
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2549
    newChangeset := self class new: self size.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2550
    newChangeset addAll:self.                
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2551
    newChangeset sort:[:a :b |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2552
                    |nameA nameB|
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2553
                    nameA := a isClassChange ifTrue:[ a className ] ifFalse:[ '^other' ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2554
                    nameB := b isClassChange ifTrue:[ b className ] ifFalse:[ '^other' ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2555
                    nameA < nameB].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  2556
    ^ newChangeset                
857
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2557
! !
0a1a91c94e53 diff utility
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
  2558
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2559
!ChangeSet::ChangeFileReader methodsFor:'accessing'!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2560
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2561
changeAction:aBlock
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2562
    changeAction := aBlock.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2563
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2564
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2565
changeSet:something
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2566
    "set the value of the instance variable 'changeSet' (automatically generated)"
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2567
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2568
    changeSet := something.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2569
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2570
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2571
inputStream:aStream
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2572
    inputStream := aStream.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2573
! !
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2574
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2575
!ChangeSet::ChangeFileReader methodsFor:'helpers'!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2576
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2577
addChange:change
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2578
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2579
    timestamp notNil ifTrue:[change timeStamp: timestamp].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2580
    timestamp := nil.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2581
    change isClassChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2582
	change package: Class packageQuerySignal query.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2583
	change nameSpace: Class nameSpaceQuerySignal query.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2584
    ].
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  2585
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2586
    changeAction
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2587
	valueWithOptionalArgument:change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2588
	and:lineNumber
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2589
	and:position.
2008
204b171a553d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1977
diff changeset
  2590
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2591
    "Modified: / 11-06-2013 / 15:57:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2592
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2593
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2594
checkReceiverIsGlobalNamed:expectedName
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2595
    ^ self variableNameOfReceiver = expectedName
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2596
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2597
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2598
classNameOf:aReceiver
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2599
    "old"
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2600
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2601
    | nameSpace isMeta clsNode clsName |
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2602
    nameSpace := Class nameSpaceQuerySignal query.
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2603
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2604
    isMeta := false.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2605
    classIsJava := false.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2606
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2607
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2608
    (aReceiver isUnaryMessage and:[aReceiver selector == #class]) ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2609
	isMeta := true.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2610
	clsNode := aReceiver receiver.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2611
    ] ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2612
	clsNode := aReceiver.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2613
    ].
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2614
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2615
    clsNode isMessage ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2616
	"Normal smalltalk method on Smalltalk class"
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2617
	clsName := clsNode name
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2618
    ] ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2619
	"Maybe a Java class?"
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2620
	((clsNode selector == #classForName:) and:[clsNode receiver name = 'Java']) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2621
	    clsName := '(Java classForName:''%1'')' bindWith: clsNode arguments first value.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2622
	    classIsJava := true.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2623
	].
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2624
    ].
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2625
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2626
    isMeta ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2627
	clsName := clsName , ' class'.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2628
    ].
2376
d7311cfb8a5f Jan's changes
vrany
parents: 2323
diff changeset
  2629
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2630
    (nameSpace ~~ Smalltalk and:[(clsName startsWith: nameSpace name) not])
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2631
	ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2632
	    ^ nameSpace name , '::' , clsName
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2633
	] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2634
	    ^ clsName
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2635
	].
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2636
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  2637
    "Modified: / 30-01-2013 / 10:02:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2638
!
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2639
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2640
classNameOfRememberingNamespace:aReceiver
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2641
    "new"
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2642
4337
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2643
    | nameSpace isMeta clsNode clsName|
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2644
    
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2645
    nameSpace := Class nameSpaceQuerySignal query.
3195
5ce601cd8a45 class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3184
diff changeset
  2646
3247
09f7b7abf87c Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3246
diff changeset
  2647
    isMeta := false.
09f7b7abf87c Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3246
diff changeset
  2648
    classIsJava := false.
09f7b7abf87c Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3246
diff changeset
  2649
09f7b7abf87c Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3246
diff changeset
  2650
    (aReceiver isUnaryMessage and:[aReceiver selector == #class]) ifTrue:[
4337
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2651
        isMeta := true.
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2652
        clsNode := aReceiver receiver.
3197
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  2653
    ] ifFalse:[
4337
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2654
        clsNode := aReceiver.
3247
09f7b7abf87c Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3246
diff changeset
  2655
    ].
09f7b7abf87c Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3246
diff changeset
  2656
09f7b7abf87c Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3246
diff changeset
  2657
    clsNode isMessage ifFalse:[
4337
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2658
        "Normal smalltalk method on Smalltalk class"
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2659
        clsName := clsNode name
3247
09f7b7abf87c Bugfix for Java extension methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3246
diff changeset
  2660
    ] ifTrue:[
4337
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2661
        "Maybe a Java class?"
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2662
        ((clsNode selector == #classForName:) and:[clsNode receiver name = 'Java']) ifTrue:[
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2663
            clsName := '(Java classForName:''%1'')' bindWith: clsNode arguments first value.
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2664
            classIsJava := true.
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2665
        ].
3195
5ce601cd8a45 class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3184
diff changeset
  2666
    ].
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2667
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2668
    "Strip off the namespace"
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2669
    (classIsJava not and:[ nameSpace ~~ Smalltalk]) ifTrue:[
4337
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2670
        (clsName startsWith:(nameSpace name,'::')) ifTrue:[
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2671
            clsName := clsName copyFrom: nameSpace name size + 3.
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2672
        ]
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2673
    ].
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2674
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2675
    isMeta ifTrue:[
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2676
        clsName := clsName , ' class'.
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2677
    ].
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2678
4337
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2679
    (nameSpace ~~ Smalltalk "and:[(clsName startsWith:(nameSpace name,'::')) not]")
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2680
        ifTrue:[
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2681
            "/ old: remember namespace in name
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2682
            "/ ^ nameSpace name , '::' , clsName
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2683
            "/ new: remember in override
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2684
            nameSpaceOverride := nameSpace.
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2685
            ^ clsName
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2686
        ] ifFalse:[
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2687
            nameSpaceOverride := nil.
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2688
            ^ clsName
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2689
        ].
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2690
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2691
    "Modified: / 11-06-2013 / 17:55:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4337
4cb5669b2979 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4325
diff changeset
  2692
    "Modified (format): / 02-07-2018 / 14:15:06 / Claus Gittinger"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2693
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2694
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2695
extractMethodsClassAndSelectorFromReceiver
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2696
    "helper for all changes which are of the form:
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  2697
        (className compiledMethodAt:#methodSelector) something: ...
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2698
    "
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2699
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2700
    (receiver isMessage
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2701
    and:[receiverSelector == #'compiledMethodAt:']) ifFalse:[
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  2702
        self proceedableError:'unexpected change'.
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  2703
        ^ false.
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2704
    ].
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2705
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2706
    "/ className := self classNameOf:receiverReceiver.
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2707
    className := self classNameOfRememberingNamespace:receiverReceiver.
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2708
    self assert:className notNil.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2709
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2710
    methodSelector := (receiver arguments at:1) evaluate.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2711
    self assert:methodSelector notNil.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2712
    ^ true.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2713
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2714
    "Created: / 27-07-2012 / 21:33:47 / cg"
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  2715
    "Modified: / 24-05-2018 / 14:54:14 / Claus Gittinger"
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2716
!
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  2717
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2718
receiversClassName
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2719
    ^ self classNameOf:receiver
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2720
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2721
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2722
receiversClassNameRememberingNamespace
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2723
    ^ self classNameOfRememberingNamespace:receiver
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2724
!
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2725
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2726
variableNameOfReceiver
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2727
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2728
    receiver isVariable ifFalse:[ ^ nil ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2729
    ^ receiver name
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2730
! !
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2731
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2732
!ChangeSet::ChangeFileReader methodsFor:'reading'!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2733
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2734
changesFromParseTree:aTree lineNumber:initialLineNumberOrNil position:initialPositionOrNil
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2735
    "given a parse-tree (from parsing some changes source/chunk),
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2736
     create changes and evaluate changeAction on each.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2737
     The chnageAction-block is invoked with the change and a lineNumberOrNil as
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2738
     arg; the lineNumber is only valid, if the underlying inputStream
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2739
     provides line-numbers; otherwise, nil is passed."
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2740
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2741
    ^self changesFromParseTree:aTree lineNumber:initialLineNumberOrNil position:initialPositionOrNil chunk: nil
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2742
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2743
    "Modified: / 24-01-2012 / 17:29:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2744
!
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2746
changesFromParseTree:aTree lineNumber:initialLineNumberOrNil position:initialPositionOrNil chunk: initialChunkOrNil
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2747
    "given a parse-tree (from parsing some changes source/chunk),
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2748
     create changes and evaluate changeAction on each.
3964
38bc2f6fa1db #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  2749
     The changeAction-block is invoked with the change and a lineNumberOrNil as
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2750
     arg; the lineNumber is only valid, if the underlying inputStream
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2751
     provides line-numbers; otherwise, nil is passed."
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2752
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2753
    lineNumber := initialLineNumberOrNil.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2754
    position := initialPositionOrNil.
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2755
    chunk := initialChunkOrNil.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2756
    parseTree := aTree.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2757
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2758
    selector := aTree selector.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2759
    receiver := aTree receiver.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2760
    arguments := aTree arguments.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2761
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2762
    receiver isMessage ifTrue:[
3964
38bc2f6fa1db #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  2763
        receiverSelector := receiver selector.
38bc2f6fa1db #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  2764
        receiverReceiver := receiver receiver.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2765
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2766
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2767
    ^ self processChange
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2768
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  2769
    "Created: / 24-01-2012 / 17:28:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2770
! !
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2771
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2772
!ChangeSet::ChangeFileReader methodsFor:'reading-private'!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2773
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2774
handleCategoriesForChange
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2775
    |selector category categories attributes change|
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2776
2256
b98137d2aa30 changed: #changesFromStream:for:reader:do:
Claus Gittinger <cg@exept.de>
parents: 2247
diff changeset
  2777
    selector := arguments first value.
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2778
    className := self receiversClassNameRememberingNamespace.
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2779
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2780
    categories := OrderedCollection new.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2781
    attributes := OrderedCollection new.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2782
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2783
    [
3957
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2784
        inputStream skipSeparators.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2785
        category := inputStream nextChunk.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2786
        category notEmptyOrNil
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2787
    ] whileTrue:[
3957
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2788
        ( #( 'public' 'private' ) includes: category) ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2789
            attributes add:category
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2790
        ] ifFalse:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2791
            categories add:category
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2792
        ].
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2793
    ].
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2794
    categories notEmpty ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2795
        categories size == 1 ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2796
            category := categories first.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2797
        ] ifFalse:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2798
            category := categories asStringWith:' and '
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2799
        ].    
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2800
        change := MethodCategoryChange
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2801
                        className:className
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2802
                        selector:selector
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2803
                        source:(parseTree printString)
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2804
                        category:category.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2805
        self addChange:change.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2806
    ].
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2807
    
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2808
    attributes notEmpty ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2809
        attributes size == 1 ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2810
            "/ easy
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2811
            (attributes first = 'public') ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2812
                "/ default anyway - ignore
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2813
            ] ifFalse:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2814
                change := MethodPrivacyChange
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2815
                            className:className
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2816
                            selector:selector
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2817
                            privacy:(attributes first asSymbol).
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2818
                change nameSpaceOverride:nameSpaceOverride.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2819
                change source:(parseTree printString).
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2820
                self addChange:change.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2821
            ].
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2822
        ] ifFalse:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2823
            self halt:'multiple/missing attributes not supported'.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2824
        ].
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2825
    ].
3957
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2826
    ^ true
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2827
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2828
    "Modified: / 11-06-2013 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2829
!
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2830
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2831
handleCategoriesForClassChange
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2832
    |category categories attributes change|
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2833
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2834
    className := self receiversClassNameRememberingNamespace.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2835
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2836
    categories := OrderedCollection new.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2837
    attributes := OrderedCollection new.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2838
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2839
    [
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2840
        inputStream skipSeparators.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2841
        category := inputStream nextChunk.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2842
        category notEmptyOrNil
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2843
    ] whileTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2844
        ( #( 'public' 'private' ) includes: category) ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2845
            attributes add:category
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2846
        ] ifFalse:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2847
            categories add:category
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2848
        ].
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2849
    ].
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2850
3957
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2851
    categories notEmpty ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2852
        categories size == 1 ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2853
            "/ easy
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2854
            category := categories first
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2855
        ] ifFalse:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2856
            category := categories asStringWith:' and '
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2857
        ].    
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2858
        change := ClassCategoryChange new
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2859
                            className:className
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2860
                            category:category.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2861
        self addChange:change.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2862
    ].
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2863
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2864
    attributes notEmpty ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2865
        attributes size == 1 ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2866
            "/ easy
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2867
            (attributes first = 'public') ifTrue:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2868
                "/ default anyway - ignore
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2869
            ] ifFalse:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2870
                "/ a private class!!
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2871
"/            change := ClassDefinitionChange
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2872
"/                        className:className
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2873
"/                        selector:selector
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2874
"/                        privacy:(attributes first asSymbol).
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2875
"/            change nameSpaceOverride:nameSpaceOverride.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2876
"/            change source:(parseTree printString).
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2877
"/            self addChange:change.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2878
            ].
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2879
        ] ifFalse:[
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2880
            self halt:'multiple/missing attributes not supported'.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  2881
        ].
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2882
    ].
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2883
    ^ true
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2884
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2885
    "Modified: / 11-06-2013 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2886
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  2887
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2888
handleClassCommentChange
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2889
    |change|
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2890
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2891
    className := self receiversClassNameRememberingNamespace.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2892
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2893
    change := ClassCommentChange new.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2894
    change className:className comment:(arguments at:1) evaluate.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2895
    change source:(parseTree printString).
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2896
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2897
    ^ true
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2898
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2899
    "Modified: / 11-06-2013 / 16:11:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2900
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2901
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2902
handleClassDefinitionChange
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2903
    |nameSpace change|
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2904
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2905
    className := (arguments at:1) evaluate.
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2906
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2907
    nameSpace := Class nameSpaceQuerySignal query.
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2908
    (nameSpace == Smalltalk) ifTrue:[ nameSpace := nil ].
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2909
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2910
    "/ old: remember namespace in className
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2911
"/    nameSpace ~~ Smalltalk ifTrue:[
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2912
"/        className := nameSpace name , '::' , className
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2913
"/    ].
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2914
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2915
    change := ClassDefinitionChange new.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2916
    change className:className; source:(parseTree printString).
3860
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2917
    change definitionSelector:selector.
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2918
1453
27882f000bc9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
  2919
    receiver isVariable ifTrue:[
3860
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2920
        change superClassName:receiver name.
1453
27882f000bc9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1450
diff changeset
  2921
    ].
1428
807f0bc05504 more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  2922
    selector keywords with:arguments do:[:kw :arg |
3860
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2923
        kw = #'instanceVariableNames:' ifTrue:[
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2924
            change instanceVariableString:arg evaluate.
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2925
        ].
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2926
        kw = #'classVariableNames:' ifTrue:[
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2927
            change classVariableString:arg evaluate.
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2928
        ].
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2929
        kw = #'poolDictionaries:' ifTrue:[
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2930
            change poolDictionaries:arg evaluate.
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2931
        ].
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2932
        kw = #'category:' ifTrue:[
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2933
            change category:arg evaluate.
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2934
        ].
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2935
        kw = #'privateIn:' ifTrue:[
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2936
            | nm |
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2937
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2938
            nm := arg name.
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2939
            nameSpace notNil ifTrue:[
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2940
                (nm startsWith: nameSpace name) ifTrue:[
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2941
                    nm := nm copyFrom: nameSpace name size + 3.
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2942
                ].
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2943
            ].
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2944
            change className:(nm ,'::',change classNameWithoutNamespace).
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2945
            change owningClassName:nm.
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2946
            change private:true.
e997ac64abab class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3856
diff changeset
  2947
        ].
1428
807f0bc05504 more state in classdefinition change
Claus Gittinger <cg@exept.de>
parents: 1422
diff changeset
  2948
    ].
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2949
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2950
    change package:(Class packageQuerySignal query).
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2951
"/        nameSpace ~~ Smalltalk ifTrue:[
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2952
"/            change nameSpaceName:(nameSpace name).
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2953
"/        ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2954
"/
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2955
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2956
    ^ true
2290
882d87800dea private class handling
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2957
882d87800dea private class handling
Claus Gittinger <cg@exept.de>
parents: 2279
diff changeset
  2958
    "Modified: / 30-08-2010 / 13:56:32 / cg"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2959
    "Modified: / 11-06-2013 / 22:30:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2960
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2961
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2962
handleClassInitializeChange
3526
e64bd3cbd704 For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3521
diff changeset
  2963
    | change nm |
e64bd3cbd704 For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3521
diff changeset
  2964
e64bd3cbd704 For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3521
diff changeset
  2965
    nm := self receiversClassNameRememberingNamespace.
e64bd3cbd704 For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3521
diff changeset
  2966
e64bd3cbd704 For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3521
diff changeset
  2967
    change := ClassInitializeChange new source: chunk.
e64bd3cbd704 For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3521
diff changeset
  2968
    change className: nm.
3197
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  2969
    self addChange: change.
3526
e64bd3cbd704 For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3521
diff changeset
  2970
3197
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  2971
    ^ true
3526
e64bd3cbd704 For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3521
diff changeset
  2972
e64bd3cbd704 For class initialization chunk, create ClassInitializeChange instead of plain DoItChange.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3521
diff changeset
  2973
    "Modified: / 21-03-2014 / 18:19:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3197
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  2974
!
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  2975
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2976
handleClassInstanceVariableDefinitionChange
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2977
    |change|
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2978
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2979
    className := self receiversClassNameRememberingNamespace.
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  2980
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2981
    change := ClassInstVarDefinitionChange new.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2982
    change className:className.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2983
    change source:(parseTree printString).
2617
a9e632776c57 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2524
diff changeset
  2984
    change classInstVarNames:(parseTree arguments first value asCollectionOfWords asArray).
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  2985
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2986
    ^ true
2617
a9e632776c57 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2524
diff changeset
  2987
a9e632776c57 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2524
diff changeset
  2988
    "Modified: / 25-11-2011 / 17:40:49 / cg"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  2989
    "Modified: / 11-06-2013 / 16:11:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2990
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2991
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2992
handleMethodCategoryChange
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2993
    |change|
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2994
2867
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  2995
    self extractMethodsClassAndSelectorFromReceiver ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  2996
	^ false.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2997
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2998
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  2999
    change := MethodCategoryChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3000
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3001
	className:className
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3002
	selector:methodSelector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3003
	category:(arguments at:1) evaluate.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3004
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3005
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3006
    ^ true
2867
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3007
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3008
    "Modified: / 27-07-2012 / 21:34:42 / cg"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3009
    "Modified: / 11-06-2013 / 16:11:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3010
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3011
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3012
handleMethodCategoryRenameChange
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3013
    |change|
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3014
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3015
    className := self receiversClassNameRememberingNamespace.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3016
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3017
    change := MethodCategoryRenameChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3018
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3019
	className:className;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3020
	oldCategoryName:(arguments at:1) evaluate
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3021
	newCategoryName:(arguments at:2) evaluate.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3022
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3023
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3024
    ^ true
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3025
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3026
    "Modified: / 11-06-2013 / 16:11:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3027
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3028
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3029
handleMethodChange
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3030
    [
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3031
	^ self handleMethodChangeUnsafe
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3032
    ] on: Error do:[:ex|
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3033
	| change |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3034
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3035
	change := InvalidChange new source: chunk.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3036
	self addChange: change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3037
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3038
	"Read methods that may follow"
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3039
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3040
	[ (chunk := inputStream nextChunk) notEmptyOrNil ] whileTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3041
	    change := InvalidChange new source: chunk.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3042
	    self addChange: change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3043
	]
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3044
    ].
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3045
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3046
    ^ true
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3047
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3048
    "Modified (comment): / 24-01-2012 / 17:32:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3049
!
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3050
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3051
handleMethodChangeUnsafe
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3052
    |priv categoryName methodSource changes change parser |
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3053
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3054
    className := self receiversClassNameRememberingNamespace.
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3055
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3056
    (selector == #'ignoredMethodsFor:') ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3057
	priv := #ignored.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3058
    ] ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3059
	priv := nil
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3060
    ].
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3061
    classIsJava := false.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3062
    ((selector == #'methods')
1977
3694111ead95 publicMethods & privateMethods detection
fm
parents: 1969
diff changeset
  3063
    or:[(selector == #'publicMethods')
3694111ead95 publicMethods & privateMethods detection
fm
parents: 1969
diff changeset
  3064
    or:[(selector == #'methodsFor')]]) ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3065
	categoryName := 'uncategorized public'
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3066
    ] ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3067
	(selector == #'privateMethods') ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3068
	    categoryName := 'uncategorized private'
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3069
	] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3070
	    categoryName := (arguments at:1) evaluate.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3071
	]
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3072
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3073
    inputStream skipSeparators.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3074
    lineNumber := inputStream lineNumber.
3521
6e43c118d860 Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3520
diff changeset
  3075
    "/ Care for non-positionable streams
6e43c118d860 Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3520
diff changeset
  3076
    position := nil.
6e43c118d860 Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3520
diff changeset
  3077
    inputStream isPositionable ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3078
	position := inputStream position + 1.
3521
6e43c118d860 Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3520
diff changeset
  3079
    ].
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3080
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3081
    methodSource := chunk := inputStream nextChunk.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3082
    changes := OrderedCollection new.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3083
1395
6ea99b157f6b Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents: 1389
diff changeset
  3084
    [methodSource notEmptyOrNil] whileTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3085
	parser := Parser
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3086
		    parseMethodArgAndVarSpecification:methodSource
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3087
		    in:nil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3088
		    ignoreErrors:true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3089
		    ignoreWarnings:true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3090
		    parseBody:false.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3091
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3092
	parser isNil ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3093
	    "/ something wierd ...
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3094
	    methodSelector := '????'.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3095
	] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3096
	    methodSelector := parser selector.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3097
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3098
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3099
	change := MethodDefinitionChange new.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3100
	change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3101
	    className:className
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3102
	    selector:methodSelector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3103
	    source:methodSource
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3104
	    category:categoryName
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3105
	    privacy:priv.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3106
	"/ huh - where is classIsJava: implemented???
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3107
	classIsJava ifTrue:[ change classIsJava: classIsJava ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3108
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3109
	self addChange:change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3110
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3111
	inputStream skipSeparators.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3112
	lineNumber := inputStream lineNumber.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3113
	"/ Care for non-positionable streams
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3114
	position := nil.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3115
	inputStream isPositionable ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3116
	    position := inputStream position + 1.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3117
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3118
	methodSource := chunk := inputStream nextChunk.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3119
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3120
    ^ true
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3121
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3122
    "Created: / 24-01-2012 / 16:52:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3521
6e43c118d860 Fixes for reading changesets from non-positionable streams
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3520
diff changeset
  3123
    "Modified: / 14-03-2014 / 16:19:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3124
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3125
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3126
handleMethodPackageChange
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3127
    |change|
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3128
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3129
    self extractMethodsClassAndSelectorFromReceiver ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3130
	^ false.
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3131
    ].
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3132
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3133
    change := MethodPackageChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3134
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3135
	className:className
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3136
	selector:methodSelector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3137
	package:(arguments at:1) evaluate.
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3138
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3139
    self addChange:change.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3140
    ^ true
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3141
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3142
    "Created: / 27-07-2012 / 21:31:25 / cg"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3143
    "Modified: / 11-06-2013 / 16:11:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3144
!
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3145
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3146
handleMethodPrivacyChange
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3147
    |change|
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3148
2867
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3149
    self extractMethodsClassAndSelectorFromReceiver ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3150
	^ false.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3151
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3152
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3153
    change := MethodPrivacyChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3154
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3155
	className:className
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3156
	selector:methodSelector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3157
	privacy:(arguments at:1) evaluate.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3158
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3159
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3160
    ^ true
2867
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3161
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3162
    "Modified: / 27-07-2012 / 21:35:20 / cg"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3163
    "Modified: / 11-06-2013 / 16:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3164
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3165
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3166
handleNameSpaceCreationChange
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3167
    |change|
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3168
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3169
    (self checkReceiverIsGlobalNamed:#Namespace) ifFalse:[
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3170
        (self checkReceiverIsGlobalNamed:#NameSpace) ifFalse:[
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3171
            self proceedableError:'unexpected receiver in nameSpace message'.
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3172
            ^ false
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3173
        ].
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3174
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3175
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3176
    className := (arguments at:1) evaluate.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3177
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3178
    change := NameSpaceCreationChange new.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3179
    change name:className.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3180
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3181
    ^ true
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3182
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3183
    "Modified: / 24-05-2018 / 14:54:21 / Claus Gittinger"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3184
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3185
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3186
handlePrimitiveChange
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3187
    self handlePrimitiveChange:nil
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3188
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3189
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3190
handlePrimitiveChange: sourceOrNil
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3191
    "if sourceOrNil is nil, the def has not been read and must be read from
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3192
     the next chunk. Otherwise, it has been already read as argument."
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3193
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3194
    |change primSource|
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3195
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3196
    className := self receiversClassNameRememberingNamespace.
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3197
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3198
    sourceOrNil notNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3199
	primSource := sourceOrNil
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3200
    ] ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3201
	inputStream skipSeparators.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3202
	primSource := inputStream nextChunk.
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3203
    ].
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3204
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3205
    (selector == #'primitiveDefinitions' or:[ selector == #'primitiveDefinitions:' ]) ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3206
	change := ClassPrimitiveDefinitionsChange new
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3207
    ] ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3208
	(selector == #'primitiveFunctions' or:[ selector == #'primitiveFunctions:' ]) ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3209
	    change := ClassPrimitiveFunctionsChange new
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3210
	] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3211
	    change := ClassPrimitiveVariablesChange new
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3212
	]
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3213
    ].
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3214
    change className:className source:primSource.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3215
    self addChange:change.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3216
    ^ true
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3217
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3218
    "Created: / 27-07-2012 / 21:39:55 / cg"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3219
    "Modified (format): / 11-06-2013 / 16:12:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3220
!
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3221
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3222
handleRemoveClassChange
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3223
    |change|
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3224
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3225
    (self checkReceiverIsGlobalNamed:#Smalltalk) ifFalse:[
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3226
        self proceedableError:'unexpected receiver in remove-class message'.
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3227
        ^ false
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3228
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3229
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3230
    className := (arguments at:1) name.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3231
"/            nameSpace ~~ Smalltalk ifTrue:[
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3232
"/                className := nameSpace name , '::' , className
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3233
"/            ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3234
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3235
    change := ClassRemoveChange new.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3236
    change className:className.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3237
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3238
    ^ true
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3239
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3240
    "Modified: / 24-05-2018 / 14:54:29 / Claus Gittinger"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3241
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3242
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3243
handleRemoveMethodChange
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3244
    |change|
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3245
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3246
    className := self receiversClassName.
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3247
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3248
    methodSelector := (arguments at:1) evaluate.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3249
    change := MethodRemoveChange new.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3250
    change className:className selector:methodSelector.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3251
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3252
    ^ true
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3253
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3254
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3255
handleRenameClassChange
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3256
    |oldName newName change|
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3257
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3258
    (self checkReceiverIsGlobalNamed:#Smalltalk) ifFalse:[
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3259
        self proceedableError:'unexpected receiver in rename-class message'.
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3260
        ^ false.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3261
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3262
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3263
    oldName := (arguments at:1) name.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3264
    newName := (arguments at:2) evaluate.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3265
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3266
    change := ClassRenameChange new oldName:oldName newName:newName.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  3267
    self addChange:change.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3268
    ^ true
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3269
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  3270
    "Modified: / 24-05-2018 / 14:54:36 / Claus Gittinger"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3271
!
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3272
1181
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3273
handleSqueakCommentStamp
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3274
    |comment change|
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3275
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3276
    inputStream skipSeparators.
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3277
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3278
    comment := inputStream nextChunk.
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3279
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3280
    className := self receiversClassNameRememberingNamespace.
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3281
1181
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3282
    change := ClassCommentChange new.
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3283
    change className:className comment:comment.
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3284
    change source:(parseTree printString).
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3285
    self addChange:change.
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3286
    ^ true
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3287
!
e13c86138164 more to read squeak change sets
Claus Gittinger <cg@exept.de>
parents: 1176
diff changeset
  3288
1183
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3289
handleVW7ClassDefinitionChange
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3290
    |nameSpace change|
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3291
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3292
    nameSpace := receiver.
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3293
    className := (arguments at:1) evaluate.
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3294
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3295
"/    nameSpace := Class nameSpaceQuerySignal query.
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3296
"/    nameSpace ~~ Smalltalk ifTrue:[
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3297
"/        className := nameSpace name , '::' , className
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3298
"/    ].
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3299
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3300
    change := ClassDefinitionChange new.
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3301
    change className:className; source:(parseTree printString).
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3302
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3303
    change package:(Class packageQuerySignal query).
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3304
    self addChange:change.
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3305
    ^ true
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3306
!
419dc41ad796 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  3307
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3308
processChange
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3309
    "given a parse-tree (from parsing some changes source/chunk),
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3310
     create changes and evaluate changeAction on each.
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3311
     The block is invoked with the change and a lineNumberOrNil as
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3312
     arg; the lineNumber is only valid, if the underlying stream
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3313
     provides line-numbers; otherwise, nil is passed."
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3314
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3315
    [
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3316
	^ self processChangeUnsafe
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3317
    ] on: Error do:[:ex|
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3318
	| change |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3319
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3320
	change := DoItChange new source: chunk.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3321
	self addChange: change.
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3322
    ].
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3323
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3324
    ^true
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3325
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3326
    "Modified: / 24-01-2012 / 17:34:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3327
!
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3328
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3329
processChangeUnsafe
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3330
    "given a parse-tree (from parsing some changes source/chunk),
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3331
     create changes and evaluate changeAction on each.
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3332
     The block is invoked with the change and a lineNumberOrNil as
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3333
     arg; the lineNumber is only valid, if the underlying stream
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3334
     provides line-numbers; otherwise, nil is passed."
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3335
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3336
    |dispatchSelector|
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3337
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3338
    dispatchSelector := ('process_',(selector copyReplaceAll:$: with:$_)) asSymbol.
2122
3ffe8c94f2cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2117
diff changeset
  3339
"/ Transcript showCR:dispatchSelector.
2179
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
  3340
    (self respondsTo:dispatchSelector) ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3341
	^ self perform:dispatchSelector.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3342
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3343
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3344
    "/ any subclass definiton selector ?
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3345
    (Behavior definitionSelectors includes:selector)
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3346
    ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3347
	^ self handleClassDefinitionChange.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3348
    ].
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3349
3195
5ce601cd8a45 class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3184
diff changeset
  3350
    self error:'unhandled change selector: ',selector.
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  3351
    ^ false
2745
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3352
c2f7200248e7 More robust changeset reading - creates InvalidChange when an error
vrany
parents: 2633
diff changeset
  3353
    "Created: / 24-01-2012 / 17:33:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3354
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3355
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3356
processInfo: string
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3357
    "Processes 'info record' - an info record consist of a chunk containing
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3358
     single string literal starting with ----, such as:
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3359
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3360
    '---- timestamp jv@neso 12-03-2012 10:49:40 ----'
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3361
    '---- snapshot st.img 30-03-2012 11:40:24 ----'
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3362
    '---- checkin SVN::ConfigurationApp into stx:libsvn (1.12) 12-03-2012 10:51:15 ----'
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3363
    '---- rake update 30-03-2012 11:40:24 ----'
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3364
    '---- start 30-03-2012 11:40:24 ----'
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3365
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3366
    timestamp info records are (for historical reasons) processed in ChangeSet
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3367
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3368
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3369
    | kind sel |
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3370
    inputStream skip: 5.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3371
    kind := inputStream upTo: Character space.
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3372
    (kind endsWith:$:) ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3373
	kind := kind copyButLast:1
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3374
    ].
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3375
    sel := ('process_', kind) asSymbolIfInterned.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3376
    sel notNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3377
	MessageNotUnderstood handle:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3378
	    self process_otherInfo:kind
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3379
	] do:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3380
	    self perform: sel.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3381
	]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3382
    ] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3383
	self process_otherInfo:kind
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3384
    ]
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3385
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3386
    "Created: / 30-03-2012 / 16:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3387
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3388
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3389
process_category_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3390
    "'category:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3391
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3392
    ^ self handleMethodCategoryChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3393
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3394
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3395
process_comment_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3396
    "'comment:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3397
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3398
    ^ self handleClassCommentChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3399
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3400
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3401
process_encoding
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3402
    "St/X encoding info record. Ignored"
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3403
!
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3404
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3405
process_ignoredMethodsFor_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3406
    "'ignoredMethodsFor:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3407
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3408
    ^ self handleMethodChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3409
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3410
3197
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  3411
process_initialize
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  3412
    "'class initialize' chunk"
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  3413
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  3414
    ^ self handleClassInitializeChange
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  3415
!
e7da5ac31b96 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3195
diff changeset
  3416
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3417
process_instanceVariableNames_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3418
    "'instanceVariableNames:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3419
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3420
    ^ self handleClassInstanceVariableDefinitionChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3421
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3422
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3423
process_name_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3424
    "'name:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3425
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3426
    ^ self handleNameSpaceCreationChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3427
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3428
3184
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3429
process_otherInfo:what
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3430
    "'---- <what> 12-03-2012 10:49:40 ----'
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3431
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3432
    '<what>' is already read from inputStream.
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3433
    "
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3434
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3435
    "/ inputStream skipSeparators.
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3436
    self addChange: (InfoChange type: what data: (inputStream upToEnd) timestamp: nil)
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3437
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3438
    "Created: / 18-05-2012 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3439
!
ca653a71c27f class: ChangeFileReader
Claus Gittinger <cg@exept.de>
parents: 3176
diff changeset
  3440
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3441
process_package_
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3442
    "'package:' chunk (ST/X)"
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3443
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3444
    ^ self handleMethodPackageChange.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3445
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3446
    "Created: / 27-07-2012 / 21:36:30 / cg"
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3447
!
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3448
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3449
process_primitiveDefinitions
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3450
    "'primitiveDefinitions' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3451
2867
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3452
    ^ self handlePrimitiveChange:nil.
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3453
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3454
    "Modified: / 27-07-2012 / 21:40:33 / cg"
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3455
!
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3456
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3457
process_primitiveDefinitions_
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3458
    "'primitiveDefinitions:' chunk (ST/X)"
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3459
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3460
    ^ self handlePrimitiveChange: (arguments at:1) evaluate.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3461
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3462
    "Created: / 27-07-2012 / 21:42:03 / cg"
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3463
!
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3464
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3465
process_primitiveFunctions
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3466
    "'primitiveFunctions' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3467
2867
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3468
    ^ self handlePrimitiveChange:nil.
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3469
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3470
    "Modified: / 27-07-2012 / 21:40:23 / cg"
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3471
!
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3472
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3473
process_primitiveFunctions_
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3474
    "'primitiveFunctions:' chunk (ST/X)"
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3475
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3476
    ^ self handlePrimitiveChange: (arguments at:1) evaluate.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3477
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3478
    "Created: / 27-07-2012 / 21:37:21 / cg"
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3479
!
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3480
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3481
process_primitiveVariables
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3482
    "'primitiveVariables' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3483
2867
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3484
    ^ self handlePrimitiveChange:nil.
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3485
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3486
    "Modified: / 27-07-2012 / 21:40:35 / cg"
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3487
!
6d868612727b fix reading primitiveDefinitions and package changes
Claus Gittinger <cg@exept.de>
parents: 2852
diff changeset
  3488
2892
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3489
process_primitiveVariables_
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3490
    "'primitiveVariables:' chunk (ST/X)"
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3491
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3492
    ^ self handlePrimitiveChange: (arguments at:1) evaluate.
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3493
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3494
    "Created: / 27-07-2012 / 21:41:49 / cg"
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3495
!
0a8a369149e9 Added lost methods
vrany
parents: 2881
diff changeset
  3496
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3497
process_privacy_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3498
    "'privacy:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3499
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3500
    ^ self handleMethodPrivacyChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3501
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3502
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3503
process_privateMethods
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3504
    "'privateMethods' chunk (ST/V and dolphin)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3505
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3506
    ^ self handleMethodChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3507
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3508
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3509
process_privateMethodsFor_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3510
    "'privateMethodsFor:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3511
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3512
    ^ self handleMethodChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3513
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3514
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3515
process_protectedMethodsFor_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3516
    "'protectedMethodsFor:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3517
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3518
    ^ self handleMethodChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3519
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3520
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3521
process_publicMethodsFor_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3522
    "'publicMethodsFor:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3523
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3524
    ^ self handleMethodChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3525
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3526
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3527
process_rake
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3528
    "Rake build system info record
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3529
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3530
    '---- rake update st.img 12-03-2012 10:49:40 ----'!!
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3531
    '---- rake compile st.img 12-03-2012 10:49:40 ----'!!
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3532
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3533
    'rake' is already read from inputStream.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3534
    "
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3535
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3536
    | ts what |
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3537
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3538
    inputStream skipSeparators.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3539
    what := inputStream through: Character space. "/read snapshot name
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3540
    inputStream through: Character space. "/skip username@host
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3541
    ts := Timestamp readFrom: inputStream.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3542
    self addChange: (InfoChange type: #rake data: what timestamp: ts)
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3543
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3544
    "Created: / 01-08-2012 / 19:33:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3545
!
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  3546
2117
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3547
process_removeClass_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3548
    "'removeClass:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3549
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3550
    ^ self handleRemoveClassChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3551
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3552
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3553
process_removeSelector_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3554
    "'removeSelector:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3555
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3556
    ^ self handleRemoveMethodChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3557
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3558
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3559
process_renameCategory_to_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3560
    "'renameCategory:to:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3561
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3562
    ^ self handleMethodCategoryRenameChange.
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3563
!
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3564
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3565
process_renameClass_to_
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3566
    "'renameClass:to:' chunk (ST/X)"
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3567
4ff77bbf9f89 refactored for more flexible changeChunk handling
Claus Gittinger <cg@exept.de>
parents: 2080
diff changeset
  3568
    ^ self handleRenameClassChange.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3569
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3570
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3571
process_snapshot
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3572
    "St/X system start info record
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3573
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3574
    '---- snapshot st.img 12-03-2012 10:49:40 ----'!!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3575
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3576
    'start' is already read from inputStream.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3577
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3578
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3579
    | ts file |
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3580
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3581
    inputStream skipSeparators.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3582
    file := inputStream through: Character space. "/read snapshot name
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3583
    ts := Timestamp readFrom: inputStream.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3584
    self addChange: (InfoChange type: #snapshot data: file timestamp: ts)
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3585
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3586
    "Created: / 18-05-2012 / 17:04:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3587
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3588
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3589
process_start
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3590
    "St/X system start info record
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3591
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3592
    '---- start 12-03-2012 10:49:40 ----'!!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3593
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3594
    'start' is already read from inputStream.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3595
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3596
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3597
    | ts |
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3598
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3599
    inputStream skipSeparators.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3600
    ts := Timestamp readFrom: inputStream.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3601
    self addChange: (InfoChange type: #start data: nil timestamp: ts)
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3602
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3603
    "Created: / 18-05-2012 / 17:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3604
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3605
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3606
process_timestamp
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3607
    "St/X timestamp info record. Example:
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3608
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3609
    '---- timestamp jv@neso 12-03-2012 10:49:40 ----'!!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3610
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3611
    'timestamp' is already read from inputStream.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3612
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3613
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3614
    inputStream skipSeparators; through: Character space. "/read username@host
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3615
    timestamp := Timestamp readFrom: inputStream.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3616
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3617
    "Created: / 02-04-2012 / 19:08:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3618
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3619
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3620
!ChangeSet::ChangeFileReader methodsFor:'reading-private-dolphin'!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3621
3957
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3622
process_categoriesForClass
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3623
    "'categoriesForClass' chunk (Dolphin)"
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3624
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3625
    ^ self handleCategoriesForClassChange.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3626
!
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3627
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3628
process_categoriesFor_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3629
    "'categoriesFor:' chunk (Dolphin)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3630
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3631
    ^ self handleCategoriesForChange.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3632
!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3633
3957
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3634
process_methods
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3635
    "'methods' chunk (ST/V and dolphin)"
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3636
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3637
    ^ self handleMethodChange.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3638
!
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3639
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3640
process_methodsFor
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3641
    "'methodsFor' chunk (ST/V and dolphin)"
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3642
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3643
    ^ self handleMethodChange.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3644
!
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3645
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3646
process_methodsForUndefined_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3647
    "'methodsForUndefined:' chunk (?)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3648
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3649
    ^ self handleMethodChange.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3650
!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3651
3957
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3652
process_methodsFor_
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3653
    "'methodsFor:' chunk (ST/80, Squeak, ST/X, VW, ...)"
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3654
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3655
    ^ self handleMethodChange.
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3656
!
420da9168e36 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3946
diff changeset
  3657
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3658
process_publicMethods
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3659
    "'publicMethods' chunk (ST/V and dolphin)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3660
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3661
    ^ self handleMethodChange.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3662
! !
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3663
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3664
!ChangeSet::ChangeFileReader methodsFor:'reading-private-gravel'!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3665
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3666
process_addClassMethod_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3667
    "'reader addClassMethod:' chunk (gravel Smalltalk)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3668
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3669
    ^ self process_addMethodOrClassMethod:true
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3670
!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3671
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3672
process_addMethodOrClassMethod:isClassMethod
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3673
    "'reader addMethod:' chunk (gravel Smalltalk)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3674
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3675
    |categoryName methodSource change parser|
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3676
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3677
    categoryName := (arguments at:1) evaluate.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3678
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3679
    lineNumber := inputStream lineNumber.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3680
    "/ Care for non-positionable streams
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3681
    position := nil.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3682
    inputStream isPositionable ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3683
	position := inputStream position + 1.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3684
    ].
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3685
    methodSource := inputStream nextChunk.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3686
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3687
    parser := Parser
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3688
		parseMethodArgAndVarSpecification:methodSource
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3689
		in:nil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3690
		ignoreErrors:true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3691
		ignoreWarnings:true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3692
		parseBody:false.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3693
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3694
    parser isNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3695
	"/ something wierd ...
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3696
	methodSelector := '????'.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3697
    ] ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3698
	methodSelector := parser selector.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3699
    ].
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3700
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3701
    isClassMethod ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3702
	className := className , ' class'
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3703
    ].
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3704
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3705
    change := MethodDefinitionChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3706
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3707
	className:className
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3708
	selector:methodSelector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3709
	source:methodSource
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3710
	category:categoryName
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3711
	privacy:nil.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3712
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3713
    self addChange:change.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3714
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3715
"/ self halt.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3716
    ^ true
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3717
!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3718
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3719
process_addMethod_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3720
    "'reader addMethod:' chunk (gravel Smalltalk)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3721
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3722
    ^ self process_addMethodOrClassMethod:false
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3723
!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3724
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3725
process_addSimpleClassTrait_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3726
    "'reader defineaddSimpleTraitTrait:' chunk (gravel Smalltalk)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3727
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3728
    |change traitName|
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3729
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3730
    traitName := (arguments at:1) evaluate.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3731
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3732
    change := TraitDefinitionChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3733
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3734
	className:className,' class';
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3735
	baseTrait:traitName;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3736
	source:chunk.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3737
"/ self halt.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3738
    self addChange:change.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3739
    ^ true
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3740
!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3741
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3742
process_addSimpleTrait_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3743
    "'reader defineaddSimpleTraitTrait:' chunk (gravel Smalltalk)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3744
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3745
    |change traitName gravelSuperclassName superclassName|
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3746
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3747
    traitName := (arguments at:1) evaluate.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3748
    gravelSuperclassName := (arguments at:2) evaluate.
3833
f40fb26d03f7 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3832
diff changeset
  3749
    superclassName := SourceFileLoader::SourceFileReader classNameMappingFor:gravelSuperclassName.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3750
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3751
    change := TraitDefinitionChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3752
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3753
	className:className;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3754
	superClassName:superclassName;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3755
	baseTrait:traitName;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3756
	source:chunk.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3757
"/ self halt.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3758
    self addChange:change.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3759
    ^ true
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3760
!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3761
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3762
process_defineClass_superclass_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3763
    "'reader defineClass:superclass:' chunk (gravel Smalltalk)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3764
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3765
    |nameSpace change gravelSuperclassName superclassName|
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3766
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3767
    className := (arguments at:1) evaluate.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3768
    gravelSuperclassName := (arguments at:2) evaluate.
3833
f40fb26d03f7 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3832
diff changeset
  3769
    superclassName := SourceFileLoader::SourceFileReader classNameMappingFor:gravelSuperclassName.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3770
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3771
    nameSpace := Class nameSpaceQuerySignal query.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3772
    (nameSpace == Smalltalk) ifTrue:[ nameSpace := nil ].
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3773
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3774
    change := ClassDefinitionChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3775
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3776
	className:className;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3777
	superClassName:superclassName;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3778
	source:chunk.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3779
"/ self halt.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3780
    self addChange:change.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3781
    ^ true
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3782
!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3783
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3784
process_defineTrait_superclass_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3785
    "'reader defineTrait:' chunk (gravel Smalltalk)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3786
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3787
    |nameSpace change|
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3788
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3789
    className := (arguments at:1) evaluate.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3790
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3791
    nameSpace := Class nameSpaceQuerySignal query.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3792
    (nameSpace == Smalltalk) ifTrue:[ nameSpace := nil ].
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3793
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3794
    change := TraitDefinitionChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3795
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3796
	className:className;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3797
	source:chunk.
3832
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3798
"/ self halt.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3799
    self addChange:change.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3800
    ^ true
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3801
! !
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3802
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3803
!ChangeSet::ChangeFileReader methodsFor:'reading-private-squeak'!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3804
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3805
process_commentStamp_prior_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3806
    "'commentStamp:prior::' chunk (Squeak)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3807
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3808
    ^ self handleSqueakCommentStamp.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3809
!
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3810
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3811
process_methodsFor_stamp_
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3812
    "'methodsFor:stamp:' chunk (Squeak)"
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3813
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3814
    ^ self handleMethodChange.
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3815
! !
d8158c7c612f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3825
diff changeset
  3816
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3817
!ChangeSet::BeeChangeFileReader methodsFor:'helpers'!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3818
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3819
receiversClassNameRememberingNamespace
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3820
    ^ (parseTree arguments at: 3) value.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3821
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3822
    "Created: / 21-08-2014 / 18:53:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3823
! !
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3824
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3825
!ChangeSet::BeeChangeFileReader methodsFor:'reading-private'!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3826
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3827
processChangeUnsafe
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3828
    "given a parse-tree (from parsing some changes source/chunk),
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3829
     create changes and evaluate changeAction on each.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3830
     The block is invoked with the change and a lineNumberOrNil as
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3831
     arg; the lineNumber is only valid, if the underlying stream
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3832
     provides line-numbers; otherwise, nil is passed."
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3833
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3834
    |dispatchSelector|
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3835
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3836
    dispatchSelector := ('process_',(selector copyReplaceAll:$: with:$_)) asSymbol.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3837
"/ Transcript showCR:dispatchSelector.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3838
    (self respondsTo:dispatchSelector) ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3839
	^ self perform:dispatchSelector.
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3840
    ].
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3841
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3842
    "/ any subclass definiton selector ?
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3843
    (Behavior definitionSelectors includes:selector)
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3844
    ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3845
	^ self handleClassDefinitionChange.
3621
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3846
    ].
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3847
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3848
    self error:'unhandled change selector: ',selector.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3849
    ^ false
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3850
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3851
    "Created: / 21-08-2014 / 18:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3852
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3853
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3854
process_timeStamp_author_className_selector_
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3855
    ^ self handleMethodChange
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3856
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3857
    "/    className := parseTree arguments at: 3.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3858
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3859
    "Created: / 21-08-2014 / 18:40:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3860
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3861
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3862
process_timeStamp_author_className_selector_applicationVersion_
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3863
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3864
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3865
    ^ self handleMethodChange
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3866
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3867
    "/    className := parseTree arguments at: 3.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3868
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3869
    "Created: / 21-08-2014 / 19:01:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3870
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3871
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3872
process_timeStamp_author_className_selector_applicationVersion_changesFileName_
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3873
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3874
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3875
    ^ self handleMethodChange
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3876
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3877
    "/    className := parseTree arguments at: 3.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3878
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3879
    "Created: / 21-08-2014 / 19:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3880
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3881
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3882
process_timeStamp_author_className_selector_changesFileName_
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3883
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3884
    ^ self handleMethodChange
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3885
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3886
    "/    className := parseTree arguments at: 3.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3887
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3888
    "Created: / 21-08-2014 / 18:59:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3889
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3890
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3891
process_timeStamp_author_className_selector_prev_
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3892
    ^ self handleMethodChange
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3893
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3894
    "/    className := parseTree arguments at: 3.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3895
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3896
    "Created: / 21-08-2014 / 18:51:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3897
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3898
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3899
process_timeStamp_author_className_selector_prev_applicationVersion_
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3900
    ^ self handleMethodChange
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3901
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3902
    "/    className := parseTree arguments at: 3.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3903
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3904
    "Created: / 21-08-2014 / 18:59:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3905
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3906
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3907
process_timeStamp_author_className_selector_prev_applicationVersion_changesFileName_
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3908
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3909
    ^ self handleMethodChange
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3910
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3911
    "/    className := parseTree arguments at: 3.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3912
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3913
    "Created: / 21-08-2014 / 19:00:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3914
!
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3915
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3916
process_timeStamp_author_className_selector_prev_changesFileName_
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3917
    ^ self handleMethodChange
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3918
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3919
    "/    className := parseTree arguments at: 3.
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3920
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3921
    "Created: / 21-08-2014 / 18:48:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3922
! !
3979244930e1 Initial support for reading Bee Smalltalk .bsc chunk format.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3619
diff changeset
  3923
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3924
!ChangeSet::ChangeFileWriter methodsFor:'source writing'!
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3925
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3926
fileOut: aChangeSet on: aStream
3518
1b770a65ef66 Fix in namespace handling when filing out chunked changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3483
diff changeset
  3927
    | hasWideChars stream lastNameSpace |
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3928
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3929
    hasWideChars := aChangeSet contains:[:each | each source isWideString ].
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3930
    hasWideChars ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3931
	stream := EncodedStream stream: aStream encoder: CharacterEncoder encoderForUTF8.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3932
	stream nextPutAll: '"{ Encoding: utf8 }"'; cr; cr.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3933
	stream nextPutAll: '!!'; cr; cr.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3934
    ] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3935
	stream := aStream
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3936
    ].
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3937
3518
1b770a65ef66 Fix in namespace handling when filing out chunked changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3483
diff changeset
  3938
    lastNameSpace := nil.
1b770a65ef66 Fix in namespace handling when filing out chunked changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3483
diff changeset
  3939
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3940
    aChangeSet do:[:eachChange |
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3941
	eachChange isClassChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3942
	    | changeNameSpace |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3943
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3944
	    changeNameSpace := eachChange nameSpaceName.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3945
	    changeNameSpace ~= lastNameSpace ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3946
		aStream nextPutAll: ('"{ NameSpace: %1 }"' bindWith: changeNameSpace).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3947
		aStream cr; cr.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3948
		stream nextPutLine:'!!'.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3949
		lastNameSpace := changeNameSpace.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3950
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3951
	    eachChange isMethodCodeChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3952
		stream nextPutAll:'!!'; nextPutAll:(eachChange className); nextPutAll:' methodsFor: '.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3953
		stream nextPutAll:(eachChange methodCategory storeString).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3954
		stream nextPutLine:'!!'.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3955
		stream cr.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3956
		stream nextPutAllAsChunk:(eachChange source).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3957
		stream nextPutLine:'!! !!'.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3958
	    ] ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3959
		stream nextPutAll:(eachChange source).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3960
		stream nextPutLine:'!!'.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3961
	    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3962
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  3963
	aStream cr.
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3964
    ].
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3965
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3966
    "Created: / 04-02-2014 / 18:51:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3518
1b770a65ef66 Fix in namespace handling when filing out chunked changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3483
diff changeset
  3967
    "Modified: / 06-03-2014 / 12:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3968
! !
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  3969
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3970
!ChangeSet::ClassSourceWriter methodsFor:'private'!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3971
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3972
analyze
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  3973
    "Analyzes changeset and build some index"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3974
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3975
    classInfos := Dictionary new.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3976
    metaInfos := Dictionary new.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3977
    topClassName := nil.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3978
    "Pass 1 - collect classes"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  3979
    changeSetBeingSaved do:[:change|
3856
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3980
        | pkg |
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3981
        pkg := change package.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3982
        packageName isNil ifTrue:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3983
            packageName := pkg.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3984
        ] ifFalse:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3985
            "/Just a defensive check...
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  3986
            self assert: (pkg isNil or:[pkg = packageName]) message: 'STC does not support multiple packages in source files'.
3856
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3987
        ].
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3988
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3989
        change isClassDefinitionChange ifTrue:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3990
            | nm ns |
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3991
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3992
            nm := change className.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3993
            (nm endsWith:' class') ifFalse:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3994
                (classInfos includesKey: nm) ifTrue:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3995
                    self error:'Multiple definitions of class ', nm.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3996
                    ^self.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3997
                ].
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3998
                classInfos at: nm put: (ClassInfo new name: nm).
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  3999
                metaInfos at: nm put: (ClassInfo new name: nm , ' class').
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4000
                change isPrivateClassDefinitionChange ifFalse:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4001
                    topClassName notNil ifTrue:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4002
                        self error: ('Multiple top class definitions (%1 vs %2)' bindWith: topClassName with: nm).
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4003
                        ^self.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4004
                    ].
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4005
                    topClassName := nm.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4006
                    namespaceName := change nameSpaceName.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4007
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4008
                ]
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4009
            ]
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4010
        ]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4011
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4012
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4013
    "/ Could be an extension container...
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4014
    topClassName isNil ifTrue:[
3856
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4015
        ^self
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4016
    ].
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4017
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4018
    "Pass 2: fill in infos"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4019
    changeSetBeingSaved do:[:change|
3856
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4020
        change isClassChange ifTrue:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4021
            | nm info |
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4022
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4023
            nm := change className.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4024
            (nm endsWith: ' class') ifTrue:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4025
                info := metaInfos at: (nm copyButLast:(' class' size)).
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4026
            ] ifFalse:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4027
                info := classInfos at: nm.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4028
                "Fill superclass info..."
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4029
                change isClassDefinitionChange ifTrue:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4030
                    | superNm |
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4031
                    superNm := change superClassName.
4445
c6a9179c1637 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  4032
                    (superNm notNil and:[superNm ~= 'nil']) ifTrue:[
3856
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4033
                        (classInfos includesKey: superNm) ifTrue:[
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4034
                            info superclass: (classInfos at: superNm).
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4035
                            (metaInfos at: nm) superclass: (classInfos at: superNm).
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4036
                        ].
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4037
                    ].
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4038
                ].
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4039
            ].
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4040
            info addChange: change.
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4041
        ]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4042
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4043
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4044
    classInfos do:[:info|info namespace: namespaceName].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4045
    metaInfos  do:[:info|info namespace: namespaceName].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4046
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4047
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4048
    "
3856
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4049
        ChangeSet::ClassSourceWriter new
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4050
            changeSetBeingSaved: (ChangeSet forExistingClass: ChangeSet);
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4051
            analyze;
f75fb195e35a class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3844
diff changeset
  4052
            yourself
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4053
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4054
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4055
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4056
    "Created: / 15-03-2012 / 17:51:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4057
    "Modified: / 11-06-2013 / 17:59:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4445
c6a9179c1637 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  4058
    "Modified: / 22-06-2019 / 16:06:06 / Claus Gittinger"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4059
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4060
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4061
changeSetBeingSaved:something
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4062
    changeSetBeingSaved := something.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4063
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4064
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4065
privateClassesOf: classInfo
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4066
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4067
    | classInfoNameSz |
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4068
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4069
    classInfoNameSz := classInfo name size.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4070
    ^classInfos values select:[:info|
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4071
	info name size > classInfoNameSz and:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4072
	    (info name startsWith: classInfo name)
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4073
		and:[(info name at:classInfoNameSz + 1) == $:
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4074
		    and:[(info name at:classInfoNameSz + 2) == $:
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4075
			and:[(info name indexOf: $: startingAt: classInfo name size + 3) == 0]]]]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4076
    ]
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4077
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4078
    "Created: / 15-03-2012 / 19:31:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4079
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4080
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4081
privateClassesSortedOf: classInfo
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4082
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4083
    |classes|
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4084
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4085
    classes := self privateClassesOf: classInfo.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4086
    (classes size > 0) ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4087
	classes := classes asOrderedCollection.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4088
	classes sort:[:a :b | a name < b name].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4089
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4090
	classes topologicalSort:[:a :b |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4091
	    "/ a must come before b iff:
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4092
	    "/    b is a subclass of a
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4093
	    "/    b has a private class which is a subclass of a
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4094
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4095
	    |mustComeBefore privateClassesOfB|
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4096
	    mustComeBefore := (b isSubclassOf:a) or:[b isPrivateClassOf: a].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4097
	    mustComeBefore
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4098
	].
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4099
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4100
    ^ classes.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4101
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4102
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4103
     Object privateClassesSorted
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4104
     NewSystemBrowser privateClassesSorted
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4105
     NewSystemBrowser privateClasses
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4106
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4107
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4108
    "Created: / 15-03-2012 / 19:45:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4109
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4110
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4111
!ChangeSet::ClassSourceWriter methodsFor:'source writing'!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4112
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4113
fileOut:aChangeSet on:outStreamArg
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4114
    ^ self
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4115
	fileOut: aChangeSet
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4116
	on:outStreamArg
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4117
	withTimeStamp:false
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4118
	withInitialize:true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4119
	withDefinition:true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4120
	methodFilter:nil encoder:nil.
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4121
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4122
    "Created: / 04-02-2014 / 18:36:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4123
!
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4124
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4125
fileOut:aChangeSet on:outStreamArg withTimeStamp:stampIt withInitialize:initIt withDefinition:withDefinition methodFilter:methodFilter encoder:encoderOrNil
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4126
3646
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4127
    |collectionOfCategories versionMethods extensionVersionMethods comment
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4128
     nonMeta meta classesImplementingInitialize outStream
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4129
     allMetaClassSelectors versionSelectors extensionVersionSelectors
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4130
     allVersionMethods|
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4131
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4132
    self todo:'code duplication with SmalltalkChunkFileSourceFileWriter - please refactor'.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4133
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4134
    changeSetBeingSaved := aChangeSet.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4135
    self analyze.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4136
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4137
    encoderOrNil isNil ifTrue:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4138
        outStream := outStreamArg.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4139
    ] ifFalse:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4140
        outStream := EncodedStream stream:outStreamArg encoder:encoderOrNil.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4141
        outStream nextPutAll:'"{ Encoding: ' , encoderOrNil nameOfEncoding , ' }"'; cr; cr.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4142
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4143
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4144
    "/ Just a bunch of extensions?
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4145
    topClassName isNil ifTrue:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4146
        self fileOutMethodsOn: outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4147
        ^self.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4148
    ].
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4149
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4150
    nonMeta := classInfos at: topClassName.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4151
       meta :=  metaInfos at: topClassName.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4152
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4153
    methodsAlreadySaved := Set new.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4154
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4155
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4156
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4157
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4158
     if there is a copyright method, add a copyright comment
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4159
     at the beginning, taking the string from the copyright method.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4160
     We cannot do this unconditionally - that would lead to my copyrights
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4161
     being put on your code ;-).
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4162
     On the other hand: I want every file created by myself to have the
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4163
     copyright string at the beginning be preserved .... even if the
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4164
     code was edited in the browser and filedOut.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4165
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4166
    self generateHeaderWithCopyrightOn:outStream.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4167
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4168
    stampIt ifTrue:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4169
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4170
        "/ first, a timestamp
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4171
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4172
        outStream nextPutAll:(Smalltalk timeStamp).
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4173
        outStream nextPutChunkSeparator.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4174
        outStream cr; cr.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4175
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4176
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4177
    withDefinition ifTrue:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4178
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4179
        "/ then the definition(s)
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4180
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4181
        self fileOutAllDefinitionsOf:nonMeta on:outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4182
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4183
        "/ a comment - if any
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4184
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4185
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4186
        (comment := nonMeta comment) notNil ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4187
            nonMeta printClassNameOn: outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4188
            outStream nextPutAll:' comment:'.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4189
            comment comment storeOn: outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4190
            outStream cr.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4191
            outStream nextPut:$!!; cr; cr.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4192
        ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4193
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4194
        "/ ST/X primitive definitions - if any
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4195
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4196
        self fileOutPrimitiveSpecsOf: nonMeta on:outStream.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4197
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4198
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4199
    "/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4200
    "/ methods from all categories in metaclass (i.e. class methods)
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4201
    "/ EXCEPT: the version method is placed at the very end, to
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4202
    "/         avoid sourcePosition-shifts when checked out later.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4203
    "/         (RCS expands this string, so its size is not constant)
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4204
    "/
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4205
    collectionOfCategories := meta methodCategories asSortedCollection.
3646
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4206
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4207
    allMetaClassSelectors := meta methodDictionary keys.
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4208
    versionSelectors := allMetaClassSelectors select:[:selector | AbstractSourceCodeManager isVersionMethodSelector:selector ].
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4209
    versionMethods := versionSelectors collect:[:eachSelector | meta methodDictionary at:eachSelector].
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4210
    extensionVersionSelectors := allMetaClassSelectors select:[:selector | AbstractSourceCodeManager isExtensionsVersionMethodSelector:selector ].
3646
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4211
    extensionVersionMethods := extensionVersionSelectors collect:[:eachSelector | meta methodDictionary at:eachSelector].
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4212
    allVersionMethods := Set new addAll:versionMethods; addAll:extensionVersionMethods; yourself.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4213
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4214
    collectionOfCategories notNil ifTrue:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4215
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4216
        "/ documentation first (if any), but not the version method
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4217
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4218
        (collectionOfCategories includes:'documentation') ifTrue:[
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4219
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4220
"/            versionMethods do:[:versionMethod |
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4221
"/                |source|
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4222
"/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4223
"/                source := versionMethod source.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4224
"/                (source isEmptyOrNil or:[(source startsWith:nonMeta nameOfOldVersionMethod) not]) ifTrue:[
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4225
"/                    "something bad happend to the classes code"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4226
"/
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4227
"/                    Class fileOutErrorSignal
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4228
"/                        raiseRequestWith:aClass
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4229
"/                        errorString:' - bad source for version method (uncompiled class file?): ', (versionMethod displayString)
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4230
"/                ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4231
"/            ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4232
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4233
            self fileOutCategory:'documentation' of:meta except:allVersionMethods only:nil methodFilter:methodFilter on:outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4234
        ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4235
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4236
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4237
        "/ initialization next (if any)
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4238
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4239
        (collectionOfCategories includes:'initialization') ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4240
            self fileOutCategory:'initialization' of:meta methodFilter:methodFilter on:outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4241
        ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4242
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4243
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4244
        "/ instance creation next (if any)
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4245
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4246
        (collectionOfCategories includes:'instance creation') ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4247
            self fileOutCategory:'instance creation' of:meta methodFilter:methodFilter on:outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4248
        ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4249
        collectionOfCategories do:[:aCategory |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4250
            ((aCategory ~= 'documentation')
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4251
            and:[(aCategory ~= 'initialization')
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4252
            and:[aCategory ~= 'instance creation']]) ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4253
                self fileOutCategory:aCategory of:meta methodFilter:methodFilter on:outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4254
            ]
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4255
        ]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4256
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4257
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4258
    "/ if there are any primitive definitions (vw-like ffi-primitives),
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4259
    "/ file them out first in the order: defines, types.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4260
    "/ Otherwise, we might have trouble when filing in later, because the types are needed
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4261
    "/ for the primitive calls.
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4262
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4263
    "/ TODO: that does not work - MethodDefinition does not implement #isVisualWorksTypedef
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4264
"/    nonMeta methodDictionary keysAndValuesDo:[:sel :m |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4265
"/        m isVisualWorksTypedef ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4266
"/            self fileOutCategory:m category of:nonMeta except:nil only:(Array with:m) methodFilter:methodFilter on:outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4267
"/        ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4268
"/    ].
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4269
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4270
    "/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4271
    "/ methods from all categories
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4272
    "/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4273
    collectionOfCategories := nonMeta categories asSortedCollection.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4274
    collectionOfCategories notNil ifTrue:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4275
        collectionOfCategories do:[:aCategory |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4276
            self fileOutCategory:aCategory of:nonMeta methodFilter:methodFilter on:outStream.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4277
        ]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4278
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4279
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4280
    "/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4281
    "/ any private classes' methods
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4282
    "/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4283
    (self privateClassesSortedOf: nonMeta) do:[:aClass |
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4284
        self fileOutAllMethodsOf:aClass on:outStream methodFilter:methodFilter
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4285
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4286
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4287
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4288
    "/
3646
cecd3c25e5af class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
  4289
    "/ finally, the previously skipped version method(s) - but NOT the extension version methods
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4290
    "/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4291
    versionMethods notEmpty ifTrue: [
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4292
        self fileOutCategory:'documentation' of:meta except:nil only:versionMethods methodFilter:methodFilter on:outStream.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4293
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4294
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4295
    initIt ifTrue:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4296
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4297
        "/ optionally an initialize message
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4298
        "/
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4299
        classesImplementingInitialize := OrderedCollection new.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4300
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4301
        classInfos values with: metaInfos values do:[:class :meta|
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4302
            (meta includesSelector: #initialize) ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4303
                classesImplementingInitialize add: class.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4304
            ]
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4305
        ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4306
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4307
        classesImplementingInitialize size ~~ 0 ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4308
            classesImplementingInitialize topologicalSort:[:a :b | b isSubclassOf:a].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4309
            outStream cr.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4310
            classesImplementingInitialize do:[:eachClass |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4311
                eachClass printClassNameOn:outStream. outStream nextPutAll:' initialize'.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4312
                outStream nextPutChunkSeparator.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4313
                outStream cr.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4314
            ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4315
        ].
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4316
    ]
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4317
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4318
    "Created: / 15-11-1995 / 12:53:06 / cg"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4319
    "Modified: / 01-04-1997 / 16:01:05 / stefan"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4320
    "Created: / 15-03-2012 / 17:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4321
    "Modified: / 01-05-2013 / 09:17:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4322
    "Modified: / 05-07-2017 / 10:50:30 / cg"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4323
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4324
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4325
fileOutAllDefinitionsOf:nonMetaInfo on:aStream
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4326
    "append expressions on aStream, which defines myself and all of my private classes."
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4327
3697
2fa150de2ee1 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3696
diff changeset
  4328
    | metaInfo definition metaDefinition |
2fa150de2ee1 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3696
diff changeset
  4329
2fa150de2ee1 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3696
diff changeset
  4330
    definition := nonMetaInfo definition.
2fa150de2ee1 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3696
diff changeset
  4331
    definition isPrivateClassDefinitionChange ifFalse:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4332
        definition package notNil ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4333
            aStream nextPutAll: ('"{ Package: ''%1'' }"' bindWith: definition package).
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4334
            aStream cr; cr.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4335
        ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4336
        aStream nextPutAll: ('"{ NameSpace: %1 }"' bindWith: namespaceName ? 'Smalltalk').
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4337
        aStream cr; cr.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4338
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4339
3697
2fa150de2ee1 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3696
diff changeset
  4340
    aStream nextChunkPut: (definition definitionStringInNamespace: namespaceName).
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4341
    aStream cr; cr.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4342
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4343
    "/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4344
    "/ optional classInstanceVariables
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4345
    "/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4346
    metaInfo := metaInfos at: nonMetaInfo name.
3697
2fa150de2ee1 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3696
diff changeset
  4347
    metaDefinition := metaInfo definition.
2fa150de2ee1 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3696
diff changeset
  4348
    metaDefinition notNil ifTrue:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4349
        | anySuperClassInstVar myClass |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4350
        aStream
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4351
            nextPutAll: metaDefinition className;
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4352
            nextPutAll:' instanceVariableNames:';
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4353
            nextPutAll: (metaDefinition classInstVarNames asStringWith:' ') storeString.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4354
        "mhmh - good idea; saw this in SmallDraw sourcecode ..."
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4355
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4356
        anySuperClassInstVar := false.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4357
        myClass := metaDefinition changeClass.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4358
        myClass notNil ifTrue:[myClass := myClass theNonMetaclass].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4359
        myClass notNil ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4360
            myClass allSuperclassesDo:[:aSuperClass |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4361
                aSuperClass class instVarNames do:[:ignored | anySuperClassInstVar := true].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4362
            ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4363
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4364
            aStream cr; cr; nextPut:(Character doubleQuote); cr; space.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4365
            anySuperClassInstVar ifFalse:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4366
                aStream
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4367
                    nextPutLine:'No other class instance variables are inherited by this class.'.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4368
            ] ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4369
                aStream
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4370
                    nextPutLine:'The following class instance variables are inherited by this class:'.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4371
                aStream cr.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4372
                myClass allSuperclassesDo:[:aSuperClass |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4373
                    aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4374
                    aStream nextPutLine:(aSuperClass class instanceVariableString).
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4375
                ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4376
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4377
            ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4378
        ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4379
        aStream nextPut:(Character doubleQuote); cr.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4380
        aStream nextPut:$!!; cr; cr
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4381
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4382
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4383
    "/ here, the full nameSpace prefixes are output,
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4384
    "/ to avoid confusing stc
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4385
    "/ (which otherwise could not find the correct superclass)
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4386
    "/
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4387
    Class fileOutNameSpaceQuerySignal answer:false do:[
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4388
        Class forceNoNameSpaceQuerySignal answer:true do:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4389
            (self privateClassesSortedOf: nonMetaInfo) do:[:i |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4390
                 self fileOutAllDefinitionsOf:i on:aStream
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4391
            ]
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4392
        ]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4393
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4394
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4395
    "Created: / 15-10-1996 / 11:15:19 / cg"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4396
    "Modified: / 22-03-1997 / 16:11:56 / cg"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4397
    "Created: / 15-03-2012 / 19:18:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4398
    "Modified: / 11-06-2013 / 22:23:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4399
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4400
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4401
fileOutAllMethodsOf:aClass on:aStream methodFilter:methodFilter
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4402
    | collectionOfCategories meta |
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4403
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4404
    meta := metaInfos at: aClass name.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4405
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4406
    collectionOfCategories := meta methodCategories asSortedCollection.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4407
    collectionOfCategories notNil ifTrue:[
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4408
        collectionOfCategories do:[:aCategory |
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4409
            self fileOutCategory:aCategory of:meta  methodFilter:methodFilter on:aStream.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4410
"/            aStream cr.
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4411
        ]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4412
    ].
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4413
    collectionOfCategories := aClass methodCategories asSortedCollection.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4414
    collectionOfCategories notNil ifTrue:[
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4415
        collectionOfCategories do:[:aCategory |
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4416
            self fileOutCategory:aCategory of:aClass methodFilter:methodFilter on:aStream.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4417
"/            aStream cr.
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4418
        ]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4419
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4420
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4421
    (self privateClassesSortedOf: aClass) do:[:privateClass |
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4422
        self fileOutAllMethodsOf:privateClass on:aStream methodFilter:methodFilter
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4423
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4424
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4425
    "Created: / 15-10-1996 / 11:13:00 / cg"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4426
    "Created: / 19-03-2012 / 18:21:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4427
    "Modified: / 01-05-2013 / 09:06:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4248
f5efd9558d57 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4183
diff changeset
  4428
    "Modified: / 05-07-2017 / 10:50:34 / cg"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4429
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4430
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4431
fileOutMethod:change on:aStream
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4432
    "file a single method onto aStream."
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4433
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4434
    | changeToFileOut |
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4435
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4436
    change isMethodCategoryChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4437
	self assert: change origin notNil.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4438
	changeToFileOut := change origin copy.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4439
	changeToFileOut category: change category.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4440
    ] ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4441
	changeToFileOut := change.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4442
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4443
    changeToFileOut source notEmptyOrNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4444
	super fileOutMethod:changeToFileOut on:aStream
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4445
    ] ifFalse:[
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4446
"/        self error: 'Should not happen' mayProceed: true.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4447
    ]
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4448
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4449
    "Created: / 20-03-2012 / 22:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4450
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4451
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4452
fileOutMethodsOn:stream
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4453
    "Writes a set of methods in changesetBeingSaved in same format as
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4454
     extensions.st created by source code management. Code stolen from
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4455
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4456
     AbstractSourceCodeManager class>>fileOutSourceCodeExtensions:package:on:version:
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4457
    "
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4458
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4459
    | methodsSortedByName |
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4460
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4461
4409
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4462
        stream nextPutAll:'"{ Package: '''.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4463
        stream nextPutAll:packageName asString.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4464
        stream nextPutAll:''' }"'; nextPutChunkSeparator; cr; cr.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4465
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4466
"/        s nextPutAll:(Smalltalk timeStamp).
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4467
"/        s nextPutChunkSeparator.
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4468
"/        s cr; cr.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4469
4409
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4470
        "/ sort them by name (to avoid conflict due to CVS merge)
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4471
        methodsSortedByName := changeSetBeingSaved.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4472
        methodsSortedByName sort:[:a :b |
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4473
                                    |clsA clsB|
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4474
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4475
                                    clsA := a className.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4476
                                    clsB := b className.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4477
                                    clsA < clsB ifTrue:[
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4478
                                        true
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4479
                                    ] ifFalse:[
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4480
                                        clsA > clsB ifTrue:[
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4481
                                            false
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4482
                                        ] ifFalse:[
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4483
                                            a selector < b selector
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4484
                                        ]
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4485
                                    ]
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4486
                                  ].
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4487
        methodsSortedByName do:[:aMethod |
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4488
            |cat source privacy|
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4489
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4490
            self assert: aMethod package = packageName.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4491
            "/self assert: aMethod programmingLanguage isSmalltalk.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4492
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4493
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4494
            stream nextPutChunkSeparator.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4495
            aMethod className printOn: stream.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4496
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4497
            (privacy := aMethod privacy) ~~ #public ifTrue:[
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4498
                stream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4499
            ] ifFalse:[
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4500
                stream nextPutAll:' methodsFor:'.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4501
            ].
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4502
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4503
            cat := aMethod category ? '* no category *'.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4504
            stream nextPutAll:cat asString storeString.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4505
            stream nextPutChunkSeparator; cr; cr.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4506
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4507
            source := aMethod source.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4508
            source isNil ifTrue:[
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4509
                "FileOutErrorSignal"Error
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4510
                    raiseRequestWith:self
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4511
                    errorString:(' - no source for method: ' ,
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4512
                                 self className , '>>' ,
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4513
                                 aMethod selector)
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4514
            ] ifFalse:[
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4515
                stream nextChunkPut:source.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4516
            ].
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4517
            stream space.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4518
            stream nextPutChunkSeparator.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4519
            stream cr.
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4520
        ].
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4521
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4522
    "Created: / 30-01-2013 / 09:35:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4409
f5fd54d175d1 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 4397
diff changeset
  4523
    "Modified: / 03-03-2019 / 22:25:24 / Claus Gittinger"
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4524
!
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4525
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4526
fileOutPrimitiveSpecsOf: nonMeta on:aStream
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4527
    "append primitive defs (if any) to aStream."
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4528
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4529
    |s|
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4530
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4531
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4532
     primitive definitions - if any
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4533
    "
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4534
    (s := nonMeta primitiveDefinitionsString) notNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4535
	aStream nextPutChunkSeparator.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4536
	nonMeta printClassNameOn:aStream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4537
	aStream nextPutAll:' primitiveDefinitions';
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4538
		nextPutChunkSeparator;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4539
		cr.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4540
	aStream nextPutAll:s.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4541
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4542
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4543
    (s := nonMeta primitiveVariablesString) notNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4544
	aStream nextPutChunkSeparator.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4545
	nonMeta printClassNameOn:aStream.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4546
	aStream nextPutAll:' primitiveVariables';
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4547
		nextPutChunkSeparator;
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4548
		cr.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4549
	aStream nextPutAll:s.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4550
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4551
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4552
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4553
    "Created: / 15-03-2012 / 19:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4554
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4555
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4556
generateHeaderWithCopyrightOn:outStream
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4557
    |copyrightChange copyrightText|
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4558
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4559
    copyrightChange :=
4035
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4560
        (metaInfos at: topClassName) methodAt: #copyright.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4561
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4562
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4563
    copyrightChange notNil ifTrue:[
4035
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4564
        "
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4565
         get the copyright method's comment-text, strip off empty and blank lines
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4566
         and insert at beginning.
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4567
        "
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4568
        copyrightText := Parser methodCommentFromSource: copyrightChange source.
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4569
        copyrightText notEmptyOrNil ifTrue:[
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4570
            copyrightText := copyrightText asCollectionOfLines asStringCollection.
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4571
            copyrightText := copyrightText withoutLeadingAndTrailingBlankLines.
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4572
            copyrightText notEmpty ifTrue:[
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4573
                copyrightText addFirst:'"'.
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4574
                copyrightText addLast:'"'.
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4575
                copyrightText := copyrightText asString.
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4576
                outStream nextPutAllAsChunk:copyrightText.
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4577
            ].
047862768e35 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4033
diff changeset
  4578
        ].
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4579
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4580
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4581
    "Created: / 15-03-2012 / 19:01:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4582
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4583
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4584
!ChangeSet::ClassSourceWriter::ClassInfo class methodsFor:'documentation'!
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4585
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4586
copyright
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4587
"
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4588
 COPYRIGHT (c) 2006 by eXept Software AG
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4589
	      All Rights Reserved
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4590
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4591
 This software is furnished under a license and may be used
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4592
 only in accordance with the terms of that license and with the
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4593
 inclusion of the above copyright notice.   This software may not
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4594
 be provided or otherwise made available to, or used by, any
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4595
 other person.  No title to or ownership of the software is
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4596
 hereby transferred.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4597
"
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4598
!
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4599
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4600
version_SVN
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4601
    ^ '$Id$'
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4602
! !
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4603
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4604
!ChangeSet::ClassSourceWriter::ClassInfo class methodsFor:'instance creation'!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4605
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4606
new
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4607
    "return an initialized instance"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4608
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4609
    ^ self basicNew initialize.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4610
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4611
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4612
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'accessing'!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4613
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4614
categories
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4615
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4616
    ^ (methods collect:[:e|e category]) asSet
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4617
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4618
    "Created: / 19-03-2012 / 18:03:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4619
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4620
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4621
comment
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4622
    ^ comment
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4623
!
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4624
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4625
comment:something
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4626
    comment := something.
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4627
!
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4628
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4629
definition
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4630
    ^ definition
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4631
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4632
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4633
definition:something
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4634
    definition := something.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4635
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4636
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4637
methodAt: selector
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4638
    ^methods detect:[:each|each selector == selector] ifNone:[nil].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4639
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4640
    "Created: / 15-03-2012 / 19:11:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4641
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4642
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4643
methodDictionary
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4644
    methodDictionary isEmptyOrNil ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4645
        methodDictionary := Dictionary new.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4646
        methods do:[:m| methodDictionary at: m selector put: m].
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4647
    ].
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4648
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4649
    ^ methodDictionary.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4650
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4651
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4652
methods
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4653
    ^ methods
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4654
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4655
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4656
methods:something
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4657
    methods := something.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4658
    methodDictionary := Dictionary new.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4659
    methods do:[:m|methodDictionary at: m selector put: m].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4660
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4661
    "Modified: / 19-03-2012 / 18:12:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4662
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4663
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4664
name
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4665
    ^ name
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4666
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4667
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4668
name:something
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4669
    name := something.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4670
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4671
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4672
namespace
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4673
    ^ namespace
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4674
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4675
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4676
namespace:aString
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4677
    namespace := aString.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4678
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4679
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4680
primitiveDefinitions
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4681
    ^ primitiveDefinitions
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4682
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4683
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4684
primitiveDefinitionsString
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4685
    ^ primitiveDefinitions isNil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4686
	ifTrue:[nil]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4687
	ifFalse:[primitiveDefinitions source]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4688
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4689
    "Created: / 13-04-2012 / 13:14:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4690
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4691
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4692
primitiveFunctions
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4693
    ^ primitiveFunctions
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4694
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4695
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4696
primitiveFunctionsString
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4697
    ^ primitiveFunctions isNil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4698
	ifTrue:[nil]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4699
	ifFalse:[primitiveFunctions source]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4700
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4701
    "Created: / 13-04-2012 / 13:15:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4702
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4703
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4704
primitiveVariables
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4705
    ^ primitiveVariables
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4706
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4707
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4708
primitiveVariablesString
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4709
    ^ primitiveVariables isNil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4710
	ifTrue:[nil]
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4711
	ifFalse:[primitiveVariables source]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4712
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4713
    "Created: / 13-04-2012 / 13:15:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4714
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4715
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4716
selectorAtMethod: m
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4717
    ^m selector
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4718
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4719
    "Created: / 19-03-2012 / 18:14:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4720
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4721
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4722
superclass
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4723
    ^ superclass
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4724
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4725
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4726
superclass:something
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4727
    superclass := something.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4728
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4729
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4730
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'adding'!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4731
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4732
addChange: change
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4733
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4734
    change isClassDefinitionChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4735
	self assert: definition isNil.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4736
	definition := change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4737
	^self.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4738
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4739
    change isMethodCodeChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4740
	methods add: change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4741
	^self.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4742
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4743
    change isMethodCategoryChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4744
	methods add: change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4745
	^self.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4746
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4747
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4748
    change isClassInstVarDefinitionChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4749
	self assert: definition isNil.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4750
	definition := change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4751
	^self
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4752
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4753
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4754
    change isPrimitiveDefinitionsChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4755
	primitiveDefinitions := change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4756
	^self
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4757
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4758
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4759
    change isPrimitiveVariablesChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4760
	primitiveVariables := change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4761
	^self
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4762
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4763
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4764
    change isPrimitiveFunctionsChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4765
	primitiveFunctions := change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4766
	^self
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4767
    ].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4768
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4769
    change isClassCommentChange ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4770
	comment := change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4771
	^self
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4772
    ].
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  4773
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4774
    change isClassInitializeChange ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4775
	"/ Ignore it, the class inititalization chunk is
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4776
	"/ written fileOut:on:withTimeStamp:withInitialize:withDefinition:methodFilter:encoder:
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4777
	"/ for all class implementing class-side #initialize
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4778
	^ self
3575
6d208ef54e78 Fixes ClassSourceWriter - ignore ClassInitializeChange when analyzing changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3545
diff changeset
  4779
    ].
6d208ef54e78 Fixes ClassSourceWriter - ignore ClassInitializeChange when analyzing changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3545
diff changeset
  4780
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4781
    self error: 'Unknown change'
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4782
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4783
    "Created: / 15-03-2012 / 19:12:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3575
6d208ef54e78 Fixes ClassSourceWriter - ignore ClassInitializeChange when analyzing changeset.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3545
diff changeset
  4784
    "Modified: / 05-06-2014 / 08:14:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4785
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4786
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4787
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'enumerating'!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4788
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4789
methodsDo: aBlock
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4790
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4791
    methods do: aBlock
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4792
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4793
    "Created: / 19-03-2012 / 18:14:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4794
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4795
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4796
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'initialization'!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4797
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4798
initialize
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4799
    "Invoked when a new instance is created."
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4800
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4801
    "/ please change as required (and remove this comment)
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4802
    "/ name := nil.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4803
    "/ instDefinition := nil.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4804
    "/ classDefinition := nil.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4805
    methods := OrderedCollection new.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4806
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4807
    "/ super initialize.   -- commented since inherited method does nothing
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4808
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4809
    "Modified: / 15-03-2012 / 19:12:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4810
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4811
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4812
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'printing & storing'!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4813
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4814
printClassNameOn:aStream
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4815
    | nameWithoutNs |
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4816
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4817
    nameWithoutNs := name.
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4818
"/    namespace notNil ifTrue:[
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4819
"/        self assert: (name startsWith:namespace).
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4820
"/        nameWithoutNs := nameWithoutNs copyFrom: namespace size + 3.
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4821
"/    ].
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4822
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4823
    aStream nextPutAll: nameWithoutNs
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4824
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4825
    "Created: / 19-03-2012 / 18:17:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3445
71962ba45fb7 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3395
diff changeset
  4826
    "Modified: / 11-06-2013 / 17:59:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4827
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4828
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4829
printOn:aStream
4073
34b57b08a7df #DOCUMENTATION by mawalch
mawalch
parents: 4035
diff changeset
  4830
    "append a printed representation of the receiver to the argument, aStream"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4831
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4832
    aStream nextPutAll: self class nameWithoutPrefix.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4833
    aStream nextPutAll:'('.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4834
    name printOn:aStream.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4835
    aStream nextPutAll:')'.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4836
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4837
    "Modified: / 19-03-2012 / 19:43:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4838
! !
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4839
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4840
!ChangeSet::ClassSourceWriter::ClassInfo methodsFor:'queries'!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4841
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4842
includesSelector: selector
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4843
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4844
    ^methods anySatisfy:[:m|m selector == selector].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4845
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4846
    "Created: / 19-03-2012 / 18:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4847
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4848
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4849
isPrivateClassOf: classInfo
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4850
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4851
    ^(name startsWith: classInfo name)
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4852
	and:[ (name at: (classInfo name size + 1)) == $:
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4853
	    and:[ (name at: (classInfo name size + 2)) == $:]]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4854
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4855
    "Created: / 15-03-2012 / 19:42:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4856
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4857
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4858
isSubclassOf: classInfo
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4859
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4860
    ^superclass notNil and:
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4861
	[superclass == classInfo or:[superclass isSubclassOf: classInfo]]
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4862
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4863
    "Created: / 15-03-2012 / 19:41:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1174
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  4864
! !
f4794940b620 new changeSet reading mechanism (extensible);
Claus Gittinger <cg@exept.de>
parents: 1169
diff changeset
  4865
2321
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4866
!ChangeSet::DiffSet class methodsFor:'documentation'!
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4867
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4868
documentation
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4869
"
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4870
    I represent the differences between two change sets.
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4871
    As such, I can be used by a VersionDiffBrowser and to generate patchSets.
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4872
"
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4873
! !
cdba8ed97ed6 added: #fromDiffSet:
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4874
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4875
!ChangeSet::DiffSet methodsFor:'accessing'!
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4876
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4877
changed
1867
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4878
    "return the set of methods which were different"
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4879
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4880
    ^ changed
1867
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4881
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4882
    "Modified: / 12-10-2006 / 22:06:55 / cg"
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4883
!
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4884
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4885
changed:something
1867
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4886
    "set the set of changed methods"
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4887
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4888
    changed := something.
1867
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4889
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4890
    "Modified: / 12-10-2006 / 22:06:03 / cg"
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4891
!
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4892
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4893
changed:changedArg onlyInReceiver:onlyInReceiverArg onlyInArg:onlyInArgArg
3338
c6065f4c9def class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3309
diff changeset
  4894
    self changed:changedArg onlyInReceiver:onlyInReceiverArg onlyInArg:onlyInArgArg same:nil
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4895
!
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4896
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4897
changed:changedArg onlyInReceiver:onlyInReceiverArg onlyInArg:onlyInArgArg same: sameArg
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4898
    "set instance variables (automatically generated)"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4899
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4900
    changed := changedArg.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4901
    changed isNil ifTrue:[changed := OrderedCollection new].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4902
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4903
    onlyInReceiver := onlyInReceiverArg.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4904
    onlyInReceiver isNil ifTrue:[onlyInReceiver := ChangeSet new].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4905
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4906
    onlyInArg := onlyInArgArg.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4907
    onlyInArg isNil ifTrue:[onlyInArg := ChangeSet new].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4908
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4909
    same := sameArg.
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4910
    same isNil ifTrue:[same := ChangeSet new].
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4911
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4912
    "Created: / 19-03-2012 / 21:35:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4913
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4914
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4915
onlyInArg
1867
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4916
    "return the set of methods which were only present in the argument of the diffset"
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4917
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4918
    ^ onlyInArg
1867
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4919
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4920
    "Modified: / 12-10-2006 / 22:07:02 / cg"
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4921
!
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4922
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4923
onlyInArg:something
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4924
    onlyInArg := something.
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4925
!
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4926
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4927
onlyInReceiver
1867
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4928
    "return the set of methods which were only present in the receiver of the diffset"
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4929
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4930
    ^ onlyInReceiver
1867
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4931
dad9e13fba4c comments
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  4932
    "Modified: / 12-10-2006 / 22:07:12 / cg"
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4933
!
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4934
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4935
onlyInReceiver:something
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4936
    onlyInReceiver := something.
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4937
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4938
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4939
same
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4940
    ^ same
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4941
!
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4942
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4943
same:something
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4944
    same := something.
1156
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4945
! !
29fb7d77797d use a rela object instead of a Dictionary as diffSet
Claus Gittinger <cg@exept.de>
parents: 1147
diff changeset
  4946
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4947
!ChangeSet::DiffSet methodsFor:'merging'!
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4948
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4949
addDiffSet:anotherDiffset
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4950
    changed addAll:(anotherDiffset changed).
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4951
    onlyInReceiver addAll:(anotherDiffset onlyInReceiver).
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4952
    onlyInArg addAll:(anotherDiffset onlyInArg).
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4953
    same addAll: (anotherDiffset same).
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4954
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4955
    "Created: / 12-10-2006 / 22:49:30 / cg"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4956
    "Modified: / 19-03-2012 / 21:36:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4957
!
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4958
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4959
copy
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4960
    ^ self class new
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4961
	changed:changed copy
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4962
	onlyInReceiver:onlyInReceiver copy
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4963
	onlyInArg:onlyInArg copy
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4964
	same:same copy
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4965
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4966
    "Created: / 12-10-2006 / 22:50:56 / cg"
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  4967
    "Modified: / 19-03-2012 / 21:36:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4968
! !
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  4969
2186
3cbd8cb9e36e removeAllVersionMethods in DiffSet
fm
parents: 2179
diff changeset
  4970
!ChangeSet::DiffSet methodsFor:'misc'!
3cbd8cb9e36e removeAllVersionMethods in DiffSet
fm
parents: 2179
diff changeset
  4971
3cbd8cb9e36e removeAllVersionMethods in DiffSet
fm
parents: 2179
diff changeset
  4972
removeAllVersionMethods
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4973
    changed := changed
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4974
		    reject:[:pair |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4975
			pair first isMethodChangeForVersionMethod
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4976
		    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4977
    onlyInReceiver := onlyInReceiver
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4978
		    reject:[:chg |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4979
			chg isMethodChangeForVersionMethod
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4980
		    ].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4981
    onlyInArg := onlyInArg
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4982
		    reject:[:chg |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4983
			chg isMethodChangeForVersionMethod
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  4984
		    ].
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4985
!
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4986
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4987
sortByClassName
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4988
    onlyInReceiver notNil ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4989
        onlyInReceiver := onlyInReceiver sortedByClassName.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4990
    ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4991
    onlyInArg notNil ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4992
        onlyInArg := onlyInArg sortedByClassName.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4993
    ].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4994
    changed notEmptyOrNil ifTrue:[
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4995
        changed := changed sort:[:pairA :pairB |
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4996
                        |nameA nameB chgA chgB|
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4997
                        chgA := pairA first. chgB := pairB first.
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4998
                        nameA := chgA isClassChange ifTrue:[chgA className] ifFalse:['^other'].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  4999
                        nameB := chgB isClassChange ifTrue:[chgB className] ifFalse:['^other'].
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  5000
                        nameA < nameB]    
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  5001
    ].
2186
3cbd8cb9e36e removeAllVersionMethods in DiffSet
fm
parents: 2179
diff changeset
  5002
! !
3cbd8cb9e36e removeAllVersionMethods in DiffSet
fm
parents: 2179
diff changeset
  5003
1292
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  5004
!ChangeSet::DiffSet methodsFor:'queries'!
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  5005
2914
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5006
changedClasses
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5007
    |allChangedClasses|
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5008
2923
fb0a62def59a diffset
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
  5009
    allChangedClasses := Set new.
2914
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5010
    allChangedClasses addAll:(onlyInArg changedClasses).
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5011
    allChangedClasses addAll:(onlyInReceiver changedClasses).
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5012
    changed do:[:eachChangePair |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5013
	allChangedClasses add:(eachChangePair first changeClass).
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5014
	allChangedClasses add:(eachChangePair second changeClass).
2923
fb0a62def59a diffset
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
  5015
    ].
fb0a62def59a diffset
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
  5016
    allChangedClasses remove:nil ifAbsent:[].
2914
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5017
    ^ allChangedClasses
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5018
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5019
    "Created: / 26-09-2012 / 15:39:18 / cg"
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5020
!
8d837a083e9b query for changedClasses added
Claus Gittinger <cg@exept.de>
parents: 2907
diff changeset
  5021
1292
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  5022
isEmpty
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  5023
    ^ changed isEmpty
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  5024
    and:[ onlyInReceiver isEmpty
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  5025
    and:[ onlyInArg isEmpty ] ]
1869
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  5026
!
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  5027
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  5028
notEmpty
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  5029
    ^ self isEmpty not
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  5030
988269721678 +isPrivateClassDefinitionChange and other support for private classes
Claus Gittinger <cg@exept.de>
parents: 1867
diff changeset
  5031
    "Created: / 12-10-2006 / 23:12:27 / cg"
1292
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  5032
! !
4f2a8ea516fa category & comments
Claus Gittinger <cg@exept.de>
parents: 1287
diff changeset
  5033
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5034
!ChangeSet::DolphinPACFileReader methodsFor:'reading-private'!
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5035
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5036
handleCategoriesForClass
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5037
    |category change|
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5038
2179
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
  5039
    [
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5040
	inputStream skipSeparators.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5041
	category := inputStream nextChunk.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5042
	category notEmpty
2179
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
  5043
    ] whileTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5044
	change := ClassCategoryChange new.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5045
	change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5046
	    className:className
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5047
	    category:category.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5048
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5049
	self addChange:change.
2179
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
  5050
    ].
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5051
    ^ true
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5052
!
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5053
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5054
handleCategoriesForMethod
2179
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
  5055
    |methodSelector categories change isPrivate isPublic category|
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5056
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5057
    methodSelector := (arguments at:1) evaluate.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5058
    inputStream skipSeparators.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5059
    isPrivate := false.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5060
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5061
    categories := OrderedCollection new.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5062
    [
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5063
	|done category |
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5064
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5065
	category := inputStream nextChunk withoutSeparators.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5066
	done := category isEmpty.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5067
	done ifFalse:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5068
	    categories add:category
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5069
	].
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5070
	done
2179
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
  5071
    ] whileFalse.
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5072
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5073
    categories size > 1 ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5074
	isPrivate := categories includes:'private'.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5075
	categories remove:'private' ifAbsent:nil.
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5076
    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5077
    categories size > 1 ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5078
	isPublic := categories includes:'public'.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5079
	categories remove:'public' ifAbsent:nil.
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5080
    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5081
"/    categories size > 1 ifTrue:[
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5082
"/        self halt.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5083
"/    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5084
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5085
    category := categories first.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5086
    isPrivate ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5087
	category := category , '-private'.
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5088
    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5089
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5090
    change := MethodCategoryChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5091
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5092
	className:className
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5093
	selector:methodSelector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5094
	category:category.
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5095
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5096
    self addChange:change.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5097
    ^ true
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5098
!
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5099
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5100
processChange
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5101
    "given a parse-tree (from parsing some changes source/chunk),
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5102
     create changes and evaluate changeAction on each.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5103
     The block is invoked with the change and a lineNumberOrNil as
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5104
     arg; the lineNumber is only valid, if the underlying stream
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5105
     provides line-numbers; otherwise, nil is passed."
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5106
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5107
    (selector == #'categoriesForClass') ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5108
	^ self handleCategoriesForClass.
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5109
    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5110
    (selector == #'categoriesFor:') ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5111
	^ self handleCategoriesForMethod.
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5112
    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5113
    selector == #'subclass:instanceVariableNames:classVariableNames:poolDictionaries:classInstanceVariableNames:' ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  5114
	^ self handleClassDefinitionChange.
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5115
    ].
2179
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
  5116
"/    selector == #'guid:' ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
  5117
"/        ^ self handleGUIDChange.
Claus Gittinger <cg@exept.de>
parents: 2160
diff changeset
  5118
"/    ].
1182
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5119
    ^ super processChange
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5120
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5121
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5122
"/    selector == #named:superclass:indexedInstanceVariables:instanceVariableNames:classVariableNames:sharedPools:classInstanceVariableNames: ifTrue:[
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5123
"/        ^ self handleClassDefinitionChange.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5124
"/    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5125
"/    (selector == #'key:value:') ifTrue:[
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5126
"/        (self checkReceiverIsGlobalNamed:'Annotation') ifTrue:[
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5127
"/            ^ self handleAnnotation.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5128
"/        ]
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5129
"/    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5130
"/    selector == #'method' ifTrue:[
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5131
"/        ^ self handleMethodChange:false.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5132
"/    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5133
"/    selector == #'classMethod' ifTrue:[
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5134
"/        ^ self handleMethodChange:true.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5135
"/    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5136
"/
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5137
"/    selector == #'initializer' ifTrue:[
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5138
"/        ^ true
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5139
"/    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5140
"/    selector == #'initialize' ifTrue:[
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5141
"/        ^ true
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5142
"/    ].
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5143
"/self halt.
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5144
"/
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5145
"/    ^ false
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5146
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5147
    "Created: / 16.2.1998 / 13:42:40 / cg"
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5148
    "Modified: / 15.12.1999 / 00:29:06 / cg"
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5149
! !
5963a5799b4e dolphin pac-file reading
Claus Gittinger <cg@exept.de>
parents: 1181
diff changeset
  5150
4397
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5151
!ChangeSet::GNUSmalltalkFileReader class methodsFor:'documentation'!
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5152
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5153
documentation
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5154
"
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5155
    documentation to be added.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5156
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5157
    [author:]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5158
        Claus Gittinger
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5159
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5160
    [instance variables:]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5161
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5162
    [class variables:]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5163
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5164
    [see also:]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5165
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5166
"
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5167
! !
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5168
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5169
!ChangeSet::GNUSmalltalkFileReader methodsFor:'private'!
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5170
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5171
readClass
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5172
    |classDefinition classCategory classComment k 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5173
     newClassName superClassName instVars 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5174
     methodStartPos methodEndPos methodSpecStartPos methodSpecEndPos
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5175
     methodClassName
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5176
     methodSpecSource methodSource|
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5177
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5178
    parser := Parser new.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5179
    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5180
    parser source:inputStream.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5181
    parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5182
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5183
    "/ expect a subclass definition of the form:
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5184
    "/ <identifier> subclass: <identifier>
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5185
    classDefinition := parser keywordExpression.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5186
    (classDefinition isMessage
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5187
    and:[ #( #'subclass:' ) includes:classDefinition selector ]) ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5188
        parser parseError:'class definition message expected (id subclass: id)'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5189
    ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5190
    classDefinition receiver isVariable ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5191
        parser parseError:'invalid superclass in class definition'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5192
    ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5193
    superClassName := classDefinition receiver name.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5194
    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5195
    "/ GNU uses plain name for the new class - we need a symbol
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5196
    classDefinition arg1 isVariable ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5197
        parser parseError:'invalid classname in class definition'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5198
    ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5199
    newClassName := classDefinition arg1 name.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5200
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5201
    classDefinition arguments 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5202
        at:1 put:(ConstantNode value:classDefinition arg1 name asSymbol).
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5203
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5204
    parser tokenType == $[ ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5205
        parser parseError:'"[" expected (class definition)'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5206
    ].    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5207
    parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5208
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5209
    [(parser tokenType == #BinaryOperator) and:[parser token = '<']] whileTrue:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5210
        parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5211
        k := parser token.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5212
        ( #('category:' 'comment:') includes: k) ifTrue:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5213
            parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5214
            (parser tokenType == #String) ifTrue:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5215
                k = 'category:' ifTrue:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5216
                    classCategory := parser token.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5217
                ] ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5218
                    classComment := parser token.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5219
                ].    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5220
                parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5221
                (parser token = '>') ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5222
                    parser parseError:'">" expected'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5223
                ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5224
                parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5225
            ] ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5226
self halt. 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5227
            ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5228
        ] ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5229
            self halt.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5230
        ].    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5231
    ].    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5232
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5233
    instVars := OrderedCollection new.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5234
    "/ instvar definition?
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5235
    parser tokenType == $| ifTrue:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5236
        parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5237
        [ parser tokenType == $| ] whileFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5238
            parser tokenType == #Identifier ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5239
                parser parseError:'identifier expected (in instvar list)'.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5240
            ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5241
            instVars add:parser token.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5242
            parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5243
        ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5244
        parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5245
    ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5246
    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5247
    self addChange:(ClassDefinitionChange new
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5248
                        className:newClassName;
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5249
                        superClassName:superClassName;
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5250
                        instanceVariableString:(instVars asStringWith:' ');
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5251
                        category:(classCategory ? 'GNU classes');
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5252
                        yourself).
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5253
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5254
    classComment notNil ifTrue:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5255
        self addChange:(ClassCommentChange new 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5256
                            className:newClassName;
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5257
                            comment:classComment;
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5258
                            yourself)
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5259
    ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5260
    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5261
    "/ methods
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5262
    [ parser tokenType == $] ] whileFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5263
        "/ must be
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5264
        "/     ( NewClassName | NewClassName "class" ) methodSpec
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5265
        "/ or 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5266
        "/     methodSpec
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5267
        methodClassName := newClassName.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5268
        
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5269
        (parser tokenType == #Identifier 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5270
        and:[ parser token = newClassName ]) ifTrue:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5271
            parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5272
            (parser tokenType == #Identifier 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5273
            and:[ parser token = 'class' ]) ifTrue:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5274
                parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5275
                methodClassName := methodClassName,' class'.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5276
            ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5277
            "/ expect >>
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5278
            (parser tokenType == #BinaryOperator
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5279
            and:[parser token = '>>']) ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5280
                parser parseError:('">>" expected').
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5281
            ].    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5282
            parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5283
        ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5284
        
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5285
        methodSpecStartPos := parser tokenPosition.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5286
        parser parseMethodSpec.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5287
        methodSpecEndPos := parser tokenPosition-1.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5288
        methodSpecSource := inputStream collection copyFrom:methodSpecStartPos to:methodSpecEndPos.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5289
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5290
        parser tokenType == $[ ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5291
            parser parseError:'"[" expected (method definition)'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5292
        ]. 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5293
        parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5294
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5295
        methodStartPos := parser tokenPosition.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5296
        parser parseMethodBody.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5297
        methodEndPos := parser tokenPosition-1.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5298
        methodSource := inputStream collection copyFrom:methodStartPos to:methodEndPos.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5299
        
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5300
        parser tokenType == $] ifFalse:[
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5301
            parser parseError:'"]" expected (method definition)'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5302
        ].    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5303
        parser nextToken.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5304
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5305
        self addChange:(MethodDefinitionChange
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5306
                            className:methodClassName
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5307
                            selector:parser selector
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5308
                            source:(methodSpecSource,Character cr,methodSource)
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5309
                            category:'* uncategorized GNU *')
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5310
    ].    
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5311
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5312
"<<END
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5313
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5314
     ChangeSet fromGNUSmalltalkStream:'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5315
Object subclass: Polynomial [
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5316
  <category: ''Math''>
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5317
  |coeffs|
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5318
  Polynomial class >> new [ ^ super basicNew init ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5319
  init [ coeffs := OrderedCollection new. ^ self ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5320
  Polynomial class >> newWithCoefficients: coefficients [
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5321
    |r|
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5322
    r := super basicNew.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5323
    ^ r initWithCoefficients: coefficients
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5324
  ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5325
  initWithCoefficients: coefficients [ 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5326
    coeffs := coefficients asOrderedCollection.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5327
    ^ self
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5328
  ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5329
  / denominator [ |n q|
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5330
    n := self deepCopy.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5331
    self >= denominator
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5332
      ifTrue: [
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5333
        q := Polynomial new.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5334
        [ n >= denominator ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5335
          whileTrue: [ |piv|
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5336
            piv := (n coeff: 0) / (denominator coeff: 0).
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5337
            q addCoefficient: piv.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5338
            n := n - (denominator * piv).
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5339
            n clean
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5340
          ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5341
        ^ { q . (n degree) > 0 ifTrue: [ n ] ifFalse: [ n addCoefficient: 0. n ] }
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5342
      ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5343
      ifFalse: [
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5344
        ^ { Polynomial newWithCoefficients: #( 0 ) . self deepCopy }
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5345
      ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5346
  ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5347
  * constant [ |r| r := self deepCopy.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5348
    1 to: (coeffs size) do: [ :i |
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5349
      r at: i put: ((r at: i) * constant)
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5350
    ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5351
    ^ r
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5352
  ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5353
  at: index [ ^ coeffs at: index ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5354
  at: index put: obj [ ^ coeffs at: index put: obj ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5355
  >= anotherPoly [
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5356
    ^ (self degree) >= (anotherPoly degree)
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5357
  ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5358
  degree [ ^ coeffs size ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5359
  - anotherPoly [ "This is not a real subtraction between Polynomial: it is an
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5360
                   internal method ..."
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5361
    |a|
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5362
    a := self deepCopy.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5363
    1 to: ( (coeffs size) min: (anotherPoly degree) ) do: [ :i |
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5364
      a at: i put: ( (a at: i) - (anotherPoly at: i) )
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5365
    ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5366
    ^ a
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5367
  ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5368
  coeff: index [ ^ coeffs at: (index + 1) ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5369
  addCoefficient: coeff [ coeffs add: coeff ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5370
  clean [
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5371
    [ (coeffs size) > 0
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5372
        ifTrue: [ (coeffs at: 1) = 0 ] ifFalse: [ false ] ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5373
      whileTrue: [ coeffs removeFirst ].
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5374
  ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5375
  display [
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5376
    1 to: (coeffs size) do: [ :i | 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5377
      (coeffs at: i) display.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5378
      i < (coeffs size)
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5379
        ifTrue: [ (''x^%1 + '' % {(coeffs size) - i} ) display ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5380
    ] 
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5381
  ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5382
  displayNl [ self display. Character nl display ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5383
].' readStream
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5384
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5385
END>>"
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5386
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5387
    "Created: / 10-02-2019 / 16:21:15 / Claus Gittinger"
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5388
    "Modified: / 10-02-2019 / 23:17:42 / Claus Gittinger"
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5389
! !
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5390
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5391
!ChangeSet::GNUSmalltalkFileReader methodsFor:'reading'!
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5392
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5393
changesFromStream:aStream for:changeSetArg do:changeActionArg
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5394
    inputStream := aStream.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5395
    changeSet := changeSetArg.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5396
    changeAction := changeActionArg.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5397
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5398
    self readClass.
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5399
    ^ changeSet
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5400
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5401
    "
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5402
     ChangeSet fromGNUSmalltalkStream:'
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5403
Object subclass: Polynomial [
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5404
  |coeffs|
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5405
  Polynomial class >> new [ ^ super basicNew init ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5406
  init [ coeffs := OrderedCollection new. ^ self ]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5407
]
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5408
' readStream
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5409
    "
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5410
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5411
    "Created: / 10-02-2019 / 16:20:21 / Claus Gittinger"
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5412
    "Modified: / 10-02-2019 / 22:48:34 / Claus Gittinger"
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5413
! !
7c728af1ad07 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4385
diff changeset
  5414
4428
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5415
!ChangeSet::GithubPharoSmalltalkFileReader class methodsFor:'documentation'!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5416
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5417
documentation
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5418
"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5419
     ChangeSet fromGithubPharoSmalltalkStream:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5420
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsBridgeTest/PjBasicTest.class.st'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5421
             asFilename readStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5422
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5423
     ChangeSet fromGithubPharoSmalltalkStream:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5424
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5425
             asFilename readStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5426
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5427
     |dir|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5428
     dir := '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries' asFilename. 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5429
     dir filesMatchingGLOB:'*.st' do:[:eachSTFile |
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5430
         Transcript showCR:'reading %1' with:eachSTFile baseName.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5431
         eachSTFile readingFileDo:[:s | 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5432
            ChangeSet fromGithubPharoSmalltalkStream:s
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5433
         ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5434
     ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5435
"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5436
! !
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5437
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5438
!ChangeSet::GithubPharoSmalltalkFileReader methodsFor:'private'!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5439
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5440
readClassDefinition:what
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5441
    "what is either #class or #trait.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5442
     'Class/Trait' '{' has been read.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5443
     read the class definition proper"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5444
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5445
    |name superClassName classType pools category 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5446
     traits classTraits instVarNames classVarNames classInstVarNames 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5447
     classDefChange traitDefChange|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5448
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5449
    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5450
    [parser token == $} ] whileFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5451
        |keyw|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5452
        
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5453
        parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5454
            parser parseError:'class definition keyword symbol expected (eg. #name)'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5455
        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5456
        keyw := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5457
        parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5458
        parser expectToken:$:.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5459
        
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5460
        keyw == #name ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5461
            parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5462
                parser parseError:'class name symbol expected (eg. #name : #className)'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5463
            ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5464
            name := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5465
            parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5466
        ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5467
            keyw == #superclass ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5468
                parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5469
                    parser parseError:'superclass name symbol expected (eg. #superclass : #className)'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5470
                ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5471
                superClassName := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5472
                parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5473
            ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5474
                keyw == #category ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5475
                    parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5476
                        parser parseError:'category symbol expected (eg. #category : #categoryName)'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5477
                    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5478
                    category := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5479
                    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5480
                ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5481
                    keyw == #type ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5482
                        parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5483
                            parser parseError:'category symbol expected (eg. #category : #categoryName)'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5484
                        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5485
                        classType := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5486
                        parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5487
                    ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5488
                        keyw == #pools ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5489
                            parser tokenType == $[ ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5490
                                parser parseError:'pools collection expected (eg. #pools : [ ... ]'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5491
                            ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5492
                            pools := self readStringList.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5493
                        ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5494
                            keyw == #traits ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5495
                                parser tokenType == #String ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5496
                                    parser parseError:'traits string expected'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5497
                                ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5498
                                traits := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5499
                                parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5500
                            ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5501
                                keyw == #classTraits ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5502
                                    parser tokenType == #String ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5503
                                        parser parseError:'classTraits string expected'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5504
                                    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5505
                                    classTraits := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5506
                                    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5507
                                ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5508
                                    keyw == #instVars ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5509
                                        parser tokenType == $[ ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5510
                                            parser parseError:'instVarNames collection expected (eg. #instVars : [ ... ]'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5511
                                        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5512
                                        instVarNames := self readStringList
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5513
                                    ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5514
                                        keyw == #classVars ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5515
                                            parser tokenType == $[ ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5516
                                                parser parseError:'classVars collection expected (eg. #instVars : [ ... ]'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5517
                                            ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5518
                                            classVarNames := self readStringList
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5519
                                        ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5520
                                            keyw == #classInstVars ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5521
                                                parser tokenType == $[ ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5522
                                                    parser parseError:'classInstVars collection expected (eg. #instVars : [ ... ]'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5523
                                                ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5524
                                                classInstVarNames := self readStringList
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5525
                                            ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5526
                                                self halt.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5527
                                            ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5528
                                        ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5529
                                    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5530
                                ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5531
                            ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5532
                        ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5533
                    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5534
                ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5535
            ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5536
        ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5537
        parser token = ',' ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5538
            parser nextToken
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5539
        ].                
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5540
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5541
    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5542
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5543
    what == #class ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5544
        classDefChange := ClassDefinitionChange new.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5545
        classDefChange className:name.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5546
        classDefChange superClassName:superClassName.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5547
        "/ classDefChange instanceVariableString:(instVars asStringWith:' ').
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5548
        classDefChange category:(category ? 'Pharo classes').
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5549
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5550
        self addChange:classDefChange.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5551
    ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5552
        what == #trait ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5553
            traitDefChange := TraitDefinitionChange new.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5554
            traitDefChange className:name.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5555
            traitDefChange category:(category ? 'Pharo traits').
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5556
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5557
            self addChange:traitDefChange.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5558
        ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5559
            self halt.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5560
        ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5561
    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5562
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5563
    parser atEnd ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5564
        self readMethods:what.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5565
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5566
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5567
    "
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5568
     self fromGithubPharoSmalltalkStream:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5569
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsBridgeTest/PjBasicTest.class.st'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5570
             asFilename readStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5571
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5572
     self fromGithubPharoSmalltalkStream:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5573
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5574
             asFilename readStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5575
    "
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5576
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5577
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5578
"/    "/ expect a subclass definition of the form:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5579
"/    "/ <identifier> subclass: <identifier>
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5580
"/    classDefinition := parser keywordExpression.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5581
"/    (classDefinition isMessage
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5582
"/    and:[ #( #'subclass:' ) includes:classDefinition selector ]) ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5583
"/        parser parseError:'class definition message expected (id subclass: id)'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5584
"/    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5585
"/    classDefinition receiver isVariable ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5586
"/        parser parseError:'invalid superclass in class definition'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5587
"/    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5588
"/    superClassName := classDefinition receiver name.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5589
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5590
"/    "/ GNU uses plain name for the new class - we need a symbol
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5591
"/    classDefinition arg1 isVariable ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5592
"/        parser parseError:'invalid classname in class definition'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5593
"/    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5594
"/    newClassName := classDefinition arg1 name.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5595
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5596
"/    classDefinition arguments 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5597
"/        at:1 put:(ConstantNode value:classDefinition arg1 name asSymbol).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5598
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5599
"/    parser tokenType == $[ ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5600
"/        parser parseError:'"[" expected (class definition)'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5601
"/    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5602
"/    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5603
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5604
"/    [(parser tokenType == #BinaryOperator) and:[parser token = '<']] whileTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5605
"/        parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5606
"/        k := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5607
"/        ( #('category:' 'comment:') includes: k) ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5608
"/            parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5609
"/            (parser tokenType == #String) ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5610
"/                k = 'category:' ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5611
"/                    classCategory := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5612
"/                ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5613
"/                    classComment := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5614
"/                ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5615
"/                parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5616
"/                (parser token = '>') ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5617
"/                    parser parseError:'">" expected'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5618
"/                ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5619
"/                parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5620
"/            ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5621
"/self halt. 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5622
"/            ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5623
"/        ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5624
"/            self halt.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5625
"/        ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5626
"/    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5627
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5628
"/    instVars := OrderedCollection new.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5629
"/    "/ instvar definition?
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5630
"/    parser tokenType == $| ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5631
"/        parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5632
"/        [ parser tokenType == $| ] whileFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5633
"/            parser tokenType == #Identifier ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5634
"/                parser parseError:'identifier expected (in instvar list)'.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5635
"/            ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5636
"/            instVars add:parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5637
"/            parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5638
"/        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5639
"/        parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5640
"/    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5641
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5642
"/    self addChange:(ClassDefinitionChange new
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5643
"/                        className:newClassName;
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5644
"/                        superClassName:superClassName;
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5645
"/                        instanceVariableString:(instVars asStringWith:' ');
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5646
"/                        category:(classCategory ? 'GNU classes');
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5647
"/                        yourself).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5648
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5649
"/    classComment notNil ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5650
"/        self addChange:(ClassCommentChange new 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5651
"/                            className:newClassName;
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5652
"/                            comment:classComment;
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5653
"/                            yourself)
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5654
"/    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5655
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5656
"/    "/ methods
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5657
"/    [ parser tokenType == $] ] whileFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5658
"/        "/ must be
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5659
"/        "/     ( NewClassName | NewClassName "class" ) methodSpec
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5660
"/        "/ or 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5661
"/        "/     methodSpec
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5662
"/        methodClassName := newClassName.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5663
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5664
"/        (parser tokenType == #Identifier 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5665
"/        and:[ parser token = newClassName ]) ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5666
"/            parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5667
"/            (parser tokenType == #Identifier 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5668
"/            and:[ parser token = 'class' ]) ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5669
"/                parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5670
"/                methodClassName := methodClassName,' class'.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5671
"/            ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5672
"/            "/ expect >>
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5673
"/            (parser tokenType == #BinaryOperator
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5674
"/            and:[parser token = '>>']) ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5675
"/                parser parseError:('">>" expected').
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5676
"/            ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5677
"/            parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5678
"/        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5679
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5680
"/        methodSpecStartPos := parser tokenPosition.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5681
"/        parser parseMethodSpec.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5682
"/        methodSpecEndPos := parser tokenPosition-1.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5683
"/        methodSpecSource := inputStream collection copyFrom:methodSpecStartPos to:methodSpecEndPos.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5684
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5685
"/        parser tokenType == $[ ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5686
"/            parser parseError:'"[" expected (method definition)'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5687
"/        ]. 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5688
"/        parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5689
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5690
"/        methodStartPos := parser tokenPosition.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5691
"/        parser parseMethodBody.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5692
"/        methodEndPos := parser tokenPosition-1.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5693
"/        methodSource := inputStream collection copyFrom:methodStartPos to:methodEndPos.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5694
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5695
"/        parser tokenType == $] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5696
"/            parser parseError:'"]" expected (method definition)'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5697
"/        ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5698
"/        parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5699
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5700
"/        self addChange:(MethodDefinitionChange
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5701
"/                            className:methodClassName
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5702
"/                            selector:parser selector
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5703
"/                            source:(methodSpecSource,Character cr,methodSource)
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5704
"/                            category:'* uncategorized GNU *')
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5705
"/    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5706
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5707
"/"<<END
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5708
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5709
"/     ChangeSet fromGNUSmalltalkStream:'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5710
"/Object subclass: Polynomial [
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5711
"/  <category: ''Math''>
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5712
"/  |coeffs|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5713
"/  Polynomial class >> new [ ^ super basicNew init ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5714
"/  init [ coeffs := OrderedCollection new. ^ self ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5715
"/  Polynomial class >> newWithCoefficients: coefficients [
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5716
"/    |r|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5717
"/    r := super basicNew.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5718
"/    ^ r initWithCoefficients: coefficients
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5719
"/  ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5720
"/  initWithCoefficients: coefficients [ 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5721
"/    coeffs := coefficients asOrderedCollection.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5722
"/    ^ self
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5723
"/  ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5724
"/  / denominator [ |n q|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5725
"/    n := self deepCopy.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5726
"/    self >= denominator
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5727
"/      ifTrue: [
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5728
"/        q := Polynomial new.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5729
"/        [ n >= denominator ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5730
"/          whileTrue: [ |piv|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5731
"/            piv := (n coeff: 0) / (denominator coeff: 0).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5732
"/            q addCoefficient: piv.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5733
"/            n := n - (denominator * piv).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5734
"/            n clean
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5735
"/          ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5736
"/        ^ { q . (n degree) > 0 ifTrue: [ n ] ifFalse: [ n addCoefficient: 0. n ] }
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5737
"/      ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5738
"/      ifFalse: [
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5739
"/        ^ { Polynomial newWithCoefficients: #( 0 ) . self deepCopy }
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5740
"/      ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5741
"/  ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5742
"/  * constant [ |r| r := self deepCopy.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5743
"/    1 to: (coeffs size) do: [ :i |
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5744
"/      r at: i put: ((r at: i) * constant)
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5745
"/    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5746
"/    ^ r
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5747
"/  ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5748
"/  at: index [ ^ coeffs at: index ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5749
"/  at: index put: obj [ ^ coeffs at: index put: obj ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5750
"/  >= anotherPoly [
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5751
"/    ^ (self degree) >= (anotherPoly degree)
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5752
"/  ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5753
"/  degree [ ^ coeffs size ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5754
"/  - anotherPoly [ "This is not a real subtraction between Polynomial: it is an
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5755
"/                   internal method ..."
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5756
"/    |a|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5757
"/    a := self deepCopy.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5758
"/    1 to: ( (coeffs size) min: (anotherPoly degree) ) do: [ :i |
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5759
"/      a at: i put: ( (a at: i) - (anotherPoly at: i) )
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5760
"/    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5761
"/    ^ a
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5762
"/  ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5763
"/  coeff: index [ ^ coeffs at: (index + 1) ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5764
"/  addCoefficient: coeff [ coeffs add: coeff ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5765
"/  clean [
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5766
"/    [ (coeffs size) > 0
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5767
"/        ifTrue: [ (coeffs at: 1) = 0 ] ifFalse: [ false ] ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5768
"/      whileTrue: [ coeffs removeFirst ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5769
"/  ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5770
"/  display [
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5771
"/    1 to: (coeffs size) do: [ :i | 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5772
"/      (coeffs at: i) display.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5773
"/      i < (coeffs size)
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5774
"/        ifTrue: [ (''x^%1 + '' % {(coeffs size) - i} ) display ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5775
"/    ] 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5776
"/  ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5777
"/  displayNl [ self display. Character nl display ]
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5778
"/].' readStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5779
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5780
"/END>>"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5781
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5782
"/    "Created: / 10-02-2019 / 16:21:15 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5783
"/
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5784
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5785
    "Created: / 26-05-2019 / 01:24:29 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5786
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5787
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5788
readClassFile
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5789
    parser nextToken. "/ skip over 'Class' 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5790
    parser token == ${ ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5791
        parser parseError:'"{" expected after Class keyword'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5792
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5793
    self readClassDefinition:#class.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5794
    self assert:(parser atEnd).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5795
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5796
    "Created: / 25-05-2019 / 22:58:09 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5797
    "Modified: / 26-05-2019 / 01:23:35 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5798
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5799
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5800
readClassOrExtensionFile
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5801
    parser := Parser new.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5802
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5803
    parser source:inputStream.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5804
    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5805
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5806
    "/ file starts with one of:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5807
    "/     Class { ... }
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5808
    "/     Extension
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5809
    parser token = 'Class' ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5810
        self readClassFile.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5811
        ^ self.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5812
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5813
    parser token = 'Extension' ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5814
        self readExtensionFile.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5815
        ^ self.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5816
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5817
    parser token = 'Package' ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5818
        self readPackageFile.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5819
        ^ self.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5820
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5821
    parser token = 'Trait' ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5822
        self readTraitFile.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5823
        ^ self.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5824
    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5825
    self halt.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5826
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5827
    "Created: / 25-05-2019 / 23:17:40 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5828
    "Modified: / 26-05-2019 / 01:24:50 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5829
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5830
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5831
readExtensionFile
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5832
    |keyw className|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5833
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5834
    parser nextToken. "/ skip over 'Extension'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5835
    parser expectToken:${.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5836
    parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5837
        parser parseError:'"#name" expected after "Extension {"'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5838
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5839
    keyw := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5840
    parser nextToken. "/ skip over keyword
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5841
    parser expectToken:$:.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5842
    keyw == #name ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5843
        parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5844
            parser parseError:'classname expected after "#name :"'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5845
        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5846
        className := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5847
        parser nextToken. "/ skip over class name
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5848
    ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5849
        self halt
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5850
    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5851
    parser expectToken:$}.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5852
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5853
    self readMethods:#class.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5854
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5855
    "Created: / 25-05-2019 / 23:16:52 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5856
    "Modified: / 26-05-2019 / 01:29:47 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5857
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5858
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5859
readMethod:what
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5860
    |keyw methodClassName category originalSource methodSource methodSourceStream s change|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5861
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5862
    parser token == ${ ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5863
        parser nextToken. "/ skip over '{'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5864
        (parser tokenType == #Symbol) ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5865
            parser parseError:'keyword symbol expected after " {"'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5866
        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5867
        keyw := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5868
        
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5869
        parser nextToken. "/ skip over keyword
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5870
        parser expectToken:$:.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5871
        keyw == #category ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5872
            parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5873
                parser parseError:'classname expected after "#name :"'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5874
            ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5875
            category := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5876
            parser nextToken. "/ skip over category name
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5877
        ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5878
            self halt
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5879
        ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5880
        
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5881
        parser expectToken:$}.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5882
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5883
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5884
    parser tokenType == #Identifier ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5885
        parser parseError:'method class name expected'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5886
    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5887
    methodClassName := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5888
    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5889
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5890
    parser token = 'class' ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5891
        self assert:(what == #class).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5892
        methodClassName := methodClassName,' class'.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5893
        parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5894
    ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5895
        parser token = 'classSide' ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5896
            self assert:(what == #trait).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5897
            methodClassName := methodClassName,' class'.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5898
            parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5899
        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5900
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5901
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5902
    parser token = '>>' ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5903
        parser parseError:'">>" expected after class name'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5904
    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5905
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5906
    originalSource := parser sourceStream.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5907
    methodSourceStream := WriteStream on:(String new:20).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5908
    s := CollectingReadStream 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5909
            on:originalSource
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5910
            collecting:[:each | methodSourceStream nextPut:each].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5911
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5912
    parser setSource:s.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5913
    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5914
    parser parseMethodSpec.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5915
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5916
    "/ skip the last character in the collected source...
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5917
    methodSourceStream skip:-1.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5918
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5919
    parser token == $[ ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5920
        parser parseError:'"[" expected after method spec'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5921
    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5922
    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5923
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5924
    parser parseMethodBody.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5925
    parser setSource:originalSource.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5926
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5927
    "/ skip the last character in the collected source...
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5928
    methodSourceStream skip:-1.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5929
    parser token == $] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5930
        parser parseError:'"]" expected after method'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5931
    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5932
    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5933
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5934
    methodSource := methodSourceStream contents.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5935
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5936
    methodSource := methodSource withoutLeadingSeparators.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5937
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5938
    change := MethodDefinitionChange
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5939
                            className:methodClassName
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5940
                            selector:parser selector
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5941
                            source:methodSource
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5942
                            category:category.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5943
    self addChange:change
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5944
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5945
    "Created: / 26-05-2019 / 01:29:00 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5946
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5947
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5948
readMethods:what
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5949
    [
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5950
        self readMethod:what.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5951
    ] doUntil:[ parser sourceStream atEnd ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5952
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5953
    "Created: / 26-05-2019 / 01:29:11 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5954
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5955
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5956
readPackageFile
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5957
    |keyw packageName|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5958
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5959
    parser nextToken. "/ skip over 'Package'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5960
    parser expectToken:${.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5961
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5962
    parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5963
        parser parseError:'"#name" expected after "Extension {"'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5964
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5965
    keyw := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5966
    parser nextToken. "/ skip over keyword
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5967
    parser expectToken:$:.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5968
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5969
    keyw == #name ifTrue:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5970
        parser tokenType == #Symbol ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5971
            parser parseError:'classname expected after "#name :"'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5972
        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5973
        packageName := parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5974
        parser nextToken. "/ skip over class name
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5975
    ] ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5976
        self halt
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5977
    ].    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5978
    parser expectToken:$}.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5979
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5980
    "Created: / 26-05-2019 / 00:18:30 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5981
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5982
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5983
readPools
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5984
    "'pools' ':' '[' has been read.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5985
     read the pools list"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5986
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5987
    ^ self readStringList
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5988
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5989
    "
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5990
     ChangeSet fromGithubPharoSmalltalkStream:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5991
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5992
             asFilename readStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5993
    "
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5994
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5995
    "Created: / 25-05-2019 / 23:11:52 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5996
    "Modified: / 26-05-2019 / 01:16:38 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5997
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5998
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  5999
readStringList
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6000
    "'[' has been read.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6001
     read a list of strings"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6002
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6003
    |strings|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6004
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6005
    self assert:(parser tokenType == $[).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6006
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6007
    parser nextToken. "/ skip over initial "["
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6008
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6009
    strings := OrderedCollection new.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6010
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6011
    [parser token == $] ] whileFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6012
        |keyw|
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6013
        
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6014
        parser tokenType == #String ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6015
            parser parseError:'string expected'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6016
        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6017
        strings add:parser token.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6018
        parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6019
        parser token = ',' ifTrue:[  
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6020
            parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6021
        ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6022
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6023
    parser nextToken.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6024
    ^ strings
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6025
    
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6026
    "
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6027
     ChangeSet fromGithubPharoSmalltalkStream:
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6028
         '/Users/cg/Downloads/smalltalk/PharoJS-master/Pharo/PharoJsCoreLibraries/PjStack.class.st'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6029
             asFilename readStream
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6030
    "
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6031
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6032
    "Created: / 26-05-2019 / 01:16:27 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6033
!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6034
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6035
readTraitFile
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6036
    parser nextToken. "/ skip over 'Class' 
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6037
    parser token == ${ ifFalse:[
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6038
        parser parseError:'"{" expected after Class keyword'
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6039
    ].
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6040
    self readClassDefinition:#trait.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6041
    self assert:(parser atEnd).
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6042
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6043
    "Created: / 26-05-2019 / 01:23:19 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6044
! !
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6045
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6046
!ChangeSet::GithubPharoSmalltalkFileReader methodsFor:'reading'!
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6047
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6048
changesFromStream:aStream for:changeSetArg do:changeActionArg
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6049
    inputStream := aStream.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6050
    changeSet := changeSetArg.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6051
    changeAction := changeActionArg.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6052
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6053
    self readClassOrExtensionFile.
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6054
    ^ changeSet
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6055
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6056
    "Created: / 10-02-2019 / 16:20:21 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6057
    "Modified: / 25-05-2019 / 23:17:46 / Claus Gittinger"
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6058
! !
ad02ce323f29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4417
diff changeset
  6059
3576
e188540a0549 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3575
diff changeset
  6060
!ChangeSet::InvalidChangeChunkError class methodsFor:'queries'!
e188540a0549 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3575
diff changeset
  6061
e188540a0549 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3575
diff changeset
  6062
mayProceed
e188540a0549 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3575
diff changeset
  6063
    ^ true
e188540a0549 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3575
diff changeset
  6064
! !
e188540a0549 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3575
diff changeset
  6065
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6066
!ChangeSet::SIFChangeFileReader methodsFor:'reading-private'!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6067
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6068
handleAnnotation
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6069
    |key value lastChange change|
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6070
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6071
    key := (arguments at:1) evaluate.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6072
    value := (arguments at:2) evaluate.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6073
1422
6871068da880 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1421
diff changeset
  6074
    key = 'Prerequisite' ifTrue:[
6871068da880 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1421
diff changeset
  6075
"/        change := SIFPrerequisiteChange new prerequisiteFileName:value.
6871068da880 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1421
diff changeset
  6076
"/        self addChange:change.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6077
	^ true
1422
6871068da880 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1421
diff changeset
  6078
    ].
6871068da880 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1421
diff changeset
  6079
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6080
    lastChange := changeSet last.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6081
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6082
    key = 'package' ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6083
	change := ClassCategoryChange new className:(lastChange className) category:value.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6084
	self addChange:change.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6085
	^ true
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6086
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6087
    key = 'category' ifTrue:[
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6088
"/        change := MethodCategoryChange new className:(lastChange className) selector:(lastChange selector) category:value.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6089
"/        self addChange:change.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6090
	lastChange category:value.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6091
	^ true
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6092
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6093
    key = 'stamp' ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6094
	"/ lastChange timeStamp:value.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6095
	^ true
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6096
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6097
    ^ false
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6098
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6099
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6100
handleClassDefinitionChange
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6101
    |nameSpace change|
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6102
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6103
    (self checkReceiverIsGlobalNamed:#Class) ifFalse:[
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  6104
        self proceedableError:'unexpected receiver in classDefinition message'.
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  6105
        ^ false.
1313
8aceccee1eaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1301
diff changeset
  6106
    ].
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6107
    className := (arguments at:1) evaluate.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6108
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6109
    nameSpace := Class nameSpaceQuerySignal query.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6110
    nameSpace ~~ Smalltalk ifTrue:[
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  6111
        className := nameSpace name , '::' , className
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6112
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6113
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6114
    change := ClassDefinitionChange new.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6115
    change className:className; source:(parseTree printString).
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6116
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6117
    change package:(Class packageQuerySignal query).
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6118
    self addChange:change.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6119
    ^ true
4325
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  6120
85103a468e28 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
  6121
    "Modified: / 24-05-2018 / 14:54:45 / Claus Gittinger"
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6122
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6123
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6124
handleMethodChange:isMeta
1188
a4594193f884 Remove unused method variables
Stefan Vogel <sv@exept.de>
parents: 1187
diff changeset
  6125
    |categoryName methodSource change parser |
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6126
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6127
    className := self receiversClassName.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6128
    isMeta ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6129
	className := className , ' class'
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6130
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6131
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6132
    categoryName := 'uncategorized'.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6133
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6134
    inputStream skipSeparators.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6135
    lineNumber := inputStream lineNumber.
3376
a0e06d192df4 class: ChangeSet
Stefan Vogel <sv@exept.de>
parents: 3360
diff changeset
  6136
    position := inputStream position + 1.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6137
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6138
    methodSource := inputStream nextChunk.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6139
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6140
    parser := Parser
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6141
		parseMethodArgAndVarSpecification:methodSource
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6142
		in:nil
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6143
		ignoreErrors:true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6144
		ignoreWarnings:true
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6145
		parseBody:false.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6146
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6147
    parser isNil ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6148
	"/ something wierd ...
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6149
	methodSelector := '????'.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6150
    ] ifFalse:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6151
	methodSelector := parser selector.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6152
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6153
3648
c66bc4f3ee3f class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3646
diff changeset
  6154
    change := MethodDefinitionChange new.
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6155
    change
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6156
	className:className
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6157
	selector:methodSelector
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6158
	source:methodSource
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6159
	category:categoryName
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6160
	privacy:nil.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6161
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6162
    self addChange:change.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6163
    ^ true
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6164
!
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6165
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6166
processChange
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6167
    "given a parse-tree (from parsing some changes source/chunk),
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6168
     create changes and evaluate changeAction on each.
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6169
     The block is invoked with the change and a lineNumberOrNil as
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6170
     arg; the lineNumber is only valid, if the underlying stream
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6171
     provides line-numbers; otherwise, nil is passed."
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6172
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6173
    (selector == #'interchangeVersion:') ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6174
	^ true
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6175
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6176
    selector == #named:superclass:indexedInstanceVariables:instanceVariableNames:classVariableNames:sharedPools:classInstanceVariableNames: ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6177
	^ self handleClassDefinitionChange.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6178
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6179
    (selector == #'key:value:') ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6180
	(self checkReceiverIsGlobalNamed:'Annotation') ifTrue:[
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6181
	    ^ self handleAnnotation.
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6182
	]
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6183
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6184
    selector == #'method' ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6185
	^ self handleMethodChange:false.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6186
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6187
    selector == #'classMethod' ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6188
	^ self handleMethodChange:true.
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6189
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6190
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6191
    selector == #'initializer' ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6192
	^ true
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6193
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6194
    selector == #'initialize' ifTrue:[
3839
e16f2217fc74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3833
diff changeset
  6195
	^ true
1176
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6196
    ].
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6197
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6198
    ^ false
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6199
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6200
    "Created: / 16.2.1998 / 13:42:40 / cg"
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6201
    "Modified: / 15.12.1999 / 00:29:06 / cg"
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6202
! !
6c65f871a3bc added SIF reading
Claus Gittinger <cg@exept.de>
parents: 1174
diff changeset
  6203
625
06f4ed35832b added #patches for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
  6204
!ChangeSet class methodsFor:'documentation'!
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  6205
2868
bee17299d228 changed:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
  6206
version
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  6207
    ^ '$Header$'
2923
fb0a62def59a diffset
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
  6208
!
fb0a62def59a diffset
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
  6209
fb0a62def59a diffset
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
  6210
version_CVS
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  6211
    ^ '$Header$'
3246
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  6212
!
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  6213
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  6214
version_HG
ac9dc57ea097 class: ChangeSet
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3229
diff changeset
  6215
3269
84de19204303 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3248
diff changeset
  6216
    ^ '$Changeset: <not expanded> $'
2868
bee17299d228 changed:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
  6217
!
bee17299d228 changed:
Claus Gittinger <cg@exept.de>
parents: 2867
diff changeset
  6218
2881
ddbb874c0ce2 Merged from SVN, added ClassSourceWriter
vrany
parents: 2868
diff changeset
  6219
version_SVN
3904
060fbc556cf9 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  6220
    ^ '$Id$'
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
  6221
! !
3844
d404026a7a55 class: ChangeSet
Claus Gittinger <cg@exept.de>
parents: 3839
diff changeset
  6222