[Q][Monticello] snipet for saving a mcz file

Hernan Tylim htylim at yahoo.com.ar
Wed Aug 4 18:45:40 UTC 2004


Thanks Avi,

I didn't know how to get an existing MCVersion. I had  thought that I might
need to create them lazily as it was done before with PackageInfo instances.

> version := package workingCopy repositoryGroup versionWithInfo: package
> workingCopy currentVersionInfo.

Looking at #MCWorkingCopy>>currentVersionInfo I see that the method will
save a new version if exists uncomitted changes. So to get the last comitted
version should I use <package workingCopy ancestors first>, instead?

Thanks a lot Avi. Monticello is really great.

Regards,
Hernán

----- Original Message -----
From: "Avi Bryant" <avi at beta4.com>
To: "The general-purpose Squeak developers list"
<squeak-dev at lists.squeakfoundation.org>
Sent: Wednesday, August 04, 2004 2:46 PM
Subject: Re: [Q][Monticello] snipet for saving a mcz file


> > | package version |
> > package := MCPackage named: 'Monticello'.
> > version := MCVersion
> >     package: package
> >     info: package workingCopy currentVersionInfo.
> > file := FileStream newFileNamed: (FileDirectory default fullNameFor:
> > version
> > fileName).
> > version fileOutOn: file.
> > file close.

> That will work, although note that if the package has been modified
> since the last committed version, this will create a new version
> instead of writing out the old one.  What's odd about it, however, is
> that you're creating a new MCVersion instance rather than using an
> existing one.  In some rare cases (for example, the package gets
> changed but somehow the modified flag isn't set) this could end up with
> two version files with the same UUID but slightly different contents.
> So you're bettter to look for the old version instance:
>
> version := package workingCopy repositoryGroup versionWithInfo: package
> workingCopy currentVersionInfo.
>
> Avi
>
>




More information about the Squeak-dev mailing list