Order of svn diff revision range

diff()svn

I'm trying to compose a list of changed/added files in a svn repository, for use with phing, using the following command.

svn diff --no-diff-deleted --summarize -r 50:HEAD path/to/workingcopy

When I reverse the revision range (-r switch), like so:

svn diff --no-diff-deleted --summarize -r HEAD:50 path/to/workingcopy

.. I get different results. Although it's behavior is what I need, I don't understand it (and perhaps I'm missing something). Example:

Assuming the head revision has a new directory with some files: The second command will only list the new directory, while the first command will also list all the new files inside it. At least, that's what I think it does after some tests.

I couldn't find any clear documentation on this thing. Can someone explain what the order of the revision range implies? Thanks!

Best Answer

In the first case, you'll get all the changes made between revision 50 and Head. This is what you naturally expect, so I won't explain further. The reverse range, however, is somewhat more interesting. It's the diff you need to apply to Head to get revision 50. In short, it's specifying how to undo all the changes that were done. You say the "second command will only list the new directory", which is correct: it's telling you to delete the directory, which will naturally delete its contents.