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

Re: [PATCH] Python 2.2 compatibility for svn_export_empty_files.py

From: Blair Zajac <blair_at_orcaware.com>
Date: 2005-08-18 07:54:29 CEST

C. Michael Pilato wrote:
> David James <james82@gmail.com> writes:
>
>>By the way, the svn_export_empty_files.py script is really nice --
>>it's the first script I've seen that properly uses the svn.client and
>>svn.ra layers to access remote respositories using the Python
>>bindings. Has anyone seen similar scripts?
>
>
> ViewCVS. (And it's been doing so for, like, a year or something.)
> And I've done some custom work for a CollabNet customer that used
> those bits.
>
> I was disappointed, though, svn_export_empty_files.py didn't expose
> any of the prompting callbacks, as they do (or did, at one point)
> work.

Is there any sample code that uses that? You're talking about these in
svn_client_ctx_t?

   /** notification callback function.
    * This will be called by notify_func2() by default.
    * @deprecated Provided for backward compatibility with the 1.1 API. */
   svn_wc_notify_func_t notify_func;

   /** notification callback baton for notify_func()
    * @deprecated Provided for backward compatibility with the 1.1 API. */
   void *notify_baton;

I tried to use them, but I can't assign anything to them. This code doesn't work:

import svn.client
import svn.core

def n(*a):
   print a

pool = svn.core.svn_pool_create(None)
client_ctx = svn.client.svn_client_create_context(pool)
client_ctx.notify_baton = n

Trying to set client_ctx.notify_baton2, client_ctx.notify_func and
client_ctx.notify_func all get some error:

TypeError: argument number 2: a 'C/C++ pointer' is expected, 'function(<function
n at 0xb76c4a74>)' is received

Also, the script doesn't use the recurse flag to svn_client_ls(), to save memory
and make the script a little easier to write, so there wasn't a need for the
notifies.

BTW, what is the ordering of results from a recursive svn_client_ls() call?

Regards,
Blair

-- 
Blair Zajac, Ph.D.
<blair@orcaware.com>
Subversion and Orca training and consulting
http://www.orcaware.com/svn/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 18 07:55:26 2005

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.