Snap to It!

Whenever possible, I like start a development session with a freshly loaded image, and I encourage the developers on my team to refresh their images as frequently as possible too. Unfortunately, there are times when it isn’t really convenient to change images. You might have several classes in a state of transition, and/or unreleased versions of other classes loaded into your image. Using the Transcript menu Tools/Query/Unreleased Classes will give you a list of deviations currently in your image, but you need to record that somewhere if you want to return to that point in a new image. I’ve even seen developers mail this list of changes to themselves. In the interest of reducing this pain, I built a mechanism for creating and browsing code snapshots, basically capturing the results of the unreleased classes query and storing it in the code repository.

If you wander over to VASt Goodies, you can download and install the “HQA Code Snapshot Tool”. Note that it requires the loading of an appropriate version of WidgetKit/Controls, which has been included as part of VA Smalltalk since version 7.0. I’ve included config expressions for VA 8.0.2 and 8.0.3 – you’ll need to modify these if you’re running another version, but there’s nothing in the Snapshot Tool to preclude you from running on other versions. Once you’ve installed it, you’ll find three new entries on your Transcript Tools menu, Snapshot Options, Snapshot Browser and Snapshot.

Snapshot Options control what is included in a snapshot. By checking “Current User Only”, only changes you have authored will be included. Otherwise, all changes are included. “Versions Only”, if checked, will record only versioned, unreleased classes.

Snapshot creates a snapshot based on the options selected. First, a dialog opens allowing you to enter an optional description. You’re welcome to leave this blank and just click OK. You can create as many snapshots as you like. They’re stored in the ENVY repository, associated with your user name.

When you’re ready to restore a snapshot, you just need to choose the Snapshot Browser from the Transcript Tools menu. This will open a two-pane window with all your available snapshots listed down the left pane, and, once you’ve selected a snapshot, its contents in the right pane. The Snapshot Browser doesn’t know if a class has been versioned since the snapshot was created, so you’ll see the version or edition information as it was when the snapshot was taken. Right-clicking on a snapshot edition in the left pane will allow you to load or delete the snapshot.

Loading a snapshot requires that the image be in a state in which all the classes in the snapshot can be loaded. This means that you already have to have the application associated with the class loaded. If the class doesn’t currently exist in the loaded application, you will need to make sure that you are using an edition of the application. You’ll get a walkback if the class can’t be loaded, but you should be able to figure out the problem.

Snapshots are a flexible, light-weight alternative to lineups specified by config maps. I hope you find the tool useful in your own work.


0 Responses to “Snap to It!”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: