+ <ol class="toc">
+ <li><a href="#s:basics">Basic Use</a></li>
+ <li><a href="#s:merge">Merging Conflicts</a></li>
+ <li><a href="#s:rollback">Recovering Old Versions</a></li>
+ <li><a href="#s:setup">Setting up a Repository</a></li>
+ <li><a href="#s:provenance">Provenance</a></li>
+ <li><a href="#s:summary">Summing Up</a></li>
+ </ol>
+
+<p>
+ Wolfman and Dracula have been hired by Universal Missions
+ (a space services spinoff from Euphoric State University)
+ to figure out where the company should send its next planetary lander.
+ They want to be able to work on the plans at the same time,
+ but they have run into problems doing this in the past.
+ If they take turns,
+ each one will spend a lot of time waiting for the other to finish.
+ On the other hand,
+ if they work on their own copies and email changes back and forth
+ they know that things will be lost, overwritten, or duplicated.
+</p>
+
+<p>
+ The right solution is to use a
+ <a href="glossary.html#version-control-system">version control system</a>
+ to manage their work.
+ Version control is better than mailing files back and forth because:
+</p>
+
+<ol>
+
+ <li>
+ It's hard (but not impossible) to accidentally overlook or overwrite someone's changes,
+ because the version control system highlights them automatically.
+ </li>
+
+ <li>
+ It keeps a record of who made what changes when,
+ so that if people have questions later on,
+ they know who to ask
+ (or blame).
+ </li>
+
+ <li>
+ Nothing that is committed to version control is ever lost.
+ This means it can be used like the "undo" feature in an editor,
+ and since all old versions of files are saved
+ it's always possible to go back in time to see exactly who wrote what on a particular day,
+ or what version of a program was used to generate a particular set of results.
+ </li>
+
+</ol>
+
+<div class="box">
+ <h3>Nothing's Perfekt</h3>
+
+ <p>
+ Version control systems do have one important shortcoming.
+ While it is easy for them to find, display, and merge differences in text files,
+ images, MP3s, PDFs, or Microsoft Word or Excel files aren't stored as text—they
+ use specialized binary data formats.
+ Most version control systems don't know how to deal with these formats,
+ so all they can say is, "These files differ."
+ Reconciling those differences will probably require use of an auxiliary tool,
+ such as an audio editor
+ or Microsoft Word's "Compare and Merge" utility.
+ </p>
+</div>
+
+<p>
+ The rest of this chapter will explore how to use
+ a popular open source version control system called Subversion.
+</p>
+
+<div class="guide">
+ <h2>For Instructors</h2>
+
+ <p class="fixme">explain</p>
+
+ <div class="prereq">
+ <h3>Prerequisites</h3>
+ <p class="fixme">prereq</p>
+ </div>
+
+ <div class="notes">
+ <h3>Teaching Notes</h3>
+ <ul>
+ </ul>
+ </div>
+
+</div>
+
+<section id="s:basics">
+ <h2>Basic Use</h2>
+
+ <div class="understand">
+ <h3>Learning Objectives:</h3>
+ <ul>
+ <li>Where version control stores information.</li>
+ <li>How to check out a working copy of a repository.</li>
+ <li>How to view the history of changes to a project.</li>
+ <li>Why working copies of different projects should not overlap.</li>
+ <li>How to add files to a project.</li>
+ <li>How to submit changes made locally to a project's master copy.</li>
+ <li>How to update a working copy to get changes made to the master.</li>
+ <li>How to check the status of a working copy.</li>
+ </ul>
+ </div>
+
+ <p>
+ A version control system keeps the master copy of a file
+ in a <a href="glossary.html#repository">repository</a>
+ located on a <a href="glossary.html#server">server</a>—a computer
+ that is never used directly by people,
+ but only by their programs
+ (<a href="#f:repository">Figure 1</a>).
+ No-one ever edits the master copy directly.
+ Instead,
+ Wolfman and Dracula each have a <a href="glossary.html#working-copy">working copy</a>
+ on their own machines.
+ They can each edit their working copies whenever and however they want.
+ </p>
+
+ <figure id="f:repository">
+ <img src="svn/repository.png" alt="Repositories and Working Copies" />
+ <figcaption>Figure 1: Repositories and Working Copies</figcaption>
+ </figure>
+
+ <p id="a:commit">
+ When Wolfman is ready to share his changes with Dracula,
+ he <a href="glossary.html#commit">commits</a> his work to the repository
+ (<a href="#f:workflow">Figure 2</a>).
+ Dracula can then <a href="glossary.html#update">update</a> his working copy
+ to get those changes when he's ready for them.
+ And of course,
+ when Dracula finishes working on something,
+ he can commit and so that Wolfman can update.
+ </p>
+
+ <figure id="f:workflow">
+ <img src="svn/workflow.png" alt="Sharing Files Through Version Control" />
+ <figcaption>Figure 2: Sharing Files Through Version Control</figcaption>
+ </figure>
+
+ <p>
+ If this is all there was to version control,
+ it would be no better than FTP or Dropbox.
+ But what if Dracula and Wolfman change their working copies at the same time?
+ If Wolfman commits first,
+ his changes are simply copied to the repository
+ (<a href="#f:merge_first_commit">Figure 3</a>):
+ </p>
+
+ <figure id="f:merge_first_commit">
+ <img src="svn/merge_first_commit.png" alt="Wolfman Commits First" />
+ <figcaption>Figure 3: Wolfman Commits First</figcaption>
+ </figure>
+
+ <p class="continue">
+ If Dracula now tries to commit something that would overwrite Wolfman's changes
+ the version control system detects the <a href="glossary.html#conflict">conflict</a>,
+ halts the commit,
+ and tells Dracula that there's a problem
+ (<a href="#f:merge_second_commit">Figure 4</a>):
+ </p>
+
+ <figure id="f:merge_second_commit">
+ <img src="svn/merge_second_commit.png" alt="Dracula Has a Conflict" />
+ <figcaption>Figure 4: Dracula Has a Conflict</figcaption>
+ </figure>
+
+ <p class="continue">
+ Dracula must <a href="glossary.html#resolve">resolve</a> that conflict
+ before the version control system will allow him to commit his work.
+ He can accept what Wolfman did,
+ replace it with what he has done,
+ or write something new that combines the two—that's up to him
+ (<a href="#f:merge_resolve">Figure 5</a>).
+ Once he has cleaned things up, he can go ahead and try committing again.
+ If all of the conflicts have been resolved,
+ the version control will accept it this time.
+ </p>
+
+ <figure id="f:merge_resolve">
+ <img src="svn/merge_resolve.png" alt="Resolving the Conflict" />
+ <figcaption>Figure 5: Resolving the Conflict</figcaption>
+ </figure>
+
+ <div class="box">
+ <h3>Forgiveness vs. Permission</h3>