Daniel Shahaf wrote on Wed, Feb 22, 2012 at 11:31:00 +0200: > Stefan Sperling wrote on Wed, Feb 22, 2012 at 00:08:35 +0100: > > On Tue, Feb 21, 2012 at 11:50:54PM +0100, Stefan Sperling wrote: > > > I think svn_wc_parse_externals_description3() should do what you need. > > > Does this help you? > > > > > > The function is mapped in the python bindings: > > > > > > >>> import svn.wc > > > >>> svn.wc.svn_wc_parse_externals_description3 > > > <function svn_wc_parse_externals_description3 at 0x20779a758> > > > > Hmmm... my suggestion probably won't work. > > The function doesn't seem to be usable. > > > > >>> svn.wc.svn_wc_parse_externals_description3("/tmp", "^/branch/gamma > > >>> foo", 0) > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "/usr/local/lib/python2.7/site-packages/libsvn/wc.py", line 398, in > > svn_w > > c_parse_externals_description3 > > return apply(_wc.svn_wc_parse_externals_description3, args) > > ValueError: svn_wc_parse_externals_description3 is not implemented yet > > > > > > But the 1.4 version of this function is working: > > > > >>> e = svn.wc.svn_wc_parse_externals_description("/tmp", "^/branch/gamma > > >>> foo") > > >>> e > > {'foo': <libsvn.wc.svn_wc_external_item_t; proxy of <Swig Object of type > > 'svn_wc > > _external_item_t *' at 0x2083e50c0> >} > > >>> e['foo'] > > <libsvn.wc.svn_wc_external_item_t; proxy of <Swig Object of type > > 'svn_wc_externa > > l_item_t *' at 0x2083e50c0> > > > >>> e['foo'].target_dir > > 'foo' > > >>> e['foo'].url > > '^/branch/gamma' > > >>> e['foo'].revision > > <libsvn.core.svn_opt_revision_t; proxy of <Swig Object of type > > 'svn_opt_revision_t *' at 0x2043d90d0> > > > > > > > But that doesn't provide you with the enhancements of the 1.5 syntax, > > e.g. peg-revision support. > > > > I am not a bindings expert so I don't know what we'd need to do to make > > the newer variants of this function work from the bindings. > > Based the difference between the signatures of the > svn_wc_parse_externals_description() and > svn_wc_parse_externals_description2(), I would suspect that someone > needs to provide a Python implementation of the following typemap: > > #ifdef SWIGRUBY > %typemap(argout) apr_array_header_t **externals_p { > %append_output(svn_swig_rb_apr_array_to_array_external_item2(*$1)); > } > #endif >
Done in r1292223: % PYTHONPATH=$prefix/svn-t1/lib/svn-python/ python -c \ 'import svn,svn.wc; print svn.wc.svn_wc_parse_externals_description3("","",1)' [] % It will be available in 1.8.0. (perhaps we should relax our compat guidelines to allow adding exposed APIs to the bindings in patch releases?) > Daniel > (not a swig expert, either)