19

I would like to see the changes that my co-workers have made before I accept the incoming changes.

So I start by getting the status

svn st -u

...which tells me that I've got an incoming change

    *     9803   incomingChanges.html
M         9803   localChanges.html
M   *     9803   localAndIncoming.html

I can see what I've changed

svn diff localChanges.html

...but how can I diff localAndIncoming.html to show what has been changed, and how it's different than my working copy?

James Mertz
  • 26,529
Andrew
  • 15,494

6 Answers6

22

I believe what you need is:

svn diff -rBASE:HEAD
2

FYI svn diff gives a diff based on the unmodified file stored in the .svn directory, not based on the live repo version.

You can run svn update to get subversion to attempt an update (and possibly merge) and then do an svn diff, but that's not as clean as I guess you want.

Finally svn diff does support diffing just on the repo. Example:

svn diff svn://svnserver/repo/localChanges.html -r REV_NO

Which defaults to comparing HEAD with the passed revision.

Andy
  • 3,137
2

With tortoisesvn (if you use windows)

  • Invoke the log screen

  • Select head revision

  • Right click on localAndIncoming.html

  • Choose Compare with working copy

rene
  • 1,123
  • 2
  • 10
  • 17
0

You really can't until you actually download the new version. Limitations like this were one of the big reasons why a new type of source control has become popular lately. It's called decentralized source control.
With this new form you have your own local repository, and you can then take changes from the main repository and run a diff on it, if you don't like the changes made you can revert your own repository and go from there.

http://mercurial.selenic.com/

And yeah, I know suggesting you switch products isn't an optimal solution, but it is a solution none the less.

Daisetsu
  • 6,171
0

Do another checkout in a fresh folder.

cd ..
svn checkout  /path/to/repo clean_working_copy

If you reuse clean_working_copy do not forget to update before

svn update clean_working_copy

Then compare your file with the one from clean_working_copy

diff your_working_copy/localAndIncoming.html clean_working_copy/localAndIncoming.html

Or with your prefered 3-way diff (mine is kdiff3)

kdiff3 --L1 Base --L2 theirs --L3 mine your_working_copy/.svn/text-base/localAndIncoming.html clean_working_copy/localAndIncoming.html your_working_copy/localAndIncoming.html
0

I think

svn diff -r HEAD

almost gives what you want. The only thing is that the + and - are reversed relative to what you expect.

Confusion
  • 131