User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:svn_config

This is an old revision of the document!


Subversion configuration for Mantis Developers

Author: Martin Fuchs

Subversion uses the concept of file “properties” (see also http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html) to record additional information for the files in the repository. A property in this context is just a key name with an associated value. Subversion can store any number of properties per file. In principle you can store any textual key/value information you want to add some meta information to your files. There are a number of reserved property names, Subversion uses internally to manage for example file types, file content encoding, executable flags, and keyword substitution. All this information is stored in the central Subversion repository on a file by file basis. You can configure them manually using the SVN command line or some graphical tool like TortoiseSVN or Subclipse. But this a quite error prone task, you can easily forget to set some property when checking in a new file. So you should setup your SVN client to do this automatically for you. When adding new files to the repository SVN sets the file properties automatically setting on file extensions. I will describe the preferred configuration of the local environment for Mantis Developers in the following. It sets the svn:eol-style for text files (non-binary files) and the svn:keywords property for all files eventually containing the $Id keyword.

On Windows the configuration is stored in the registry under the key KEY_CURRENT_USER\Software\Tigris.org\Subversion\Config. You should download the following file and launch it by double clicking to import the settings in the registry:

subversion_mantis_config.reg

REGEDIT4

[HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config\auto-props]
"*.php"="svn:eol-style=native;svn:keywords=Author Date Id Revision"
"*.txt"="svn:eol-style=native;svn:keywords=Author Date Id Revision"
"*.css"="svn:eol-style=native"
"*.js"="svn:eol-style=native"
"*.sample"="svn:eol-style"
"*.html"="svn:eol-style=native"
"*.htm"="svn:eol-style=native"
"*.htaccess"="svn:eol-style=native"
"*.png"="svn:mime-type=image/png"
"*.jpg"="svn:mime-type=image/jpeg"
"*.gif"="svn:mime-type=image/gif"

[HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config\miscellany]
"enable-auto-props"="yes"

Under Unix the configuration is located in the “$HOME/.subversion/config” file in your home directory on Unix:

HOME/.subversion/config

### Set enable-auto-props to 'yes' to enable automatic properties
### for 'svn add' and 'svn import', it defaults to 'no'.
### Automatic properties are defined in the section 'auto-props'.

enable-auto-props = yes

### Section for configuring automatic properties.
### The format of the entries is:
###   file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?').  All entries which match will be applied to the file.
### Note that auto-props functionality must be enabled, which
### is typically done by setting the 'enable-auto-props' option.

[auto-props]
*.php = svn:eol-style=native;svn:keywords=Author Date Id Revision
*.txt = svn:eol-style=native;svn:keywords=Author Date Id Revision
*.css = svn:eol-style=native
*.js = svn:eol-style=native
*.sample = svn:eol-style=native
*.html = svn:eol-style=native
*.htm = svn:eol-style=native
*.htaccess = svn:eol-style=native
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
*.gif = svn:mime-type=image/gif

For more information on this topic also see the Subversion documentation:

http://svnbook.red-bean.com/en/1.4/svn.advanced.confarea.html#svn.advanced.confarea.opts

mantisbt/svn_config.1194566935.txt.gz · Last modified: 2008/10/29 04:31 (external edit)

Driven by DokuWiki