
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
12
|
Chapter 2: Basic Concepts
made to each are semantically incompatible. Suddenly A and B don’t work
together anymore. The locking system was powerless to prevent the problem—
yet it somehow provided a false sense of security. It’s easy for Harry and Sally to
imagine that by locking files, each is beginning a safe, insulated task, and thus
inhibits them from discussing their incompatible changes early on.
The Copy-Modify-Merge Solution
Subversion, CVS, and other version control systems use a copy-modify-merge model
as an alternative to locking. In this model, each user’s client contacts the project
repository and creates a personal working copy—a local reflection of the repository’s
files and directories. Users then work in parallel, modifying their private copies.
Finally, the private copies are merged together into a new, final version. The version
control system often assists with the merging, but ultimately a human being is
responsible for making it happen correctly.
Here’s an example. Say that Harry and Sally each create working copies of the same
project, copied from the repository. They work concurrently, and make changes to
the same file A within their copies. Sally saves her changes to the repository first.
Figure 2-3. The lock-modify-unlock solution
A
Repository
Harry
LOCK
Sally ...