You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jelmer Vernooij <je...@samba.org> on 2006/07/05 22:59:46 UTC
Re: [PATCH] Fill in callbacks for svn_ra_callbacks2_t()
On Mon, 2006-06-12 at 11:53 -0700, David James wrote:
> On 6/11/06, Jelmer Vernooij <je...@vernstok.nl> wrote:
> > > Could you update our test suite with a few new tests to make sure your
> > > code works? For example, you could register a few callback functions
> > > in Python and make sure they get called with appropriate arguments.
> > ra_local doesn't actually call these callbacks, which makes it very hard
> > to write tests using the file:// RA backend. Apparently ra_dav uses them
> > most often, but there are no Python tests that use it. I have used them
> > successfully here using other protocols though.
>
> Ah, OK. Jelmer, could you provide some example test scripts which use
> these functions so that I can test them myself?
I've attached an example script that does a checkout, which crashes
without this patch.
> In all new functions: Use Py_XDECREF instead of Py_DECREF.
> Py_XDECREF handles NULL values safely. Only use Py_DECREF if you are
> absolutely sure that the variable in question will not be NULL.
Fixed.
I've attached a patch that contains the subset of functions that are
proven to work now using the attached example script.
[[[
Allow some callbacks in svn_ra_callbacks2_t() to be implemented in
Python.
* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
(svn_swig_py_setup_ra_callbacks): Fill in callback function pointer
for open_tmp_file and auth_baton.
(ra_callbacks_open_tmp_file): Add wrapper for Python callbacks
]]]
Cheers,
Jelmer
--
Jelmer Vernooij <je...@samba.org> - http://samba.org/~jelmer/
Re: [PATCH] Fill in callbacks for svn_ra_callbacks2_t()
Posted by David James <dj...@collab.net>.
On 7/5/06, Jelmer Vernooij <je...@samba.org> wrote:
> > Ah, OK. Jelmer, could you provide some example test scripts which use
> > these functions so that I can test them myself?
> I've attached an example script that does a checkout, which crashes
> without this patch.
Thanks!
> I've attached a patch that contains the subset of functions that are
> proven to work now using the attached example script.
>
> [[[
> Allow some callbacks in svn_ra_callbacks2_t() to be implemented in
> Python.
>
> * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
>
> (svn_swig_py_setup_ra_callbacks): Fill in callback function pointer
> for open_tmp_file and auth_baton.
>
> (ra_callbacks_open_tmp_file): Add wrapper for Python callbacks
>
> ]]]
+1. Thanks for following up! This is a nice patch. Could you reference
this thread from your commit message? Mention that you included a test
script in this mail thread, so that anybody who is interested can add
a real test later.
The mail thread URL is
http://svn.haxx.se/dev/archive-2006-07/0126.shtml and your test-dav.py
is accessible from that URL.
Cheers,
David
--
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org