For many purposes, it is useful to have a library containing pristine trees of a large number of revisions – for example, all of the revisions in a particular version. To be practical, though, such a library must be represented in a space-efficient way.
Unix hard-links provide a natural way to store such a library. Each successive revision in a series is a copy of the previous, but with unmodified files shared via hard-links.
arch provides commands to help you build, maintain, and browse such
As a pleasant side effect, many
arch commands are speeded up if the
revisions they need to operate are present in your revision library.
You can read more about this in the next chapter.
To begin a new revision library, first create a new directory (
and then register its location:
% tla my-revision-library DIR
You can check the location of your library with:
% tla my-revision-library
or unregister it with:
% tla my-revision-library -d DIR
Note that you can have more than one revision library: in effect you have a "path" listing all of your library locations.
A revision library has subdirectories of the form:
REVISION directory contains the complete source of a particular
revision, along with some supplemantary subdirectories and files:
REVISION/,,patch-set/ The patch set that creates this revision from its ancestor (unless the revision is a full-source base revision).
Although the permissions on files in the revision library are
determined as determined by patch sets, you must never modify files
int the revision library. Doing so will cause odd errors and
failures in various
You can add a selected revision to your revision library with:
% tla library-add REVISION
library-add will normally add not only
REVISION to the library,
but all directly preceeding revisions (recursively) which are from the
version as REVISION.
If you want to add only REVISION and no others, use the
% tla library-add --sparse REVISION
You can find a particular revision in the library with
% tla library-find REVISION PATH-TO-REVSION
The output is an absolute path name to the library directory containing the revision. (Once again, you must not modify files in that directory.)
To remove a particular revision from the library, use:
% tla library-remove REVISION
Be aware of the following limitation in the current release: suppose
that you add three successive revisions,
C. Then you
B, then re-add
B. Now there is a chance that the file
C will be less than optimal, causing your
library to be larger than it needs to be. (You can fix this by then
removing and re-adding
library-archives lists all archives with records in the library:
% tla library-archives ARCHIVE-NAME ARCHIVE-NAME ...
Similarly, you can list categories, branches, versions, or revisions:
% tla library-categories [ARCHIVE] % tla library-branches [ARCHIVE/CATEGORY] % tla library-versions [ARCHIVE/BRANCH] % tla library-revisions [ARCHIVE/VERSION]
You can locate an individual file in a revision library with:
% tla library-file FILE [REVISION] PATH
or obtain its contents with:
% tla cat-library-file FILE [REVISION] ...file contents...
Both commands accept the options
FILE is interpreted as an inventory id, and the file
with that id is found.
FILE is interpreted as a file relative to the current
directory, which should be part of a project tree. The file's
inventory id is computed and the corresponding file found in
% tla touched-files-prereqs REVISION
That command looks at the patch set for
REVISION and at all
preceding patch sets in the same version (it searches your library
rather than your repository for this purpose). It reports the list of
patches that touch overlapping sets of files and directories – in
other words, it tells you what patches can be applied independently of
others. The command has an option to exclude from consideration file
names matching a certain pattern (e.g. =README or ChangeLog). It
has an option to exclude from the output list patches which have
already been applied to a given project tree. It has an option to
report the specific files which are overlapped.