MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

Register Binary Files with SVN


If you use third-party source control tools, you must register your MATLAB and Simulink
file extensions such as .mlx, .mat, .fig, .mdl, and .slx as binary formats. If you do
not register the extensions, these tools can corrupt your files when you submit them by
changing end-of-line characters, expanding tokens, substituting keywords, or attempting
to automerge. Corruption can occur whether you use the source control tools outside of
MATLAB or if you try submitting files from MATLAB without first registering your file
formats.

Also check that other file extensions are registered as binary to avoid corruption at check-
in. Check and register files such as .mdlp, .slxp, .sldd, .p, MEX-
files, .xlsx, .jpg, .pdf, .docx, etc.

You must register binary files if you use any version of SVN, including the built-in SVN
integration provided by MATLAB. If you do not register your extensions as binary, SVN
might add annotations to conflicted MATLAB files and attempt automerge. To avoid this
problem when using SVN, register file extensions.

1 Locate your SVN config file. Look for the file in these locations:


  • C:\Users\myusername\AppData\Roaming\Subversion\config or
    C:\Documents and Settings\myusername\Application Data
    \Subversion\config on Windows

  • ~/.subversion on Linux or macOS


(^2) If you do not find a config file, create a new one. See “Create SVN Config File” on
page 32-18.
(^3) If you find an existing config file, you have previously installed SVN. Edit the
config file. See “Update Existing SVN Config File” on page 32-19.
Create SVN Config File
(^1) If you do not find an SVN config file, create a text file containing these lines:
[miscellany]
enable-auto-props = yes
[auto-props]
.mlx = svn:mime-type=application/octet-stream
.mat = svn:mime-type=application/octet-stream
.fig = svn:mime-type=application/octet-stream
.mdl = svn:mime-type=application/octet-stream
*.slx = svn:mime-type= application/octet-stream
32 Source Control Interface

Free download pdf