Edgewall Software

Ticket #2012 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

PatchRenderer does not render chunk separator

Reported by: Shunichi Goto <gotoh@…> Owned by: cmlenz
Priority: normal Milestone: 0.9
Component: wiki system Version: devel
Severity: minor Keywords:
Cc:

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

Change History

Changed 3 years ago by cboos

  • owner changed from jonas to cboos
  • status changed from new to assigned
  • severity changed from normal to minor

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).

Changed 3 years ago by mgood

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.

Changed 3 years ago by cmlenz

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.

Changed 3 years ago by mgood

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.

Changed 3 years ago by cboos

  • milestone set to 0.9

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

Changed 3 years ago by cmlenz

  • owner changed from cboos to cmlenz
  • status changed from assigned to new

I'll take this (sorry cboos).

Changed 3 years ago by cmlenz

  • status changed from new to assigned

Changed 3 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in [2264].

Add/Change #2012 (PatchRenderer does not render chunk separator)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.