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

Re: Python properties destroyed when container Pool is garbage collected

From: troy d. straszheim <troy_at_resophonic.com>
Date: 2005-08-05 00:28:26 CEST

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 <troy@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
Received on Fri Aug 5 00:29:06 2005

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.