I used ikvmc to compile svnkit to a C# (dll) library and linked it as a reference to my project.
I tried a proof of concept code to checkout:
public void checkOut(Dictionary<string,List<object>> tokens) {
string url_str = (string) tokens["checkout"][0];
setupLibrary();
java.io.File path = new java.io.File(Path.Combine (Directory.GetCurrentDirectory (), "check_out_folder"));
SVNURL url = SVNURL.parseURIEncoded(url_str);
SVNClientManager cm = SVNClientManager.newInstance();
SVNUpdateClient uc = cm.getUpdateClient();
try {
uc.doCheckout(url, path, SVNRevision.UNDEFINED, SVNRevision.HEAD, true);
}
catch (SVNException e) {
Console.WriteLine(e.getErrorMessage());
}
}
Everything compiles fine, and even runs fine. However, I have this error:
$ mono subsync.exe -co http://code.djangoproject.com/svn/django/trunk/
svn: Cannot rename file '/home/nubela/Workspace/subsync/subsync/bin/Debug/check_out_folder/.svn/tmp/entries' to '/home/nubela/Workspace/subsync/subsync/bin/Debug/check_out_folder/.svn/entries'
It creates the checkout_folder, and here are the conflicting files:
$ ls -alR check_out_folder/ | grep entries
-r--r--r-- 1 nubela nubela 204 2010-02-17 13:07 entries
-r--r--r-- 1 nubela nubela 204 2010-02-17 13:07 entries
Heres are the contents of the checkout_folder:
[nubela@nubela-netbook check_out_folder]$ ls -al
total 12
drwxr-xr-x 3 nubela nubela 4096 2010-02-17 13:07 ./
drwxrwxr-x 3 nubela nubela 4096 2010-02-17 13:07 ../
drwxr-xr-x 6 nubela nubela 4096 2010-02-17 13:07 .svn/
Any idea why this is happening and how I can overcome this?
Edit: It works under windows (with mono, not under .NET). Prolly because windows does not have the annoying file permissions for files.
Edit2: I have chmod 777 -R checkout_folder already, and explicitly chmod 777 the 2 entries file. It still doesn't work. Weird.
Finally, we have figured out that it is not an SVNKit bug, but rather converter one. For whatever reason, converted code was not able to rename file when destination already exist (contrary to the JVM behavior on Linux).
Adding "dst.delete();" before "src.renameTo(dst);" solved the problem (so far I'm not going to make it standard as it breaks rename atomicity - I think converter should be changed to fix this problem).
Alexander Kitaev, http://svnkit.com/