
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
74
|
Chapter 5: Repository Administration
Understanding Transactions and Revisions
Conceptually speaking, a Subversion repository is a sequence of directory trees. Each
tree is a snapshot of how the files and directories versioned in your repository looked
at some point in time. These snapshots are created as a result of client operations,
and are called revisions.
Every revision begins life as a transaction tree. When doing a commit, a client builds
a Subversion transaction that mirrors their local changes (plus any additional
changes that might have been made to the repository since the beginning of the cli-
ent’s commit process), and then instructs the repository to store that tree as the next
snapshot in the sequence. If the commit succeeds, the transaction is effectively pro-
moted into a new revision tree, and is assigned a new revision number. If the com-
mit fails for some reason, the transaction is destroyed and the client is informed of
the failure.
Updates work in a similar way. The client builds a temporary transaction tree that
mirrors the state of the working copy. The repository then compares that transac-
tion tree with the revision tree at the requested revision (usually the most recent, or
youngest tree), and sends back information that informs the client about what
changes ...