metacello
metacello copied to clipboard
MetacelloVersion should maybe take the projectLabel into account in the #=
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?
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>>#=?
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