Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > e8fe8188cee5592550f08a19b470186d > files > 220

subversion-doc-1.9.7-1.mga6.x86_64.rpm

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Examining History</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" />
    <style type="text/css">
body { background-image: url('images/draft.png');
       background-repeat: no-repeat;
       background-position: top left;
       /* The following properties make the watermark "fixed" on the page. */
       /* I think that's just a bit too distracting for the reader... */
       /* background-attachment: fixed; */
       /* background-position: center center; */
     }</style>
    <link rel="home" href="index.html" title="Version Control with Subversion [DRAFT]" />
    <link rel="up" href="svn.tour.html" title="Chapter 2. Basic Usage" />
    <link rel="prev" href="svn.tour.cycle.html" title="Basic Work Cycle" />
    <link rel="next" href="svn.tour.cleanup.html" title="Sometimes You Just Need to Clean Up" />
  </head>
  <body>
    <div xmlns="" id="vcws-version-notice">
      <p>This text is a work in progress—highly subject to
       change—and may not accurately describe any released
       version of the Apache™ Subversion® software.
       Bookmarking or otherwise referring others to this page is
       probably not such a smart idea.  Please visit
       <a href="http://www.svnbook.com/">http://www.svnbook.com/</a>
       for stable versions of this book.</p>
    </div>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Examining History</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="svn.tour.cycle.html">Prev</a> </td>
          <th width="60%" align="center">Chapter 2. Basic Usage</th>
          <td width="20%" align="right"> <a accesskey="n" href="svn.tour.cleanup.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" title="Examining History">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="svn.tour.history"></a>Examining History</h2>
          </div>
        </div>
      </div>
      <p>Your Subversion repository is like a time machine.  It keeps
      a record of every change ever committed and allows you to
      explore this history by examining previous versions of files and
      directories as well as the metadata that accompanies them.  With
      a single Subversion command, you can check out the repository
      (or restore an existing working copy) exactly as it was at any
      date or revision number in the past.  However, sometimes you
      just want to <span class="emphasis"><em>peer into</em></span> the past instead of
      <span class="emphasis"><em>going into</em></span> it.</p>
      <p>Several commands can provide you with historical data from
      the repository:</p>
      <div class="variablelist">
        <dl>
          <dt>
            <span class="term">
              <span class="command">
                <strong>svn diff</strong>
              </span>
            </span>
          </dt>
          <dd>
            <p>Shows line-level details of a particular change</p>
          </dd>
          <dt>
            <span class="term">
              <span class="command">
                <strong>svn log</strong>
              </span>
            </span>
          </dt>
          <dd>
            <p>Shows you broad information: log messages with date
              and author information attached to revisions and which
              paths changed in each revision</p>
          </dd>
          <dt>
            <span class="term">
              <span class="command">
                <strong>svn cat</strong>
              </span>
            </span>
          </dt>
          <dd>
            <p>Retrieves a file as it existed in a particular
              revision number and displays it on your screen</p>
          </dd>
          <dt>
            <span class="term">
              <span class="command">
                <strong>svn annotate</strong>
              </span>
            </span>
          </dt>
          <dd>
            <p>Retrieves a human-readable file as it existed in a
              particular revision number, displaying its contents in a
              tabular form with last-changed information attributed to
              each line of the file.</p>
          </dd>
          <dt>
            <span class="term">
              <span class="command">
                <strong>svn list</strong>
              </span>
            </span>
          </dt>
          <dd>
            <p>Displays the files in a directory for any given
              revision</p>
          </dd>
        </dl>
      </div>
      <div class="sect2" title="Examining the Details of Historical Changes">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="svn.tour.history.diff"></a>Examining the Details of Historical Changes</h3>
            </div>
          </div>
        </div>
        <p>We've already seen <span class="command"><strong>svn diff</strong></span>
        before—it displays file differences in unified diff
        format; we used it to show the local modifications made to
        our working copy before committing to the repository.</p>
        <p>In fact, it turns out that there are
        <span class="emphasis"><em>three</em></span> distinct uses of <span class="command"><strong>svn
        diff</strong></span>:</p>
        <div class="itemizedlist">
          <ul class="itemizedlist" type="disc">
            <li class="listitem">
              <p>Examining local changes</p>
            </li>
            <li class="listitem">
              <p>Comparing your working copy to the repository</p>
            </li>
            <li class="listitem">
              <p>Comparing repository revisions</p>
            </li>
          </ul>
        </div>
        <div class="sect3" title="Examining local changes">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="svn.tour.history.diff.local"></a>Examining local changes</h4>
              </div>
            </div>
          </div>
          <p>As we've seen, invoking <strong class="userinput"><code>svn diff</code></strong> with
          no options will compare your working files to the cached
          <span class="quote">“<span class="quote">pristine</span>”</span> copies in
          the <code class="filename">.svn</code> area:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn diff
Index: rules.txt
===================================================================
--- rules.txt	(revision 3)
+++ rules.txt	(working copy)
@@ -1,4 +1,5 @@
 Be kind to others
 Freedom = Responsibility
 Everything in moderation
-Chew with your mouth open
+Chew with your mouth closed
+Listen when others are speaking
$
</pre>
          </div>
        </div>
        <div class="sect3" title="Comparing working copy to repository">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="svn.tour.history.diff.wcrepos"></a>Comparing working copy to repository</h4>
              </div>
            </div>
          </div>
          <p>If a single <code class="option">--revision</code>
          (<code class="option">-r</code>) number is passed, your
          working copy is compared to the specified revision in the
          repository:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn diff -r 3 rules.txt
Index: rules.txt
===================================================================
--- rules.txt	(revision 3)
+++ rules.txt	(working copy)
@@ -1,4 +1,5 @@
 Be kind to others
 Freedom = Responsibility
 Everything in moderation
-Chew with your mouth open
+Chew with your mouth closed
+Listen when others are speaking
$
</pre>
          </div>
        </div>
        <div class="sect3" title="Comparing repository revisions">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="svn.tour.history.diff.reposrepos"></a>Comparing repository revisions</h4>
              </div>
            </div>
          </div>
          <p>If two revision numbers, separated by a colon, are
          passed via <code class="option">--revision</code>
          (<code class="option">-r</code>), the two revisions are directly
          compared:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn diff -r 2:3 rules.txt
Index: rules.txt
===================================================================
--- rules.txt	(revision 2)
+++ rules.txt	(revision 3)
@@ -1,4 +1,4 @@
 Be kind to others
-Freedom = Chocolate Ice Cream
+Freedom = Responsibility
 Everything in moderation
 Chew with your mouth open
$
</pre>
          </div>
          <p>A more convenient way of comparing one revision to the
          previous revision is to use the <code class="option">--change</code>
          (<code class="option">-c</code>) option:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn diff -c 3 rules.txt
Index: rules.txt
===================================================================
--- rules.txt	(revision 2)
+++ rules.txt	(revision 3)
@@ -1,4 +1,4 @@
 Be kind to others
-Freedom = Chocolate Ice Cream
+Freedom = Responsibility
 Everything in moderation
 Chew with your mouth open
$
</pre>
          </div>
          <p>Lastly, you can compare repository revisions even when
          you don't have a working copy on your local machine, just by
          including the appropriate URL on the command line:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn diff -c 5 http://svn.example.com/repos/example/trunk/text/rules.txt
…
$
</pre>
          </div>
        </div>
      </div>
      <div class="sect2" title="Generating a List of Historical Changes">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="svn.tour.history.log"></a>Generating a List of Historical Changes</h3>
            </div>
          </div>
        </div>
        <p>To find information about the history of a file or
        directory, use the <span class="command"><strong>svn log</strong></span>
        command. <span class="command"><strong>svn log</strong></span> will provide you with a
        record of who made changes to a file or directory, at what
        revision it changed, the time and date of that revision,
        and—if it was provided—the log message that accompanied
        the commit:</p>
        <div class="informalexample">
          <pre class="screen">
$ svn log
------------------------------------------------------------------------
r3 | sally | 2008-05-15 23:09:28 -0500 (Thu, 15 May 2008) | 1 line

Added include lines and corrected # of cheese slices.
------------------------------------------------------------------------
r2 | harry | 2008-05-14 18:43:15 -0500 (Wed, 14 May 2008) | 1 line

Added main() methods.
------------------------------------------------------------------------
r1 | sally | 2008-05-10 19:50:31 -0500 (Sat, 10 May 2008) | 1 line

Initial import
------------------------------------------------------------------------
</pre>
        </div>
        <p>Note that the log messages are printed in
        <span class="emphasis"><em>reverse chronological order</em></span> by default.
        If you wish to see a different range of revisions in a
        particular order or just a single revision, pass the
        <code class="option">--revision</code> (<code class="option">-r</code>)
        option:</p>
        <div class="table">
          <a id="svn.tour.history.log.tbl-1"></a>
          <p class="title">
            <strong>Table 2.1. Common log requests</strong>
          </p>
          <div class="table-contents">
            <table summary="Common log requests" border="1">
              <colgroup>
                <col />
                <col />
              </colgroup>
              <thead>
                <tr>
                  <th>Command</th>
                  <th>Description</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td>
                    <strong class="userinput">
                      <code>svn log -r 5:19</code>
                    </strong>
                  </td>
                  <td>Display logs for revisions 5 through 19 in
                chronological order</td>
                </tr>
                <tr>
                  <td>
                    <strong class="userinput">
                      <code>svn log -r 19:5</code>
                    </strong>
                  </td>
                  <td>Display logs for revisions 5 through 19 in
                reverse chronological order</td>
                </tr>
                <tr>
                  <td>
                    <strong class="userinput">
                      <code>svn log -r 8</code>
                    </strong>
                  </td>
                  <td>Display logs for revision 8 only</td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <br class="table-break" />
        <p>You can also examine the log history of a single file or
        directory.  For example:</p>
        <div class="informalexample">
          <pre class="screen">
$ svn log foo.c
…
$ svn log http://foo.com/svn/trunk/code/foo.c
…
</pre>
        </div>
        <p>These will display log messages <span class="emphasis"><em>only</em></span>
        for those revisions in which the named file (or directory)
        changed.</p>
        <div class="sidebar" title="Why Does svn log Not Show Me What I Just Committed?">
          <div class="titlepage">
            <div>
              <div>
                <p class="title">
                  <strong>Why Does svn log Not Show Me What I
          Just Committed?</strong>
                </p>
              </div>
            </div>
          </div>
          <p>If you make a commit and immediately type <strong class="userinput"><code>svn
          log</code></strong> with no arguments, you may notice that your
          most recent commit doesn't show up in the list of log
          messages.  This is due to a combination of the behavior of
          <span class="command"><strong>svn commit</strong></span> and the default behavior of
          <span class="command"><strong>svn log</strong></span>.  First, when you commit changes
          to the repository, <span class="command"><strong>svn</strong></span> bumps only the
          revision of files (and directories) that it commits, so
          usually the parent directory remains at the older revision
          (See
          <a class="xref" href="svn.basic.in-action.html#svn.basic.in-action.mixedrevs.update-commit" title="Updates and commits are separate">the section called “Updates and commits are separate”</a>
          for an explanation of why).  <span class="command"><strong>svn log</strong></span> then
          defaults to fetching the history of the directory at its
          current revision, and thus you don't see the newly committed
          changes.  The solution here is to either update your working
          copy or explicitly provide a revision number to <span class="command"><strong>svn
          log</strong></span> by using the <code class="option">--revision</code>
          (<code class="option">-r</code>) option.</p>
        </div>
        <p>If you want even more information about a file or
        directory, <span class="command"><strong>svn log</strong></span> also takes a
        <code class="option">--verbose</code> (<code class="option">-v</code>) option.
        Because Subversion allows you to move and copy files and
        directories, it is important to be able to track path changes
        in the filesystem.  So, in verbose mode, <span class="command"><strong>svn
        log</strong></span> will include a list of changed paths in a
        revision in its output:</p>
        <div class="informalexample">
          <pre class="screen">
$ svn log -r 8 -v
------------------------------------------------------------------------
r8 | sally | 2008-05-21 13:19:25 -0500 (Wed, 21 May 2008) | 1 line
Changed paths:
   M /trunk/code/foo.c
   M /trunk/code/bar.h
   A /trunk/code/doc/README

Frozzled the sub-space winch.

------------------------------------------------------------------------
</pre>
        </div>
        <p><span class="command"><strong>svn log</strong></span> also takes
        a <code class="option">--quiet</code> (<code class="option">-q</code>) option, which
        suppresses the body of the log message.  When combined
        with <code class="option">--verbose</code> (<code class="option">-v</code>), it
        gives just the names of the changed files.</p>
        <div class="sidebar" title="Why Does svn log Give Me an Empty Response?">
          <div class="titlepage">
            <div>
              <div>
                <p class="title">
                  <strong>Why Does svn log Give Me an Empty
          Response?</strong>
                </p>
              </div>
            </div>
          </div>
          <p>After working with Subversion for a bit, most users will
          come across something like this:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn log -r 2
------------------------------------------------------------------------
$
</pre>
          </div>
          <p>At first glance, this seems like an error.  But recall
          that while revisions are repository-wide, <span class="command"><strong>svn
          log</strong></span> operates on a path in the repository.  If you
          supply no path, Subversion uses the current working
          directory as the default target.  As a result, if you're
          operating in a subdirectory of your working copy and attempt
          to see the log of a revision in which neither that directory
          nor any of its children was changed, Subversion will show you
          an empty log.  If you want to see what changed in that
          revision, try pointing <span class="command"><strong>svn log</strong></span> directly at
          the topmost URL of your repository, as in <strong class="userinput"><code>svn log
          -r 2 ^/</code></strong>.</p>
        </div>
        <p>As of Subversion 1.7, users of the Subversion command-line
        can also take advantage of a special output mode
        for <span class="command"><strong>svn log</strong></span> which integrates a difference
        report such as is generated by the <span class="command"><strong>svn diff</strong></span>
        command we introduced earlier.  When you invoke <span class="command"><strong>svn
        log</strong></span> with the <code class="option">--diff</code> option,
        Subversion will append to each revision log chunk in the log
        report a <span class="command"><strong>diff</strong></span>-style difference report.
        This is a very convenient way to see both the high-level, semantic
        changes and the line-based modifications of a revision all at
        the same time!</p>
      </div>
      <div class="sect2" title="Browsing the Repository">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="svn.tour.history.browsing"></a>Browsing the Repository</h3>
            </div>
          </div>
        </div>
        <p>Using <span class="command"><strong>svn cat</strong></span> and <span class="command"><strong>svn
        list</strong></span>, you can view various revisions of files and
        directories without changing the working revision of your
        working copy.  In fact, you don't even need a working copy to
        use either one.</p>
        <div class="sect3" title="Displaying file contents">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="svn.tour.history.browsing.cat"></a>Displaying file contents</h4>
              </div>
            </div>
          </div>
          <p>If you want to examine an earlier version of a file and
          not necessarily the differences between two files, you can use
          <span class="command"><strong>svn cat</strong></span>:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn cat -r 2 rules.txt
Be kind to others
Freedom = Chocolate Ice Cream
Everything in moderation
Chew with your mouth open
$
</pre>
          </div>
          <p>You can also redirect the output directly into a
          file:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn cat -r 2 rules.txt &gt; rules.txt.v2
$
</pre>
          </div>
        </div>
        <div class="sect3" title="Displaying line-by-line change attribution">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="svn.tour.history.browsing.annotate"></a>Displaying line-by-line change attribution</h4>
              </div>
            </div>
          </div>
          <p>Very similar to the <span class="command"><strong>svn cat</strong></span> command
          we discussed in the previous section is the <span class="command"><strong>svn
          annotate</strong></span> command.  This command also displays the
          contents of a versioned file, but it does so using a tabular
          format.  Each line of output shows not only a line of the
          file's content but also the username, the revision number
          and (optionally) the datestamp of the revision in which that
          line was last modified.</p>
          <p>When used with a working copy file target, <span class="command"><strong>svn
          annotate</strong></span> will by default show line-by-line
          attribution of the file as it currently appears in the
          working copy.</p>
          <div class="informalexample">
            <pre class="screen">
$ svn annotate rules.txt
     1      harry Be kind to others
     3      sally Freedom = Responsibility
     1      harry Everything in moderation
     -          - Chew with your mouth closed
     -          - Listen when others are speaking
</pre>
          </div>
          <p>Notice that for some lines, there is no attribution
          provided.  In this case, that's because those lines have
          been modified in the working copy's version of the file.  In
          this way, <span class="command"><strong>svn annotate</strong></span> becomes another
          way for you to see which lines in the file you have
          changed.  You can use the <code class="literal">BASE</code> revision
          keyword (see <a class="xref" href="svn.tour.revs.specifiers.html#svn.tour.revs.keywords" title="Revision Keywords">the section called “Revision Keywords”</a>) to
          instead see the unmodified form of the file as it resides
          in your working copy.</p>
          <div class="informalexample">
            <pre class="screen">
$ svn annotate rules.txt@BASE
     1      harry Be kind to others
     3      sally Freedom = Responsibility
     1      harry Everything in moderation
     1      harry Chew with your mouth open
</pre>
          </div>
          <p>The <code class="option">--verbose (-v)</code> option causes
          <span class="command"><strong>svn annotate</strong></span> to also include on each line
          the datestamp associated with that line's reported revision
          number.  (This adds a significant amount of width to each
          line of ouput, so we'll skip the demonstration here.)</p>
          <p>As with <span class="command"><strong>svn cat</strong></span>, you can also
          ask <span class="command"><strong>svn annotate</strong></span> to display previous
          versions of the file.  This can be a handy trick when, after
          finding out who most recently modified a particular line of
          interest in the file, you then wish to see who modified the
          same line prior to that.</p>
          <div class="informalexample">
            <pre class="screen">
$ svn blame rules.txt -r 2
     1      harry Be kind to others
     1      harry Freedom = Chocolate Ice Cream
     1      harry Everything in moderation
     1      harry Chew with your mouth open
</pre>
          </div>
          <p>Unlike the <span class="command"><strong>svn cat</strong></span> command, the
          functionality of <span class="command"><strong>svn annotate</strong></span> is tied
          heavily to the idea of <span class="quote">“<span class="quote">lines</span>”</span> of text in a
          human-readable file.  As such, if you attempt to run the
          command on a file that Subversion has determined is
          <span class="emphasis"><em>not</em></span> human-readable (per the file's
          <code class="literal">svn:mime-type</code> property—see <a class="xref" href="svn.advanced.props.file-portability.html#svn.advanced.props.special.mime-type" title="File Content Type">the section called “File Content Type”</a> for
          details), you'll get an error message.</p>
          <div class="informalexample">
            <pre class="screen">
$ svn annotate images/logo.png
Skipping binary file (use --force to treat as text): 'images/logo.png'
$
</pre>
          </div>
          <p>As revealed in the error message, you can use
          the <code class="option">--force</code> option to disable this check
          and proceed with the annotation as if the file's contents
          are, in fact, human-readable and line-based.  Naturally, if
          you force Subversion to try to perform line-based annotation
          on a nontextual file, you'll get what you asked for: a
          screenful of nonsense.</p>
          <div class="informalexample">
            <pre class="screen">
$ svn annotate images/logo.png --force
     6      harry \211PNG
     6      harry ^Z
     6      harry 
     7      harry \274\361\MI\300\365\353^X\300…
</pre>
          </div>
          <div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Tip">
              <tr>
                <td rowspan="2" align="center" valign="top" width="25">
                  <img alt="[Tip]" src="images/tip.png" />
                </td>
                <th align="left">Tip</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>Depending on your mood at the time you execute this
            command and your reasons for doing so, you may find
            yourself typing <strong class="userinput"><code>svn blame …</code></strong>
            or <strong class="userinput"><code>svn praise …</code></strong> instead of
            using the canonical <span class="command"><strong>svn annotate</strong></span>
            command form.  That's okay—the Subversion developers
            anticipated as much, so those particular command aliases
            work, too!</p>
                </td>
              </tr>
            </table>
          </div>
          <p>Finally, as with many of Subversion's informational
          commands, you can also reference files in your <span class="command"><strong>svn
          annotate</strong></span> command invocations by their repository
          URLs, allowing access to this information even when you
          don't have ready access to a working copy.</p>
        </div>
        <div class="sect3" title="Listing versioned directories">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="svn.tour.history.browsing.list"></a>Listing versioned directories</h4>
              </div>
            </div>
          </div>
          <p>The <span class="command"><strong>svn list</strong></span> command shows you what
          files are in a repository directory without actually
          downloading the files to your local machine:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn list http://svn.example.com/repo/project
README
branches/
tags/
trunk/
</pre>
          </div>
          <p>If you want a more detailed listing, pass the
          <code class="option">--verbose</code> (<code class="option">-v</code>) flag to get
          output like this:</p>
          <div class="informalexample">
            <pre class="screen">
$ svn list -v http://svn.example.com/repo/project
  23351 sally                 Feb 05 13:26 ./
  20620 harry            1084 Jul 13  2006 README
  23339 harry                 Feb 04 01:40 branches/
  23198 harry                 Jan 23 17:17 tags/
  23351 sally                 Feb 05 13:26 trunk/
</pre>
          </div>
          <p>The columns tell you the revision at which the file or
          directory was last modified, the user who modified it, the size
          if it is a file, the date it was last modified, and the item's
          name.</p>
          <div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
            <table border="0" summary="Warning">
              <tr>
                <td rowspan="2" align="center" valign="top" width="25">
                  <img alt="[Warning]" src="images/warning.png" />
                </td>
                <th align="left">Warning</th>
              </tr>
              <tr>
                <td align="left" valign="top">
                  <p>The <strong class="userinput"><code>svn list</code></strong> command with no
            arguments defaults to the <span class="emphasis"><em>repository
            URL</em></span> of the current working
            directory, <span class="emphasis"><em>not</em></span> the local working copy
            directory.  After all, if you want a listing of your local
            directory, you could use just plain
            <span class="command"><strong>ls</strong></span> (or any reasonable non-Unixy
            equivalent).</p>
                </td>
              </tr>
            </table>
          </div>
        </div>
      </div>
      <div class="sect2" title="Fetching Older Repository Snapshots">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="svn.tour.history.snapshots"></a>Fetching Older Repository Snapshots</h3>
            </div>
          </div>
        </div>
        <p>In addition to all of the previous commands, you can use
        the <code class="option">--revision</code> (<code class="option">-r</code>) option
        with <span class="command"><strong>svn update</strong></span> to take an entire working
        copy <span class="quote">“<span class="quote">back in time</span>”</span>:<sup>[<a id="idp8382096" href="#ftn.idp8382096" class="footnote">8</a>]</sup></p>
        <div class="informalexample">
          <pre class="screen">
# Make the current directory look like it did in r1729.
$ svn update -r 1729
Updating '.':
…
$
</pre>
        </div>
        <div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Tip">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Tip]" src="images/tip.png" />
              </td>
              <th align="left">Tip</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>Many Subversion newcomers attempt to use the preceding
          <span class="command"><strong>svn update</strong></span> example to <span class="quote">“<span class="quote">undo</span>”</span>
          committed changes, but this won't work as you can't commit
          changes that you obtain from backdating a working copy if
          the changed files have newer revisions.  See <a class="xref" href="svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.resurrect" title="Resurrecting Deleted Items">the section called “Resurrecting Deleted Items”</a> for a
          description of how to <span class="quote">“<span class="quote">undo</span>”</span> a commit.</p>
              </td>
            </tr>
          </table>
        </div>
        <p>If you'd prefer to create a whole new working copy from an
        older snapshot, you can do so by modifying the typical
        <span class="command"><strong>svn checkout</strong></span> command.  As with <span class="command"><strong>svn
        update</strong></span>, you can provide
        the <code class="option">--revision</code> (<code class="option">-r</code>) option.
        But for reasons that we cover in
        <a class="xref" href="svn.advanced.pegrevs.html" title="Peg and Operative Revisions">the section called “Peg and Operative Revisions”</a>, you might instead want
        to specify the target revision as part of Subversion's
        expanded URL syntax.</p>
        <div class="informalexample">
          <pre class="screen">
# Checkout the trunk from r1729.
$ svn checkout http://svn.example.com/svn/repo/trunk@1729 trunk-1729
…
# Checkout the current trunk as it looked in r1729.
$ svn checkout http://svn.example.com/svn/repo/trunk -r 1729 trunk-1729
…
$
</pre>
        </div>
        <p>Lastly, if you're building a release and wish to bundle up
        your versioned files and directories, you can use <span class="command"><strong>svn
        export</strong></span> to create a local copy of all or part of your
        repository without any <code class="filename">.svn</code>
        administrative directories included.  The basic syntax of this
        subcommand is identical to that of <span class="command"><strong>svn
        checkout</strong></span>:</p>
        <div class="informalexample">
          <pre class="screen">
# Export the trunk from the latest revision.
$ svn export http://svn.example.com/svn/repo/trunk trunk-export
…
# Export the trunk from r1729.
$ svn export http://svn.example.com/svn/repo/trunk@1729 trunk-1729
…
# Export the current trunk as it looked in r1729. 
$ svn export http://svn.example.com/svn/repo/trunk -r 1729 trunk-1729
…
$
</pre>
        </div>
      </div>
      <div class="footnotes">
        <br />
        <hr width="100" align="left" />
        <div class="footnote">
          <p><sup>[<a id="ftn.idp8382096" href="#idp8382096" class="para">8</a>] </sup>See?  We told
        you that Subversion was a time
        machine.</p>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="svn.tour.cycle.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="svn.tour.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="svn.tour.cleanup.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">Basic Work Cycle </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> Sometimes You Just Need to Clean Up</td>
        </tr>
      </table>
    </div>
    <div xmlns="" id="vcws-footer">
      <hr />
      <img src="images/cc-by.png" style="float: right;" />
      <p>You are reading <em>Version Control with Subversion</em> (for
       Subversion 1.8), by Ben Collins-Sussman, Brian W. Fitzpatrick,
       and C. Michael Pilato.</p>
      <p>This work is licensed under
       the <a href="http://creativecommons.org/licenses/by/2.0/">Creative Commons Attribution License v2.0</a>.</p>
      <p>To submit comments, corrections, or other contributions to the
       text, please visit <a href="http://www.svnbook.com/">http://www.svnbook.com/</a>.</p>
    </div>
  </body>
</html>