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

Re: SOLVED: Re: Problem with the svn python bindings

From: ryan <ryan_at_netidea.com>
Date: 2003-04-02 07:34:33 CEST

Hi,

I develeloped my Patch independently of Matt's. I'm not sure which one is
more correct since I'm not an expert in SWIG. I really cant say for
certain. But it does look like his does more error checking. So its
probably better to go with his.

As for where I 'got stuck', I got stuck with the interface to
svn_stream_read(). Fs.py was passing in 2 parameters, and the function
takes 3 - but 1 of the parameters is a char * buffer out. I couldn't
resolve that mismatch, so I had to give up.

Regards,
-ryan

On 4/1/03 9:01 AM, "kfogel@collab.net" <kfogel@collab.net> wrote:

> ryan <ryan@netidea.com> writes:
>> I spent a bunch of more time looking into it. Matt is right, the .i
>> files are out of sync with the library interfaces. From my work on it,
>> I discovered i dont know enough about python or swig to really fix the
>> out of sync Python bindings. the problem is that the svn_* interface is
>> changing faster than the Python bindings. My solution was to use
>> version 0.20.1. but before I gave up I made the following fixes which
>> eased the problem a bit:
>>
>> Index: svn_fs.i
>> ===================================================================
>> --- svn_fs.i (revision 5501)
>> +++ svn_fs.i (working copy)
>> @@ -43,6 +43,10 @@
>> svn_stream_t **
>> };
>>
>> +%apply long long * OUTPUT {
>> + svn_filesize_t *
>> +};
>> +
>> /* and this is always an OUT param */
>> %apply const char **OUTPUT { const char ** };
>
> Hmmm. Your patch is different than Matt's patch, but you clearly know
> about Matt's patch since your mail quotes it in response :-). Can you
> say why to use one rather than the other? Did Matt's patch not solve
> things for you, or is yours as effective but preferable because
> simpler?
>
>> But then there is a problem with the interface to svn_stream_read which
>> I couldn't quite resolve, but here is a first stab which converts it to
>> using the proper type:
>>
>> Index: util.i
>> @@ -94,7 +95,7 @@
>> /*
>> -----------------------------------------------------------------------
>> fix up the svn_stream_read() ptr/len arguments
>> */
>> -%typemap(python, in) (char *buffer, apr_size_t *len) ($*2_type temp) {
>> +%typemap(python, in) (char *buffer, svn_filesize_t *len) ($*2_type
>> temp) {
>> if (!PyInt_Check($input)) {
>> PyErr_SetString(PyExc_TypeError,
>> "expecting an integer for the buffer size");
>>
>>
>>
>> These are all in subversion/bindings/swig
>>
>> In any case, I got stuck here, and I gave up and used subversion 0.20.1,
>> and I got ViewCVS working in no time flat.
>
> Thanks for the patches. When you say "got stuck", what were the exact
> symptoms you were seeing?
>
> -K
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 2 07:35:40 2003

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