3
votes

First things first - I am sorry if you think this question is utterly stupid.

I am working on an application wherein the user can enter a SVN URL. It can either be a Directory or a file. I am using sharpsvn.

My aim is to somehow know if this url is a directory or a file.

For example : svn://svnrepository/Directory/pascal.cs or svn://svnrepository/DirectoryName

are both valid entries. Its my job to differentiate between the two and bring out the fact that the former is a file while the latter is a directory.

Can this be done using sharpsvn ?

Thanks and Regards Gagan

2

2 Answers

4
votes

Condireng that it't only a wrapper over a real subversion, for you it should be enough to execute

svn info $path$

in the result set there has to be Node Type string. That would be give you description either it a directory or file.

Hope this helps.

0
votes

You could use one of the following:

The last two are illustrated in "Check that an svn repository url does not exist".

You can encapsulate those calls in SVNSharp hook following the examples of "How can i get access to the SVN pre-commit message using SharpSVN?"