miércoles, 14 de abril de 2010

Versioning in squeak/pharo using Monticello

Lately I've been working on a simple website I'm doing in smalltalk. It's not a complex thing, but it's someway new being my first serious website I've done.

To build it I'm using pier and seaside. And it's mostly fantastic. But sometimes, all of the sudden, some unknown error occurs and my image freezes. And my last codes are lost. No way to recover it even using the recovery tool.

So I remembered something Mr. Ducasse said in the course he did in UPC. The idea is you could throw away your image every day, and start with a fresh new one, EVERY DAY.

One option is fileOuts and fileIns, and in fact, it's simple, reliable and it just works (tm), but you cannot store different versions, and if you did the manual filename juggling, the versions would not have any relationship between them.

Then, here comes monticello. A kind of apt-get + launchpad. It's a package browser and installer (no dependency tracking AFAIK), where repos can be lots of different places, from local directories, to squeaksource remotes, or ftp, or ....

The trick is opening a create a new package (+package button) with the name of the category you want to save. Then, it will appear in the left panel of monticello browser. After that, create a new repository (+Repository button) and add a directory where you want to save it. Then just press the save button.

When you open a new image and want to load the package, open monticello browser, open the repository (+Repository again), click it, and browse. There you'll be able to load the package, and once it's loaded, it will appear in the left panel of the main Monticello Browser.
In the second screenshot you see top left, the different repository types. on the right, the main Monticello screen with the two panels.  My advise is to play a bit with it, selecting and unselecting items to get the feeling of it.

Btw, there's a new project related to source maintaining and versioning called Metacello that seems to be the next iteration of monticello, or "monticello done right", adding full support for package managing, being aware of versions and so.  I'm just guessing as I'm a newbie in both projects and I just skimmed the docs, so please, correct me if I'm wrong.

1 comentario:

Anónimo dijo...

This has helped me on my first repository. I found that your description about loading is not completely clear. It you could describe how to find the repository and load it. Also what happens next is needed. For example, updating your project and storing the next version, and showing differences, etc.

Gracias mil!