[squeak-dev] The Inbox: Monticello-cmm.565.mcz

Bert Freudenberg bert at freudenbergs.de
Fri Sep 13 10:12:57 UTC 2013


(this is another instance of me trying to constructively criticize details when I'm not convinced of the whole yet - we do want a global history somehow but we're not sure yet exactly how it should be implemented)

> + ----- Method: Class>>mcVersions (in category '*monticello') -----
> + mcVersions
> + 	"Answer a collection of MCClassDefinitions for this Class, which are in the first Magma-repository in the list of repositories of my working-copy."
> + 	^ self mcModel ifNotNil: [ : mcmodel | mcmodel historyOf: self asClassDefinition ]!

An "MCVersion" is a precisely defined entity (a package snapshot with associated meta data). This selector thus is misleading. MC has no concept yet of a series of definitions that describe multiple variants of the same class.

> + ----- Method: Class>>mcPatchOperations (in category '*monticello') -----
> + mcPatchOperations
> + 	"Answer a collection of MCPatchOperations that can be displayed in a MCPatchBrowser which will reflect the history of this methods definition in relation to each other (not simply compared to the image version)."
> + 	^(self mcVersions reversed
> + 			inject: OrderedCollection new
> + 			into:
> + 				[ : coll : each | coll
> + 					ifEmpty:
> + 						[ coll
> + 							 add: (MCAddition of: each) ;
> + 							 yourself ]
> + 					ifNotEmpty:
> + 						[ coll
> + 							 add:
> + 							(MCModification
> + 								of:
> + 									(coll last isAddition
> + 										ifTrue: [ coll last definition ]
> + 										ifFalse: [ coll last modification ])
> + 								to: each) ;
> + 							 yourself ] ]) reversed!

An MCPatchBrowser displays an MCPatch, which is a set of MCPatchOperations that can be applied to an MCSnapshot to make another MCSnapshot.

If you want to display the patches from multiple versions you would need something new, e.g. an MCPatchSeries which would have multiple patches. Otherwise we're watering down the very precise model of Monticello, making it much harder to understand and maintain. 

- Bert -




More information about the Squeak-dev mailing list