tags:

views:

108

answers:

4

I would like to programmatically check if a file is versioned, and add, delete and commit files into a subversion repository using Delphi.

Does anyone have sample code that might help me create the necessary functions and procedures?

Thanks,

Steve

+1  A: 

Probably the easiest way to do this is to call the svn command line program, passing it the relevant commands and arguments to do whatever it is you want to do. Although there are probably Delphi-compatible Subversion API bindings, calling svn is undoubtedly going to be more straightforward.

Most svn command line commands have an --xml switch that writes the output in program-friendly XML format, instead of making you rely on fragile text parsing.

Greg Hewgill
+1  A: 

The most recent version, Delphi XE has Subversion integration by default.

Marco van de Voort
+1  A: 

Use the Subversion library. That's what TortoiseSVN does.

Rob Kennedy
+4  A: 

Delphi XE integration is open source (MPL based license). You can get the code at radstudioverins on SourceForge.

take a look at trunk/svn/SvnClient.pas, and let me know if it's what you're looking for. It is a nice looking wrapper around libsvn.

jachguate
This looks like what I'm after. I'm not seeing any documentation though, so it's hard to know for sure. Have you used this?
Steve Kramer
This looks like what I'm after. Have you used this?The terminology used below is based on my experience with TortoiseSVN: Users will request my application to add, edit and delete files in a folder under version control. If the file isn't yet versioned (I need a way to determine this from SVNClient.pas), I would like to add, then commit it (using SVNClient.pas). If a file being added is in version control, I'd like to commit it. If a file being deleted is in version control, I'd like to delete and commit it.Do you have any examples that might get me started?
Steve Kramer