Why is the Subversion client on Linux detecting my XML file as binary?
I have a strange error with a client svn
on Linux.
I would like to add a file test.xml
to the repository. This file is standard latin text XML (no BOM) and Linux trailing end (only LF
). But my client svn
is failing:
[mn@mn testy]$ cat test.xml
<?xml version="1.0" encoding="UTF-8"?>
<Test>test</Test>
<Test>89012345678901234</Test>
[mn@mn testy]$ file test.xml
test.xml: XML document text
[mn@mn testy]$ svn add test.xml
svn: E200009: Can't set 'svn:eol-style': file '/home/mn/testy/test.xml' has binary mime type property
The same operation works in the Windows environment. I have a config with auto support:
*.xml = svn:eol-style=native
I have svn, version 1.8.10 (r1615264)
.
I can work in this:
- add file to windows
-
add
svn:mime-type=text/xml
to auto-props so it looks like this:*.xml = svn:mime-type=text/xml;svn:eol-style=native
-
svn add
with the option--no-auto-props
and then usesvn propset
- add an empty file and then edit it
But I would like to do it just by adding a file.
Why is the Subversion client on Linux detecting this file as binary?
source to share
Not a real solution, but some notes that might help:
- Usually mime types are specified explicitly by the user with auto-props.
- I found a link for how files are marked as binaries: http://svnbook.red-bean.com/en/1.7/svn.forcvs.binary-and-trans.html Perhaps it helps to understand how it works.
- Have you checked if the file was executed executable on Linux, so Subversion considers it a binary file?
With Subversion 1.8 on the client, you have what is called the Dictated Configuration Repository , so the following should work under all circumstances:
- Include in the root of your repository (/ or / trunk) a property
svn:auto-props
with the value*.xml = svn:mime-type=text/xml;svn:eol-style=native
- When you add a new file (on Windows and Linux) and the file has an ending
.xml
, Subversion must add as a property to the filesvn:mime-type
andsvn:eol-style
. There should be no magic to see if a file is binary and set the mime type to something liketext/*
to make sure the file is not interpreted as binary.
source to share