qdiff side-by-side is not aligned properly when there is no newline at one side

Bug #250027 reported by Alexander Belchenko
2
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
High
Alexander Belchenko

Bug Description

Sometimes side-by-side diff is not aligned properly because content on one of the side has no trailing newline. This is very easy to see because horizontal line under file name and properties of next file is not on the same level.

Attached screenshot with illustration. I made this on my WinXP when I run in my versioned-properties branch (available as lp:~bialix/qbzr/versioned-properties) following command:

bzr merge -r297 --qpreview ../trunk

See below simple test case with 2 branches.

Tags: qdiff

Related branches

Revision history for this message
Alexander Belchenko (bialix) wrote :
Changed in qbzr:
milestone: none → 0.9.2
description: updated
Revision history for this message
Gary van der Merwe (garyvdm) wrote :

Hi Alexander

I was not able to reproduce this on my computer.

Is it maybe possible that you experienced this with older code?

Changed in qbzr:
status: New → Incomplete
Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 250027] Re: qdiff side-by-side is not aligned properly

Gary van der Merwe пишет:
> Hi Alexander
>
> I was not able to reproduce this on my computer.
>
> Is it maybe possible that you experienced this with older code?

No, it was with trunk revno.297. BTW I'm still running bzr 1.5+,
not latest 1.6b3. PyQt 4.3.1. But IMO it's not related to shown problem.

I suspect it's related to the fact that diff.py had no newline
at the end of file. I'll try to check this assumption.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Gary van der Merwe пишет:
> I was not able to reproduce this on my computer.
>
> Is it maybe possible that you experienced this with older code?

Gary, this bug still present on my machine with current 0.9.2 revno.310.
But bug disappear when I try to qpreview merge of the 0.9.2. I suspect
this is because I've added trailing newline at the end of lib/diff.py
recently.
I'll try to create simple test branch.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: qdiff side-by-side is not aligned properly

Gary, I managed to reproduce it with simple example (see attached zip with branches 1 and 2). To reproduce you need to run command

bzr merge --qpreview ../2

from branch 1.

I'm convinced we have several bugs related to diffing files that have no trailing new line in one (and only one) side. Moreover, adding newline in next revision is also produce odd diff. Run in 0.9.2 branch command:

bzr qdiff -c305

and examine last line of diff in SBS view.

Revision history for this message
Alexander Belchenko (bialix) wrote :

This is screenshot for `bzr merge --qpreview ../2`.

description: updated
Revision history for this message
Alexander Belchenko (bialix) wrote :

Old QBzr 0.9.1 works properly in the same situation. So it's regression in 0.9.2.

Changed in qbzr:
importance: Undecided → High
status: Incomplete → Triaged
Revision history for this message
Alexander Belchenko (bialix) wrote :

I have fix for this and about to push it to 0.9.2 branch.

Changed in qbzr:
assignee: nobody → bialix
status: Triaged → In Progress
Revision history for this message
Alexander Belchenko (bialix) wrote :

fix pushed to 0.9.2.

Changed in qbzr:
status: In Progress → Fix Committed
Changed in qbzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.