Thanks Colin!

On Wed, Jan 15, 2014 at 12:06 PM, Colin Putney <colin@wiresong.com> wrote:



On Wed, Jan 15, 2014 at 1:41 PM, Eliot Miranda <eliot.miranda@gmail.com> wrote:
I just stumbled across Monticello's MCPatcher and the Backport button which claims to apply a partial delta to the ancestor of a package. �Does anyone who understands this code know if the code supports loading a package, without installing it, applying a partial set of changes (i.e. the relevant changes form the bootstrap) and saving the package as an mcz? �If it does then I could construct patched versions of the three packages and substitute them in the bootstrap instead of using the hack.

�Yeah, that ought to work fine. There's no way to do it through the GUI, but a bit of workspace hackery should do the trick.

Here's a working example that patches a single method:

| fn fs version method patch ancestry newVersion |
fn := '/Users/eliot/Glue/repositories/spurnsboot/smalltalk/Kernel.newspeak-bwesterg.682.mcz'.
fs := FileStream readOnlyFileNamed: fn.
version := [((MCVersionReader readerClassForFileNamed: fn) on: fs fileName: fn) version] ensure: [fs close].
method := SpurBootstrap class >> #ProtoObjectPROTOTYPEscaledIdentityHash.
patch := MCPatch operations: {MCAddition of: (MCMethodDefinition
className: #ProtoObject
classIsMeta: false
selector: #scaledIdentityHash
category: #comparing
timeStamp: method timeStamp
source: (method getSourceFromFile asString allButFirst: 20))}.
ancestry := MCWorkingAncestry new addAncestor: version info.
newVersion := MCVersion
package: version package
info: (ancestry
infoWithName: 'Kernel.newspeak.spur-bwesterg.682.mcz'
message: 'Kernel.newspeak-bwesterg.682.mcz patched for Spur')
snapshot: (MCPatcher apply: patch to: version snapshot)
dependencies: {}.
(MCDirectoryRepository new directory: fs directory) storeVersion: newVersion�

--
best,
Eliot