How to use Subversion Ctypes Python Bindings?

Subversion 1.6 introduces something called Python Ctypes binding, but it is not documented. Is any information available on what bindings are and how to use it? For example, I have fresh Windows XP and you want to manage the SVN repository using subversiion 1.6 and these mysterious python bindings. What I need to download / install / compile in order to do something like

import svn from almighty_ctype_subversion_bindings svn.get( "\\rep\\project" ) 

And how does this relate to the pysvn project? Is it the same technology or different technologies?

+4
source share
3 answers

You need the original distribution of Subversion, Python (> = 2.5) and ctypesgen .

Instructions for creating ctypes bindings are here .

You end up with a package called csvn , examples of its use are here .

+1
source

The whole point of ctypes is that you don't need to collect anything. However, readme for bindings mentions some dependencies and a build step.

Links can be found in the Subversion source distribution, at least in subversion/bindings/ctypes-python/ using distutils setup.py.

They seem to be the successor / alternative to the pysvn genus.

0
source

I looked at the python binding for subversion, but in the end I found it easier to just call svn.exe as follows:

 (stdout, stderr, err) = execute('svn export "%s" "%s"' \ % (exportURL, workingCopyFolder)) 

where execute is a function like this:

 def execute(cmd): import subprocess proc = subprocess.Popen(\ cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = proc.communicate() return (stdout, stderr, proc.returncode) 

The svn.exe output is intended for easy analysis if necessary. There is even a -xml output option.

-1
source

All Articles