[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

locking files

From: <kmoulton_at_chisystems.com>
Date: 2003-09-17 16:55:55 CEST

I am in need of a solution which will allow me to lock files and to notify
users when they attempt to checkout a file that the file is being used by
someone else. I have copied a suggested solution but I am not sure I
understand this correctly. It is suggesting that the pre-commit hook be used
to maintain a lock database. If I understand things correctly the pre-commit
Event is actually activated when the user attempts to commit a file.

 

I would think we would need a pre-checkout and post checkout hook. This way
when someone went to checkout a file it would let them know that it was
checkout or not by looking at the status of the lock database. If they
checked it out it would then update the lock database. As far as I can tell
there are not pre or post checkout events so this solution would not work.
Could someone let me know if my thinking is correct here.

 

 

 

Thanks, Kathy Moulton

 

 

 

 

 

Yup, quite doable. The locking plan sitting in notes/ is the long-term

goal. For a short term, you should be able to do this relatively easily

with a small (command-line) client tool (written in Python or Perl) which

interacts with a CGI script on the server to maintain a lock database. A

pre-commit hook script can then check the if any of the modified files are

present in the lock database and held by somebody besides the committer. A

post-commit hook can then clear the appropriate files from the lock

database (if desired). The cron job can periodically expire files, or you

can simply test the expiration when you investigate whether a lock is

present.

 

Cheers,

 

 

 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Sep 17 16:56:49 2003

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.