
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Examining History
|
45
Everything in moderation
Chew with your mouth closed
$
You can also redirect the output directly into a file:
$ svn cat --revision 2 rules.txt > rules.txt.v2
$
You’re probably wondering why we don’t just use svn update --revision to update
the file to the older revision. There are a few reasons why we might prefer to use
svn
cat
.
First, you may want to see the differences between two revisions of a file using an
external diff program (perhaps a graphical one, or perhaps your file is in such a for-
mat that the output of unified diff is nonsensical). In this case, you’ll need to grab a
copy of the old revision, redirect it to a file, and pass both that and the file in your
working copy to your external diff program.
Sometimes it’s easier to look at an older version of a file in its entirety as opposed to
only the differences between it and another revision.
svn list
The svn list command shows you what files are in a repository directory without
actually downloading the files to your local machine:
$ svn list http://svn.collab.net/repos/svn
README
branches/
clients/
tags/
trunk/
If you want a more detailed listing, pass the --verbose (-v) flag to get output like this:
$ svn list --verbose http://svn.collab.net/repos/svn
2755 harry 1331 Jul 28 02:07 README
2773 sally Jul 29 15:07 ...