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 http://www.svnbook.com/ for stable versions of this book.
svnlook diff — Print differences of changed files and properties.
svnlook diff REPOS_PATH
This shows a newly added (empty) file, a modified binary file, and a renamed (that is, copied and deleted) file with modifications:
$ svnlook diff -r 40 /var/svn/repos Copied: trunk/relish.txt (from rev 39, trunk/vendors/deli/pickle.txt) =================================================================== --- trunk/relish.txt (rev 0) +++ trunk/relish.txt 2013-01-29 20:39:17 UTC (rev 40) @@ -0,0 +1 @@ +Pickle relish is mostly made from cucumbers. Deleted: trunk/vendors/deli/pickle.txt =================================================================== --- trunk/vendors/deli/pickle.txt (rev 39) +++ trunk/vendors/deli/pickle.txt 2013-01-29 20:39:17 UTC (rev 49) @@ -1 +0,0 @@ -Pickles are mostly made from cucumbers. Modified: trunk/vendors/deli/logo.jpg =================================================================== (Binary files differ) Added: trunk/vendors/deli/soda.txt =================================================================== $
By default, svnlook diff will treat
copied files very much like any other added file,
displaying in their entirety the contents of the new file
and merely using a different label to draw the copy/add
distinction. However, you can use the
--diff-copy-from
option to cause
svnlook diff to consider a copied
file as worthy of mention only if it differs from the file
from which it was copied, and to actually describe those
differences.
$ svnlook diff -r 40 /var/svn/repos --diff-copy-from Copied: trunk/relish.txt (from rev 39, trunk/vendors/deli/pickle.txt) =================================================================== --- trunk/vendors/deli/pickle.txt 2013-01-29 20:39:17 UTC (rev 39) +++ trunk/relish.txt 2013-01-29 20:47:40 UTC (rev 3) @@ -1 +1 @@ -Pickles are mostly made from cucumbers. +Pickle relish is mostly made from cucumbers. Deleted: trunk/vendors/deli/pickle.txt =================================================================== --- trunk/vendors/deli/pickle.txt (rev 39) +++ trunk/vendors/deli/pickle.txt 2013-01-29 20:39:17 UTC (rev 40) @@ -1 +0,0 @@ -Pickles are mostly made from cucumbers. Modified: trunk/vendors/deli/logo.jpg =================================================================== (Binary files differ) Added: trunk/vendors/deli/soda.txt ============================================================================== $
Use the --no-diff-deleted
option to
silence output regarding deleted files.
$ svnlook diff -r 40 /var/svn/repos --no-diff-deleted Copied: trunk/relish.txt (from rev 39, trunk/vendors/deli/pickle.txt) =================================================================== --- trunk/relish.txt (rev 0) +++ trunk/relish.txt 2013-01-29 20:39:17 UTC (rev 40) @@ -0,0 +1 @@ +Pickle relish is mostly made from cucumbers. Modified: trunk/vendors/deli/logo.jpg =================================================================== (Binary files differ) Added: trunk/vendors/deli/soda.txt ============================================================================== $
Note that in each of the previous examples, when a
file has a nontextual svn:mime-type
property, the differences are not explicitly shown.