pruning older versions of a method

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Wed Mar 13 15:09:44 UTC 2002


On Wed, 13 Mar 2002, Stéphane Rollandin wrote:

> Hello list,
> 
> I guess this are typical newbie questions, but I could not find the answers 
> anywhere, so here they are:

Actually this should be added to some FAQ page, you are right.

> how do one get rid of the older versions of a method ?
> 
> is there a way to have a class automatically scanned so that only the more 
> recent version of each of its methods is kept ?
> 
> finally, where are all these versions living ? in the image or in the 
> change set ?

They do not bloat the image, nor are they kept in changesets. Don't 
worry about them. It's just magic. ;-)

All modified method source code lives in the changes file (the file named
like your image, but with .changes file extension). Each new version of a
method is appended to the changes file along with a header indicating the
index of the prior version:

!Class methodsFor: 'category' stamp: 'date' prior: 1234567!
methodName
	method text! !

So there is no need to get rid of the old version, because they don't 
hurt. It's normal for Smalltalkers to live with multi-megabyte changes 
files!

Usually only in the process of a major version increment (Squeak v2 -> v3
was the last) the old versions are purged: the current sources of all
methods in the image constitute the new sources file, the changes file is
emptied. The condenseChanges method is used for this, but I would not 
recommend using it unless you're *absolutely sure* what you're doing.


-- Bert




More information about the Squeak-dev mailing list