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: | 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 1 1 this is example text 2 2 and one more line 3 no more lines 4 No newline at end of file 3 no more lines
but if I omit the "\ No newline…" part, it renders like I wanted it to
-
.txt
a b 1 1 this is example text 2 2 and one more line 3 no more lines 3 no more lines
Tested on 0.10.4 release and r6049 trunk, 100% reproducible.
Attachments (3)
Change History (10)
comment:1 by , 17 years ago
Keywords: | mimeview diff added |
---|---|
Milestone: | → 0.11 |
Owner: | changed from | to
Priority: | normal → high |
comment:2 by , 17 years ago
Status: | new → assigned |
---|
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 , 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 , 17 years ago
Keywords: | needinfo added |
---|
Above patch committed as r6072.
I'm still waiting for the backtrace for the error you had…
comment:5 by , 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 , 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 , 17 years ago
Milestone: | 0.11.1 → 0.11 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
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).
Right, so far there's no special handling for the "\ No newline at end of file" case.