$_limit, $_verbose, $_incremental, $_oneline, $_l_fmt, $_show_commit,
$_version, $_upgrade, $_authors, $_branch_all_refs, @_opt_m,
$_merge, $_strategy, $_dry_run, $_ignore_nodate, $_non_recursive,
- $_username, $_config_dir, $_no_auth_cache,
+ $_config_dir,
$_pager, $_color, $_prefix);
my (@_branch_from, %tree_map, %users, %rusers, %equiv);
my ($_svn_can_do_switch);
'repack:i' => \$_repack,
'no-metadata' => \$_no_metadata,
'quiet|q' => \$_q,
- 'username=s' => \$_username,
+ 'username=s' => \$Git::SVN::Prompt::_username,
'config-dir=s' => \$_config_dir,
- 'no-auth-cache' => \$_no_auth_cache,
+ 'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache,
'ignore-nodate' => \$_ignore_nodate,
'repack-flags|repack-args|repack-opts=s' => \$_repack_flags);
'Initialize multiple trees (like git-svnimport)',
{ %multi_opts, %init_opts,
'revision|r=i' => \$_revision,
- 'username=s' => \$_username,
+ 'username=s' => \$Git::SVN::Prompt::_username,
'config-dir=s' => \$_config_dir,
- 'no-auth-cache' => \$_no_auth_cache,
+ 'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache,
'prefix=s' => \$_prefix,
} ],
'multi-fetch' => [ \&multi_fetch,
}
}
-sub _simple_prompt {
+package Git::SVN::Prompt;
+use strict;
+use warnings;
+require SVN::Core;
+use vars qw/$_no_auth_cache $_username/;
+
+sub simple {
my ($cred, $realm, $default_username, $may_save, $pool) = @_;
$may_save = undef if $_no_auth_cache;
$default_username = $_username if defined $_username;
}
$cred->username($default_username);
} else {
- _username_prompt($cred, $realm, $may_save, $pool);
+ username($cred, $realm, $may_save, $pool);
}
$cred->password(_read_password("Password for '" .
$cred->username . "': ", $realm));
$SVN::_Core::SVN_NO_ERROR;
}
-sub _ssl_server_trust_prompt {
+sub ssl_server_trust {
my ($cred, $realm, $failures, $cert_info, $may_save, $pool) = @_;
$may_save = undef if $_no_auth_cache;
print STDERR "Error validating server certificate for '$realm':\n";
$SVN::_Core::SVN_NO_ERROR;
}
-sub _ssl_client_cert_prompt {
+sub ssl_client_cert {
my ($cred, $realm, $may_save, $pool) = @_;
$may_save = undef if $_no_auth_cache;
print STDERR "Client certificate filename: ";
$SVN::_Core::SVN_NO_ERROR;
}
-sub _ssl_client_cert_pw_prompt {
+sub ssl_client_cert_pw {
my ($cred, $realm, $may_save, $pool) = @_;
$may_save = undef if $_no_auth_cache;
$cred->password(_read_password("Password: ", $realm));
$SVN::_Core::SVN_NO_ERROR;
}
-sub _username_prompt {
+sub username {
my ($cred, $realm, $may_save, $pool) = @_;
$may_save = undef if $_no_auth_cache;
if (defined $realm && length $realm) {
$password;
}
+package main;
+
sub libsvn_connect {
my ($url) = @_;
SVN::_Core::svn_config_ensure($_config_dir, undef);
SVN::Client::get_simple_provider(),
SVN::Client::get_ssl_server_trust_file_provider(),
SVN::Client::get_simple_prompt_provider(
- \&_simple_prompt, 2),
+ \&Git::SVN::Prompt::simple, 2),
SVN::Client::get_ssl_client_cert_prompt_provider(
- \&_ssl_client_cert_prompt, 2),
+ \&Git::SVN::Prompt::ssl_client_cert, 2),
SVN::Client::get_ssl_client_cert_pw_prompt_provider(
- \&_ssl_client_cert_pw_prompt, 2),
+ \&Git::SVN::Prompt::ssl_client_cert_pw, 2),
SVN::Client::get_username_provider(),
SVN::Client::get_ssl_server_trust_prompt_provider(
- \&_ssl_server_trust_prompt),
+ \&Git::SVN::Prompt::ssl_server_trust),
SVN::Client::get_username_prompt_provider(
- \&_username_prompt, 2),
+ \&Git::SVN::username, 2),
]);
my $config = SVN::Core::config_get_config($_config_dir);
my $ra = SVN::Ra->new(url => $url, auth => $baton,