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

[PATCH] fix up svn_fs_paths_changed SWIG binding

From: Edward S. Marshall <esm_at_logic.net>
Date: 2002-11-18 20:28:08 CET

Hi,

Using svn.fs.paths_changed() via the SWIG bindings currently produces an
incorrect result; the apr_hash_t is converted to a dictionary of
properties by default instead of a dictionary of paths mapped to
svn_fs_path_change_t values.

This patch minimally fixes that up, but requires ugliness like...

changes = svn.fs.paths_changed(root, pool)
for change in changes.keys():
  print svn.fs.path_change_t_change_kind_get(changes[change])

...just to retrieve a value. Perhaps someone with more swig-fu than I
could enhance this to allow "changes[change].change_kind" to work? :-)
It looks like svn.fs.dir_entries() might need to have the same magic
applied to it as well.

Simple patch included below.

-- 
Edward S. Marshall <esm@logic.net>
http://esm.logic.net/
* subversion/bindings/swig/svn_fs.i: Add an exception to the apr_hash_t
  translation for svn_fs_paths_changed().
Index: subversion/bindings/swig/svn_fs.i
===================================================================
--- subversion/bindings/swig/svn_fs.i	(revision 3811)
+++ subversion/bindings/swig/svn_fs.i	(working copy)
@@ -102,6 +102,19 @@
         svn_swig_py_convert_hash(*$1, SWIGTYPE_p_svn_fs_dirent_t));
 }
 
+/*
-----------------------------------------------------------------------
+   and except for svn_fs_paths_changed, which returns
svn_fs_path_change_t
+   structures
+*/
+
+%typemap(in,numinputs=0) apr_hash_t **changed_paths_p = apr_hash_t
**OUTPUT;
+%typemap(python, argout, fragment="t_output_helper")
+apr_hash_t **changed_paths_p {
+    $result = t_output_helper(
+      $result,
+      svn_swig_py_convert_hash(*$1, SWIGTYPE_p_svn_fs_path_change_t));
+}
+
 /*
-----------------------------------------------------------------------
*/
 
 

Received on Mon Nov 18 20:28:49 2002

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.