Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#2012 closed defect (fixed)

PatchRenderer does not render chunk separator

Reported by: Shunichi Goto <gotoh@…> Owned by: Christopher Lenz
Priority: normal Milestone: 0.9
Component: wiki system Version: devel
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Trac does not render chunk separator row on ticket or wiki page because of typo in template string in patch.py.

  • patch.py

     
    4040   <colgroup><col class="lineno" /><col class="lineno" /><col class="content" /></colgroup>
    4141   <thead><tr>
    4242    <th title="<?cs var:file.oldrev ?>"><?cs var:file.oldrev ?></th>
    43     <th title="<?cs var:file.newrev ?>"><?cs var:item.newrev ?></th>
     43    <th title="<?cs var:file.newrev ?>"><?cs var:file.newrev ?></th>
    4444    <th>&nbsp;</th>
    4545   </tr></thead><?cs
    4646   each:change = file.diff ?><?cs
    4747    call:diff_display(change, diff.style) ?><?cs
    48     if:name(change) < len(item.diff) - 1 ?>
     48    if:name(change) < len(file.diff) - 1 ?>
    4949     <tbody class="skipped">
    5050      <tr><th>&hellip;</th><th>&hellip;</th><td>&nbsp;</td></tr>
    5151     </tbody><?cs

Attachments (0)

Change History (8)

comment:1 by Christian Boos, 19 years ago

Owner: changed from Jonas Borgström to Christian Boos
Severity: normalminor
Status: newassigned

Also, the PatchRenderer shouldn't be used at all when used in a wiki text for which the source is not available (i.e. in the ticket description or in ticket comments), as it's impossible to get the actual diff source in that case.

But this would require an API change, IHTMLPreviewRenderer.get_quality_ratio would have to know about the context of use (add an optional context argument?).

Note that I see additional benefits for such a change, related to the idea of using Mimeview renderers in order to show svn:properties in the browser (see #1601 and #1947): different renderers could be used depending on where the property is shown (either the list of properties for the current path or in additional custom column #1601).

comment:2 by Matthew Good, 19 years ago

cboos: I don't see why the PatchRenderer should not be used in the Wiki. Embeding the content in the Wiki is no different than rendering a ".diff" file that's an attachment or in the repository. In any case where the PatchRenderer is used it's not actually connected back to the actual source file, so if you don't want to use it you should simply disable that mimeviewer.

I also don't think that mime types are an appropriate way to handle the SVN properties, but I'll follow up on that in #1947 where you mention it.

comment:3 by Christopher Lenz, 19 years ago

cboos, the statement that the PatchRenderer makes the original patch inaccessible (e.g. for copy&paste) is certainly valid, but doesn't have anything to do with this ticket.

I've been thinking about ways to solve this particular problem, and the only thing that seems realistic would be some javascript that would toggle between the "pretty" diff and a plain diff view. Simply forbidding the PatchRenderer to handle formatting in the context of wiki text doesn't sound attractive; I think the prettified view helps a lot getting a quick idea of what the patch actually changes.

comment:4 by Matthew Good, 19 years ago

Ah, cmlenz's comments made me realize what cboos meant by the "source" in his comments. I was thinking "source" was in reference to the files that were being diffed, not the plain text diff itself. I can understand that, although cmlenz is right that it's a separate issue.

comment:5 by Christian Boos, 19 years ago

Milestone: 0.9

Ok, I'll apply the patch, and create a new ticket to discuss about the above problem.

comment:6 by Christopher Lenz, 19 years ago

Owner: changed from Christian Boos to Christopher Lenz
Status: assignednew

I'll take this (sorry cboos).

comment:7 by Christopher Lenz, 19 years ago

Status: newassigned

comment:8 by Christopher Lenz, 19 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [2264].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz 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.