In my last post, I discussed how to configure the version control system, Subversion, to correctly handle BizTalk files. Although I did talk about how to set the correct file-type properties and how to mass update files already in the repository, I neglected to detail how to set those properties when files are first added to a repository.
As a committer, you won’t want to keep updating your newly added files with Subversion properties every time you add a or import a file. To resolve this problem, Subversion uses a concept of ‘auto-properties’ – properties that are automatically set on a new file (based on file type) when they are first added to the repository. Auto-properties can either be set in the Subversion configuration file or in the Windows Registry.
Auto-Properties in the Subversion Configuration File
To set auto-properties in the Subversion configuration file, open the config file
%USERPROFILE%\Application Data\Subversion\config
and add lines similar to the following under the [auto-props] section of the file:
[auto-props]
*.btm = svn:mime-type=text/xml
*.btp = svn:mime-type=text/xml
*.odx = svn:mime-type=text/xml
*.xsd = svn:mime-type=text/xml;svn:eol-style=native
*.xml = svn:mime-type=text/xml;svn:eol-style=native
*.xsn = svn:mime-type=application/octet-stream
This sets the MIME-types defined in my earlier post for several common BizTalk file types; note that multiple properties can be set per file type, each separated by a semi-colon (e.g. *.xsd and *.xml file-types).
In order to enable these auto-properties, enable-auto-props under [miscellany] must be set to ‘yes’:
[miscellany]
enable-auto-props = yes
Auto-Properties in the Registry
The same auto-properties settings can be achieved through the Windows Registry. A sample .reg file is shown below that sets the same auto-properties detailed earlier:
REGEDIT4
[HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config\auto-props]
"*.btm"="svn:mime-type=text/xml"
"*.btp"="svn:mime-type=text/xml"
"*.odx"="svn:mime-type=text/xml"
"*.xsd"="svn:mime-type=text/xml;svn:eol-style=native"
"*.xml"="svn:mime-type=text/xml;svn:eol-style=native"
"*.xsn"="svn:mime-type=application/octet-stream"
[HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config\miscellany]
"enable-auto-props"="yes"
For a full list of auto-properties that can be set, see the Special Properties section of the Subversion Online Help.
Hi,
I’m having a little trouble getting the auto-prop settings to work when added to the Windows registy. I’ve added values (to update the author name, date etc in my files) to both HKEY_CURRENT_USER\Software\TortoiseSVN\Config and HKEY_LOCAL_MACHINE\Software\TortoiseSVN\Config but when I add a new file to the SVN repository, it seems to have no effect.
Hope you can help.
Unfortunately, I can’t remember the correct procedure for configuring Tortoise through Registry settings, however I’m wondering whether because Tortoise integrates into Windows Explorer, that needs to be restarted for the changes to take effect – that should be a simple as restarting your machine – have you tried that?
Rgds, Nick.
I just tried that, no luck I’m afraid.
The following is the .reg file I’m using:
Thanks
Faraz
————-
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseSVN\Config\miscellany]
“enable_auto_props”=”yes”
[HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseSVN\Config\auto-props]
“*.txt”=”svn:keywords=Author Date Id HeadURL Revision”
“*.java”=”svn:keywords=Author Date Id HeadURL Revision”
“*.js”=”svn:keywords=Author Date Id HeadURL Revision”
“*.pas”=”svn:keywords=Author Date Id HeadURL Revision”
“*.dpr”=”svn:keywords=Author Date Id HeadURL Revision”
“*.dfm”=”svn:keywords=Author Date Id HeadURL Revision”
[HKEY_CURRENT_USER\SOFTWARE\TortoiseSVN\Config\miscellany]
“enable_auto_props”=”yes”
[HKEY_CURRENT_USER\Software\TortoiseSVN\Config\auto-props]
“*.txt”=”svn:keywords=Author Date Id HeadURL Revision”
“*.java”=”svn:keywords=Author Date Id HeadURL Revision”
“*.js”=”svn:keywords=Author Date Id HeadURL Revision”
“*.pas”=”svn:keywords=Author Date Id HeadURL Revision”
“*.dpr”=”svn:keywords=Author Date Id HeadURL Revision”
“*.dfm”=”svn:keywords=Author Date Id HeadURL Revision”
Take a look at the Tortoise SVN online help at http://svnbook.red-bean.com/en/1.5/svn.advanced.confarea.html#svn.advanced.confarea.windows-registry
I’ve also noticed that your registry keys appear to be incorrect – you should be using:
HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config
instead of
HKEY_CURRENT_USER\Software\TortoiseSVN\Config
Nick.
We’re seeing a UNICODE encoding problem on our systems – Biztalk expects the byte ordering mark for all unicode files, even UTF-8 ones. Have you been able to avoid this problem, or are all of your files encoded UTF-8 with the BOM?