<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Jakob,</p>
<p><br>
</p>
<p>Thanks for the report - and I'm sorry to hear that I broke this!</p>
<p><br>
</p>
<p>The motivation for the deferred list was that #addToOrder: (and so the constructor #items:) actually does not sort the added items, but only their dependencies. That's why you need to send #addDeferred to the sorter after adding all other items. <span style="font-size:12pt">Before
 now, I did not realize that #orderedItems has external users.</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p>So there are two options:</p>
<p><span style="font-size:12pt">1.</span><span style="font-size:12pt"> Permanently change the public protocol of the dependency sorter - if you want to get all items, you need to send #addDeferred ti the sorter before retrieving the #orderedItems. In the Trunk,
 we would need to update four senders in three classes for this solution.</span></p>
<p><span style="font-size:12pt">2. Change #orderedItems to lazily append the deferred items to the returned list. This is not ideal as it makes the getter more expensive, but on the other hand, we can preserve compatibility by doing so.</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p>I'm open for your opinion on both approaches, or for any other idea! :-)</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Jakob Reschke <forums.jakob@resfarm.de><br>
<b>Gesendet:</b> Freitag, 10. April 2020 00:03:47<br>
<b>An:</b> Thiede, Christoph; squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> Re: [squeak-dev] The Trunk: Monticello-ct.715.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Forgot to mention the net result of the issue: the postscripts gets<br>
effectively removed in the saved version.<br>
<br>
Am Fr., 10. Apr. 2020 um 00:02 Uhr schrieb Jakob Reschke<br>
<forums.jakob@resfarm.de>:<br>
><br>
> It looks like this broke the writing of postscripts in FileTree repositories.<br>
><br>
> MCFileTreePackageStructureStWriter>>acceptVisitor:forDefinitions:<br>
> (MCDependencySorter sortItems: aCollection) does not include an<br>
> MCPostscriptDefinition that is still present in aCollection.<br>
><br>
> MCDependencySorter class>>sortItems:<br>
> The sorter includes the MCPostscriptDefinition in the new deferred<br>
> list, but not in the orderedItems. Therefore it is not included in the<br>
> result of sortItems:, because it only returns the orderedItems, not<br>
> the deferred ones.<br>
><br>
> Christoph, can and must sortItems: be fixed or a different method?<br>
><br>
><br>
> Am Do., 5. März 2020 um 21:05 Uhr schrieb <commits@source.squeak.org>:<br>
> ><br>
> > Nicolas Cellier uploaded a new version of Monticello to project The Trunk:<br>
> > <a href="http://source.squeak.org/trunk/Monticello-ct.715.mcz">http://source.squeak.org/trunk/Monticello-ct.715.mcz</a><br>
> ><br>
> > ==================== Summary ====================<br>
> ><br>
> > Name: Monticello-ct.715<br>
> > Author: ct<br>
> > Time: 6 February 2020, 6:58:26.533648 pm<br>
> > UUID: 199bf8a3-5eee-1045-a44b-89ad30fa5523<br>
> > Ancestors: Monticello-cmm.708<br>
> ><br>
> > Fixes wrong load and unload order of MCScriptDefinitions<br>
> ><br>
> > See <a href="http://forum.world.st/Monticello-Bug-Preamble-of-removal-is-executed-too-late-tp5108401.html">
http://forum.world.st/Monticello-Bug-Preamble-of-removal-is-executed-too-late-tp5108401.html</a>. Regression tests are in Tests-ct.426.<br>
> ><br>
> > Please review!<br>
> ><br>
> > =============== Diff against Monticello-cmm.708 ===============<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: MCDefinition>>wantsToBeOutermost (in category 'testing') -----<br>
> > + wantsToBeOutermost<br>
> > +<br>
> > +       ^ false!<br>
> ><br>
> > Item was changed:<br>
> >   Object subclass: #MCDependencySorter<br>
> > +       instanceVariableNames: 'required provided deferred orderedItems'<br>
> > -       instanceVariableNames: 'required provided orderedItems'<br>
> >         classVariableNames: ''<br>
> >         poolDictionaries: ''<br>
> >         category: 'Monticello-Loading'!<br>
> ><br>
> > Item was changed:<br>
> >   ----- Method: MCDependencySorter>>add: (in category 'building') -----<br>
> >   add: anItem<br>
> >         | requirements |<br>
> > +       (anItem wantsToBeOutermost)<br>
> > +               ifTrue: [^self addDeferred: anItem].<br>
> >         requirements := self unresolvedRequirementsFor: anItem.<br>
> >         requirements isEmpty<br>
> >                 ifTrue: [self addToOrder: anItem]<br>
> >                 ifFalse: [self addRequirements: requirements for: anItem].<br>
> >         ^anItem!<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: MCDependencySorter>>addDeferred (in category 'building') -----<br>
> > + addDeferred<br>
> > +       deferred do: [:ea |<br>
> > +               self addToOrder: ea].!<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: MCDependencySorter>>addDeferred: (in category 'private') -----<br>
> > + addDeferred: anItem<br>
> > +       ^ deferred add: anItem!<br>
> ><br>
> > Item was changed:<br>
> >   ----- Method: MCDependencySorter>>initialize (in category 'initialize-release') -----<br>
> >   initialize<br>
> >         provided := Set new.<br>
> >         required := Dictionary new.<br>
> > +       orderedItems := OrderedCollection new.<br>
> > +       deferred := OrderedCollection new.!<br>
> > -       orderedItems := OrderedCollection new.!<br>
> ><br>
> > Item was changed:<br>
> >   ----- Method: MCPackageLoader>>sorterForItems: (in category 'private') -----<br>
> >   sorterForItems: aCollection<br>
> >         | sorter |<br>
> >         sorter := MCDependencySorter items: aCollection.<br>
> >         sorter addExternalProvisions: self provisions.<br>
> > +       sorter addDeferred.<br>
> >         ^ sorter!<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: MCPostscriptDefinition>>wantsToBeOutermost (in category 'nil') -----<br>
> > + wantsToBeOutermost<br>
> > +<br>
> > +       ^ true!<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: MCRemovalPreambleDefinition>>wantsToBeOutermost (in category 'testing') -----<br>
> > + wantsToBeOutermost<br>
> > +<br>
> > +       ^ true!<br>
> ><br>
> ><br>
</div>
</span></font>
</body>
</html>