Tutorial :subversion: How to: difference between modified working copy and alternate branch?



Question:

I have tried.

My working copy is based on but a modified version of

svn://foo.net/svn/repo/branch/yyy  

I want to diff against branch xxx. I have tried

svn diff --old=svn://foo.net/svn/repo/branch/xxx --new=.   

but that only seems like shorthand for

svn diff --old=svn://foo.net/svn/repo/branch/xxx --new=svn://foo.net/svn/repo/branch/yyy  


Solution:1

Seems that subversion doesn't allow to compare working copy with url. Both --old and --new need to be either WC or URL.

I think there's a workaround though - you may checkout your xxx branch and then compare 2 working copies.

svn checkout svn://foo.net/svn/repo/branch/xxx xxx_branch  

svn diff xxx_branch yyy_modified_wc

diff -u xxx_branch yyy_modified_wc  

Edit As Pavel noticed svn diff in this form doesn't compare xxx and yyy - it just shows local modifications of xxx and yyy. svn diff --old=xxx --new=yyy seems not allowed (at least in svn client 1.6.17). To compare xxx and yyy diff command is needed. Pavel, 10x for the notice


Solution:2

You can also compare between two urls : it's faster because you don't have to checkout the other branch.

svn info # grap url  svn diff localUrl distantUrl  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »