metacello icon indicating copy to clipboard operation
metacello copied to clipboard

MetacelloVersion should maybe take the projectLabel into account in the #=

Open jecisc opened this issue 7 years ago • 2 comments

I have a problem because I wanted to collect as a set some versions but I lost one project because MetacelloVersion>>#= takes only the species and the version number into account.

Maybe it should also takes the projectLabel into account if there is one?

jecisc avatar Jun 18 '17 13:06 jecisc

hmmm the projectLabel is not an attribute of MetacelloVersion .... I can understand your problem, but I'm also reluctant to change such a fundamental thing without quite a bit of testing ... could you provide some context for collecting the set? Maybe there's another way to do what you are attempting without modifying MetacelloVersion>>#=?

dalehenrich avatar Jun 19 '17 18:06 dalehenrich

The idea is to build a visualization around the a configuration version.

With the Telescope framework I have this code:

self addNodesFromEntities: self versionsNodes.
	self connectFollowingProperty: [ :each | each projects collect: #version ].
	self styleSheet
		nodeLabel: [ :each | #(#ConfigurationOf #BaselineOf) inject: each asString into: [ :name :toRemove | name copyReplaceAll: toRemove with: '' ] ];
		nodeLabelPosition: #bottom.
	self
		layout:
			(TLTreeLayout rightToLeft
				leavesGap: 100;
				levelGap: 100;
				yourself)

And for now versionsNodes is:

versionsNodes
	^ (version withDeepCollect: [ :each | each projects collect: #version ])
		inject: OrderedCollection new
		into: [ :coll :vers | 
			coll detect: [ :each | each versionNumber = vers versionNumber and: [ each projectLabel = vers projectLabel ] ] ifNone: [ coll add: vers ].
			coll ]

And originally I wanted to do:

versionsNodes
	^ version withDeepCollect: [ :each | each projects collect: #version ] as: Set

But then I miss some projects

jecisc avatar Jun 19 '17 22:06 jecisc