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

RE: Re: Getting diff of a new file

From: Gale, David <David.Gale_at_Hypertherm.com>
Date: 2006-01-30 14:20:28 CET

Vincent Lefevre wrote:
> On 2006-01-29 22:14:54 +0100, Giovanni Bajo wrote:
>> Andy Levy <andy.levy@gmail.com> wrote:
>>
>>>> I added foo.c as part of the commit r124. When I run this command
>>>> line:
>>>>
>>>> svn diff -r123:124
>>>>
>>>> I get the diff of the whole commit, including the diff of the new
>>>> file that was added (just like a diff against /dev/null). But if I
>>>> try to single out the new file:
>>>>
>>>> svn diff -r123:124 foo.c
>>>>
>>>> I get this error:
>>>>
>>>> svn: Unable to find repository location for 'foo.c' in revision 123
>>>>
>>>> Is there a way to get this diff? While I understand that the error
>>>> message is strictly correct, I believe that it's unfortunate that
>>>> svn diff -r[N-1]:[N] work for modified files but not for new files.
>>>> Should I file a ticket for this?
>>>
>>> I don't see how this could be a bug. It's not possible to do a diff
>>> between a version that doesn't exist and anything else. What do you
>>> expect the output to be? Every line added?
>>
>> Yes, exactly the same output that I get when I run "svn diff
>> -r123:124". The bug is because of inconsistency: why the diff is
>> produced if I don't name the file, while it errors out if I provide
>> the file name?
>
> I don't see any consistency. When you do "svn diff -r123:124" and
> "svn diff -r123:124 foo.c", you don't diff the same thing, hence
> the different outputs.

I'm with Vincent on this one--if you do "svn diff", you want to know how
the directory has changed, and that includes the addition of the new
file (complete with all its contents); "svn diff <file>" asks for how
the file has changed, but since it didn't exist before, the question is
rather non-sensical ("How is the file in this revision different from
the file that existed in this other one, where it didn't exist?"). Not
a bug.

-David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Jan 30 14:25:18 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.