tags:

views:

42

answers:

3

Hello,

We are working with two different teams on the same project. In a configuration file App.config, we have two connections string with our connection settings to connect to our database and the second team has another database with a different connection string. I have to comment the second connection string and uncomment the first. I have to check always this file if the connection string is correct (if the another team has not commited this file). It's a little bit boring..

This configuration file contains some other configurations keys that we use in common. My goal is to set (on the config file with a or somewhat) to tell to SVN to not include this part of file when I made a commit.

Is it possible ?

+2  A: 

Partial file commits aren't possible in any version tracking system I've ever seen. You can however take a look at something like this if you're using VS2010.

David
But I have: TortoiseHg let you choose which parts of a file to commit (on the hunk selection tab). Git also has this function, but I don't recall how it's spelled there.
Rudi
+1  A: 

I suggest that everyone in your teams backup the configuration file, and have someone rename the file in SVN to something like template.[original-name] and commit that.

Then, have everybody restore their own configuration file and put in into the svn:ignore Subversion property of the directory containing the file, and commit that directory to have the svn:ignore in version control for everyone and have them update their working copies after that.

This way, each team member can have a different configuration.

Configuration and user/system specific files should not be in version control.

See also http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.ignore.html.

EDIT: To actually answer your question, David is right, partial file commits are not possible (and usually would not make sense either). It is not the intended workflow of Subversion.

Archimedix
+2  A: 

You can use the configSource attribute to have ASP.NET read the config from an external file instead of the main config file. That way you can have one dirty and ignore-on-commit file containing the connection strings, and still be able to commit the main config file when changes are needed.

Sander Rijken