« FireBug is an amazing FireFox plugin for developers | Main | Announcing DotSVN.Net site »

Connecting to SVN repository using DotSVN


In this post I would like to highlight how easy it is to connect to SVN repository using DotSVN.

Steps to follow:
1) Create an instance of ISVNRepository using the SVNRepositoryFactory
2) Now that we have a connection to the repository, we can get contents using the GetDir method.
The SVNDirEntry representation of a versioned directory entry, It contains
  • The Entry name
  • Entry kind (is it a file or directory).
  • File size (in case an entry is a file)
  • The last changed revision
  • The date when the entry was last changed
  • The name of the author who last changed the entry
  • The commit log message for the last changed revision.

3) Now we can iterate through the SVNDirEntry collection.

And that is it. We can also call other methods in the repository like

Comments

Wow, nice library, this will come in very handy when writing tools against our repository, thanks!

Thanks.
Let me know if you face any issues. I will be glad to help.

-George

I downloaded the dotsvn open source. It is a very handy tool.
but the question is that how do i connect it with my SVN? Can you please write whole process that once we download what to do next, how can we connect this whole project with SVN and get the document from the SVN?

Thank you.

Please take a look at the following article at Code Project.
http://www.codeproject.com/useritems/subversion_using_dotsvn.asp

Hope this helps.

Hi all
if i want the use the DotSVN API, which dll should i add to my project and how to add?


thanks
weifang

It depends on which layer you would want to connect to...
To connect to the server layer (to the native SVN repository - FSFS) you should use
dotsvn.server.dll
This has a dependency on dotsvn.common.dll

The dotsvn.client.dll is used for working-copy management - but this functionality is not implemented.

So in short, right now you should use
- dotsvn.server.dll
- dotsvn.common.dll

Hi Mr. Chiramattel, i'm using DotSVN to connect to my local SVN, and i used GetFile method from FSRepository class but got an error.

After a debug, i found that if i use the SVNDirEntry.URL property to GetFile(...) as my path, this has been assign with ToLower(), so, this is the fix that i made.

In SVNURL Class on line 119 i took ToLower out from the line and it worked fine.

Hope it helps for your excellent DotSVN project.

hi, I want to send a single file that contains whole files and directories to the server, and I wish that it search the files that have change. Can I do it with your library? Thanks in advance

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Archives

Subscribe by e-mail

Creative Commons License
This weblog is licensed under a Creative Commons License.