Subversion & BizTalk: Setting Committer Auto-Properties

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 DataSubversionconfig

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_USERSoftwareTigris.orgSubversionConfigauto-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_USERSoftwareTigris.orgSubversionConfigmiscellany]
"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.

Advertisements

6 thoughts on “Subversion & BizTalk: Setting Committer Auto-Properties

  1. 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_USERSoftwareTortoiseSVNConfig and HKEY_LOCAL_MACHINESoftwareTortoiseSVNConfig but when I add a new file to the SVN repository, it seems to have no effect.

    Hope you can help.

  2. 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.

  3. 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_MACHINESOFTWARETortoiseSVNConfigmiscellany]
    “enable_auto_props”=”yes”

    [HKEY_LOCAL_MACHINESOFTWARETortoiseSVNConfigauto-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_USERSOFTWARETortoiseSVNConfigmiscellany]
    “enable_auto_props”=”yes”

    [HKEY_CURRENT_USERSoftwareTortoiseSVNConfigauto-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”

  4. 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?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s