tags:

views:

134

answers:

2

Hi;

I am working on a SVN controlled project that I had checkout from server at the beginning.

In one of the SVN controlled directory, there is a configuration file (settings.py) which I had to edit to suit my local setup.

I have created a local backup of my own configuration file. In order not to update this file to server, I always revert "settings.py" before committing to the server. After committing, I move my own "settings.py" from my local backup.

I will appreciate if somebody can guide me how to exclude this file from SVN without any side effects; so that I don't have to revert and recopy by hand.

+1  A: 

Well, you can simply not commit the file.

When committing, you can select what to commit; just omit the file.

sleske
Yeah, simply uncheck the file, if using tortoise.
John Gietzen
assuming the OP is using tortoise.
Robert Greiner
I think using svn:ignore makes more sense here...so you don't have to uncheck the file every single time you make a commit.
davr
+6  A: 

A common way to do this is to store an example file such as settings.py.template in source control, but not settings.py. That way, you can change settings.py as needed locally, without Subversion prompting you to commit it.

When you make a new checkout, you would copy settings.py.template to settings.py to get things started. If you make any changes that affect the default configuration file, change settings.py.template and commit the change.

Greg Hewgill
this is what I typically do too, plus I will set svn to ignore settings.py
rally25rs
This is a good partion solution...I think you could combine it with svn:ignore to make the perfect solution.
davr
Actually, we use a similar approach. We have a dir etc/ for config files, and etc.deploy for the *real* config files that go into deployments for RTM. Works well; only caveat is to keep the files in sync (new settings etc.).
sleske
can somebody show an example of how to issue svn:ignore command to the already included file?
Tolga
@Tolga: Subversion will not ignore a file that is already in the repository. To use this method, you would *delete* the `settings.py` file from the repository (or use `svn mv` to rename it to `settings.py.template`).
Greg Hewgill
@Greg: Thank you very much for the clarification..
Tolga