In 7.9.1 I enhanced PublishedPundleVersionsTool in various ways. One of the simplest of these enhancements is to show parentage in the version pane.
In MyPundleVersionPane>>selectEmphasisFor:, I added more behavior:
1) if there are zero or many selected versions, use the inherited behavior (super)
2) if there is a single selected version and aPackage is inline with that selection, add italic
The result is that all descendants above the selection are italic, but more importantly all ancestors below the selection are italic. It eliminates most of the need for popping up the graph versions tool, since one can see immediately where the selection came from, and whether a particular earlier version in the apparent chain (judging only by version string) was skipped (by manually editing the version string when publishing).
Suppose a version was downgraded from dev to wip. Before making a build, I want to know if anyone incorporated those demoted changes upstream. This enhancement lets me see if someone hopped over the demoted version (with the current version selected, the demoted version would not be italic) because they could see it had been demoted, or possibly incorporated it (with the current version selected, the demoted version would be italic) because it was not demoted until after the newer version was published.
The code in my subclass is straightforward:
MyPundleVersionPane>>selectEmphasisFor: aPackage
| emphasis |
emphasis := (super selectEmphasisFor: aPackage) asDependentsAsCollection.
^(self selectionInlineWith: aPackage)
ifTrue: [emphasis copyWith: #italic]
ifFalse: [emphasis]
as is the relevant supporting code:
PundleVersionPane>>selectionInlineWith: aPundle
^self tool hasSingleSelectedVersion and:
[self itemsInList listModule listHolder selections any value
isInlineWith: aPundle]
StorePundle>>isInlineWith: aPundle
^self primaryKey = aPundle primaryKey or:
[(self youngerThan: aPundle)
ifTrue: [aPundle isAncestorOf: self]
ifFalse: [self isAncestorOf: aPundle]]
StorePundle>>isAncestorOf: aPundle
(aPundle youngerThan: self) ifFalse: [^false].
^aPundle parentRecord
ifNil: [false]
ifNotNil:
[:parentPundle |
self primaryKey = parentPundle primaryKey
or: [self isAncestorOf: parentPundle]]
Dave Stevenson
[hidden email]