Edgewall Software

Ticket #3428: trac-mimetype-no-binary-diff.patch

File trac-mimetype-no-binary-diff.patch, 1.4 KB (added by daniel.m.church@…, 6 years ago)

trac-mimetype-no-binary-diff.patch

  • versioncontrol/web_ui/changeset.py

    old new  
    221221                continue 
    222222 
    223223            # Content changes 
     224            if old_node.content_type and not old_node.content_type.startswith("text/"): 
     225                continue 
     226            if new_node.content_type and not new_node.content_type.startswith("text/"): 
     227                continue 
    224228            default_charset = self.config.get('trac', 'default_charset') 
    225229            old_content = old_node.get_content().read() 
    226230            if mimeview.is_binary(old_content): 
     
    286290            new_node_info = old_node_info = ('','') 
    287291 
    288292            if old_node: 
     293                if old_node.content_type and not old_node.content_type.startswith("text/"): 
     294                    continue 
    289295                charset = mimeview.get_charset(old_node.content_type) or \ 
    290296                          default_charset 
    291297                old_content = util.to_utf8(old_node.get_content().read(), 
     
    295301                continue 
    296302 
    297303            if new_node: 
     304                if new_node.content_type and not new_node.content_type.startswith("text/"): 
     305                    continue 
    298306                charset = mimeview.get_charset(new_node.content_type) or \ 
    299307                          default_charset 
    300308                new_content = util.to_utf8(new_node.get_content().read(),