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

Re: "svn lock" process return code (Subversion 1.2 RC2 Win32)

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-05-10 16:05:34 CEST

Rowell, Geoff wrote:
>On Sat, May 07 2005, Peter N. Lundblad wrote:
>>On Wed, 4 May 2005, Henrik Blomgren TACMa wrote:
>>>When attempting to lock a file already locked by another user, I get the
>>>error message in stderr, but the exitcode of the process is 0, indicating
>>>success. Bug or ?
>>
>>It might be considered a bug, but it's not clear to me how to treat this.
>>The problem is that this operation treats certain errors as non-fatal and
>>continues. So if you say
>>svn lock a b
>>and a was already locked, it continues with b. If the latter lock
>>operation succeeds, should it return success or failer? Maybe someone on
>>dev@ has an opinion.
>
> If you might depend on the result of the command to control the flow
> of operations, then an exit code should indicate any deviation from
> complete success.
>
> In this case, an inability to acquire a lock will prevent your being able
> to commit file changes. This should be signaled by a non-zero exit code.

I would say that this particular case (file is locked by another user) should
be classed as an Error. Whenever a Subversion command encounters an Error, it
should print an error message and exit immediately with a non-zero status
without processing any further targets.

We may want to handle some other cases (e.g. file is already locked by you in
this WC) as a Warning. Whenever a Subversion command gives a Warning, it
should print a message that says "warning", proceed to process any other
targets, and exit with a zero status if every target resulted in success or a
warning.

No Subversion command should behave in a manner that is in between an Error and
a Warning.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 10 16:08:47 2005

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

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