Discussion:
[Tutor] How do to an svn checkout using the svn module?
Stephen Nelson-Smith
2007-03-09 10:42:52 UTC
Permalink
Hello,

I want to do a simple svn checkout using the python svn module. I
haven't been able to find any/much/basic documentation that discusses
such client operations.

This should be very easy, I imagine!

What do I need to do?

S.
Kent Johnson
2007-03-09 11:39:07 UTC
Permalink
Post by Stephen Nelson-Smith
Hello,
I want to do a simple svn checkout using the python svn module. I
haven't been able to find any/much/basic documentation that discusses
such client operations.
Did you find the pysvn Programmer's Guide that comes with pysvn? It has
this example:

import pysvn
client = pysvn.Client()
#check out the current version of the pysvn project
client.checkout('http://localhost/example/trunk',
'./examples/pysvn')
#check out revision 11 of the pysvn project
client.checkout('http://localhost/example/trunk',
'./examples/pysvn-11',
revision=pysvn.Revision(pysvn.opt_revision_kind.number, 11))

Kent
Stephen Nelson-Smith
2007-03-09 11:43:35 UTC
Permalink
Post by Kent Johnson
Did you find the pysvn Programmer's Guide that comes with pysvn? It has
Ah.. no.... I haven't got pysvn installed... but will take a look.
Post by Kent Johnson
import sys
import svn.core
import svn.client
import sys
pool = svn.core.svn_pool_create(None)
svn.core.svn_config_ensure( None, pool )
ctx = svn.client.svn_client_ctx_t()
config = svn.core.svn_config_get_config( None, pool )
ctx.config = config
rev = svn.core.svn_opt_revision_t()
rev.kind = svn.core.svn_opt_revision_head
rev.number = 0
ctx.auth_baton = svn.core.svn_auth_open( [], pool )
url = "https://svn.uk.delarue.com/repos/prdrep/prddoc/"
path ="/tmp"
svn.client.svn_client_checkout(url, path, rev, 0, ctx, pool)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
libsvn._core.SubversionException: ("PROPFIND request failed on
'/repos/prdrep/prddoc'", 175002)

Not sure what I am doing wrong... the url is correct.
Post by Kent Johnson
Kent
S.
Kent Johnson
2007-03-09 13:14:52 UTC
Permalink
Post by Stephen Nelson-Smith
Post by Kent Johnson
Did you find the pysvn Programmer's Guide that comes with pysvn? It has
Ah.. no.... I haven't got pysvn installed... but will take a look.
Seems like a good idea. What package are you using?

Loading...