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

Re: How to use SVN::Client with authenticated proxy?

From: Josef Wolf <jw_at_raven.inka.de>
Date: Tue, 10 Mar 2009 19:22:08 +0100

On Fri, Mar 06, 2009 at 05:23:34PM +0100, Josef Wolf wrote:

> I am about to write a perl script to manage a subversion working copy
> with SVN::Client module. It seems to be easier than I thought. Here's
> my first attempt (mostly copied from the man page):
[ ... ]

I've come a little bit closer now. Retrieval of the configuration seems
not to work like it is described in the documentation. From the manpage
of SVN::Client, one of the following should work:

  my $ctx = new SVN::Client(
      config => SVN::Core::config_get_config("/etc/subversion"),
      # more options

  $ctx->config (SVN::Core::config_get_config(undef));

But they do _not_ work. What actually works, is a rather strange

  my $conf = SVN::Core::config_get_config("/etc/subversion");

  my $ctx = new SVN::Client(
      # more options

What makes this construct strange is:

 - it works _only_ if the return value is assigned to a variable that
   does not go out of scope as long as $ctx exists.
 - calling SVN::Core::config_get_config("/etc/subversion") again makes
   it fail again, although the assigned value is not modified.
 - passing this variable as parameter to SVN::Client::new() or
   to $ctx->config() breaks it again.

I guess the config_get_config function keeps some static storage somewhere
which is destroyed when its return value gets out of scope or when it
is called a second time.
Received on 2009-03-10 19:31:16 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.