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

Re: Return value of "svn info"

From: Jake Stone <jake.the.stone_at_gmail.com>
Date: Thu, 22 Oct 2009 21:46:48 -0500

Hyrum K. Wright wrote:
>
> On Oct 22, 2009, at 5:31 PM, Stefan Sperling wrote:
>
>> On Thu, Oct 22, 2009 at 05:14:13PM -0500, Jake Stone wrote:
>>> Hello,
>>>
>>> I am writing a quick batch script to perform actions on several &
>>> arbitrary SVN working copies. One complication is that there are
>>> folders
>>> in the target directory that are unrelated - not SVN checkouts. One way
>>> I've found of checking to see if a given folder is an SVN working copy
>>> is to run "svn info %folder%" on it. So far, "svn info" returns 0
>>> (or in
>>> Windows, sets %ERRORLEVEL% to 0) if the working copy exists, or 1 if
>>> the
>>> folder is not a working copy.
>>>
>>> My question is: would "svn info" ever return a non-zero value on an SVN
>>> working copy, for any reason? If so, this would break my script.
>>
>> $ svn info foo
>> svn: The node '/home/stsp/svn/svn-trunk/foo' was not found.
>> $ echo $?
>> 1
>>
That example shows it returning 1 on a NON-working-copy, which is what I
want.
My question was more of will it return 1 (or any non-zero value) when
the target IS a working copy, but some other error occurs.

>>> Also: is there a simple way to check if a folder is a SVN working copy?
>>
>> Right now, you can look for a .svn directory. But that will likely
>> stop working once working copy meta data is centralised at the working
>> copy root, or even at a single arbitrary location. For the latter case,
>> new commands will be added to register/unregister working copies with
>> a meta data store, and possibly list known working copies. But I don't
>> think anyone knows yet what these commands will look like.
>>
>> So, this is easy right now, but will get harder in the future.
>
> Ideally, you use the APIs; they will continue to answer the question
> in the correct manner.
>
> -Hyrum
Are the APIs separate from the standard SVN client distribution? How
would I call them?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2410503

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-10-23 04:47:31 CEST

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.