tags:

views:

19

answers:

2

In my project another dev reorganised some files, and now I'm having some issues getting at the diffs of them :-( I started out thinking that it'd be nice to get webSVN to be able to show these diffs, now I'd just like to be able to see them myself!

I know that the 'svn way' is to treat deletion as an operation on the parent directory, but my problem is compounded by the fact that the files were in a subdirectory, which has been deleted.

Original structure:

 conf/
      files/
            configfile1
            configfile2

Here's what happened:

$ svn log -vr 5
...
D /conf/files
A /conf/combined_configfile

What I'm trying to get is a diff of the changes previously introduced in the config files, before the delete happened. Something like this would be nice:

svn diff -r 2:4 conf/files/configfile1
svn: 'conf/files' is not a working copy
svn: 'conf/files' does not exist

or even:

svn diff -r 2:4 'conf/files'
svn: 'conf/files' is not under version control

or how about:

svn diff -r 2:4 'https://svnhost.localdomain/project1/conf/files'
svn: '/proj1/!svn/bc/1343/conf/files' path not found

It seems like the only way to get at this history is through svn operations on a directory that's currently present in the head revision of the repository (conf/ in this case), widening the scope of the diff massively.

Surely there must be a better way?

A: 

Why not get a copy of the files you care about from the previous version, then get your latest ones you want to dioff against, then make use of numerous open source differencing programs out there...TortiseSVN (make it your UI to the SVN repo as well), WinMerge, etc...

Don't feel forced into using the CVN CLI for your differencing, make use of any and all tools available. As long as you can get access to the previous versions, this should not be a problem.

Aaron
+2  A: 

svn diff has several forms of usage

one if them is

diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]

It's better than -r option when directory structure of the project is changed. Try this:

svn diff  https://svnhost.localdomain/project1/conf/files@2 https://svnhost.localdomain/project1/conf/files@4
Dmitry Yudakov
Great, thanks! This actually works with the individual file names too, which is much more promising in terms of trying to make chnges to the rest of our custom tooling :)
paulw1128