Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add text file to subversion repository-- that it thinks is binary

Tags:

svn

I'm trying to add a text file to SVN and it has different ideas. Using tortoise SVN and right clicking "Add.." I get an unhappy message telling me the file has a binary mime type property. And it won't add it to the repository.

I can't think of why that would be, as it's one of several text files (SQL stored procedure listings in this case) that I created at once. (Three files, in fact, give me this message, while two others were added just fine.)

When I tried changing the mime property on the file via svn propset svn:mime-type text/plain I'm given a warning that the file isn't under version control, which is of course 100% true.

What can I do to get SVN to recognize these files as text, and add them to the repository?

like image 453
larryq Avatar asked Oct 04 '22 19:10

larryq


1 Answers

You should do the following steps (using TortoiseSVN) to check what is the source of the failure:

  • Open your TortoiseSVN > Settings, and open there General > Subversion configuration file > Edit.
  • Search in that file for the string "prc" (without double quotes).
  • If you find a rule like that: *.prc = svn:mime-type=application/octet-stream, this is the reason that the property is added.
  • There is no way that the autoprops come from another source (see Subversion wiki for details).
  • Just to be sure: Do you have client hooks installed? This is the only thing I can think of that does that for you.
  • If all fails, ask your Subversion administrator if there is a server hook (like a pre-commit hook), that 1. sets the property and 2. checks the property. But this sounds ridiculous.

Try to do the following steps:

  1. Add a file test.prc (with some content) to your directory (a local copy).
  2. Use TortoiseSVN > Add on that file.
  3. Open then the properties for that file. If there are properties, there should be the autoprops in your configuration, or a hook that changes the props.
  4. If there are no properties (what should be normal), try to commit that file to the server.
  5. If that works well now, ...
  6. Check the properties of that file again (they could have changed).

By the way, some information about your Subversion server version, TortoiseSVN client version would be helpful ...

like image 121
mliebelt Avatar answered Oct 10 '22 02:10

mliebelt