#4933 check mime type for text/binary for code browser [ss539]

v1.0.0
closed
nobody
SCM
2015-08-20
2012-09-13
Chris Tsai
No

[forge:site-support:#539]

Trying to browse Subversion repository, for example page

https://sourceforge.net/p/gputils/code/813/

for every file you'll see "Cannot display: file marked as a binary type."

I do not see any mark of binary type.

The files have properties:

Properties on 'ChangeLog':
  svn:keywords
    Author Date Id Revision
  svn:eol-style
    native

The svn-book says "If the file has no svn:mime-type property, or has a MIME type that is textual (e.g., text/*), Subversion assumes it is text. Otherwise, Subversion assumes the file is binary."

These files have no svn:mime-type property, so they are assumed to be text by subversion.

Related

Tickets: #4933

Discussion

  • Chris Tsai - 2012-09-17
    • labels: support, p3 --> support, p2
     
  • Chris Tsai - 2012-09-17

    The example given is for svn, but we should go for improvements/detection for all scms.

     
  • Dave Brondsema

    Dave Brondsema - 2012-09-17

    We're already reading the data for the file (or about to), so we could check SVN/git/hg metadata for the file, or use heuristics on the first few hundred bytes.

     
  • Dave Brondsema

    Dave Brondsema - 2012-09-17
    • labels: support, p2 --> support, p2, 42cc
    • component: General --> SCM
    • milestone: limbo --> forge-backlog
     
  • Igor Bondarenko

    Igor Bondarenko - 2012-09-19

    Created #170: [#4933] better mime type detection for code browser (1cp)

    • status: open --> in-progress
     

    Related

    Tickets: #4933

  • Igor Bondarenko

    Igor Bondarenko - 2012-09-21

    Closed #170. Branch 42cc_4933.

    We use heuristic on a file content using python-magic lib.

    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-09-25
    • status: code-review --> closed
    • qa: Dave Brondsema
    • milestone: forge-backlog --> forge-oct-05
     

Log in to post a comment.