[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

python and ctx.log_msg_func

From: Sebastian Tusk <sebastian.tusk_at_silver-style.com>
Date: 2003-10-15 16:24:23 CEST

And a new problem with my python experiments.

import svn.util
import svn.client

def testmethod():
 print "called"

svn.util.apr_initialize()
subpool = svn.util.svn_pool_create(None)

revision = svn.util.svn_opt_revision_t()
svn.util.svn_opt_parse_revision(
  revision,
  None,
  "HEAD",
  subpool );

config_dir = svn.util.svn_config_ensure( '', subpool )
ctx = svn.client.svn_client_ctx_t()

ctx.config = svn.util.svn_config_get_config( \
  config_dir, subpool )

ctx.log_msg_func = testmethod

That last assignment results in this output.

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/home/dwhedon/subversion/0.31.0/subversion-0.31.0/debian/tmp/usr/lib/python
2.3/site-packages/libsvn/client.py", line 132, in <lambda>
  File
"/home/dwhedon/subversion/0.31.0/subversion-0.31.0/debian/tmp/usr/lib/python
2.3/site-packages/libsvn/client.py", line 13, in _swig_setattr
TypeError: Type error. Expected _svn_client_get_commit_log_t

Ok, but how do I create such type?

What I want to accomplish is a repository checkout. Like in the following
code snippet.

import svn.util
import svn.client

svn.util.apr_initialize()
subpool = svn.util.svn_pool_create(None)

revision = svn.util.svn_opt_revision_t()
svn.util.svn_opt_parse_revision(
  revision,
  None,
  "HEAD",
  subpool );

config_dir = svn.util.svn_config_ensure( '', subpool )
ctx = svn.client.svn_client_ctx_t()

ctx.config = svn.util.svn_config_get_config( \
  config_dir, subpool )

svn.client.svn_client_checkout( \
  "http://repository/",
  "path",
  revision,
  False,
  ctx,
  subpool )
svn.util.svn_pool_destroy(subpool)
svn.util.apr_terminate()

But this leads to a Segmentation fault. I assume that is because ctx is not
appropriate filled.

Regards,
Sebastian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 15 16:34:45 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.