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

Perl Bindings: checking for config...?

From: Goddard Lee <lee.goddard_at_easa.eu.int>
Date: 2005-09-27 13:03:27 CEST

When I run the little test script below as 'nobody', as my httpd would,
it fails on both counts with the message:

     Bogus filename: Can't open config file '/root/.subversion/servers'

All I want to do is create an SVN::Client object to add/commit a
document with a specific username. From what I can make of the perldocs
for SVN::Client, the "prompt" provider shouldn't look at the
filesystem...

Please help!
Lee

#! perl
use Test::More tests => 3;
use strict;
use warnings;
use_ok('SVN::Client');

diag "Sub ref";
eval {
 my $ctx = new SVN::Client(
  auth => [
   SVN::Client::get_simple_prompt_provider(\&simple_prompt, 1),
  ]
 );
};
$@? fail($@) : pass("OK");

diag "Anon sub";
eval {
 my $ctx = new SVN::Client(
  auth => [
   SVN::Client::get_simple_prompt_provider(sub {
    my $cred = shift;
    $cred->username("test");
    $cred->password("p455w0rd");
   }, 2),
  ]
 );
};
$@? fail($@) : pass("OK");

exit;

sub simple_prompt {
 my $cred = shift;
 $cred->username('test');
 $cred->password('p455w0rd');
}

__END__

OUTPUT:

[root@bdms t]# sudo -u nobody perl ctx.mini.t
1..3
ok 1 - use SVN::Client;
# Sub ref
not ok 2 - Bogus filename: Can't open config file
'/root/.subversion/servers' at ctx.mini.t line 12
#
# Failed test (ctx.mini.t at line 18)
# Anon sub
not ok 3 - Bogus filename: Can't open config file
'/root/.subversion/servers' at ctx.mini.t line 28
#
# Failed test (ctx.mini.t at line 32)
# Looks like you failed 2 tests of 3.
[root@bdms t]#

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Sep 27 13:04:45 2005

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