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

[PATCH] Re: bug when diffing

From: Alan Wood <Alan.Wood_at_clear.net.nz>
Date: Sun, 25 Jan 2009 16:43:06 +1300

Hi,
 I have continued on from this and think I have found the cause.
 The 128k size if the chunk_size for the file diff routines.

 At the boundary of a chunk in the file libsvn_diff/diff_file.c
 the routine svn_diff__normalize_buffer() is called for
 the part of the line that is in the first chunk and then again for
 the part of the line that is in the new chunk.
 If the start of the new chunk has characters that are skipped, in this
 case the \n of the \r\n pair, then the file_token->norm_offset is incorrectly
 moved forward.

 A possible log entry:
[[[
 Fix issue with incorrect diff on 128k chunk boundaries
 * subversion/libsvn_diff/diff_file.c
    (datasource_get_next_token) don't skip chars at front of buffer
      if buffer is not the start of a line
]]]

Sorry patch is against 1.5.x, I haven't got sqlite yet.

Alan Wood

On 24 Jan 2009 at 19:53, Stefan Küng wrote:

> Hi,
>
> Just spent the last four hours trying to find the bug in the lib_diff
> but failed miserably. So I'm reporting the issue here hoping someone
> else is more familiar with that part of the code.
>
> How to reproduce the problem:
>
> * get the attached zip file
> * extract file1.txt and file2.txt
> (the files are identical but the first line)
>
> $ svnadmin create repo
> $ svn co file://repo/ wc
> $ cd wc
> $ mv file1.txt wc/file1.txt
> $ svn add file1.txt
> $ svn ci -m ""
> $ mv -f file2.txt file1.txt
> $ svn diff file1.txt
> .. one line different shown
>
> But:
> $ svn diff file1.txt -x --ignore-eol-style
>
> shows a line diff on every 128kByte mark in the file!
>
> I first thought the shown diffs were random, but they're in fact
> *exactly* at 128k boundaries.
>
> This happens with a trunk build from yesterday as well as with an 1.5.4
> client.
>
>
> Stefan
>
> --
> ___
> oo // \\ "De Chelonian Mobile"
> (_,\/ \_/ \ TortoiseSVN
> \ \_/_\_/> The coolest Interface to (Sub)Version Control
> /_/ \_\ http://tortoisesvn.net
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1047363

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1048312

Received on 2009-01-25 04:43:38 CET

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