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

Re: r3205 cvs2svn broken?

From: Alex Zepeda <zipzippy_at_sonic.net>
Date: 2002-09-24 08:40:38 CEST

On Mon, Sep 23, 2002 at 05:30:07AM -0700, Greg Stein wrote:

> Looks like SWIG is constructing an improper binding for you. Of the three
> arguments to svn_fs_commit_txn(), two are return values, and you should only
> have one input value.

> I might suggest posting a snippet of code from the SWIG output. The file
> should be something like: .../bindings/swig/python/build/svn_fs.c. Grab the
> first chunk of the _wrap_svn_fs_commit_txn() code down to after its arg
> parsing, and just as it calls the function. If you post that here, then we
> should be able to figure out what it up (without needing to fully repro
> here).

    result = (svn_error_t *)svn_fs_commit_txn((char const **)arg1,arg2,arg3);

    {
        if (result != NULL) {
            if (result->apr_err != SVN_ERR_SWIG_PY_EXCEPTION_SET)
            PyErr_SetString(PyExc_RuntimeError,
            result->message ? result->message : "unknown error");
            return NULL;
        }
        Py_INCREF(Py_None);
        resultobj = Py_None;
    }

That chunk? Here's the whole function as I see it:

static PyObject *_wrap_svn_fs_begin_txn(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    svn_fs_txn_t **arg1 ;
    svn_fs_t *arg2 ;
    svn_revnum_t arg3 ;
    apr_pool_t *arg4 ;
    svn_error_t *result;
    svn_fs_txn_t *temp1 ;
    apr_pool_t *_global_pool ;
    PyObject * obj0 = 0 ;
    PyObject * obj2 = 0 ;

    {
        /* Assume that the pool here is the last argument in the list */
        SWIG_ConvertPtr(PyTuple_GET_ITEM(args, PyTuple_GET_SIZE(args) - 1),
        (void **)&arg4, SWIGTYPE_p_apr_pool_t, SWIG_POINTER_EXCEPTION | 0);
        _global_pool = arg4;
    }
    {
        arg1 = (svn_fs_txn_t **)&temp1;
    }
    if(!PyArg_ParseTuple(args,(char *)"OlO:svn_fs_begin_txn",&obj0,&arg3,&obj2)) goto fail;
    if ((SWIG_ConvertPtr(obj0,(void **) &arg2, SWIGTYPE_p_svn_fs_t,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;

    result = (svn_error_t *)svn_fs_begin_txn(arg1,arg2,arg3,arg4);

    {
        if (result != NULL) {
            if (result->apr_err != SVN_ERR_SWIG_PY_EXCEPTION_SET)
            PyErr_SetString(PyExc_RuntimeError,
            result->message ? result->message : "unknown error");
            return NULL;
        }
        Py_INCREF(Py_None);
        resultobj = Py_None;
    }
    {
        resultobj = t_output_helper(resultobj,
        SWIG_NewPointerObj(*arg1, SWIGTYPE_p_svn_fs_txn_t, 0));
    }
    return resultobj;
    fail:
    return NULL;
}

blarf:~#swig -version

SWIG Version 1.3.15u-20020920-0012
Copyright (c) 1995-1998
University of Utah and the Regents of the University of California
Copyright (c) 1998-2001
University of Chicago

Compiled with CC

- alex

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 24 08:41:24 2002

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