Edgewall Software
Modify

#13459 closed defect (fixed)

Syntax highlight doens't work for a file without svn:mime-type in Subversion repository

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.5.4
Component: version control/browser Version: 1.5.3
Severity: normal Keywords: svn
Cc: Branch:
Release Notes:

Fixed wrong content_type for a file in Subversion repository when svn:mime-type is not set.

API Changes:
Internal Changes:

Description

Reported at gmessage:trac-users:ZI6x6-IaY0c/m/_YhEYQHWAwAJ.

My Trac installation will not do syntax highlighting based on file extension in Subversion repository browser, only when I set it explicitly, like:

svn propset svn:mime-type "`file -bi start.pl`" start.pl

Only then syntax highlighting works, for this file only. Do I have to set this property on all files to see them highlighted?

Attachments (0)

Change History (2)

comment:1 by Jun Omae, 10 months ago

Owner: set to Jun Omae
Status: newassigned

The following patch fixes it. I'll push the patch with a test case.

  • tracopt/versioncontrol/svn/svn_fs.py

    diff --git a/tracopt/versioncontrol/svn/svn_fs.py b/tracopt/versioncontrol/svn/svn_fs.py
    index b5fd52854..bac8fa157 100644
    a b class SubversionNode(Node):  
    827827    def _get_prop(self, name):
    828828        value = fs.node_prop(self.root, self._scoped_path_utf8, name,
    829829                             self.pool)
    830         return to_unicode(value)
     830        return _from_svn(value)
    831831
    832832    def get_branch_origin(self):
    833833        """Return the revision in which the node's path was created.

comment:2 by Jun Omae, 10 months ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [17574].

Modify Ticket

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