Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I determine who locked a file using SVN?

We are using SVN server 1.4 (I think) with the clients being either the command line client or TortoiseSVN.

like image 789
detroitpro Avatar asked May 12 '09 15:05

detroitpro


People also ask

What is svn get lock?

After you configure SVN to make files with certain extensions read only, then users must get a lock on these read-only files before editing. In a project, in any Files view, select the files you want to check out. Right-click the selected files and select Source Control > Get File Lock. Get File Lock is for SVN.

How do you break the lock in TortoiseSVN?

To release a lock manually, select the file(s) in your working copy for which you want to release the lock, then select the command TortoiseSVN → Release Lock There is nothing further to enter so TortoiseSVN will contact the repository and release the locks.

Which command in svn is used to ensure that no multiple people are editing same file at a given time?

To prevent other people from committing changes to the file while he is modifying it (as well as alerting them that he is about to change it), he locks the file in the repository using the svn lock command.


4 Answers

Using the repo-browser feature of TortoiseSVN there is a lock column that shows the user who locked the file.

Right click on the local working copy -> TortoiseSVN-> repo-browser.

like image 21
detroitpro Avatar answered Oct 04 '22 14:10

detroitpro


Use svn status --show-updates to discover locks on files. In the following example, Sally discovers there is a lock on raisin.jpg.

$ whoami
sally

$ svn status --show-updates
M              23   bar.c
M    O         32   raisin.jpg
       *       72   foo.h
Status against revision:     105

Once you know the lock, you can use svn -info to discover who set the lock. Notice "Lock Owner" below:

$ svn info http://svn.example.com/repos/project/raisin.jpg
Path: raisin.jpg
Name: raisin.jpg
URL: http://svn.example.com/repos/project/raisin.jpg
Repository UUID: edb2f264-5ef2-0310-a47a-87b0ce17a8ec
Revision: 105
Node Kind: file
Last Changed Author: sally
Last Changed Rev: 32
Last Changed Date: 2005-01-25 12:43:04 -0600 (Tue, 25 Jan 2005)
Lock Token: opaquelocktoken:fc2b4dee-98f9-0310-abf3-653ff3226e6b
Lock Owner: harry
Lock Created: 2005-02-16 13:29:18 -0500 (Wed, 16 Feb 2005)
Lock Comment (1 line):
Need to make a quick tweak to this image.
like image 119
Mike Caron Avatar answered Oct 04 '22 14:10

Mike Caron


The command line client shows the lock owner with the command "svn info".

In TortoiseSVN, you can see the lock owner in the "properties" context menu (tab "subversion").

like image 30
sleske Avatar answered Oct 04 '22 12:10

sleske


Steps to check:

  1. Right click on the file/folder on which you want to determine the lock

  2. Go to TortoiseSVN Options >> Repo-browser

  3. A new window will open and you will get a table view

  4. Lock column in the table will show who has the lock

like image 34
Rupesh Avatar answered Oct 04 '22 12:10

Rupesh