subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1227828 - in /subversion/trunk/tools/examples: SvnCLBrowse get-location-segments.py
Date Thu, 05 Jan 2012 20:54:09 GMT
Author: danielsh
Date: Thu Jan  5 20:54:09 2012
New Revision: 1227828

URL: http://svn.apache.org/viewvc?rev=1227828&view=rev
Log:
Fix the swig-py examples.

When trying to run the get-location-segments.py, it throws:

    TypeError: Unexpected NULL parent pool on proxy object

Somehow, the "_parent_pool" property wasn't initialized on the context.
Not sure how this works, but creating a context using
client.svn_client_create_context() instead of client.ctx_t() (which
subversion/bindings/swig/python/tests/pool.py also does) fixes this
error and makes the example work again.

* tools/examples/get-location-segments.py
  (main): Use client.svn_client_create_context instead of client.ctx_t.

* tools/examples/SvnCLBrowse
  (SvnCLBrowse.__init__): Same.

Patch by: Matthijs Kooijman <matthijs@stdin.nl>
(SvnCLBrowse part by me)

Modified:
    subversion/trunk/tools/examples/SvnCLBrowse
    subversion/trunk/tools/examples/get-location-segments.py

Modified: subversion/trunk/tools/examples/SvnCLBrowse
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/examples/SvnCLBrowse?rev=1227828&r1=1227827&r2=1227828&view=diff
==============================================================================
--- subversion/trunk/tools/examples/SvnCLBrowse (original)
+++ subversion/trunk/tools/examples/SvnCLBrowse Thu Jan  5 20:54:09 2012
@@ -161,7 +161,7 @@ class _item:
 class SvnCLBrowse(wx.App):
   def __init__(self, wc_dir):
     svn.core.svn_config_ensure(None)
-    self.svn_ctx = svn.client.ctx_t()
+    self.svn_ctx = svn.client.svn_client_create_context()
     self.svn_ctx.config = svn.core.svn_config_get_config(None)
     if wc_dir is not None:
       self.wc_dir = svn.core.svn_path_canonicalize(wc_dir)

Modified: subversion/trunk/tools/examples/get-location-segments.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/examples/get-location-segments.py?rev=1227828&r1=1227827&r2=1227828&view=diff
==============================================================================
--- subversion/trunk/tools/examples/get-location-segments.py (original)
+++ subversion/trunk/tools/examples/get-location-segments.py Thu Jan  5 20:54:09 2012
@@ -124,7 +124,7 @@ ERROR: %s
     sys.exit(1)
 
   core.svn_config_ensure(None)
-  ctx = client.ctx_t()
+  ctx = client.svn_client_create_context()
   providers = [
     client.get_simple_provider(),
     core.svn_auth_get_ssl_server_trust_file_provider(),



Mime
View raw message