views:

632

answers:

2

We've recently moved from CVS to Subversion 1.6. We used the native Eclipse CVS support as our CVS client. We now use the Subsclipse plugin as our SVN client.

I've found that we're having problem seeing locked files in Subclise if the file isn't configured with "svn:needs-lock".

If a file has "svn:needs-lock" then the Navigator pane clearly shows whether you have a lock or if you don't have a lock in the file icon. If a file does not have "svn:needs-lock" then the Navigator pane shows the same icon for both locked and unlocked files.

Does anyone know of a way to change this (either in Subclipse or by using a new plugin?)

A: 

According to Issue 2306, svn lock theFile should remove the read only attribute even though the svn:needs-lock property does not exist.

If your WC has a file with the svn:needs-lock property set and you then switch your WC to a branch where that file does not have that property. The property is removed in the WC but the read-only attribute is not removed from the file.

This causes problems in Subclipse, and somewhat also TortoiseSVN, since we both decorate files based on the read-only attribute. In the case of Subclipse, the presence of the read-only attribute causes Eclipse to present the user with the Subclipse Lock UI -- a good thing. However, we are then relying on the svn lock command to remove the read-only attribute, which it doesn't in this case. It would be nice as a fail-safe if it could do that.

VonC
A: 

Locally Locked

It works for me. I just tested it with Subversion 1.6.2 (server), Subclipse 1.6.5 client, and eclipse 3.5.1.

I used right-click -> Team -> Lock... and after creating the lock the overlay icon on the file changed from a yellow cylinder to a dark square with a white check mark inside. I restarted eclipse and verified that the file was still marked as locked.

This file does not have the svn:need-lock property set and the file was not read-only prior to requesting the lock.

Remotely Locked

If you want to see files locked by another user then you should not expect a visible indication of that lock to appear in your environment because Subclipse would have to poll the server to discover the lock. You can discover remote locks in multiple ways.

  • From the SVN Repositories view you can view the properties of files in the repository and see any outstanding locks. (right-click -> Properties).
  • Attempting to commit a change to a locked file will fail.
  • Attempting to lock a locked file will fail.

Hope this helps.

ChrisH