Subversion use a heuritic algorithm to determine whether a file is binary or not. Firstly, it checks if the mime-types-file
configuration parameter is set and uses this to map files to mime-types. If not such configuration is found, it looks at the 1024 first bytes, and if more than 15% are not within ASCII range or any of them are null values, the file is considered binary. To specifically set a mime-type of a given file-type, you must use auto props.
Please note that if subversion determines your file to be of mime-type image/x-xbitmap
or image/x-xpixmap
, it will be treated as a text file
Auto-props affect the svn add
and svn import
actions and are set using the runtime configuration, which are specified through either command line options or in the config file for subversion, found in the subversion installation conf directory.
The following values should be set:
# default is 'no', so we enable auto props with
enable-auto-props = yes
# specify absolute path to mime.types like file, e.g.
mime-types-file = /etc/mime.types
This should map your binary files correctly.
EDIT: From the cvs2svn manual:
--auto-props=FILE
Specify a file in the format of Subversion's config file, whose
[auto-props] section can be used to set arbitrary properties on
files in the Subversion repository based on their filenames. (The
[auto-props] section header must be present; other sections of the
config file, including the enable-auto-props setting, are ignored.)
Filenames are matched to the filename patterns case-insensitively,
consistent with Subversion's behavior. The auto-props file might
have content like this:
[auto-props]
*.txt = svn:mime-type=text/plain;svn:eol-style=native
*.doc = svn:mime-type=application/msword;!svn:eol-style
So, using the command line switch --auto-props
and an auto-props
file, you should be able to get the wanted functionality of the
cvs2svn
script