[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

no diff possible on URL for an added file in a set of changes?

From: Olaf Dabrunz <od_at_suse.de>
Date: 2006-10-31 13:45:30 CET

Hello,

someone adds and checks in a file to our repository (together with other
changes). I want to see only the changes made in specific files, and
especially in the added file. I have a script that depends on the
ability to pick diffs for single files.

But when I use some "svn diff" command on the file URL in the repository
like

    svn diff -r <revision-of-change - 1>:<revision-of-change> https://path/to/added/file,

I only get this error message:

    svn: Unable to find repository location for 'https://path/to/added/file' in revision <revision-of-change - 1>.

This is understandable, since the file did not exist with a revision
before it was added.

But what is really a problem is that there seems to be absolutely no way
to ask subversion for a diff of this file (and this file only) in this
revision.

The UNIX diff command has the "-N" or "--new-file" options that makes
diff assume that the file has existed before and was empty. In this way
it is possible to always get a diff for the file contents.

But there seems to be no such thing for "svn diff".

Please note that I really want to refrain from using an "svn diff" over a
directory or the whole project instead, and then somehow filter out the
relevant diffs for added files. This would add a lot of complexity to my
script.

Here are some commands and their results to illustrate the problem:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~/proj> svn log -r 33916 -v
------------------------------------------------------------------------
r33916 | otheruser | 2006-10-31 09:48:20 +0100 (Tue, 31 Oct 2006) | 1 line
Changed paths:
   M /trunk/proj/Makefile.am
   A /trunk/proj/proj.conf
   M /trunk/proj/proj.spec.in
   [... other changes...]

conf file added for feature X
[...other changes for feature X...]
------------------------------------------------------------------------

~/proj> svn info https://svn/svn/trunk/proj/proj.conf
Path: proj.conf
Name: proj.conf
URL: https://svn/svn/trunk/proj/proj.conf
Repository Root: https://svn/svn
Repository UUID: XYZ
Revision: 33931
Node Kind: file
Last Changed Author: otheruser
Last Changed Rev: 33916
Last Changed Date: 2006-10-31 09:48:20 +0100 (Tue, 31 Oct 2006)

~/proj> svn info
Path: .
URL: https://svn/svn/trunk/proj
Repository Root: https://svn/svn
Repository UUID: XYZ
Revision: 33912
Node Kind: directory
Schedule: normal
Last Changed Author: od
Last Changed Rev: 33912
Last Changed Date: 2006-10-31 02:52:08 +0100 (Tue, 31 Oct 2006)

~/proj> svn diff -r 33916 https://svn/svn/trunk/proj/proj.conf
~/proj> svn diff -r 33915:33916 https://svn/svn/trunk/proj/proj.conf
svn: Unable to find repository location for 'https://svn/svn/trunk/proj/proj.conf' in revision 33915
~/proj> svn diff -c 33916 https://svn/svn/trunk/proj/proj.conf
svn: Unable to find repository location for 'https://svn/svn/trunk/proj/proj.conf' in revision 33915
~/proj> svn diff --force -c 33916 https://svn/svn/trunk/proj/proj.conf
svn: Unable to find repository location for 'https://svn/svn/trunk/proj/proj.conf' in revision 33915
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Regards,

-- 
Olaf Dabrunz (od/odabrunz), SUSE Linux Products GmbH, Nürnberg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Oct 31 13:46:23 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.