3

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

Gagan
  • 5,416
  • 13
  • 58
  • 86

2 Answers2

4

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.

Tigran
  • 61,654
  • 8
  • 86
  • 123
0

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?"

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for taking time out for me @VonC. However I think Tigran's approach is the option that i will be interested in. The node type gives the exact type of the svn url ( if its a file or a directory) . if only i could make it work in LinqPad :) – Gagan Apr 26 '12 at 07:42
  • @Gagan sure, my point was not about the svn command you choose, but more about pointing out a way to encapsulate it in SVNSharp. – VonC Apr 26 '12 at 07:44