Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#6199 closed defect (fixed)

trac diff parser doesn't recognize \ No newline at end of file

Reported by: theultramage@… Owned by: Christian Boos
Priority: high Milestone: 0.11
Component: ticket system Version: devel
Severity: normal Keywords: mimeview diff needinfo
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Example diff

# ! diff (without the spaces)
--- a.txt       Wed Oct 17 08:44:43 2007
+++ b.txt       Wed Oct 17 08:44:58 2007
@@ -1,3 +1,3 @@
 this is example text
 and one more line
-no more lines
\ No newline at end of file
+no more lines

renders as

  • .txt

    a b  
    11this is example text
    22and one more line
    3 no more lines
    4  No newline at end of file
     3no more lines

but if I omit the "\ No newline…" part, it renders like I wanted it to

  • .txt

    a b  
    11this is example text
    22and one more line
    3 no more lines
     3no more lines

Tested on 0.10.4 release and r6049 trunk, 100% reproducible.

Attachments (3)

t6199.patch (3.5 KB ) - added by Christian Boos 17 years ago.
Highlight "meta" line change information
t6199.2.patch (4.7 KB ) - added by Christian Boos 17 years ago.
Highlight "meta" line change information - updated patch, which fixed one mistake in the previous patch and adapted the unit tests.
trac.log (5.5 KB ) - added by theultramage@… 17 years ago.
debug trace

Download all attachments as: .zip

Change History (10)

comment:1 by Christian Boos, 17 years ago

Keywords: mimeview diff added
Milestone: 0.11
Owner: changed from Jonas Borgström to Christian Boos
Priority: normalhigh

Right, so far there's no special handling for the "\ No newline at end of file" case.

comment:2 by Christian Boos, 17 years ago

Status: newassigned

Well, I forgot that I've already added support for that :P

So if in 0.11 you get no highlighting by the dedicated patch renderer, it's because there has been an error. Can you look it up in the log file and post it?

Then, the display of the "No newline at the end of the file" line could be made visually different, so that it stands out from a normal modified line.

Can you try the attachment:t6199.patch? It works fine for me on your example.

by Christian Boos, 17 years ago

Attachment: t6199.patch added

Highlight "meta" line change information

by Christian Boos, 17 years ago

Attachment: t6199.2.patch added

Highlight "meta" line change information - updated patch, which fixed one mistake in the previous patch and adapted the unit tests.

comment:3 by Christian Boos, 17 years ago

Keywords: needinfo added

Above patch committed as r6072.

I'm still waiting for the backtrace for the error you had…

comment:4 by Christian Boos, 17 years ago

Milestone: 0.110.11.1

(moving to 0.11.1 in the meantime)

by theultramage@…, 17 years ago

Attachment: trac.log added

debug trace

comment:5 by theultramage@…, 17 years ago

Sorry for the delay, due to a filter against trac-users group, notifications about this ended up deleted…

Attached trace from revision 6122 trunk (latest) shows no obvious problems… but the above example still doesn't render as I want it in the preview page (actually it just displays as plaintext).

Any suggestions/instructions?

comment:6 by Christian Boos, 17 years ago

When a {{{\n#!diff\n...}}} blocks fails to render, there must be a message in the logs. Well, even when it's successfully rendered, there's something written, along the lines of:

... DEBUG: Trying to render HTML preview using PatchRenderer [No annotations]"

So to me, the trace you've given above doesn't match the attempt to display a diff block…

comment:7 by Christian Boos, 17 years ago

Milestone: 0.11.10.11
Resolution: fixed
Status: assignedclosed

I believe this issue was fixed with r6072.

If it appears to not work, please reopen and provide the relevant information (please take the time to read my other comments here in this ticket).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.