[Glass] About GsDeployer new doBulkMigrate

Martin McClure martin.mcclure at gemtalksystems.com
Wed Apr 16 20:05:28 PDT 2014


On 04/16/2014 04:31 PM, Mariano Martinez Peck wrote:
>     As a final comment ... if for some reason you mess up your class
>     history, it should be possible to rebuild the class history from the
>     instances of the old class ... while it is something you don't want
>     to do ... it's worth keeping in mind that it can be done in an
>     emergency:)
>
>
> Ahhhh of course...the migrate stuff "just" changes the class pointer of
> the instances right? So if the slots for XXX instVars were there...they
> won't get lost. I guess it is similar to Pharo's #adoptInstance: and
> #primitiveChangeClassTo:
> Good!

No, I think Dale's comment only applies to recovering classes that have 
been removed from the class history, not to recovering lost values from 
instances due to instvar removal.

Migration of an instance creates a new instance of the new version of 
the class, copies instvar values across, then uses #become: to swap 
identities of the old and new instances. So if an instvar has been 
removed or renamed in the new class version, you *can* lose data with a 
default migration. There are ways to customize migration, but I don't 
know how those interact with GsDeployer.

Regards,

-Martin


More information about the Glass mailing list