One annoying aspect though is that almost all Drupal files use CVS style tags, such as the $Id$ one. Subversion does not recognize these by default.
However, there is a way to make Subversion recognize these tags. This post describes the steps needed to achieve this goal.
1. Edit your subversion configuration file
Depending on your distribution, subversion's configuration could be in /etc/subversion/config.
2. Set auto properties
Under the [miscellany] section, add the following line:
[miscellany] enable-auto-props = yes
3. Configure auto properties
We now list the Drupal file types, and enable Id and Revision tags on them.
[auto-props] # enable keywords for Drupal files *.inc = svn:keywords=Revision Id *.install = svn:keywords=Revision Id *.info = svn:keywords=Revision Id *.module = svn:keywords=Revision Id *.theme = svn:keywords=Revision Id *.php = svn:keywords=Revision Id # CSS and JS *.css = svn:keywords=Revision Id *.js = svn:keywords=Revision Id # C files *.c = svn:keywords=Revision Id *.h = svn:keywords=Revision Id # Scripts *.pl = svn:keywords=Revision Id *.sh = svn:keywords=Revision Id *.txt = svn:keywords=Revision Id
Wait! This only works for newly added files. What about files that are already in the repository? For these, we have to do the next step.
4. Change properties for existing files:
A command like the following enables the named properties to be replaced by SVN with the relevant info. Note that Rev is an alias for Revision.
svn propset svn:keywords "Id Rev" some_file.module
But we need this on all files in the repository, so you need to follow these steps:
# Change to your sandbox's main directory cd /your/sandbox # Make sure that everything is up to date svn up # Get a list of all Drupal files find . -type f | grep -v '/\.svn/' | egrep "\.(inc|install|info|module|theme|php|txt|sh)$" > list # Add svn:keywords properties for all files for FILE in `cat list` do svn propset svn:keywords "Id Rev" $FILE done # Commit the change svn commit -m "Adding Id and Rev property to all files"
Now, all the files will have the Id and Revision tag replaced, and you can trace what your client/site is using, vs. what is in the repository.