Using the Changes Browser
Smalltalk/X keeps track of all your changes made to either
the class hierarchy or to individual methods in a file called
'changes'
. For each change, one record
(i.e. one chunk in fileOut-format)
is appended to this file (*).
The changesBrowser allows inspection and manipulation of this
file.
It consists of 2 subviews; which are:
- change list view
- contents view
The change list shows a list of all 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 remains
unmodified unless you execute the "writeback change file"
function from the
changelists popup-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 the 'patches'
file is opened with:
ChangesBrowser openOn:'patches'
Also, integration/merge of other peoples changefile into your current
environment is done this way.
The top part of the changes browser is called changelist view and
offers the following functions in its popup menu:
- apply change
apply the currently selected change (i.e. redo it)
The accept key (usually CMD-a) in the codeview
performs this funtion too.
- apply changes to end
apply all changes from the currently selected one up to the end.
- apply changes for this class to end
apply all changes from the currently selected one up to the end
which affect the same class as the currently selected changes class.
- apply all changes
apply all changes from the very first to the very last in the list
- delete
delete the currently selected change
from the list (the deletion becomes effective
when the change-list is written back to the
changes file - see below)
Pressing the Delete key in the changeList view has the same effect.
- delete to end
deletes all changes from the currently selected one up to the end.
- delete changes for this class to end
delete all changes affecting the same classas the currently selected change, up to
the end.
- delete all changes for this class
delete all changes (from the beginning to the end)
which affect the same class as the currently selected changes class.
(useful after a class-fileOut)
- update
reread the changes file (useful as an undo)
- compress
compress the change list.
This function removes multiple changes for a method leaving the last one.
- compare with current version
compare a methods code in a change with
the current and output a message on the
Transcript. If there are any differences,
open up a view showing differences.
- browse class
opens a browser on the class of the current change
- make change a patch
append the change to the end of the
'patches'
file, making the change be
automatically applied on the next startup.
- save change in file
append the current changes text to a file.
A DialogBox will ask you for the files name.
- save change to end in file
append all changes from the currently selected one to the
last change to a file.
A DialogBox will ask you for the files name.
- save changes for this class to end in file
append all changes from the currently selected one to the
last change which affect the same class as the currently selected change
to a file.
A DialogBox will ask you for the files name.
- save all changes for this class in file
append all changes from the very first one to the
last change which affect the same class as the currently selected change
to a file.
A DialogBox will ask you for the files name.
- writeback changefile
writeback the change list to the changes
file. All delete/compress operations
performed in the changesBrowser will
not affect the changes-file unless this
operation is performed.
After a crash of Smalltalk/X, 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..
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.
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'
).
Copyright © Claus Gittinger Development & Consulting, all rights reserved
(cg@ssw.de)