Rev 988: Fix another segfault in the wc code. in file:///data/jelmer/bzr-svn/pyrex/

Jelmer Vernooij jelmer at samba.org
Sun Mar 16 05:41:32 GMT 2008


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

------------------------------------------------------------
revno: 988
revision-id:jelmer at samba.org-20080316054130-9cxetonsebnsjeem
parent: jelmer at samba.org-20080316052421-ua97xas37gg20ebn
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: pyrex
timestamp: Sun 2008-03-16 06:41:30 +0100
message:
  Fix another segfault in the wc code.
modified:
  mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
  wc.pyx                         wc.pyx-20080313142018-10l8l23vha2j9e6b-1
=== modified file 'mapping.py'
--- a/mapping.py	2008-03-16 05:24:21 +0000
+++ b/mapping.py	2008-03-16 05:41:30 +0000
@@ -20,6 +20,7 @@
 from bzrlib.trace import mutter
 
 import calendar
+import core
 import errors
 from scheme import BranchingScheme, guess_scheme_from_branch_path
 import sha
@@ -154,7 +155,7 @@
             pass
 
     if svn_revprops.has_key(constants.PROP_REVISION_DATE):
-        rev.timestamp = 1.0 * core.secs_from_timestr(svn_revprops[constants.PROP_REVISION_DATE], None)
+        rev.timestamp = core.time_from_cstring(svn_revprops[constants.PROP_REVISION_DATE]) / 1000000.0
     else:
         rev.timestamp = 0.0 # FIXME: Obtain repository creation time
     rev.timezone = None

=== modified file 'wc.pyx'
--- a/wc.pyx	2008-03-16 04:31:39 +0000
+++ b/wc.pyx	2008-03-16 05:41:30 +0000
@@ -152,7 +152,8 @@
 
 cdef py_entry(svn_wc_entry_t *entry):
     ret = Entry(entry.name, entry.revision, entry.url, entry.repos, entry.uuid, entry.kind, entry.schedule, entry.copied, entry.deleted, entry.absent, entry.incomplete)
-    # FIXME: entry.copyfrom_url, entry.copyfrom_rev, entry.conflict_old, entry.conflict_new, entry.conflict_wrk, entry.prejfile, entry.text_time, entry.prop_time, entry.checksum, entry.cmt_rev, entry.cmt_date, entry.cmt_author, entry.lock_token, entry.lock_owner, entry.lock_comment, entry.lock_creation_date, entry.has_props, entry.has_prop_mods, entry.cachable_props, entry.present_props)
+    ret.cmt_rev = entry.cmt_rev
+    # FIXME: entry.copyfrom_url, entry.copyfrom_rev, entry.conflict_old, entry.conflict_new, entry.conflict_wrk, entry.prejfile, entry.text_time, entry.prop_time, entry.checksum, entry.cmt_date, entry.cmt_author, entry.lock_token, entry.lock_owner, entry.lock_comment, entry.lock_creation_date, entry.has_props, entry.has_prop_mods, entry.cachable_props, entry.present_props)
     return ret
 
 cdef class WorkingCopy:
@@ -233,7 +234,7 @@
         cdef svn_prop_t *el
         temp_pool = Pool(self.pool)
         check_error(svn_wc_get_prop_diffs(&propchanges, &original_props, 
-                    path, self.adm, self.pool))
+                    path, self.adm, temp_pool))
         py_propchanges = []
         for i in range(propchanges.nelts):
             el = <svn_prop_t *>propchanges.elts[i]
@@ -244,7 +245,7 @@
             apr_hash_this(idx, <void **>&key, &klen, <void **>&string)
             py_orig_props[key] = PyString_FromStringAndSize(string.data, string.len)
             idx = apr_hash_next(idx)
-        apr_pool_destroy(self.pool)
+        apr_pool_destroy(temp_pool)
         return (py_propchanges, py_orig_props)
 
     def close(self):
@@ -253,7 +254,7 @@
             self.adm = NULL
 
     def __dealloc__(self):
-        self.close()
+        apr_pool_destroy(self.pool)
 
 
 def revision_status(wc_path, trail_url=None, committed=False, cancel_func=None):




More information about the bazaar-commits mailing list