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

Re: bug: diff adding newline at end of file when changing lines

From: Tobias Schäfer <tobiasschaefer_at_gmx.de>
Date: 2007-02-05 21:50:40 CET

On Sunday 04 February 2007 23:30, Avalon wrote:
> Hello,
>
> i have a problem using "diff" of TortoiseSVN and asked on the developers
> mailing list. Since no one responds their i thought about sending it to
> the users mailing list.
>
> I have local modifications in a text file and look at the diff with
> TortoiseSVN. Then i select one modified line and choose "Use this text
> block" and save the file.
>
> I would expect that only the selected line should change, but
> additionally the saved file now has a newline appended at the end of the
> file.
>
> Is this a known bug or did i make something wrong?
> Can someone reproduce this problem?

Bug confirmed with 1.4.3 and trunk.

I had a look at this before because I also had this problem. If I recall
correctly problem is that the internally used method CFile::ReadString
cannot destinguish between a file ending with "xxxx\r\n" and "xxxx". In
both cases it only reads "xxxx". When writting the file TortoiseMerge
always adds a newline to the end of the line and this results in the
newline being added at the end of the file.

Workaround: make sure all your files end with a newline - not the perfect
solution :-(

Tobias

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Mon Feb 5 21:51:16 2007

This is an archived mail posted to the TortoiseSVN Users mailing list.

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