views:

451

answers:

2

My situation is this: I have a Subversion server set up at my home, and we also use Subversion at the company where I work.

At work, we use the lock/edit/unlock model (mainly because we are transitioning from Visual SourceSafe and it's easier for the moment). At the moment this is achieved by setting the 'needs-lock' property on all added files (using the auto-props section of the SVN client config file on each client machine).

However, I don't want to use this model for my home SVN server (I prefer the edit/merge/commit way of working), so currently after I commit anything from my work PC to my home server, I have to manually remove the needs-lock property from any files I have added.

Is there a way I can set up the SVN client to only apply this property to files committed to a particular server? Or am I going about it the wrong way: should I be using hooks on the work server to add this property, instead of the client?

Any help or advice is much appreciated.

EDIT: Apparently, you cannot do this on the server (or at least it's extremely strongly recommended that you don't).

+2  A: 

The subversion autoprops feature is configured in the config file of your SVN client. There is also a separate servers configuration file that supports server-specific settings, but unfortunately you cannot override autoprops there.

I suggest you make two versions of config: config.home and config.work. Then write a shell script (e.g. a .bat file) that copies one of those over config. That should allow you to switch quickly and easily between both configurations.

Wim Coenen
That's a good plan.
Mark B
+1  A: 

I also wrote a little Windows batch file to recursively remove the needs-lock property from any folders where it had already been set. Put these lines into a text file:

svn propdel svn:needs-lock -R -q ”%1” 
svn commit ”%1” -m “Removed needs-lock”

Save it as remove-needs-lock.bat, and add it's location to your PATH environment variable. Then you can run:

remove-needs-lock c:\workingcopyfoldername

And presto, all the files no longer require lock to edit.

Mark B