Re: [Bug] [Subversion 1.7] svn blame doesn't work for locally modified files
From: Paul Burba <ptburba_at_gmail.com>
Date: Tue, 30 Oct 2012 16:19:35 -0400
On Fri, Oct 14, 2011 at 6:49 AM, Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
Hi All,
Mike Pilato is tying off loose ends for the upcoming 1.8 release and
The patch doesn't appear to make any difference:
With three files, with three different eols as per their names:
trunk_at_1403813>svn st -v
All three files have the same contents but for eols:
trunk_at_1403813>type file-with-CRLF-eols
Blame works fine with no local mods as expected:
trunk_at_1403813>svn blame file-with-CR-eols
trunk_at_1403813>svn blame file-with-CRLF-eols
trunk_at_1403813>svn blame file-with-LF-eols
I edited line #3 in each file like this:
trunk_at_1403813>svn diff file-with-CRLF-eols
Index: file-with-CRLF-eols
Without Daniels patch we see the bug described previously in the thread:
trunk_at_1403813>svn blame file-with-CR-eols
trunk_at_1403813>svn blame file-with-CRLF-eols
trunk_at_1403813>svn blame file-with-LF-eols
But with Daniel's patch I see no difference in the blame output:
trunk_at_1403813>svn blame file-with-CR-eols
trunk_at_1403813>svn blame file-with-CRLF-eols
trunk_at_1403813>svn blame file-with-LF-eols
-- Paul T. Burba CollabNet, Inc. -- www.collab.net -- Enterprise Cloud Development Skype: ptburba > [[[ > Index: subversion/libsvn_client/blame.c > =================================================================== > --- subversion/libsvn_client/blame.c (revision 1182771) > +++ subversion/libsvn_client/blame.c (working copy) > @@ -473,6 +473,9 @@ > svn_io_file_del_on_pool_cleanup, > filepool, filepool)); > > + cur_stream = svn_subst_stream_translated(cur_stream, "\n", TRUE, NULL, > + FALSE, filepool); > + > /* Get window handler for applying delta. */ > svn_txdelta_apply(last_stream, cur_stream, NULL, NULL, > frb->currpool, > ]]] > >> > >> > This explains why it works on *nix regardless of whether svn:eol-style is >> > set. On *nix, the data has "\n" EOLs in the repository. I believe you'll be >> > able to reproduce the problem on *nix too if you commit a file with CRLF >> > line endings. Also, I see that svn blame works correctly for modified files >> > on my Windows system for files having LF line endings. >> > >> > I'm not sure what's the best way to resolve the issue. For me, just removing >> > the call to svn_subst_stream_translated would fix the problem, I think. But >> > it wouldn't always be TRT in presence of svn:eol-style. >> > >> > Anyway, please consider reverting svn blame behavior without explicit >> > @REVISION as the last resort for 1.7.1. >> > >> >> Best regards, >> Konstantin KolinkoReceived on 2012-10-30 21:20:09 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.