Discussion:
TortoiseMerge - ignore line endings with large files
Nate
2009-01-22 04:03:03 UTC
Permalink
Hi Guys,

I found some unexpected behavior in TortoiseMerge. I don't think it's been
reported before (I did a search) but if it has I apologise for the double up.


The behavior I'm seeing is:
If you diff two files with the ignore line endings option enabled then at
regular intervals after a difference the line will show as a difference but with
equals signs beside the line in each file.


To replicate:
Create two almost identical files. I used this code snippet.

using (System.IO.StreamWriter sw1 = new System.IO.StreamWriter(@"file1.txt"))
{
using (System.IO.StreamWriter sw2 = new System.IO.StreamWriter(@"file2.txt"))
{
sw2.Write(Environment.NewLine);
for (int i = 0; i < 500000; i++)
{
char letter = (char)((int)'a' + (i % 26));
sw1.Write(letter + Environment.NewLine);
sw2.Write(letter + Environment.NewLine);
}
}
}

Load the two files in TortoiseMerge and turn on the ignore line endings option.

You should see the behaviour on lines 43691, 87381, 174763, 218453, ..., 480597
It appears to happen at alternating intervals of 43691 and 87382 lines.

It's not a problem for me at the moment. I can ignore it now that I know about
it, but I thought I should let you know just in case the cause of the behavior
could cause problems somewhere else in the program.

cheers,
Nathan

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=1042693

To unsubscribe from this discussion, e-mail: [dev-***@tortoisesvn.tigris.org].
Stefan Küng
2009-01-22 17:16:53 UTC
Permalink
Post by Nate
Hi Guys,
I found some unexpected behavior in TortoiseMerge. I don't think it's been
reported before (I did a search) but if it has I apologise for the double up.
If you diff two files with the ignore line endings option enabled then at
regular intervals after a difference the line will show as a difference but with
equals signs beside the line in each file.
Create two almost identical files. I used this code snippet.
{
{
sw2.Write(Environment.NewLine);
for (int i = 0; i < 500000; i++)
{
char letter = (char)((int)'a' + (i % 26));
sw1.Write(letter + Environment.NewLine);
sw2.Write(letter + Environment.NewLine);
}
}
}
Load the two files in TortoiseMerge and turn on the ignore line endings option.
You should see the behaviour on lines 43691, 87381, 174763, 218453, ..., 480597
It appears to happen at alternating intervals of 43691 and 87382 lines.
It's not a problem for me at the moment. I can ignore it now that I know about
it, but I thought I should let you know just in case the cause of the behavior
could cause problems somewhere else in the program.
Are you sure that the lines shown as different are exactly the same? If
you have 'ignore whitespaces' enabled, then the lines will show as
different but with the equal sign.

Do you have maybe two files which show the problem so I can reproduce
this? If yes, please zip them before sending, otherwise mail clients
tend to mess with text files...

Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=1043355

To unsubscribe from this discussion, e-mail: [dev-***@tortoisesvn.tigris.org].
Stefan Küng
2009-01-24 18:54:11 UTC
Permalink
I thought the code snippet I provided would be sufficient to recreate
the files i'm using. This time I've attached a zip of the two files for you.
I've tested with all three whitespace options and it doesn't make any
difference.
Thanks for the files. I could narrow the problem down to a bug in the
svn diff library.
I've reported the issue on the Subversion mailing list.

Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=1047364

To unsubscribe from this discussion, e-mail: [dev-***@tortoisesvn.tigris.org].
Loading...