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

Re: Are post-commit hooks atomic?

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-09-19 17:58:00 CEST

On Sep 18, 2004, at 3:03 AM, Stefan Haller wrote:

> <kfogel@collab.net> wrote:
>
>> Dewey Sasser <dewey@sasser.com> writes:
>>> So, does subversion call my post-commit script atomically? Can I
>>> count on there *never* being two instances of the script running
>>> simultaneously?
>>
>> It is only called once per revision, but there is no guarantee that
>> one instance of post-commit will have finished before another instance
>> is called -- indeed, if people are committing fast enough, you can
>> pretty much guarantee that instances will overlap.
>
> OK, so is it safe to call several "svn up" on the same working copy
> concurrently?

When 'svn up' enters a directory to update it, it drops a lockfile.
(Actually, this is true of any svn subcommand that changes working copy
data.) This prevents another process from changing things in the
directory.... in other words, only one process can have a directory
open for "writing" at any given time. So running a 2nd 'svn up' will
just error out as soon as it hits the other process' lockfile.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Sep 19 17:58:58 2004

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.