Mark Ziesemer wrote on Wed, Sep 02, 2015 at 00:01:40 +0000: > I'm trying to call fs.change_rev_prop2 (https://goo.gl/6b6TG5) from Python / > SWIG - and apparently can't figure out how to pass old_value_p as what I'm > assuming needs to be a double pointer from Python. >
[ I've replied to this part on dev@. tldr: Not currently possible. More below. ] > user = fs.revision_prop(fs_ptr, rev_num, "svn:author") > > # Works, but is is deprecated in favor of fs.change_rev_prop2 . > fs.change_rev_prop(fs_ptr, rev_num, "svn:author", user.lower()) > > # fs.change_rev_prop2(fs_ptr, rev_num, "svn:author", user, user.lower()) > # > svn.core.SubversionException: 160049 - revprop 'svn:author' has > unexpected value in filesystem > > # fs.change_rev_prop2(fs_ptr, rev_num, "svn:author", None, user.lower()) > # Per svn_ra.h: If the capability is not advertised, then @a old_value_p > MUST be @c NULL. You should be looking at svn_fs.h, not svn_ra.h, since that's the layer you're working with. And, once the svn_fs-based code works, you should probably switch to using the svn_repos layer instead (i.e., svn_repos_fs_change_rev_prop4()). > I believe the value I'm attempting to pass is "correct". After all, I'm > obtaining it from the API immediately before attempting to set it back. I'm > assuming I'm just not passing the value correctly in a way that the native > API can accept it. You certainly aren't: you're passing a wrapped svn_string_t* to a parameter that expects a wrapped svn_string_t**. > So I could just continue using change_rev_prop - but it is clearly marked as > deprecated in the API ("Provided for backward compatibility with the 1.6 > API"). Should be able to do better, though... The deprecation just means we remove the API when we release 2.0, which might be sometime before the Sun stops working. Or maybe after. We have an issue somewhere reminding us to decide between these two options. Basically, don't worry about it.