What's the correct/best properties to assign to *.xml files in Subversion?
I'm particularly interested in the properties svn:mime-type
and svn:needs-lock
.
I think there are two answers, but I'm not sure about which one to choose. The first one is to consider XML files as text files, letting Subversion manage textual merges in them. For this, I would use svn:mime-type=text/xml
and would not use svn:needs-lock
.
The second would be to consider XML files as binary files, preventing Subversion to perform automatic merges and insisting on lock-before-edit behaviour. For this, I would use svn:mime-type=application/xml
and would set svn:needs-lock
.
I think it's ok to treat XML as text if it's the kind of XML file that is edited directly in a text editor, because the user would then be able to resolve any eventual merge conflicts by hand. However, tool generated XML files cannot be easily edited by hand and so should not be automatically merged by Subversion lest the user be put in a situation in which he has to resolve a conflict in an (essentially) binary file.
Being conservative, I'm treatting XML files as binary. But I'm always having to explain this to developers that would rather prefer to be able to edit some XML files directly, with no need to get locks previously.
I would like to know what others think about this and if there really is a danger concerning tools generated XML files or not.
POST CLARIFICATION:
After having read the first three responses I realized that the above question wasn't clear enough.
My doubt is what properties should be configured for *.xml
files in the [auto-props]
section of the Subversion configuration file (~/.subversion/config
)?
The problem is that there can only be one configuration. So, should I be conservative and treat all XML files as binary or should I please the users that edit their XML files by hand and treat all XML files as text by default?