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

Re: [PATCH] Re: bug when diffing

From: Alan Wood <Alan.Wood_at_clear.net.nz>
Date: Thu, 12 Mar 2009 22:40:59 +1300

Hi all,
 I would just like to nudge this patch along. Could someone please take a look at it.
The patch does apply to trunk,

 Its been about 6 weeks hanging around, and I know 1.6 is more fun and we have had
a patch manager change too.

 I was thinking that it would be nice to be able to see a 'pending patches' list
somewhere. I'm sure Gavin has something like this but could it be made more
accessible to all?

Cheers
Alan Wood

On 25 Jan 2009 at 16:43, Alan Wood wrote:

> 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

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

Received on 2009-03-12 10:41:22 CET

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

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