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

API ickiness again: svn_client_(un)lock not returning error on failed locks

From: Bert Huijben <B.Huijben_at_competence.biz>
Date: Tue, 29 Jul 2008 16:29:03 +0200

        Hi,

Last night a SharpSvn user mailed me about an issue he found when using
the subversion api. When he used .Lock() (which is a direct wrapper
around svn_client_lock()) he didn't get an error when the file he
specified was already locked in another working copy.

Re-reading the documentation I found out that I had to listen to the
notify callback to really find out if the lock really was acquired or
not.

While this obviously works for the CLI (It can show multiple errors at
the same time here), it is certainly strange behavior at the c and
binding level.

Especially as it requires you to hook the /working copy/ notification
handler to receive results from a possible Url-only action (no working
copy involved at all).

I worked around this issue in SharpSvn (It throws/returns an error now;
as all other methods when they get an error), but revving+deprecating
this strange api contract at the subversion level and introducing a more
logical one will certainly help other bindings to not make the same
mistake.

Suggestions on what to put in a patch?

        Bert

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-07-29 16:29:19 CEST

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.