A new version of DeltaStreams-Model was added to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Model-gk.5.mcz
==================== Summary ====================
Name: DeltaStreams-Model-gk.5
Author: gk
Time: 9 March 2009, 9:22:20 pm
UUID: 848edde4-01e9-4a02-94ea-e08d2f76c729
Ancestors: DeltaStreams-Model-mtf.4
- Lots of "self changes" to accommodate new ivar compositeChange in DSDelta.
- Moved code from DSDelta to DSChangeSequence, closer to the changes collection they operate on.
=============== Diff against DeltaStreams-Model-mtf.4 ===============
Item was changed:
----- Method: DSDelta>>isEmpty (in category 'testing') -----
isEmpty
+ ^self changes isEmpty!
- ^changes isEmpty!
Item was added:
+ ----- Method: DSChangeSequence>>removeShadows (in category 'applying') -----
+ removeShadows
+ "Remove all changes that are shadowed (redundant).
+ We go in reverse and remove all changes before
+ each change that it shadows. The logic is all based
+ on #canShadow and #isShadowing:. To make it
+ at least somewhat efficient we nil out the changes
+ and then remove them in one big swoop at the end."
+
+ | candidate change |
+ changes size to: 2 by: -1 do: [:index |
+ change := changes at: index.
+ (change notNil and: [change canShadow]) ifTrue: [
+ index - 1 to: 1 by: -1 do: [:i |
+ candidate := changes at: i.
+ (candidate notNil and: [change isShadowing: candidate])
+ ifTrue: [changes at: i put: nil]]]].
+ changes := changes select: [:each | each notNil]!
Item was added:
+ ----- Method: DSChangeSequence>>moveClassNameChanges (in category 'applying') -----
+ moveClassNameChanges
+ "Move all class name changes to the beginning as if they were made first."
+
+ | nameChanges map |
+ nameChanges := OrderedCollection new.
+ map := Dictionary new.
+ changes reverseDo: [:change |
+ change isClassName
+ ifTrue: [
+ "Is there already a mapping in place?"
+ (map includesKey: change newName)
+ ifTrue: [
+ "Then we remap it using the even older name as key from now on"
+ map at: change oldName put: (map at: change newName).
+ map removeKey: change newName]
+ ifFalse: [
+ "Then we just add a mapping."
+ map at: change oldName put: change newName].
+ nameChanges add: change ]
+ ifFalse: [
+ change remapClassNames: map]].
+ changes removeAll: nameChanges.
+ changes := nameChanges, changes!
Item was changed:
----- Method: DSDelta>>changesMaybeRevertable (in category 'testing') -----
changesMaybeRevertable
"Are all changes per definition revertable
or marked by the developer as being revertable?"
+ ^self changes allSatisfy: [:change | change isMaybeRevertable]!
- ^changes allSatisfy: [:change | change isMaybeRevertable]!
Item was added:
+ ----- Method: DSChangeSequence>>clearChanges (in category 'applying') -----
+ clearChanges
+ "Remove all changes and return them."
+
+ | oldChanges |
+ oldChanges := changes.
+ changes := nil.
+ ^oldChanges!
Item was changed:
----- Method: DSDelta>>uuid: (in category 'initialize-release') -----
uuid: aUUID
super initialize.
uuid := aUUID.
changeCounter := 0.
- changes := OrderedCollection new.
notRevertable := false
!
Item was changed:
----- Method: DSDelta>>classGroupsDo: (in category 'applying') -----
classGroupsDo: aBlock
"Execute a block for all groups of changes per class."
| groups coll |
groups := Dictionary new.
+ self changes do: [:each |
- changes do: [:each |
coll := groups at: each className ifAbsentPut: [SortedCollection new].
coll add: each].
groups values do: [:group | aBlock value: group]!
Item was changed:
----- Method: DSDelta>>fixChangeNumbers (in category 'utilities') -----
fixChangeNumbers
"Fix the change numbers to conform to the invariant that the number
+ of the change is the same as it's index in the change collection."
- of the change is the same as it's index in the change array."
+ | chgs |
+ chgs := self changes.
+ chgs withIndexDo: [:change :index | change number: index].
+ changeCounter := chgs size!
- changes withIndexDo: [:change :index | change number: index].
- changeCounter := changes size!
Item was changed:
----- Method: DSDelta>>normalize (in category 'applying') -----
normalize
"Modify changes so that they are compacted into the minimal form
still producing the equivalent end result. In other words - remove redundancy."
+ compositeChange ifNotNil: [
+ compositeChange moveClassNameChanges; removeShadows; mergeChanges]!
- self moveClassNameChanges; removeShadows; mergeChanges!
Item was removed:
- ----- Method: DSDelta>>moveClassNameChanges (in category 'applying') -----
- moveClassNameChanges
- "Move all class name changes to the beginning as if they were made first."
-
- | nameChanges map |
- nameChanges := OrderedCollection new.
- map := Dictionary new.
- changes reverseDo: [:change |
- change isClassName
- ifTrue: [
- "Is there already a mapping in place?"
- (map includesKey: change newName)
- ifTrue: [
- "Then we remap it using the even older name as key from now on"
- map at: change oldName put: (map at: change newName).
- map removeKey: change newName]
- ifFalse: [
- "Then we just add a mapping."
- map at: change oldName put: change newName].
- nameChanges add: change ]
- ifFalse: [
- change remapClassNames: map]].
- changes removeAll: nameChanges.
- changes := nameChanges, changes!
Item was removed:
- ----- Method: DSDelta>>removeShadows (in category 'applying') -----
- removeShadows
- "Remove all changes that are shadowed (redundant).
- We go in reverse and remove all changes before
- each change that it shadows. The logic is all based
- on #canShadow and #isShadowing:. To make it
- at least somewhat efficient we nil out the changes
- and then remove them in one big swoop at the end."
-
- | candidate change |
- changes size to: 2 by: -1 do: [:index |
- change := changes at: index.
- (change notNil and: [change canShadow]) ifTrue: [
- index - 1 to: 1 by: -1 do: [:i |
- candidate := changes at: i.
- (candidate notNil and: [change isShadowing: candidate])
- ifTrue: [changes at: i put: nil]]]].
- changes := changes select: [:each | each notNil]!
Item was removed:
- ----- Method: DSDelta>>clearChanges (in category 'applying') -----
- clearChanges
- "Remove all changes and return them."
-
- | oldChanges |
- oldChanges := changes.
- changes := OrderedCollection new.
- ^oldChanges!
A new version of DeltaStreams-Tests was added to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Tests-mtf.3.mcz
==================== Summary ====================
Name: DeltaStreams-Tests-mtf.3
Author: mtf
Time: 9 March 2009, 2:04:24 pm
UUID: b5ed6d43-493d-4ecb-8441-456074a69d1b
Ancestors: DeltaStreams-Tests-mtf.2
moved some old query methods to the tests package, where their only user is
=============== Diff against DeltaStreams-Tests-mtf.2 ===============
Item was added:
+ ----- Method: DSDelta>>classSuperclassChanges (in category '*deltastreams-tests') -----
+ classSuperclassChanges
+ ^changes select: [:change | change isClassSuperclass]!
Item was added:
+ ----- Method: DSDelta>>classCommentChanges (in category '*deltastreams-tests') -----
+ classCommentChanges
+ ^changes select: [:change | change isClassComment]!
Item was added:
+ ----- Method: DSDelta>>classGroupNamed: (in category '*deltastreams-tests') -----
+ classGroupNamed: aClassName
+ "Answers all the changes to the class with this name"
+
+ ^ self classGroupFor: (DSBasicClassChange className: aClassName)!
Item was added:
+ ----- Method: DSDelta>>classRemovedChanges (in category '*deltastreams-tests') -----
+ classRemovedChanges
+ ^changes select: [:change | change isClassRemoved]!
Item was added:
+ ----- Method: DSDelta>>classNameChanges (in category '*deltastreams-tests') -----
+ classNameChanges
+ ^changes select: [:change | change isClassName]!
Item was added:
+ ----- Method: DSDelta>>classInstVarsChanges (in category '*deltastreams-tests') -----
+ classInstVarsChanges
+ ^changes select: [:change | change isClassInstVars]!
Item was added:
+ ----- Method: DSDelta>>classGroupFor: (in category '*deltastreams-tests') -----
+ classGroupFor: protoChange
+ "Answers all the changes to the same class as protoChange. Returns the list in reverse order from the delta"
+
+ protoChange isClassChange ifFalse: [^ Array new].
+ ^ (self withClassName: protoChange className reverseSelect: [:change :className |
+ change inClassGroupFor: protoChange withClassName: className])!
A new version of DeltaStreams-Model was added to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Model-mtf.4.mcz
==================== Summary ====================
Name: DeltaStreams-Model-mtf.4
Author: mtf
Time: 9 March 2009, 2:03:44 pm
UUID: d97707e7-9ada-4a66-9aa9-48189421109d
Ancestors: DeltaStreams-Model-mtf.3
moved some old query methods to the tests package, where their only user is
=============== Diff against DeltaStreams-Model-mtf.3 ===============
Item was removed:
- ----- Method: DSDelta>>methodGroupFor: (in category 'queries') -----
- methodGroupFor: protoChange
- "Answers all the changes to the same method in the same class, or to the same class if the change is not a method change"
-
- protoChange isClassChange ifFalse: [^ Array new].
- ^ (self withClassName: protoChange className reverseSelect: [:change :className |
- change inMethodGroupFor: protoChange withClassName: className]) reverse!
Item was removed:
- ----- Method: DSDelta>>classCommentChanges (in category 'queries') -----
- classCommentChanges
- ^changes select: [:change | change isClassComment]!
Item was removed:
- ----- Method: DSDelta>>classGroupNamed: (in category 'queries') -----
- classGroupNamed: aClassName
- "Answers all the changes to the class with this name"
-
- ^ self classGroupFor: (DSBasicClassChange className: aClassName)!
Item was removed:
- ----- Method: DSDelta>>classRemovedChanges (in category 'queries') -----
- classRemovedChanges
- ^changes select: [:change | change isClassRemoved]!
Item was removed:
- ----- Method: DSDelta>>classInstVarsChanges (in category 'queries') -----
- classInstVarsChanges
- ^changes select: [:change | change isClassInstVars]!
Item was removed:
- ----- Method: DSDelta>>classGroupFor: (in category 'queries') -----
- classGroupFor: protoChange
- "Answers all the changes to the same class as protoChange. Returns the list in reverse order from the delta"
-
- protoChange isClassChange ifFalse: [^ Array new].
- ^ (self withClassName: protoChange className reverseSelect: [:change :className |
- change inClassGroupFor: protoChange withClassName: className])!
Item was removed:
- ----- Method: DSDelta>>classSuperclassChanges (in category 'queries') -----
- classSuperclassChanges
- ^changes select: [:change | change isClassSuperclass]!
Item was removed:
- ----- Method: DSDelta>>hasDoIts (in category 'testing') -----
- hasDoIts
-
- ^self doIts notEmpty!
Item was removed:
- ----- Method: DSDelta>>doIts (in category 'queries') -----
- doIts
-
- ^changes select: [:change | change isDoIt]!
Item was removed:
- ----- Method: DSDelta>>methodGroups (in category 'queries') -----
- methodGroups
- ^ DSChangeCategorizer forClassesAndMethods withAll: self!
Item was removed:
- ----- Method: DSDelta>>classNameChanges (in category 'queries') -----
- classNameChanges
- ^changes select: [:change | change isClassName]!
A new version of DeltaStreams-Model was added to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Model-mtf.3.mcz
==================== Summary ====================
Name: DeltaStreams-Model-mtf.3
Author: mtf
Time: 9 March 2009, 1:59:36 pm
UUID: 8ff6850a-aacf-409f-8447-ca7df55f9382
Ancestors: DeltaStreams-Model-mtf.2
fixed some issues with DSRevertTest
=============== Diff against DeltaStreams-Model-mtf.2 ===============
Item was changed:
----- Method: DSVisitor>>applyDelta: (in category 'composite changes') -----
applyDelta: aDelta
"Treat like a composite change by default."
+ ^ self applyCompositeChange: aDelta compositeChange!
- ^ self applyCompositeChange: aDelta!
Item was added:
+ ----- Method: DSDelta>>asAntiChange (in category 'applying') -----
+ asAntiChange
+ "Return a new Delta that, when applied, reverts each change of this Delta
+ in reverse order. Each change should have enough information to create
+ an anti change from itself."
+
+ | anti |
+ self isRevertable ifFalse: [DSDeltaNotRevertableException signal].
+ anti := DSDelta name: 'undo ' translated, self name.
+ properties ifNotNil: [properties associationsDo: [:assoc | anti propertyAt: assoc key put: assoc value]].
+ self changes reverseDo: [:each | anti addChange: each asAntiChange].
+ ^anti!
Item was removed:
- ----- Method: DSDelta>>asAntiDelta (in category 'applying') -----
- asAntiDelta
- "Return a new Delta that, when applied, reverts each change of this Delta
- in reverse order. Each change should have enough information to create
- an anti change from itself."
-
- | anti |
- self isRevertable ifFalse: [DSDeltaNotRevertableException signal].
- anti := DSDelta name: 'undo ' translated, self name.
- properties ifNotNil: [properties associationsDo: [:assoc | anti propertyAt: assoc key put: assoc value]].
- self changes reverseDo: [:each | anti addChange: each asAntiChange].
- ^anti!
A new version of Sake-Core was added to project Sake :
http://www.squeaksource.com/Sake/Sake-Core-kph.106.mcz
==================== Summary ====================
Name: Sake-Core-kph.106
Author: kph
Time: 8 March 2009, 10:54:52 pm
UUID: 23a88dc2-0c34-11de-987b-000a95edb42a
Ancestors: Sake-Core-kph.105
- removed packages tasks, added them as normal code to MC
+ SakeBlock new handling of blocked tasks!
=============== Diff against Sake-Core-kph.105 ===============
Item was changed:
----- Method: SakeTask>>sort (in category 'as yet unclassified') -----
sort
+ "if your top level is simply a collection of tasks we presort them"
- "if your top level is a collection of tasks we presort them"
actionBlock ifNotNil: [ self error: 'no need to presort' ].
+ self dependsOn: self allPriorTasksInOrder.
- actionBlock := self allPriorTasksInOrder.
-
- priors := nil.
+ ^ self
+
+ !
- ^ self!
Item was added:
+ ----- Method: SakeBlock class>>signalTask: (in category 'as yet unclassified') -----
+ signalTask: aTask
+
+ ^ self new
+ tag: aTask;
+ signal!
Item was added:
+ ----- Method: SakeBlock>>task (in category 'as yet unclassified') -----
+ task
+
+ ^ tag!
Item was changed:
----- Method: SakeTask>>privateRun: (in category 'as yet unclassified') -----
privateRun: setOfTasks
+ | priorTasks blocked wasBlocked |
+
"this is the way that Rake orders tasks"
"we ensure that we obtain the task to run from the overall set of tasks"
- | priorTasks |
self hasRun ifTrue: [ ^ result ].
+ priorTasks := self dependsOn collect: [ :prior | setOfTasks like: (self taskFrom: prior) ] thenSelect: [ :ea | ea notNil ].
+
+ "anyting it runs that is blocked is added to the block set, anything that suceeds is removed form the blocked set.
+ at the end, we shall have a list of blocked tasks that can be retried, if that list is the same as the list that was blocked
+ before stop and complain"
- priorTasks := self dependsOn collect: [ :prior | setOfTasks like: (self taskFrom: prior) ].
+ blocked := Set new.
+
+ [
+ wasBlocked := blocked copy.
+
+ priorTasks do: [ :each |
+ each runLevel: runLevel.
+ [
+ each privateRun: setOfTasks.
+ blocked remove: each ifAbsent: [ ].
+ ] on: SakeBlock do: [ :ex | blocked add: ex task ].
+ ].
+
+ (blocked notEmpty and: [ blocked = wasBlocked ]) ifTrue: [ SakeBlock signalTask: self ].
+
+ ] doWhileFalse: [ blocked isEmpty ].
+
- priorTasks collect: [ :each |
- each ifNotNil: [ each runLevel: runLevel.
- each privateRun: setOfTasks ]].
(self isNeeded: priorTasks)
ifTrue: [
self trace.
self doAction: priorTasks.
hasRun := true.
^ result.
].
^ false
+ !
- !
Item was added:
+ Warning subclass: #SakeBlock
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Sake-Core'!
+
+ !SakeBlock commentStamp: 'kph 3/6/2009 12:58' prior: 0!
+ Raise this if for some reason you find that the task you are doing is blocked. This might occur in a multi builder build system where two building threads decide to build the same item.
+
+ (implementation idea - not implemented yet)
+
+ When a Block is detected, Sake, looks for any following dependent task that is not dependant upon the blocked task.
+
+ Alternatively, Sake could simply randomise the task order and re-sort them, tryng again.!
Item was removed:
- ----- Method: MCWorkingCopy>>taskSaveWithComment: (in category '*sake-core') -----
- taskSaveWithComment: message
-
- ^ (self taskAdoptHistoryFrom: self repository saveWithComment: message) defined
- !
Item was removed:
- ----- Method: MCWorkingCopy>>taskAdoptHistoryFrom:saveWithComment: (in category '*sake-core') -----
- taskAdoptHistoryFrom: repo saveWithComment: message
-
- "The repo is the one we are maintaining. If there are no changes then adopt the one in the repo as the master"
-
- | closest |
- ^ SakeTask define: [ :task |
-
- task if: [ self needsSaving ].
-
- task action: [ self repositoryGroup addRepository: repo.
- self setMyRepositoryFromLastAdded.
- closest := self repository closestAncestorVersionFor: ancestry ifNone:[nil].
- closest ifNotNil: [ ancestry := MCWorkingAncestry new addAncestor: closest info ].
-
- (self changesRelativeToRepository: self repository) isEmpty
- ifTrue: [
- self modified: false.
- ]
- ifFalse: [
- message ifNotNil: [
- self repository storeVersion: (self newVersionWithName: self uniqueVersionName message: message)]
- ]
- ]
- ]
- !
A new version of File-Base was added to project Rio:
http://www.squeaksource.com/Rio/File-Base-kph.23.mcz
==================== Summary ====================
Name: File-Base-kph.23
Author: kph
Time: 8 March 2009, 10:51:18 pm
UUID: a4707eb6-0c33-11de-987b-000a95edb42a
Ancestors: File-Base-kph.22
+ #pathHasNoWildCards
+ optimization to #resolveMatchOne will avoid hitting an ftp site if there is no actual matching to be done
hmm.... might not be the expected behaviour. One might assume that the result of resolveMatchOne actually exists.
=============== Diff against File-Base-kph.22 ===============
Item was changed:
----- Method: File>>resolveMatchOne (in category 'enumeration') -----
resolveMatchOne
| list |
+
+ "if we do not contain wild cards, simply return self"
+ self pathHasNoWildCards ifTrue: [ ^ self ].
+
list :=self parent filesMatching: self fileName.
list size = 1 ifFalse: [ ^ nil ].
^ list first
!
Item was added:
+ ----- Method: File>>pathHasNoWildCards (in category 'enumeration') -----
+ pathHasNoWildCards
+ ^ ((value includes: $*) not and: [ (value includes: $#) not ]) !