[Monticello2] Loading from a repository

Colin Putney cputney at wiresong.ca
Mon Jul 16 20:02:08 UTC 2007


On Jul 16, 2007, at 11:49 AM, Damien Cassou wrote:

> Hi Colin,
>
> 2007/7/16, Colin Putney <cputney at wiresong.ca>:
>> No, you need to have a slice do the loading. Here's some code to save
>> and then reload a snapshot:
>>
>> "Create a working copy and repository"
>> wc := MDWorkingCopy forImageProxy: MDWorkingCopy defaultImageProxy.
>> memory := MDMemoryRepository new.
>>
>> "Create a slice"
>> slice := MDPackageInfoSlice named: 'Refactory'.
>>
>> "Save it"
>> snapshot := slice saveFrom: wc to: memory.
>>
>> "Load it"
>> slice load: snapshot from: memory to: wc.
>
> How do you load a slice in a new image if it's not a PackageInfo then?

You just need to create a different kind of slice. The snapshot will  
contain a version based on an MDSliceElement that has the details of  
what kind of slice to use.

Colin



More information about the Squeak-dev mailing list