Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

branch

diff

svn

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
like image 248
bradgonesurfing Avatar asked Jul 09 '10 07:07

bradgonesurfing


People also ask

How do you find the difference between two revisions in svn?

Display the differences between two paths. The ways you can use svn diff are: Use just svn diff'to display local modifications in a working copy. Display the changes made to TARGET s as they are seen in REV between two revisions.

What is svn diff?

svn diff (di) — This displays the differences between two revisions or paths.

How do I view a specific revision in svn?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.

What does svn copy do?

svn copy (cp) — Copy a file or directory in a working copy or in the repository.


1 Answers

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

like image 173
Dmitry Yudakov Avatar answered Oct 23 '22 07:10

Dmitry Yudakov