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

Re: svn commit: r40403 - trunk/subversion/libsvn_diff

From: Branko Cibej <brane_at_xbc.nu>
Date: Fri, 06 Nov 2009 18:38:40 +0100

Daniel Rall wrote:
> On Fri, Nov 6, 2009 at 9:31 AM, Arfrever Frehtes Taifersar Arahesis
> <Arfrever.FTA_at_gmail.com> wrote:
>
>> 2009-11-06 16:37:10 Stefan Sperling napisał(a):
>>
> ...
>
>>> @@ -248,6 +252,11 @@ parse_next_hunk(svn_hunk_t **hunk,
>>> last_line = pos;
>>> SVN_ERR(svn_stream_readline(stream, &line, patch->eol_str, &eof,
>>> iterpool));
>>> +
>>> + /* Skip lines which aren't part of the hunk text. */
>>> + if (strcmp(line->data, "\\ No newline at end of file") == 0)
>>> + continue;
>>>
>> Such comparisons won't help for non-English users:
>>
>> $ echo -e "x\ny" > file1
>> $ echo -en "x\ny" > file2
>> $ diff -u file1 file2
>> --- file1 2009-11-06 18:19:48.000000000 +0100
>> +++ file2 2009-11-06 18:19:54.000000000 +0100
>> @@ -1,2 +1,2 @@
>> x
>> -y
>> +y
>> \ Brak znaku nowej linii na końcu pliku
>> $
>>
>
> Not commenting on the approach, but you could wrap that English string
> in _() to localize it before the strcmp (maybe still also falling back
> to the English translation).
>

In a patch file, a backslash in the first column means "no newline at
end of file" -- the rest of the line is pure comment and *should* be
igmored, but that backslash tells you important things about the hunk's
context.

-- Brane

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2415163
Received on 2009-11-06 18:39:59 CET

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