On 3/23/2013 10:58 AM, Peter Stuge wrote: > Lele Gaifax wrote: >> Is there any drawback in the approach? > > Maybe if the guess is wrong sometimes.. >
Note that mimetypes.guess_type() is also called as part of Mimeview.get_mimetype() [1] and that one is called when the Node.content_type returns None. > >> Should git_fs.py do the same[2]? > > It doesn't seem like an operation that belongs in version control > code in the first place.. > Right, this Node.get_content_type() method is there to get a chance to take advantage of special conventions about how to store the MIME type in the version control system, like the svn:mime-type property in Subversion. For git, .gitattributes could be used for that although I don't think there are widespread conventions for this. -- Christian [1] http://www.edgewall.org/docs/branches-1.0-stable/html/api/trac_mimeview.html#trac.mimeview.api.Mimeview.get_mimetype -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/trac-dev?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
