Domanda

We recently started using AnkhSVN subversion plugin for Visual Studio. Everything is working as it should, but we have a bit of a problem.

When one of my co-workers locks a certain file, I then cannot commit changes I've made to that file. This isn't neccesarly a problem, but we're wondering if its possible to do the following:

Person X locks a file --> Person Y automatically sees in Visual studio that he can't edit the file because it is locked by someone else. Now we have to "manually" ask the other person wheter or not he has locked a certain file, because the plugin doesn't show a red ! thingy sign or whatever if the file is locked. This is a little annoying because it's possible that i've been working on a file for like an hour, only to see that I can't commit the changes because the file is locked by someone else.

Is this possible using AnkhSVN, or do I need to resort to other solutions?

È stato utile?

Soluzione

With Subverison (of any kind), locking is useful when there are binary files to modify.

In this case, the steps should be:

  1. lock the binary file
  2. modify
  3. commit

If someone else has the file locked, your attempt to lock the file will fail, and you will know not to make any modifications, and should ask the other user to alert you when they are done.

If this is a text file, then locking is not needed, as you can (usually) merge changes easily.

SVN Book, Chapter 3. Advanced Topics: Locking

Altri suggerimenti

You can set the subversion property "svn:needs-lock". In that way you are required to lock the file when you try to edit it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top