views:

790

answers:

4

I have a django project that I have been working on as a solo developer, and have been using TortoiseSVN to keep the code managed in a repository on a work server. I work on this on a local installation of django etc.

There is now a second person who will be working on this project, and the possibility of working on some other PCs.

Now, there should, for the time being, only be one development version (branch?) of this project, but the configuration file (settings.py) will need to be different on each computer that is being used. I want to create one local version of this file on each PC which should not need to be changed again.

How can I set the repository (preferably within TortoiseSVN) to exclude this one file? E.g. the repository should not include settings.py. When a checkout occurs, it should update all files in the local folder but not change/remove the local copy of settings.py. When a commit occurs, settings.py should be ignored and not uploaded.

At the moment settings.py is overwritten/updated as per any other file in the project folder/repository.

Any nudges in the right direction would be useful - I'm new to SVN generally and would like to know if this is something that's going to need detailed understanding of branching or if there is a simpler way.

Thanks

+3  A: 

In TortoiseSVN, when you try to commit your files, in the file list dialog, right click the file and look for the Ignore option. You can ignore by complete filename or extension.

If the file is already in the repository, and you want to remove it from there and ignore it, you can simply right-click the file and in the TortoiseSVN menu look for the 'Delete and add to ignore list' option.

bgever
Note that this operation will also delete it from everyone else on the next update. Svn has a --keep-local switch in the newer versions, but that has the same problem: you get to keep your local copy, but everyone else loses theirs.
Rytmis
So, to clarify, I want to backup each local copy, delete/ignore the file from the repository, checkout the repository to each machine (which will delete the file), then put the backup local copy back in the local folder, and from then on commit/checkout will work as intended? Or will the file still be deleted on each local update?
meepmeep
If the other machines don't have a working copy yet, everything is fine. If they do have one, and have the settings file, doing the copy/update/copy back dance will do the trick. The update will delete the file once only (as it's a pending change to the local copy once only).
Rytmis
Actually, the simplest way is probably to rename the file to something like settings.py.tmp, then run update, and then rename it back. :)
Rytmis
that worked perfectly, thank you!
meepmeep
+2  A: 

You'll be looking for the svn:ignore property, which tells subversion to not version files matching a pattern or patterns you specify.

There's some guidance on using it with TortoiseSVN at:

http://arcware.net/tortoisesvn-global-ignore-pattern-vs-svn-ignore/

marramgrass
+1  A: 

The typical solution is to do what bgever said and ignore the settings file itself, and then commit a file with example values, something like settings.py.example. That file should only be updated when you add or remove settings. When deploying, you'd copy that to settings.py and edit the values.

Rytmis