[prev] [up] [next]

Using the Changes Browser

Index

Introduction

Smalltalk/X keeps track of all your changes made to either the class hierarchy or to individual methods both in memory (in the so called ChangeSet) and in a file called 'changes'.

For each change, one record is appended to the changeSet and the changes-file (*)
These records are change-entries in the changeSet, or chunks (in fileOut-format) in the changes file.

The changeSet is compressed, whenever a class is checked into the sourceCode repository.
The change-file is never cleared automatically, and therefore is even available for repair and undo in case of a crash, power failure or when ST/X is exited without an image being written.

The ChangeBrowser allows inspection and manipulation of the changes-file.
A ChangeSetBrowser allows inspection and manipulation of a changeSet.
Both consist of 2 subviews; which are:

The change list view (top panel) displays a list of changes in chronological order.
To see a change, select (i.e. click on) the corresponding line in the changelist. The change will be displayed in the contents view.
Dont be afraid using the changesBrowser, the changes file (resp. changeSet) remains unmodified unless you execute the "writeback change file" function from the menu.

The text shown in the contents view is readonly - changes cannot be changed.

The accept function of the contents view has been redefined to perform an apply change (see below).

A changeBrowser can be started either from the launcher (it is found in the "Browsers" submenu), or by evaluating the expression:

    ChangesBrowser open
in a workspace. Use of the changesBrowser is not limited to the 'changes' file; any file which contains expressiones in changefile-format can be manipulated.
For example, a browser on a backup changeFile 'changes.bak' file is opened with:
    ChangesBrowser openOn:'changes.bak'
and, because Smalltalks regular fileOut (i.e. source-file) format also consists of chumks, it can be even opened on a classes source:
    ChangesBrowser openOn:'../../libbasic/Object.st'
which is useful to import, compare or investigate other/public-domain smalltalk code.

A changeSetBrowser on a changeSet can be opened by:

    ChangeSetBrowser openOn:(ChangeSet current)
In addition to reapplying or undoing previous changes to the system, integration/merge of other peoples changes into your current environment can also be done this way - by opening a cahngeBrowser on the other persons changeFile and applying changes as required.
Since this is a common task, the FileBrowser provides a menu-item for this in its tools menu.

Change list menu functions

The top part of the changes browser is called changelist view and offers the following functions in its popup menu:
(notice: new versions of the changeBrowser also provide these functions in the main window menu). Pressing the Control (CTRL-) Key while right clicking brings up a search menu.

Recovering after a crash

After a crash of Smalltalk/X (or the machine), you should use a changesBrowser to reapply all changes made. Usually, you would look for the last "snapshot"-entry in the change list and apply all changes after that one up to the end.
If the crash was caused by one of those changes (for example, you redefined a system method), the best approach is to manually apply individual changes upto, but excluding the 'bad'-one..
If the crash was caused by a system breakDown or power failure (or because you forgot to leave ST/X before shutting down the windowSystem), you can execute the ``apply changes to end'' function.

Keeping the change file small

Since the change file grows over time (while programming), and having a big changefile slows down the ChangesBrowser startup, old changes should be removed from time to time.
To do this, classes should be filed out completely and all changes for that class be removed.

Also a regular compress (which removes all old changes for a method, just leaving the newest one) helps to keep the change file smaller.

Writing to another change file

The launchers ``settings-source & debugger''-menu provides an field to change the name of the changeFile (into which changes are written).
Change this if either two or more people are working in the same directory (to avoid one user to overwrite the others change file) or to separate changes on a per project or per image basis.
But keep in mind, that ST/X does keep the internal changeSet on a per-project basis anyway.

Caution

The current implementation of the changesBrowser does NOT automatically update its view when new changes are made. Therefore, be careful when a changesBrowser was left open, while changes were made in a browser, and you perform the writeback changes function. These changes made in the meanwhile will then NOT be stored in the newly written changes file.

The changesBrowser will display ``(outdated)'' in the window title, whenever it detects that new changes have been written to the changefile, and the displayed list is not in-sync with it.

If in doubt, perform the update function.

Notice

The functionality provided by the current changesBrowser is probably far from being complete and more functions are required - especially when working in a group on a big project.
If you add any enhancements or extra features, please return them to eXept for inclusion into the next release(s).

Notes:

(*)
By default, the system only adds changed class and method definitions to the changefile. Expressions evaluated by the "doit" function are not appened. (to keep the changefile from growing too fast).
If you want doits to be remembered too, execute:
    Smalltalk logDoits:true
in a workspace or add it to your startup file ('smalltalk.rc' or 'private.rc'), or use the launchers ``settings-source & debugger'' dialog.

[stx-logo]>
Copyright © 1995 Claus Gittinger Development & Consulting, all rights reserved
<P>
<ADDRESS>
<tt><<a href=cg@exept.de>


Doc $Revision: 1.17 $ $Date: 2001/10/10 09:50:34 $