All files in the SVN repository should have the Unix style (LF) line endings. This is controlled via the Subversion "eol-style=LF" property. In addition, most files (.php, .css, .js, .ini) should have the "keywords=Id" property set. This is what allows Subversion to record the "@version" tag in the Doc block at the beginning of each file. For example,
* @version $Id: index.php 14276 2010-01-18 14:20:28Z louis $.
You only need to set these properties when you create new files and add them to version control. If you are editing existing files that are already under version control, the properties should already be set correctly.
You can set file properties either manually or you can configure Subversion to do this automatically each time you add a file to version control.
Subversion uses a configuration file to control automatic property settings. For Mac or Linux users, this file is called
~/.subversion/config. For Windows users, this file is called
C:\Documents and Settings\<your user name>\Application Data\Subversion or
C:\Users\<your user name>\AppData\Roaming\Subversion\config. For TortoiseSVN, you can edit the configuration file right from the program. Right-click on a project, select TortoiseSVN→Settings and click on the "Edit" button next to "Subversion configuration file:".
Edit the configuration file as shown below. At the end of the file, you will see a section called
[auto-props]. Be sure to set the
enable-auto-props = yes. Also, note that "Id" is upper-case "I" and lower-case "d".
### Section for configuring automatic properties. enable-auto-props = yes [auto-props] ... *.php = svn:eol-style=LF;svn:keywords=Id *.html = svn:eol-style=LF *.xml = svn:eol-style=LF *.ini = svn:eol-style=LF;svn:keywords=Id *.css = svn:eol-style=LF;svn:keywords=Id *.js = svn:eol-style=LF;svn:keywords=Id
You can test that the change was successful by creating a new file of the desired type and adding it to version control. Then examine the SVN properties for this file and you should see the new properties automatically. See below for instructions on examining the properties.
You can of course manually set or check the properties for any file that is under version control. Here is how you do this in Eclipse, command line, or TortoiseSVN.
propset svn:keywords "Id" <file name>or
propset svn:keywords "Id" <file name>. You can also use the "propdel" command to remove properties.