|
|
A4 is a library of Perl modules and associated scripts for automating
°Perforce codeline
(a.k.a. branch) management according to certain conventions.
The concept of a codeline is formalized.
Each codeline may have its own regression and default view.
The creation of workspaces (a.k.a. clients) and codelines,
as well as integration between codelines, is automated.
A4 does not supplant the direct use of Perforce — it merely streamlines
some operations that are otherwise complicated and error-prone.
Clients and branches created with A4 are specializations of Perforce
clients and branches, respectively, that can be accessed either through
A4 or through ordinary Perforce operations.
|
|
|
|
The regression is a hook into which you can attach an executable that does
whatever you want.
A presubmit trigger optionally runs the regression for every submitted change.
An attempt to submit a change that fails the regression will itself fail, and
therefore the codeline can never be "broken."
Changes that might otherwise be stranded because they cannot be successfully
submitted may be projected onto another workspace — most likely a workspace
based on a different codeline.
|
|
Automatic View Generation
|
|
|
Each codeline has a default view that is set up automatically when workspaces
are created via A4.
Changes to the default view propagate through a designated file in the
workspace.
If the view file is missing, then the view is similar to that of the parent
codeline, but points to a different tree in the depot, such that workspaces
look and feel much like workspaces based on the parent codeline.
The scope of codeline integration is controlled via an alternate client view
that is also defined by a workspace file, and the branch view itself never
changes.
The problem of concurrent codeline branch spec editors wiping out each other's
changes is thereby avoided.
|
|
|
|
The generation of clean workspaces (cleanly tested clean builds of clean
source configurations) is scripted.
New workspaces can be cloned from a reference build, such that they can be
built incrementally, potentially saving hours or even days of build time.
|
|
Automatic Workspace Configuration
|
|
|
By default, A4 deletes the Host property and locks clients
(which is almost always desirable in an environment with shared file systems).
Also, if your A4_ALT_ROOTS environment variable is set to reflect your
drive mappings, then the AltRoots property is set automatically.
.p4env files are also created automatically, so that the correct
client is always selected.
To support directory sensitive Perforce settings (e.g. P4DIFF),
simply create a .p4props file, and a corresponding .p4env
file that specifies the present client will be generated.
If you use Perforce passwords (and you should, because otherwise your account
is wide open to anyone on the network) just create a "~/.p4passwd"
file.
Then your .p4env files will be unreadable by others, and will set your
password.
(Never set P4PASSWD from your environment or on the command line,
because then it's visible to other users via ps(1) on many systems.)
|
|
|
|
Every directory in a workspace created by A4 contains a relative
symbolic link to the client root.
This is useful for referring to another file in the tree by a "pseudo-absolute"
path, e.g. ".p4top/foo/bar.pl".
Because the target directory is always the same node (as long as you stay
in the same workspace), it is usually legitimate to use such a path where an
absolute path would otherwise be required, such as the value of a
PREFIX configuration variable in an install script.
|
|
|
|
Because each codeline can be guaranteed to satisfy certain properties by virtue
of having passed its own regression, A4 is particularly well-suited to
any of the various evolutionary development paradigms, such as Evolutionary
Prototyping, Evolutionary Delivery, Time-box Development, Extreme Programming,
and many others.
Most of these paradigms dictate that near-production test occurs early and
often — as often as several times per day.
By preventing malfunctional changes from entering prominent codelines, without
requiring costly code freezes, A4 ensures that parallel development
activities can continue uninterrupted.
Productivity can therefore increase substantially.
|
|
|