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

RE: Methods to test whether a URL is valid (possible solution/wor karound?)

From: Campbell, Matthew A <Matthew.Campbell_at_Relizon.com>
Date: 2004-07-07 15:31:25 CEST

> > However, for the sake of scriptability, I would have
> liked to just
> > call 'svn probe <URL>' and just get as answer whether there
> is a repository
> > accessible under the given URL or not. Would have saved me
> some trouble.
> >
> > thanks
> >
> > Uli
> Try svn log file:///D:/whatever.

Here's a piece of scripting I wrote that uses a similar approach - in my
case not specifically to validate the parsability of the URL but to validate
that there isn't already a repository branch of the same name. It's Korn
shell, but should be reasonably readable:
function Repos_Path_Exists
    svn ls ${SVNROOT}/${1} > /dev/null 2>&1
... and an example of its usage:
if Repos_Path_Exists ${SITE}/branches/${APP}${TASK} ; then
    print "already exists in the repository!"
    exit 1
I'm redirecting all output (including stderr) to null, which you probably
don't want, at least while there's any question about malformed URLs.
Actually, I'm beginning to question that redirection myself...

Anyway, HTH.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jul 7 15:38:20 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.