Version Control with Subversion - Examining History -
svn cat
If you want to examine an earlier version of a file and
not necessarily the differences between two files, you can use
svn cat
:
$ svn cat --revision 2 rules.txt
Be kind to others
Freedom = Chocolate Ice Cream
Everything in moderation
Chew with your mouth open
$
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 format 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 just the differences
between it and another revision.
[an error occurred while processing this directive]
|