Search code examples
svnwebsvn

SVN Log/diff on files in a deleted directory


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?


Solution

  • 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