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

Re: Learning the Python API - early questions

From: Barry Scott <barry_at_barrys-emacs.org>
Date: 2003-10-07 23:50:34 CEST

Russ,

Aha! That makes svn_client_ls work (unless I need to input a auth credentials).
I could get useful values out of the dirent with one expection. How do I turn
the .time (_b875ba00_p_apr_time_t) property into a python time.time() value?
The 64bit value in apr_time_t should convert without lose into a double that
python uses.

I've used the same pattern to get checkout working.

But status looks like it will not work until we wrap the status func.

TypeError: Type error. Expected _p_svn_wc_status_func_t

Here is the code I'm testing with:
-------------------------------------------
import sys
import svn.core
import svn.client

def main(argv):
     path = argv[1]
     print 'svn status %s' % path

     try:
         pool = svn.core.svn_pool_create(None)
         svn.core.svn_config_ensure( None, pool )

         ctx = svn.client.svn_client_ctx_t()

         config = svn.core.svn_config_get_config( None, pool )

         ctx.config = config

         yougest = svn.client.svn_client_status(
     # svn_client_status (svn_revnum_t *youngest, /* only touched if
`update' set */
             path, # const char *path,
             None, # svn_opt_revision_t *revision,
             status_func, # svn_wc_status_func_t status_func,
             None, # void *status_baton,
             0, # svn_boolean_t descend,
             0, # svn_boolean_t get_all,
             0, # svn_boolean_t update,
             1, # svn_boolean_t no_ignore,
             ctx, # svn_client_ctx_t *ctx,
             pool ) # apr_pool_t *pool);

     finally:
         svn.core.svn_pool_destroy(pool)

     return 0

def status_func( baton, path, status ):
     print 'baton:', repr(baton)
     print 'path:',repr(path)
     print 'status:',repr(status)

if __name__ == '__main__':
     sys.exit( main( sys.argv ) )
-------------------------------------------

BArry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Oct 7 23:52:03 2003

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.