Pagine

Tuesday 6 December 2016

SVN tutotial n 16 - diff

The "svn diff" command displays the differences between two revisions or paths. You can use svn diff in the following ways:
1) Use just svn diff to display local modifications in a working copy.
 svn diff [-c M | -r N[:M]] [TARGET[@REV]...]
Examples:
Compare BASE and your working copy
 svn diff MyFile.txt 
See what changed in the file MyFile.txt revision 3000:
 svn diff -c 3000 MyFile.txt
2) Display the changes made to TARGETs as they are seen in REV between two revisions. TARGETs may be all working copy paths or all URLs. If TARGETs are working copy paths, N defaults to BASE and M to the working copy; if TARGETs are URLs, N must be specified and M defaults to HEAD. The -c M option is equivalent to -r N:M where N = M-1. Using -c -M does the reverse: -r M:N where N = M-1.
 svn diff [-r N[:M]] --old=OLD-TGT[@OLDREV] [--new=NEW-TGT[@NEWREV]] [PATH...]
Example:
Compare revision 3000 to revision 5000 using range notation (pass only the one URL in this case):
 svn diff -r 3000:5000 http://mysvnrepo/svn/trunk/MyFile.txt
3) Display the differences between OLD-TGT as it was seen in OLDREV and NEW-TGT as it was seen in NEWREV. PATHs, if given, are relative to OLD-TGT and NEW-TGT and restrict the output to differences for those paths. OLD-TGT and NEW-TGT may be working copy paths or URL[@REV]. NEW-TGT defaults to OLD-TGT if not specified. -r N makes OLDREV default to N; -r N:M makes OLDREV default to N and NEWREV default to M.
 svn diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]
Example:
Compare two tags:
 svn diff http://mysvnrepo/svn/tags/tag-1 http://mysvnrepo/svn/tags/tag-2
The versions are managed via the --revision (-r) option or by using the “@” notation as described earlier. Example:
 svn diff http://mysvnrepo/svn/trunk/MyFile.txt@3000 http://mysvnrepo/svn/trunk/MyFile.txt@5000
You can use the --xml option along with the --summarize option to view XML describing the changes that occurred between revisions, but not the contents of the diff itself:
 svn diff --summarize --xml http://mysvnrepo/svn/trunk/MyFile.txt@3000 http://mysvnrepo/svn/trunk/MyFile.txt@5000

No comments:

Post a Comment