User can work with ClearCase from Emacs using either backend module for VC package, either using specialized package called clearcase. Last package has more features, comparing backend for VC and for users it's better to use it. This package supports following functions:
The clearcase package is available for download from author's page. It could be used with GNU Emacs 20.4 or higher, and with latest versions of XEmacs. It could work with different operating systems — with different MS Windows, and with Unix-like OSes. To use package you need to download file to place where Emacs find it, and execute following command:
Warning: this package sometimes has problems with old versions of vc-hooks package, as they use incompatible versions of tq package. But this happens not so often.
The clearcase package tries to keep compatibility with VC package in key bindings. But interface, that is implemented by package, is more powerful and better reflects ideology of ClearCase than backend for VC package.
Besides functions and key bindings user can use
ClearCase menu, that is added to menu bar
when he edit files with ClearCase minor-mode enabled. User can perform all basic commands
directly from Emacs, and also can run external utilities from ClearCase distribution.
Many operations could be performed in the Dired mode — view tree of files versions, work
with several files (checking them in and out), etc. To work with directories, that are
registered in ClearCase the clearcase package defines special mode —
For all key bindings the clearcase package use prefix key
C-x v. To avoid problems with
VC's key bindings, the clearcase package removes needless key bindings, when you work with
files, registered in ClearCase.
All functions we can split into several logical groups — work with files, work with
changes, work with external utilities, and other functions. For almost any function, that
works with current file (they have suffix
-current-buffer) there is also function that
provides work with file from Dired buffer (such functions have suffix
Usually both variants has same key bindings, that call appropriate function, depending on
places in which they was pressed — current file, or Dired buffer.
The clearcase package tries to keep work logic of VC package as much as possible. It
defines two functions —
C-x v v) and
clearcase-next-action-dired-files (same key binding, but in Dired mode), that performs
following operation on current file (or selected files). To change state of current file
you can use
clearcase-toggle-read-only function (
C-x C-q), that either allow modification
of file, either switch it to read-only state.
The package allows user to perform bulk operations of getting data from repository and
committing them back. To retrieve data from repository user can use following functions:
clearcase-dired-checkout-current-dir, that retrieve actual versions for current file,
selected files and current directory. And to commit data back to repository there are
functions with similar names —
clearcase-dired-checkin-current-dir. To cancel changes
user can use either
clearcase-uncheckout-current-buffer function (it bound to
C-x v c or
C-x v u), or
clearcase-uncheckout-dired-files function (it has same key bindings, but work
To register files in the ClearCase user can use either
C-x v i), that register current file, or
that register selected files.
To update data from repository we can use
functions, that update corresponding object — current file, selected files, directory or
view. And we can also can get concrete file version with
function, that bound to
C-x v ~.
We also can create a new branch with
clearcase-mkbrtype function, that bound to
C-x v m.
Other branch manipulations are performed the same way as in VC.
All functions, that implement work with changes we can split into two groups. First group
diff to get changes between versions (their names started with
while second group use ediff package (and their names start with
describe only functionss from first group, as there are no differences between them, except
C-x v =) and
clearcase-diff-pred-dired-filefunctions compare current file (or selected files) with their previous versions;
clearcase-diff-branch-base-dired-filecompare current file (or selected files) with their base versions in the current branch;
clearcase-diff-named-version-dired-filecompare current file (or selected files) with concrete named version of files.
To get information about files we can use several functions. The
clearcase-describe-current-buffer function (
C-x v ?) could be used to get description of
current file, while
clearcase-describe-dired-file is used to get information about
User can also get annotated copy of file(s) with
clearcase-annotate-dired-file functions. And to get history of changes, he can use
C-x v l) or
User can also use clearcase package to work with ClearCase file's properties, that could
be assigned to each registered file. User can view them with
clearcase-fprop-display-properties function, and insert them into current buffer with
User can use clearcase package to run many utilities from ClearCase's distribution without leaving Emacs:
clearcase-gui-merge-manager— runs merge manager;
clearcase-gui-project-explorer— runs utility that works with projects
clearcase-gui-vtree-browser-current-buffer— runs project tree browser for current buffer;
clearcase-gui-vtree-browser-dired-file— runs project tree browser for selected files.
It also allows to use external utilities with graphical interface to view changes in files:
clearcase-gui-diff-branch-base-current-buffer— show difference between current file and its base version;
clearcase-gui-diff-branch-base-dired-file— show difference between selected files and their base versions;
clearcase-gui-diff-pred-current-buffer— show difference between current file and its previous version;
clearcase-gui-diff-pred-dired-file— show difference between selected files and their previous versions.
User can edit ClearCase configuration with functions, those names starts with
clearcase-edcs. For editing configurations, there is a special mode —
clearcase-edcs-mode, that could be enabled by function with the same name. User can edit
clearcase-edcs-edit function (
C-x v e), and save changes with
clearcase-edcs-save. To finish work with configuration there is special function —
If there are some problems with package, then user can trace state of package with special
functions. To enable tracing user can use
clearcase-enable-tracing function, and to
clearcase-disable-tracing function. User can also get data about package's
internal state with
clearcase-dump function. But this is happen not so often. And if you
find a bug in package, then you can set bug report with
function, that collects all needed data (values of variables, version of Emacs, etc.) and
prepare it to sending.
As for many other packages, the clearcase package supports customization via standard
Emacs routines. User just need to execute
M-x customize-group clearcase to do this. He
can set many parameters, for example, which program will be used as
diff, etc. User can
also set (and remove) special hooks with
Last change: 05.03.2013 16:54