4

How can I change the type of all the files in a repository SVN who have the extension .xml from the type binary to the type text.

It means, is no more necessary to change the type of each file, one by one, but all files with extension .xml in a repository.

taintedlove
  • 195
  • 2
  • 7

2 Answers2

4

First, do a svn proplist <file> on the file to see what properties are there.

Then, depending on what you see, you will want to use svn propset or svn propdel to set, change, or remove properties to make things sane.

If you want to do this to more than one, you will want to do something like:

svn propset svn:mime-type text/xml *.xml

or

find . -name \*.xml | xargs svn propset svn:mime-type text/xml
Michael Graff
  • 6,588
  • 1
  • 23
  • 36
  • 3
    It's a bit safer to use find . -name \*.xml -print0 | xargs -0 svn propset svn:mime-type text/xml It resists better to strange characters in the filename. – b0fh Feb 22 '10 at 17:40
4

If you want all new files having a filename ending in .xml be treated as text, you can try the following:

Edit your local svn config file (Typically located in ~/.subversion/config

Add the following to the [auto-props] section:

[auto-props]
*.xml = svn:mime-type=text/xml
b0fh
  • 3,313
  • 1
  • 20
  • 32