Q:

How do you treat the deployment of configuration files on different systems in Subversion?

Subversion is a great way to update our web applications on our servers. With a simple svn update all changed files get... well, changed.
Except for the omnipresent configuration files such as config.php which hold the database access configuration, server paths etc. And are therefore different on my local development system and the remote server.
With the update command, a file modified on the server won't get overwritten, but if I change the file locally and commit it, the server gets the wrong configuration file.
But I don't want to set the svn:ignore property either, since the config file belongs to the project.
Is there a Subversion-mechanism which will allow me to easily handle these kind of files? Or is the only way to solve this problem to make a system switch within the config file which will determine the executing system and sets the configuration accordingly?

A:

Create a template for the file (e.g. config.php-default) and let the user copy the template. She can also do a diff to see what changed between versions to incorporate these changes in the locally deployed version of the file.

A:

I find the easiest way is to switch on the machine's hostname.  I have a .ini file with a general section that also overrides this for production, testing and development systems.
[general]
info=misc
db.password=secret
db.host=localhost

[production : general]
info=only on production system
db.password=secret1

[testing : general]
info=only on test system
db.password=secret2

[dev : general]
info=only on dev system
db.password=secret3

So dev:db.password == 'secret3', but dev:db.host == 'localhost', from the original 'general' group.
The 'production', 'testing' and 'dev' could be the machine hostnames, or they are aliases for them set from some other mechanism in a configuration control script.

