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

Testing if a folder exists in a repository

From: Olivier Sannier <obones_at_free.fr>
Date: Thu, 4 Jun 2009 10:14:14 +0200

Hi,

I'm trying to find a command or series of command to test if a given URL
points to an existing folder inside a repository.
Right now, I'm using this command:

svn info --xml http://my.server.com/repository/trunk/foldertotest

If "foldertotest" does not exist, it gives me an empty but valid XML
with a single "info" node. On the error output, I get a localized
message saying "Invalid URL"
If the server is unreachable, or that there is a typo in the URL part
before the repository, I get an invalid XML with the info node not being
closed. This way, I can know that there was an issue in accessing the
repository.
My problem comes from the fact that if there is a typo in the protocol
part (hptt instead of http for instance), then I still get an empty but
valid XML file, with the same "Invalid URL" message as when the folder
does not exist.

So my question is : how to reliably test for the existence of a folder
in a repository? Is it easily doable?
To make matters a bit more complex, I need to be able to do this under a
Windows OS.

Thanks for your help.
Regards
Olivier

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-06-04 10:15:43 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.