[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: Hyrum K. Wright <hyrum_at_hyrumwright.org>
Date: Thu, 22 Oct 2009 19:06:26 -0500

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
>> 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.



To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-10-23 02:07:30 CEST

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