Rev 970: Fix the build. in file:///data/jelmer/bzr-svn/pyrex/

Jelmer Vernooij jelmer at samba.org
Fri Mar 14 11:14:18 GMT 2008


At file:///data/jelmer/bzr-svn/pyrex/

------------------------------------------------------------
revno: 970
revision-id:jelmer at samba.org-20080314111415-aw0ritbpr7kbc79b
parent: jelmer at samba.org-20080314004707-zsccmxh4tmes1wgn
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: pyrex
timestamp: Fri 2008-03-14 12:14:15 +0100
message:
  Fix the build.
modified:
  core.pxd                       core.pxd-20080314004625-ng663dn07ewpc26a-1
  core.pyx                       core.pyx-20080313210413-17k59slolpfe5kdq-1
  ra.pyx                         ra.pyx-20080313140933-qybkqaxe3m4mcll7-1
  transport.py                   transport.py-20060406231150-b3472d06b3a0818d
  types.pxd                      types.pxi-20080313202425-vtt1ry64o98kgpg8-1
=== modified file 'core.pxd'
--- a/core.pxd	2008-03-14 00:47:07 +0000
+++ b/core.pxd	2008-03-14 11:14:15 +0000
@@ -16,7 +16,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 from apr cimport apr_pool_t
-from types cimport svn_error_t
+from types cimport svn_error_t, svn_lock_t
 cdef apr_pool_t *Pool(apr_pool_t *parent)
 cdef check_error(svn_error_t *error)
 cdef svn_error_t *py_cancel_func(cancel_baton)
+cdef wrap_lock(svn_lock_t *)

=== modified file 'core.pyx'
--- a/core.pyx	2008-03-14 00:47:07 +0000
+++ b/core.pyx	2008-03-14 11:14:15 +0000
@@ -30,6 +30,9 @@
         self.msg = msg
 
 
+cdef wrap_lock(svn_lock_t *lock):
+    return (lock.path, lock.token, lock.owner, lock.comment, lock.is_dav_comment, lock.creation_date, lock.expiration_date)
+
 cdef check_error(svn_error_t *error):
     if error:
         raise SubversionException(error.apr_err, errormessage)

=== modified file 'ra.pyx'
--- a/ra.pyx	2008-03-14 00:47:07 +0000
+++ b/ra.pyx	2008-03-14 11:14:15 +0000
@@ -18,9 +18,10 @@
 from apr cimport apr_hash_t, apr_hash_make, apr_hash_index_t, apr_hash_first, apr_hash_next, apr_hash_this, apr_hash_set
 from apr cimport apr_array_header_t
 from apr cimport apr_file_t, apr_off_t
-from core cimport check_error, Pool
+from core cimport check_error, Pool, wrap_lock
+from core import SubversionException
 from types cimport svn_error_t, svn_revnum_t, svn_string_t, svn_version_t
-from types cimport svn_string_ncreate
+from types cimport svn_string_ncreate, svn_lock_t
 
 apr_initialize()
 
@@ -177,7 +178,6 @@
         SVN_PROP_REVISION_DATE: date})
 
 cdef extern from "svn_ra.h":
-    ctypedef struct svn_lock_t
     svn_version_t *svn_ra_version()
 
     ctypedef struct svn_ra_reporter2_t:
@@ -203,7 +203,8 @@
 
         svn_error_t *(*abort_report)(void *report_baton, apr_pool_t *pool)
 
-    ctypedef void (*svn_ra_progress_notify_func_t)(apr_off_t progress, apr_off_t total, void *baton, apr_pool_t *pool)
+    ctypedef void (*svn_ra_progress_notify_func_t)(apr_off_t progress, 
+                           apr_off_t total, void *baton, apr_pool_t *pool)
 
     ctypedef svn_error_t *(*svn_ra_get_wc_prop_func_t)(void *baton,
                                                   char *relpath,
@@ -375,8 +376,11 @@
 cdef svn_error_t *py_lock_func (baton, char *path, int do_lock, 
                                 svn_lock_t *lock, svn_error_t *ra_err, 
                                 apr_pool_t *pool):
-    # FIXME: pass lock and ra_err, too
-    baton(path, do_lock)
+    py_ra_err = None
+    if ra_err != NULL:
+        py_ra_err = SubversionException(ra_err.apr_err, ra_err.message)
+    # FIXME: Pass lock
+    baton(path, do_lock, py_ra_err)
 
 
 cdef class Reporter:
@@ -499,13 +503,15 @@
         cdef void *report_baton
         cdef apr_pool_t *temp_pool
         cdef svn_delta_editor_t *editor
+        cdef Reporter ret
         temp_pool = Pool(self.pool)
         check_error(svn_ra_do_update(self.ra, &reporter, &report_baton, 
                      revision_to_update_to, update_target, recurse, 
                      editor, update_editor, temp_pool))
         ret = Reporter()
-        ret.set_reporter(reporter, report_baton)
-        ret.set_pool(temp_pool)
+        ret.reporter 
+        ret.report_baton = report_baton
+        ret.pool = temp_pool
         return ret
 
     def do_switch(self, revision_to_update_to, update_target, recurse, 
@@ -514,13 +520,15 @@
         cdef void *report_baton
         cdef apr_pool_t *temp_pool
         cdef svn_delta_editor_t *editor
+        cdef Reporter ret
         temp_pool = Pool(self.pool)
         check_error(svn_ra_do_update(self.ra, &reporter, &report_baton, 
                      revision_to_update_to, update_target, recurse, 
                      editor, update_editor, temp_pool))
         ret = Reporter()
-        ret.set_reporter(reporter, report_baton)
-        ret.set_pool(temp_pool)
+        ret.reporter = reporter
+        ret.report_baton = report_baton
+        ret.pool = temp_pool
         return ret
 
     def replay(self, revision, low_water_mark, send_deltas, update_editor):
@@ -584,7 +592,7 @@
         temp_pool = Pool(self.pool)
         check_error(svn_ra_get_lock(self.ra, &lock, path, temp_pool))
         apr_pool_destroy(temp_pool)
-        return lock
+        return wrap_lock(lock)
 
     def check_path(self, path, revision):
         cdef svn_node_kind_t kind

=== modified file 'transport.py'
--- a/transport.py	2008-03-14 00:47:07 +0000
+++ b/transport.py	2008-03-14 11:14:15 +0000
@@ -21,7 +21,7 @@
 from bzrlib.trace import mutter
 from bzrlib.transport import Transport
 
-from core import SubversionException, Pool
+from core import SubversionException
 import ra
 import core
 import client
@@ -195,7 +195,6 @@
     to fool Bazaar. """
     @convert_svn_error
     def __init__(self, url="", _backing_url=None):
-        self.pool = Pool()
         bzr_url = url
         self.svn_url = bzr_to_svn_url(url)
         self._root = None
@@ -206,7 +205,7 @@
         self._backing_url = _backing_url.rstrip("/")
         Transport.__init__(self, bzr_url)
 
-        self._client = create_svn_client(self.pool)
+        self._client = create_svn_client()
         try:
             self.mutter('opening SVN RA connection to %r' % self._backing_url)
             self._ra = self._client.open_ra_session(self._backing_url.encode('utf8'))
@@ -304,7 +303,7 @@
             return
         if hasattr(self._ra, 'reparent'):
             self.mutter('svn reparent %r' % url)
-            self._ra.reparent(self.svn_url, self.pool)
+            self._ra.reparent(self.svn_url)
         else:
             self.mutter('svn reparent (reconnect) %r' % url)
             self._ra = self._client.open_ra_session(self.svn_url.encode('utf8'))
@@ -402,7 +401,7 @@
     def do_update(self, revnum, recurse, editor):
         self._open_real_transport()
         self.mutter('svn update -r %r' % revnum)
-        return self._ra.do_update(revnum, "", recurse, editor))
+        return self._ra.do_update(revnum, "", recurse, editor)
 
     @convert_svn_error
     def has_capability(self, cap):

=== modified file 'types.pxd'
--- a/types.pxd	2008-03-14 00:47:07 +0000
+++ b/types.pxd	2008-03-14 11:14:15 +0000
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from apr cimport apr_status_t, apr_pool_t
+from apr cimport apr_status_t, apr_pool_t, apr_time_t
 
 cdef extern from "svn_version.h":
     ctypedef struct svn_version_t:
@@ -37,6 +37,15 @@
     ctypedef int svn_boolean_t
     ctypedef svn_error_t *(*svn_cancel_func_t)(cancel_baton)
     ctypedef long svn_revnum_t
+    ctypedef struct svn_lock_t:
+        char *path
+        char *token
+        char *owner
+        char *comment
+        svn_boolean_t is_dav_comment
+        apr_time_t creation_date
+        apr_time_t expiration_date
+
 
 cdef extern from "svn_string.h":
     ctypedef struct svn_string_t:




More information about the bazaar-commits mailing list