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
Select any file and/or folders you want to commit, then TortoiseSVN → Commit.... The commit dialog will show you every changed file, including added, deleted and unversioned files. If you don't want a changed file to be committed, just uncheck that file.
To remove a file from a Subversion repository, change to the directory with its working copy and run the following command: svn delete file… Similarly, to remove a directory and all files that are in it, type: svn delete directory…
svn list <URL> Lists all the files available in the given URL in the repository without downloading a working copy. svn add <filename> Use this command to add new files or changed files to the commit list. svn commit m “Commit message” Commit the added files using a commit message for better traceability.
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.
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.
The most recent version, Delphi XE has Subversion integration by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With