Subversion: How to compare differences between incoming changes?

20,608

Solution 1

I believe what you need is:

svn diff -rBASE:HEAD

Solution 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.

Solution 3

With tortoisesvn (if you use windows)

  • Invoke the log screen

  • Select head revision

  • Right click on localAndIncoming.html

  • Choose Compare with working copy

Share:
20,608

Related videos on Youtube

Andrew
Author by

Andrew

Updated on September 17, 2022

Comments

  • Andrew
    Andrew over 1 year

    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?

    • Arjan
      Arjan almost 14 years
      Not an answer to your command line question, but: in the end, once you know what is different from your working copy, you'll probably want to merge the repository changes with your own changes. When using some GUI to do so, why not use a GUI to help you do the initial diff as well? Tools like TortoiseSVN offer such compare. Also, IDEs like Eclipse can make reviewing incoming changes (even when there's nothing to merge -- nice to get an idea of what your coworkers have been up to) very easy, avoiding automatic merges.
    • Christian
      Christian over 13 years
      Is there a GUI way of seeing incoming changes using TortoiseSVN?
    • Raffi Khatchadourian
      Raffi Khatchadourian over 10 years
      You'd also want to diff incomingChanges.html as well, no?
  • rds
    rds over 12 years
    This work, but a scm should provide a more integrated way.