You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David James <ja...@gmail.com> on 2005/08/04 21:57:31 UTC

Re: Python properties destroyed when container Pool is garbage collected

On 8/4/05, troy d. straszheim <tr...@resophonic.com> wrote:
> Here's a new version:  on my machine, at the end, it shows that things
> are garbled...   rhmmm.  I'm going to try this on a linux box as well.
> 
> -t
> 
> #!/usr/bin/env python
> 
> import sys
> import os
> import getopt
> import pprint
> 
> #os.putenv("PYTHONPATH", "/Users/troy/Projects/svn-install/lib/svn-python")
> #os.putenv("DYLD_LIBRARY_PATH", "/Users/troy/Projects/svn-install/lib")
> 
> from svn import fs, core, repos
> 
> os.system("rm -rf /tmp/temp_repo temp_checkout")
> os.system("svnadmin create /tmp/temp_repo")
> os.system("svn co file:///tmp/temp_repo ./temp_checkout")
> os.chdir("./temp_checkout")
> os.system("svn propset svn:externals \"short /external\" .")
> os.system("svn commit -m first_rev_has_external")
> os.system("svn propset svn:externals \"this_one /is_really_really_really_long_and_comes_out_completely_garbled\" .")
> os.system("svn commit -m next_rev_has_empty_external")
> 
> repos_ptr = repos.open("/tmp/temp_repo", core.Pool())
> fsob = repos.fs(repos_ptr)
> 
> young_root = fs.revision_root(fsob, 2, core.Pool())
> old_root = fs.revision_root(fsob, 1, core.Pool())
> 
> young_props = fs.node_proplist(young_root, "/", core.Pool())
> old_props = fs.node_proplist(old_root, "/", core.Pool())
> 
> oldprop = old_props["svn:externals"]
> assert(young_props.has_key("svn:externals"))
> youngprop = young_props["svn:externals"]
> if old_props["svn:externals"] != young_props["svn:externals"]:
>   print "gah."
> print len(young_props["svn:externals"])
> 
> print "this external should be garbled: >>>%(external)s<<<" % { 'external' : youngprop }

Wow! Thanks for the detailed test case, Troy! I've fixed this by
turning SVN strings into real python strings, instead of pointers to
"pool memory".

Fixed in r15595.

Cheers,

David


-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Python properties destroyed when container Pool is garbage collected

Posted by "troy d. straszheim" <tr...@resophonic.com>.
Cool.  That fixes it here too.  The "real python strings" make debugging 
easier, as well.  Thanks.

-t

David James wrote:
> On 8/4/05, troy d. straszheim <tr...@resophonic.com> wrote:
> 
>>Here's a new version:  on my machine, at the end, it shows that things
>>are garbled...   rhmmm.  I'm going to try this on a linux box as well.
>>
>>-t
>>
>>#!/usr/bin/env python
>>
>>import sys
>>import os
>>import getopt
>>import pprint
>>
>>
>>from svn import fs, core, repos
>>
>>os.system("rm -rf /tmp/temp_repo temp_checkout")
>>os.system("svnadmin create /tmp/temp_repo")
>>os.system("svn co file:///tmp/temp_repo ./temp_checkout")
>>os.chdir("./temp_checkout")
>>os.system("svn propset svn:externals \"short /external\" .")
>>os.system("svn commit -m first_rev_has_external")
>>os.system("svn propset svn:externals \"this_one /is_really_really_really_long_and_comes_out_completely_garbled\" .")
>>os.system("svn commit -m next_rev_has_empty_external")
>>
>>repos_ptr = repos.open("/tmp/temp_repo", core.Pool())
>>fsob = repos.fs(repos_ptr)
>>
>>young_root = fs.revision_root(fsob, 2, core.Pool())
>>old_root = fs.revision_root(fsob, 1, core.Pool())
>>
>>young_props = fs.node_proplist(young_root, "/", core.Pool())
>>old_props = fs.node_proplist(old_root, "/", core.Pool())
>>
>>oldprop = old_props["svn:externals"]
>>assert(young_props.has_key("svn:externals"))
>>youngprop = young_props["svn:externals"]
>>if old_props["svn:externals"] != young_props["svn:externals"]:
>>  print "gah."
>>print len(young_props["svn:externals"])
>>
>>print "this external should be garbled: >>>%(external)s<<<" % { 'external' : youngprop }
> 
> 
> Wow! Thanks for the detailed test case, Troy! I've fixed this by
> turning SVN strings into real python strings, instead of pointers to
> "pool memory".
> 
> Fixed in r15595.
> 
> Cheers,
> 
> David
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org