[Pkg] DeltaStreams: DeltaStreams-Model-mtf.6.mcz
squeak-dev-noreply at lists.squeakfoundation.org
squeak-dev-noreply at lists.squeakfoundation.org
Mon Mar 9 21:39:54 UTC 2009
A new version of DeltaStreams-Model was added to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Model-mtf.6.mcz
==================== Summary ====================
Name: DeltaStreams-Model-mtf.6
Author: mtf
Time: 9 March 2009, 5:39:06 pm
UUID: 678dc17e-7483-4ba2-b4d6-9be91faf85c4
Ancestors: DeltaStreams-Model-gk.5
moved logging methods to DS-Logging
made instance creation more uniform
=============== Diff against DeltaStreams-Model-gk.5 ===============
Item was changed:
+ ----- Method: DSBasicClassChange class>>fromClass: (in category 'instance creation') -----
- ----- Method: DSBasicClassChange class>>fromClass: (in category 'as yet unclassified') -----
fromClass: aClass
+ ^self new
+ fromClass: aClass;
+ yourself!
- ^self new fromClass: aClass; yourself!
Item was changed:
----- Method: DSClassCommentChange>>newComment (in category 'accessing') -----
newComment
+ ^ comment!
- ^comment!
Item was changed:
----- Method: DSBasicClassChange>>fromClass: (in category 'initialize-release') -----
fromClass: aClass
+ self setClass: aClass!
- className := aClass name!
Item was changed:
----- Method: DSClassCommentChange>>newStamp: (in category 'accessing') -----
newStamp: aString
stamp := aString!
Item was changed:
----- Method: DSClassCommentChange>>newStamp (in category 'accessing') -----
newStamp
+ ^ stamp!
- ^stamp!
Item was added:
+ ----- Method: DSClassRemovedChange class>>fromClass: (in category 'instance creation') -----
+ fromClass: aClass
+ "A class was removed from the system. The default change
+ is a composite class deleted change - since it needs to contain
+ all individual changes needed to do a revert. If the resulting
+ composite ends up containing just one change - then that
+ can be used instead - a simple DSClassRemovedChange."
+
+ | change |
+ change := DSCompositeClassDeletedChange fromClass: aClass.
+ ^ change changes size = 1
+ ifTrue: [change changes first]
+ ifFalse: [change]!
Item was added:
+ ----- Method: DSBasicClassChange>>setClass: (in category 'accessing') -----
+ setClass: aClass
+ self className: aClass theNonMetaClass name!
Item was changed:
----- Method: DSCompositeClassDeletedChange>>fromClass: (in category 'initialize-release') -----
fromClass: aClass
"We add changes corresponding to removing every bit individually.
This is mainly in order to be able to do a full revert later."
aClass theNonMetaClass selectors do: [:sel | self
add: (DSMethodRemovedChange fromClass: aClass theNonMetaClass selector: sel)].
aClass theMetaClass selectors do: [:sel | self
add: (DSMethodRemovedChange fromClass: aClass theMetaClass selector: sel)].
+ self add: (DSClassRemovedChange new fromClass: aClass)!
- "This one below looks odd, but recall that we need to be able to do revert and this one is needed then"
- aClass theMetaClass instVarNames isEmpty ifFalse: [self
- add: (DSClassInstVarsChange class: aClass
- from: aClass theMetaClass instVarNames
- to: #())].
-
- aClass hasComment ifTrue: [self
- add: (DSClassCommentChange class: aClass
- from: aClass organization classComment
- to: nil
- oldStamp: aClass organization commentStamp
- newStamp: nil)].
- self add: (DSClassRemovedChange class: aClass)!
Item was changed:
----- Method: DSCompositeClassAddedChange>>fromClass: (in category 'initialize-release') -----
fromClass: aClass
"We add changes corresponding to adding every bit of the class individually.
This change is normally used when adding a class to a Delta manually."
+ self add: (DSClassCreatedChange fromClass: aClass).
- self add: (DSClassCreatedChange class: aClass).
-
- aClass hasComment ifTrue: [self
- add: (DSClassCommentChange class: aClass
- from: nil
- to: aClass organization classComment
- oldStamp: nil
- newStamp: aClass organization commentStamp)].
-
- "This one below looks odd, but recall that we need to be able to do revert and this one is needed then"
- aClass theMetaClass instVarNames isEmpty ifFalse: [self
- add: (DSClassInstVarsChange class: aClass
- from: #()
- to: aClass theMetaClass instVarNames)].
aClass theNonMetaClass selectors do: [:sel | self
add: (DSMethodAddedChange fromClass: aClass theNonMetaClass selector: sel)].
aClass theMetaClass selectors do: [:sel | self
add: (DSMethodAddedChange fromClass: aClass theMetaClass selector: sel)].!
Item was changed:
----- Method: DSClassChange>>fromClass: (in category 'initialize-release') -----
fromClass: aClass
"We extract all needed attributes from the class so that we can recreate it."
+ | class metaclass |
super fromClass: aClass.
+ class := aClass theNonMetaClass.
+ metaclass := aClass theMetaClass.
+
+ self superclassName: class superclass name.
+ self instVarNames: class instVarNames.
+ self classVarNames: class classVarNames asArray.
+ self poolDictionaryNames: class poolDictionaryNames.
+ self category: class category.
+ self type: class typeOfClass.
+ self classInstVarNames: metaclass instVarNames.
+ self comment: class organization classComment.
+ self stamp: class organization commentStamp.!
- self superclassName: aClass superclass name.
- self instVarNames: aClass instVarNames.
- self classVarNames: aClass classVarNames asArray.
- self poolDictionaryNames: aClass poolDictionaryNames.
- self category: aClass category.
- self type: aClass typeOfClass.
- self classInstVarNames: aClass class instVarNames.
- self comment: aClass organization classComment.
- self stamp: aClass organization commentStamp.!
Item was changed:
+ ----- Method: DSBasicClassChange class>>class: (in category 'instance creation') -----
- ----- Method: DSBasicClassChange class>>class: (in category 'as yet unclassified') -----
class: aClass
+ ^ self new
+ setClass: aClass;
+ yourself!
- ^self className: aClass name!
Item was changed:
----- Method: DSClassCommentChange>>newComment: (in category 'accessing') -----
newComment: aString
comment := aString!
Item was changed:
+ ----- Method: DSBasicMethodChange class>>fromClass:selector: (in category 'instance creation') -----
- ----- Method: DSBasicMethodChange class>>fromClass:selector: (in category 'as yet unclassified') -----
fromClass: aClass selector: selector
^ self new fromClass: aClass selector: selector; yourself!
Item was changed:
+ ----- Method: DSBasicClassChange class>>className: (in category 'instance creation') -----
- ----- Method: DSBasicClassChange class>>className: (in category 'as yet unclassified') -----
className: aClassName
+ ^self new
+ className: aClassName;
+ yourself!
- ^self new className: aClassName; yourself!
Item was changed:
----- Method: DSClassCommentChange>>oldComment (in category 'accessing') -----
oldComment
+ ^ oldComment!
- ^oldComment!
Item was changed:
----- Method: DSBasicMethodChange>>setClass: (in category 'convenience') -----
setClass: aClass
+ super setClass: aClass.
- self className: aClass theNonMetaClass name.
self meta: aClass isMeta!
Item was changed:
+ ----- Method: DSBasicMethodChange class>>class:selector: (in category 'instance creation') -----
- ----- Method: DSBasicMethodChange class>>class:selector: (in category 'as yet unclassified') -----
class: aClass selector: selector
+ ^ (self class: aClass)
+ selector: selector;
+ yourself!
- ^ self new class: aClass selector: selector; yourself!
Item was changed:
----- Method: DSClassCommentChange>>oldStamp (in category 'accessing') -----
oldStamp
+ ^ oldStamp!
- ^oldStamp!
Item was changed:
+ ----- Method: DSClassChange class>>className: (in category 'instance creation') -----
- ----- Method: DSClassChange class>>className: (in category 'as yet unclassified') -----
className: aClassName
^self new className: aClassName; initializeFromNone; yourself!
Item was changed:
----- Method: DSCompositeClassChange class>>fromClass: (in category 'as yet unclassified') -----
fromClass: aClass
+ ^ self new
+ fromClass: aClass;
+ yourself!
- ^ self new fromClass: aClass; yourself!
Item was added:
+ ----- Method: Collection>>scanNames (in category '*DeltaStreams-Model') -----
+ scanNames
+ ^ (self collect: [:ea | ea asSymbol]) asArray!
Item was removed:
- ----- Method: SequenceableCollection>>scanNames (in category '*DeltaStreams-Model') -----
- scanNames
- ^ (self collect: [:ea | ea asSymbol]) asArray!
Item was removed:
- ----- Method: DSDelta>>changeClassInstVars:from:to: (in category 'change logging events') -----
- changeClassInstVars: aClass from: oldNames to: newNames
- "Instvars changed."
-
- self from: oldNames to: newNames do: [:old :new |
- self addChange: (DSClassInstVarsChange class: aClass theNonMetaClass from: old to: new)]!
Item was removed:
- ----- Method: DSDelta>>logMethodModifyEvent: (in category 'change logging events') -----
- logMethodModifyEvent: anEvent
- anEvent isProtocolModified ifTrue:
- [self logMethodProtocolEvent: anEvent from: anEvent oldProtocol to: anEvent newProtocol].
- self logMethodSourceEvent: anEvent from: anEvent oldItem to: anEvent item!
Item was removed:
- ----- Method: DSDelta>>createClass: (in category 'change logging events') -----
- createClass: aClass
- "A new class was created."
-
- self addChange: (DSClassCreatedChange class: aClass)!
Item was removed:
- ----- Method: DSBasicMethodChange class>>fromEvent: (in category 'as yet unclassified') -----
- fromEvent: anEvent
- ^ self new
- setClass: anEvent itemClass;
- selector: anEvent itemSelector;
- yourself!
Item was removed:
- ----- Method: DSDelta>>changeSuperclass:from:to: (in category 'change logging events') -----
- changeSuperclass: aClass from: oldSuperclass to: newSuperclass
- "Superclass changed."
-
- self addChange: (DSClassSuperclassChange class: aClass from: oldSuperclass to: newSuperclass)!
Item was removed:
- ----- Method: DSMethodChange class>>fromEvent: (in category 'as yet unclassified') -----
- fromEvent: anEvent
- ^ (super fromEvent: anEvent)
- method: anEvent itemMethod;
- protocol: anEvent itemProtocol;
- yourself!
Item was removed:
- ----- Method: DSDelta>>renameClassFrom:to: (in category 'change logging events') -----
- renameClassFrom: oldName to: newName
- "A class is being renamed."
-
- self addChange: (DSClassNameChange className: oldName to: newName)!
Item was removed:
- ----- Method: DSDelta>>commentClassName:from:to:oldStamp:newStamp: (in category 'change editing') -----
- commentClassName: aName from: oldComment to: newComment oldStamp: oldStamp newStamp: newStamp
- "A class comment has been changed."
-
- self addChange: (DSClassCommentChange
- className: aName
- from: oldComment
- to: newComment
- oldStamp: oldStamp
- newStamp: newStamp)!
Item was removed:
- ----- Method: DSDelta>>categorizeClass:from:to: (in category 'change logging events') -----
- categorizeClass: aClass from: oldCategory to: newCategory
- "Class Category changed."
-
- self addChange: (DSClassCategoryChange class: aClass from: oldCategory to: newCategory)!
Item was removed:
- ----- Method: DSDelta>>logMethodSourceEvent:from:to: (in category 'change logging events') -----
- logMethodSourceEvent: anEvent from: oldMethod to: newMethod
- "A method has new source."
-
- self addChange: (DSMethodSourceChange
- class: anEvent itemClass
- selector: anEvent itemSelector
- from: oldMethod
- to: newMethod)!
Item was removed:
- ----- Method: DSDelta>>changeClassVars:from:to: (in category 'change logging events') -----
- changeClassVars: aClass from: oldNames to: newNames
- "Class vars changed."
-
- self from: oldNames asArray to: newNames asArray do: [:old :new |
- self addChange: (DSClassVarsChange class: aClass from: old to: new)]!
Item was removed:
- ----- Method: DSDelta>>commentClass:from:to:oldStamp:newStamp: (in category 'change logging events') -----
- commentClass: aClass from: oldComment to: newComment oldStamp: oldStamp newStamp: newStamp
- "A class comment has been changed."
-
- self addChange: (DSClassCommentChange
- class: aClass
- from: oldComment
- to: newComment
- oldStamp: oldStamp
- newStamp: newStamp)!
Item was removed:
- ----- Method: DSDelta>>changeClassType:from:to: (in category 'change logging events') -----
- changeClassType: aClass from: oldType to: newType
- "Type of class changed."
-
- self addChange: (DSClassTypeChange class: aClass from: oldType to: newType)!
Item was removed:
- ----- Method: DSDelta>>removeClass: (in category 'change logging events') -----
- removeClass: aClass
- "A class was removed from the system. The default change
- is a composite class deleted change - since it needs to contain
- all individual changes needed to do a revert. If the resulting
- composite ends up containing just one change - then that
- can be used instead - a simple DSClassRemovedChange."
-
- | change |
- change := DSCompositeClassDeletedChange fromClass: aClass.
- self addChange: (change changes size = 1
- ifTrue: [change changes first]
- ifFalse: [change])!
Item was removed:
- ----- Method: DSDelta>>modifyClass:event: (in category 'private') -----
- modifyClass: class event: anEvent
- "A class definition was modified. A lot of changes can be made this way:
- - class type
- - superclass
- - instvars
- - classvars
- - shared pools"
-
- anEvent isTypeModified ifTrue: [
- self changeClassType: class from: anEvent oldTypeOfClass to: anEvent typeOfClass].
-
- anEvent isSuperclassModified ifTrue: [
- self changeSuperclass: class from: anEvent oldSuperclass to: anEvent superclass].
-
- anEvent areInstVarsModified ifTrue: [
- self changeInstVars: class from: anEvent oldInstVarNames to: anEvent instVarNames].
-
- anEvent areClassVarsModified ifTrue: [
- self changeClassVars: class from: anEvent oldClassVarNames to: anEvent classVarNames].
-
- anEvent areSharedPoolsModified ifTrue: [
- self changeSharedPools: class from: anEvent oldItem poolDictionaryNames asArray to: anEvent item poolDictionaryNames asArray]!
Item was removed:
- ----- Method: DSDelta>>logMethodRemovedEvent: (in category 'change logging events') -----
- logMethodRemovedEvent: anEvent
- "A new method was created."
-
- self addChange: (DSMethodRemovedChange fromEvent: anEvent)!
Item was removed:
- ----- Method: DSDelta>>modifyMetaclass:event: (in category 'private') -----
- modifyMetaclass: class event: anEvent
- "A metaclass definition was modified. This basicly just means the class instance variables were changed"
-
- anEvent areInstVarsModified ifTrue: [
- self changeClassInstVars: class theNonMetaClass from: anEvent oldInstVarNames to: anEvent instVarNames]!
Item was removed:
- ----- Method: DSDelta>>reorganizeClass: (in category 'change logging events') -----
- reorganizeClass: aClass!
Item was removed:
- ----- Method: DSClassCommentChange class>>class:from:to:oldStamp:newStamp: (in category 'as yet unclassified') -----
- class: aClass from: oldComment to: newComment oldStamp: oldStamp newStamp: newStamp
- ^(self class: aClass) oldComment: oldComment; newComment: newComment;
- oldStamp: oldStamp; newStamp: newStamp; yourself!
Item was removed:
- ----- Method: DSClassCommentChange class>>className:from:to:oldStamp:newStamp: (in category 'as yet unclassified') -----
- className: aName from: oldComment to: newComment oldStamp: oldStamp newStamp: newStamp
- ^(self className: aName) oldComment: oldComment; newComment: newComment;
- oldStamp: oldStamp; newStamp: newStamp; yourself!
Item was removed:
- ----- Method: DSDelta>>logMethodProtocolEvent:from:to: (in category 'change logging events') -----
- logMethodProtocolEvent: anEvent from: oldProtocol to: newProtocol
- "A method is being categorized under a new protocol."
-
- | selector |
- selector := anEvent itemSelector.
- selector ifNil: [selector := anEvent itemMethod sourceSelector].
- selector ifNil: [selector := anEvent itemMethod selector].
- self addChange: (DSMethodProtocolChange
- class: anEvent itemClass
- selector: selector
- from: oldProtocol
- to: newProtocol)!
Item was removed:
- ----- Method: DSDelta>>from:to:do: (in category 'private') -----
- from: oldNames to: newNames do: aBlock
- "Scan both Strings of names into Arrays (or otherwise presume they are Arrays)
- and evaluate the block with them."
-
- | old new scanner |
- scanner := Scanner new.
- old := oldNames isString
- ifTrue: [scanner scanFieldNames: oldNames]
- ifFalse: [oldNames].
- new := newNames isString
- ifTrue: [scanner scanFieldNames: newNames]
- ifFalse: [newNames].
- ^aBlock value: old value: new!
Item was removed:
- ----- Method: DSDelta>>event: (in category 'private') -----
- event: anEvent
- "This is where events come in from the SystemChangeNotifier.
- This code is similar to the old code in ChangeSet."
-
- | class |
- anEvent itemKind = SystemChangeNotifier classKind ifTrue: [
- class := anEvent item.
- class isBehavior ifFalse: [^ self]. "Ignore traits for now"
- class wantsChangeSetLogging ifFalse: [^self].
- anEvent isAdded ifTrue: [self createClass: class].
- anEvent isRemoved ifTrue: [self removeClass: class].
- anEvent isRenamed ifTrue: [self renameClassFrom: anEvent oldName to: anEvent newName].
- anEvent isCommented ifTrue: [self commentClass: class from: anEvent oldComment to: anEvent newComment oldStamp: anEvent oldStamp newStamp: anEvent newStamp].
- anEvent isModified ifTrue: [class isMeta
- ifTrue: [self modifyMetaclass: class event: anEvent]
- ifFalse: [self modifyClass: class event: anEvent]].
- anEvent isReorganized ifTrue: [self reorganizeClass: anEvent item].
- anEvent isRecategorized ifTrue: [self categorizeClass: anEvent item from: anEvent oldCategory to: anEvent item category].
- ].
-
- anEvent itemKind = SystemChangeNotifier methodKind ifTrue: [
- class := anEvent itemClass.
- class isBehavior ifFalse: [^ self]. "Ignore traits for now"
- class wantsChangeSetLogging ifFalse: [^self].
- anEvent isAdded ifTrue: [self logMethodAddedEvent: anEvent].
- anEvent isRemoved ifTrue: [self logMethodRemovedEvent: anEvent].
- anEvent isRecategorized ifTrue: [self logMethodProtocolEvent: anEvent from: anEvent oldCategory to: anEvent itemProtocol].
- anEvent isModified ifTrue: [self logMethodModifyEvent: anEvent].
- ].!
Item was removed:
- ----- Method: DSClassNameChange class>>className:to: (in category 'as yet unclassified') -----
- className: aName to: newName
- ^(self className: aName) newName: newName; yourself!
Item was removed:
- ----- Method: DSClassNameChange class>>class:to: (in category 'as yet unclassified') -----
- class: aClass to: newName
- ^(self class: aClass) newName: newName; yourself!
Item was removed:
- ----- Method: DSMethodChange class>>fromClass:selector: (in category 'as yet unclassified') -----
- fromClass: aClass selector: selector
- ^ self new fromClass: aClass selector: selector!
Item was removed:
- ----- Method: DSDelta>>logMethodAddedEvent: (in category 'change logging events') -----
- logMethodAddedEvent: anEvent
- "A new method was created."
-
- self addChange: (DSMethodAddedChange fromEvent: anEvent)!
Item was removed:
- ----- Method: DSDelta>>changeSharedPools:from:to: (in category 'change logging events') -----
- changeSharedPools: aClass from: oldNames to: newNames
- "Shared pools changed."
-
- self from: oldNames to: newNames do: [:old :new |
- self addChange: (DSSharedPoolVarsChange class: aClass from: old to: new)]!
Item was removed:
- ----- Method: DSDelta>>changeInstVarsName:from:to: (in category 'change editing') -----
- changeInstVarsName: aName from: oldNames to: newNames
- "Instvars changed."
-
- self from: oldNames to: newNames do: [:old :new |
- self addChange: (DSInstVarsChange className: aName from: old to: new)]!
Item was removed:
- ----- Method: DSDelta>>changeInstVars:from:to: (in category 'change logging events') -----
- changeInstVars: aClass from: oldNames to: newNames
- "Instvars changed."
-
- self from: oldNames to: newNames do: [:old :new |
- self addChange: (DSInstVarsChange class: aClass from: old to: new)]!
More information about the Packages
mailing list