Name

svk diff — Display the differences between two paths.

Synopsis

diff [--revision REV[@]] [PATH...]
diff --revision REV1[@][:REV2[@]]] DEPOTPATH|PATH...
diff DEPOTPATH1 DEPOTPATH2
diff DEPOTPATH [PATH]

Description

Display the differences between two paths. The four different ways you can use svk diff are:

svk diff [--revision REV[@]] [PATH...] displays the differences between each file or directory specified in the working copy, if none are specified . is implied, with the BASE or REV (if it's specified) revision of that file in the depot

svk diff --revision REV1[@]:REV2[2] DEPOTPATH|PATH... displays the differences between REV1 and REV2 of the DEPOTPATH specified, or of each file or directory specified in the working copy.

svk diff DEPOTPATH1 DEPOTPATH2 shows the differences between 2 depot paths—this is useful for displaying the difference between branches or tags.

svk diff DEPOTPATH [PATH] shows the differences between the current working copy (or the PATH directory and the contents of DEPOTPATH.

Running svk diff ignores the ancestry of files and merely compares the contents of the two files being compared.

Alternate Names

di

Changes

Nothing

Accesses Depot

Yes

Accesses Mirrored Repository

No

Switches

--revision (-r) REV1[@][:REV2[@]]
--summarize (-s)
--verbose (-v)
--non-recursive (-N)

Examples

Compare BASE and your working copy (one of the most popular uses of svk diff):

$ echo 'Added some stuff.' >> file.txt
$ svk diff file.txt 
=== file.txt
==================================================================
--- file.txt  (revision 15)
    file.txt  (local)
@@ -0,0  1 @@
 Added some stuff.

See how your working copy's modifications compare against an older revision:

$ svk diff --revision 14 file.txt
=== file.txt
==================================================================
--- file.txt  (revision 14)
    file.txt  (local)

Compare revision 12 to revision 15 using range notation:

$ svk diff --revision 12:15 //trunk/file.txt
=== file.txt
==================================================================
--- file.txt  (revision 12)
    file.txt  (revision 15)

Compare revision 3000 to revision 3500 of all files in trunk using range notation:

$ svk diff --revision 3000:3500 //test/trunk

If you have a working copy, you can obtain the differences without typing in the long URLs:

$ svk diff --revision 12:15 file.txt 
=== file.txt
==================================================================
--- file.txt  (revision 12)
    file.txt  (revision 15)

Tip

Set the $SVKDIFF environment variable to run and external diff program instead of the built in diff.

$ SVKDIFF="/usr/bin/diff -i -b" svk diff file.txt
1,2c1
< This is a README file.
< You should read this.
---
> Added some stuff.