Discard all when I have zero metadata raises an arror
How I did and reproduced it :
- New Pharo image (Official distribution Pharo 12.0)
- Create a new package with a class and methods
- Open iceberg and add a new repository
- Add the package
- Click on "Discard All"
IceNoCommit(Object)>>doesNotUnderstand: #shortId IceTipDiscardAllChangesPreviewBrowser>>loadCommitShortId IceTipDiscardAllChangesPreviewBrowser>>initializePresenters IceTipDiscardAllChangesPreviewBrowser(SpPresenter)>>initializePrivateHooks IceTipDiscardAllChangesPreviewBrowser(SpPresenter)>>initialize IceTipDiscardAllChangesPreviewBrowser(IceTipBrowser)>>initialize IceTipDiscardAllChangesPreviewBrowser class(SpPresenter class)>>newApplication:model: IceTipDiscardAllChangesPreviewBrowser class(SpPresenter class)>>on: IceTipDiscardAllChangesPreviewBrowser class>>onRepository: IceTipDiscardChangesCommand>>execute IceTipSpCommand(CmCommandDecorator)>>execute [ aCommand execute ] in IceTipToolbarButtonStrategy(IceTipCommandToPresenterBuildingStrategy)>>resultOn: in Block: [ aCommand execute ] FullBlockClosure(BlockClosure)>>cull: SpMorphicToolbarButtonAdapter>>execute SpToolbarButtonMorph(PluggableButtonMorph)>>performAction: [:m | (m containsPoint: evt cursorPoint) ifTrue: [m enabled ifTrue: [ m performAction: evt ]]] in SpToolbarButtonMorph(PluggableButtonMorph)>>mouseUp: in Block: [:m |... Array(SequenceableCollection)>>do: SpToolbarButtonMorph(PluggableButtonMorph)>>mouseUp: SpToolbarButtonMorph(Morph)>>handleMouseUp: MouseButtonEvent>>sentTo: SpToolbarButtonMorph(Morph)>>handleEvent: SpToolbarButtonMorph(Morph)>>handleFocusEvent: [ result := focusHolder handleFocusEvent: transformedEvent. ] in HandMorph>>sendFocusEvent:to:clear: in Block: [... FullBlockClosure(BlockClosure)>>on:do: WorldMorph>>becomeActiveDuring: HandMorph>>sendFocusEvent:to:clear: HandMorph>>sendEvent:focus:clear: HandMorph>>sendMouseEvent: HandMorph>>handleEvent: HandMorph>>processEvents [:h | self activeHand: h. h processEvents. self activeHand: nil. ] in WorldState>>doOneCycleFor: in Block: [:h |... Array(SequenceableCollection)>>do: WorldState>>handsDo: WorldState>>doOneCycleFor: WorldMorph>>doOneCycleNow WorldMorph>>doOneCycle [ | extraWorldsToDraw | extraWorldsToDraw := ExtraWorldListMutex critical: [ self extraWorldList ]. extraWorldsToDraw do: [ :world | world doOneCycle ].
(self currentWorld isNotNil and: [
(extraWorldsToDraw includes: self currentWorld) not ]) ifTrue: [
self currentWorld doOneCycle ] ] in WorldMorph class>>doOneCycle in Block: [...
FullBlockClosure(BlockClosure)>>ensure: WorldState class>>doDrawCycleWith: WorldMorph class>>doOneCycle MorphicRenderLoop>>doOneCycle MorphicRenderLoop>>doOneCycleWhile: [ MorphicRenderLoop new doOneCycleWhile: [ true ] ] in MorphicUIManager>>spawnNewProcess in Block: [ MorphicRenderLoop new doOneCycleWhile: [ tru[..] [self value. "IMPORTANT: Do not step over next line of code. See method comments for details" Processor terminateRealActive] in FullBlockClosure(BlockClosure)>>newProcess in Block: [self value....
We can reproduce it Pharo 13 (Pharo-13.0.0+SNAPSHOT.build.297.sha.9d19b62922b7fc72f44387254700dafd12c8c4a3 )
We defined
IceNoCommit >> shortId
^ 'nocommit id'
It does not raise an error anymore and the caller is the following one.
initializePresenters
super initializePresenters.
diffPanel
leftLabel: 'Working Copy (Image)';
rightLabel: 'Commit to load: ', self loadCommitShortId
Now I do not know if adding shortId on IceNoCommit is a good idea.
@tesonep do you think that this is safe? I cannot simply run locally the tests