perl / Git / SVN / Ra.pmon commit git-svn: remove unnecessary DESTROY override (6725eca)
   1package Git::SVN::Ra;
   2use vars qw/@ISA $config_dir $_ignore_refs_regex $_log_window_size/;
   3use strict;
   4use warnings;
   5use SVN::Client;
   6use Git::SVN::Utils qw(
   7        canonicalize_url
   8        canonicalize_path
   9        add_path_to_url
  10);
  11
  12use SVN::Ra;
  13BEGIN {
  14        @ISA = qw(SVN::Ra);
  15}
  16
  17my ($ra_invalid, $can_do_switch, %ignored_err, $RA);
  18
  19BEGIN {
  20        # enforce temporary pool usage for some simple functions
  21        no strict 'refs';
  22        for my $f (qw/rev_proplist get_latest_revnum get_uuid get_repos_root
  23                      get_file/) {
  24                my $SUPER = "SUPER::$f";
  25                *$f = sub {
  26                        my $self = shift;
  27                        my $pool = SVN::Pool->new;
  28                        my @ret = $self->$SUPER(@_,$pool);
  29                        $pool->clear;
  30                        wantarray ? @ret : $ret[0];
  31                };
  32        }
  33}
  34
  35# serf has a bug that leads to a coredump upon termination if the
  36# remote access object is left around (not fixed yet in serf 1.3.1).
  37# Explicitly free it to work around the issue.
  38END {
  39        $RA = undef;
  40        $ra_invalid = 1;
  41}
  42
  43sub _auth_providers () {
  44        my @rv = (
  45          SVN::Client::get_simple_provider(),
  46          SVN::Client::get_ssl_server_trust_file_provider(),
  47          SVN::Client::get_simple_prompt_provider(
  48            \&Git::SVN::Prompt::simple, 2),
  49          SVN::Client::get_ssl_client_cert_file_provider(),
  50          SVN::Client::get_ssl_client_cert_prompt_provider(
  51            \&Git::SVN::Prompt::ssl_client_cert, 2),
  52          SVN::Client::get_ssl_client_cert_pw_file_provider(),
  53          SVN::Client::get_ssl_client_cert_pw_prompt_provider(
  54            \&Git::SVN::Prompt::ssl_client_cert_pw, 2),
  55          SVN::Client::get_username_provider(),
  56          SVN::Client::get_ssl_server_trust_prompt_provider(
  57            \&Git::SVN::Prompt::ssl_server_trust),
  58          SVN::Client::get_username_prompt_provider(
  59            \&Git::SVN::Prompt::username, 2)
  60        );
  61
  62        # earlier 1.6.x versions would segfault, and <= 1.5.x didn't have
  63        # this function
  64        if (::compare_svn_version('1.6.15') >= 0) {
  65                my $config = SVN::Core::config_get_config($config_dir);
  66                my ($p, @a);
  67                # config_get_config returns all config files from
  68                # ~/.subversion, auth_get_platform_specific_client_providers
  69                # just wants the config "file".
  70                @a = ($config->{'config'}, undef);
  71                $p = SVN::Core::auth_get_platform_specific_client_providers(@a);
  72                # Insert the return value from
  73                # auth_get_platform_specific_providers
  74                unshift @rv, @$p;
  75        }
  76        \@rv;
  77}
  78
  79
  80sub new {
  81        my ($class, $url) = @_;
  82        $url = canonicalize_url($url);
  83        return $RA if ($RA && $RA->url eq $url);
  84
  85        ::_req_svn();
  86
  87        SVN::_Core::svn_config_ensure($config_dir, undef);
  88        my ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers);
  89        my $config = SVN::Core::config_get_config($config_dir);
  90        $RA = undef;
  91        my $dont_store_passwords = 1;
  92        my $conf_t = ${$config}{'config'};
  93        {
  94                no warnings 'once';
  95                # The usage of $SVN::_Core::SVN_CONFIG_* variables
  96                # produces warnings that variables are used only once.
  97                # I had not found the better way to shut them up, so
  98                # the warnings of type 'once' are disabled in this block.
  99                if (SVN::_Core::svn_config_get_bool($conf_t,
 100                    $SVN::_Core::SVN_CONFIG_SECTION_AUTH,
 101                    $SVN::_Core::SVN_CONFIG_OPTION_STORE_PASSWORDS,
 102                    1) == 0) {
 103                        SVN::_Core::svn_auth_set_parameter($baton,
 104                            $SVN::_Core::SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,
 105                            bless (\$dont_store_passwords, "_p_void"));
 106                }
 107                if (SVN::_Core::svn_config_get_bool($conf_t,
 108                    $SVN::_Core::SVN_CONFIG_SECTION_AUTH,
 109                    $SVN::_Core::SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
 110                    1) == 0) {
 111                        $Git::SVN::Prompt::_no_auth_cache = 1;
 112                }
 113        } # no warnings 'once'
 114
 115        my $self = SVN::Ra->new(url => $url, auth => $baton,
 116                              config => $config,
 117                              pool => SVN::Pool->new,
 118                              auth_provider_callbacks => $callbacks);
 119        $RA = bless $self, $class;
 120
 121        # Make sure its canonicalized
 122        $self->url($url);
 123        $self->{svn_path} = $url;
 124        $self->{repos_root} = $self->get_repos_root;
 125        $self->{svn_path} =~ s#^\Q$self->{repos_root}\E(/|$)##;
 126        $self->{cache} = { check_path => { r => 0, data => {} },
 127                           get_dir => { r => 0, data => {} } };
 128
 129        return $RA;
 130}
 131
 132sub url {
 133        my $self = shift;
 134
 135        if (@_) {
 136                my $url = shift;
 137                $self->{url} = canonicalize_url($url);
 138                return;
 139        }
 140
 141        return $self->{url};
 142}
 143
 144sub check_path {
 145        my ($self, $path, $r) = @_;
 146        my $cache = $self->{cache}->{check_path};
 147        if ($r == $cache->{r} && exists $cache->{data}->{$path}) {
 148                return $cache->{data}->{$path};
 149        }
 150        my $pool = SVN::Pool->new;
 151        my $t = $self->SUPER::check_path($path, $r, $pool);
 152        $pool->clear;
 153        if ($r != $cache->{r}) {
 154                %{$cache->{data}} = ();
 155                $cache->{r} = $r;
 156        }
 157        $cache->{data}->{$path} = $t;
 158}
 159
 160sub get_dir {
 161        my ($self, $dir, $r) = @_;
 162        my $cache = $self->{cache}->{get_dir};
 163        if ($r == $cache->{r}) {
 164                if (my $x = $cache->{data}->{$dir}) {
 165                        return wantarray ? @$x : $x->[0];
 166                }
 167        }
 168        my $pool = SVN::Pool->new;
 169        my ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);
 170        my %dirents = map { $_ => { kind => $d->{$_}->kind } } keys %$d;
 171        $pool->clear;
 172        if ($r != $cache->{r}) {
 173                %{$cache->{data}} = ();
 174                $cache->{r} = $r;
 175        }
 176        $cache->{data}->{$dir} = [ \%dirents, $r, $props ];
 177        wantarray ? (\%dirents, $r, $props) : \%dirents;
 178}
 179
 180# get_log(paths, start, end, limit,
 181#         discover_changed_paths, strict_node_history, receiver)
 182sub get_log {
 183        my ($self, @args) = @_;
 184        my $pool = SVN::Pool->new;
 185
 186        # svn_log_changed_path_t objects passed to get_log are likely to be
 187        # overwritten even if only the refs are copied to an external variable,
 188        # so we should dup the structures in their entirety.  Using an
 189        # externally passed pool (instead of our temporary and quickly cleared
 190        # pool in Git::SVN::Ra) does not help matters at all...
 191        my $receiver = pop @args;
 192        my $prefix = "/".$self->{svn_path};
 193        $prefix =~ s#/+($)##;
 194        my $prefix_regex = qr#^\Q$prefix\E#;
 195        push(@args, sub {
 196                my ($paths) = $_[0];
 197                return &$receiver(@_) unless $paths;
 198                $_[0] = ();
 199                foreach my $p (keys %$paths) {
 200                        my $i = $paths->{$p};
 201                        # Make path relative to our url, not repos_root
 202                        $p =~ s/$prefix_regex//;
 203                        my %s = map { $_ => $i->$_; }
 204                                qw/copyfrom_path copyfrom_rev action/;
 205                        if ($s{'copyfrom_path'}) {
 206                                $s{'copyfrom_path'} =~ s/$prefix_regex//;
 207                                $s{'copyfrom_path'} = canonicalize_path($s{'copyfrom_path'});
 208                        }
 209                        $_[0]{$p} = \%s;
 210                }
 211                &$receiver(@_);
 212        });
 213
 214
 215        # the limit parameter was not supported in SVN 1.1.x, so we
 216        # drop it.  Therefore, the receiver callback passed to it
 217        # is made aware of this limitation by being wrapped if
 218        # the limit passed to is being wrapped.
 219        if (::compare_svn_version('1.2.0') <= 0) {
 220                my $limit = splice(@args, 3, 1);
 221                if ($limit > 0) {
 222                        my $receiver = pop @args;
 223                        push(@args, sub { &$receiver(@_) if (--$limit >= 0) });
 224                }
 225        }
 226        my $ret = $self->SUPER::get_log(@args, $pool);
 227        $pool->clear;
 228        $ret;
 229}
 230
 231sub trees_match {
 232        my ($self, $url1, $rev1, $url2, $rev2) = @_;
 233        my $ctx = SVN::Client->new(auth => _auth_providers);
 234        my $out = IO::File->new_tmpfile;
 235
 236        # older SVN (1.1.x) doesn't take $pool as the last parameter for
 237        # $ctx->diff(), so we'll create a default one
 238        my $pool = SVN::Pool->new_default_sub;
 239
 240        $ra_invalid = 1; # this will open a new SVN::Ra connection to $url1
 241        $ctx->diff([], $url1, $rev1, $url2, $rev2, 1, 1, 0, $out, $out);
 242        $out->flush;
 243        my $ret = (($out->stat)[7] == 0);
 244        close $out or croak $!;
 245
 246        $ret;
 247}
 248
 249sub get_commit_editor {
 250        my ($self, $log, $cb, $pool) = @_;
 251
 252        my @lock = (::compare_svn_version('1.2.0') >= 0) ? (undef, 0) : ();
 253        $self->SUPER::get_commit_editor($log, $cb, @lock, $pool);
 254}
 255
 256sub gs_do_update {
 257        my ($self, $rev_a, $rev_b, $gs, $editor) = @_;
 258        my $new = ($rev_a == $rev_b);
 259        my $path = $gs->path;
 260
 261        if ($new && -e $gs->{index}) {
 262                unlink $gs->{index} or die
 263                  "Couldn't unlink index: $gs->{index}: $!\n";
 264        }
 265        my $pool = SVN::Pool->new;
 266        $editor->set_path_strip($path);
 267        my (@pc) = split m#/#, $path;
 268        my $reporter = $self->do_update($rev_b, (@pc ? shift @pc : ''),
 269                                        1, $editor, $pool);
 270        my @lock = (::compare_svn_version('1.2.0') >= 0) ? (undef) : ();
 271
 272        # Since we can't rely on svn_ra_reparent being available, we'll
 273        # just have to do some magic with set_path to make it so
 274        # we only want a partial path.
 275        my $sp = '';
 276        my $final = join('/', @pc);
 277        while (@pc) {
 278                $reporter->set_path($sp, $rev_b, 0, @lock, $pool);
 279                $sp .= '/' if length $sp;
 280                $sp .= shift @pc;
 281        }
 282        die "BUG: '$sp' != '$final'\n" if ($sp ne $final);
 283
 284        $reporter->set_path($sp, $rev_a, $new, @lock, $pool);
 285
 286        $reporter->finish_report($pool);
 287        $pool->clear;
 288        $editor->{git_commit_ok};
 289}
 290
 291# this requires SVN 1.4.3 or later (do_switch didn't work before 1.4.3, and
 292# svn_ra_reparent didn't work before 1.4)
 293sub gs_do_switch {
 294        my ($self, $rev_a, $rev_b, $gs, $url_b, $editor) = @_;
 295        my $path = $gs->path;
 296        my $pool = SVN::Pool->new;
 297
 298        my $old_url = $self->url;
 299        my $full_url = add_path_to_url( $self->url, $path );
 300        my ($ra, $reparented);
 301
 302        if ($old_url =~ m#^svn(\+\w+)?://# ||
 303            ($full_url =~ m#^https?://# &&
 304             canonicalize_url($full_url) ne $full_url)) {
 305                $_[0] = undef;
 306                $self = undef;
 307                $RA = undef;
 308                $ra = Git::SVN::Ra->new($full_url);
 309                $ra_invalid = 1;
 310        } elsif ($old_url ne $full_url) {
 311                SVN::_Ra::svn_ra_reparent(
 312                        $self->{session},
 313                        canonicalize_url($full_url),
 314                        $pool
 315                );
 316                $self->url($full_url);
 317                $reparented = 1;
 318        }
 319
 320        $ra ||= $self;
 321        $url_b = canonicalize_url($url_b);
 322        my $reporter = $ra->do_switch($rev_b, '', 1, $url_b, $editor, $pool);
 323        my @lock = (::compare_svn_version('1.2.0') >= 0) ? (undef) : ();
 324        $reporter->set_path('', $rev_a, 0, @lock, $pool);
 325        $reporter->finish_report($pool);
 326
 327        if ($reparented) {
 328                SVN::_Ra::svn_ra_reparent($self->{session}, $old_url, $pool);
 329                $self->url($old_url);
 330        }
 331
 332        $pool->clear;
 333        $editor->{git_commit_ok};
 334}
 335
 336sub longest_common_path {
 337        my ($gsv, $globs) = @_;
 338        my %common;
 339        my $common_max = scalar @$gsv;
 340
 341        foreach my $gs (@$gsv) {
 342                my @tmp = split m#/#, $gs->path;
 343                my $p = '';
 344                foreach (@tmp) {
 345                        $p .= length($p) ? "/$_" : $_;
 346                        $common{$p} ||= 0;
 347                        $common{$p}++;
 348                }
 349        }
 350        $globs ||= [];
 351        $common_max += scalar @$globs;
 352        foreach my $glob (@$globs) {
 353                my @tmp = split m#/#, $glob->{path}->{left};
 354                my $p = '';
 355                foreach (@tmp) {
 356                        $p .= length($p) ? "/$_" : $_;
 357                        $common{$p} ||= 0;
 358                        $common{$p}++;
 359                }
 360        }
 361
 362        my $longest_path = '';
 363        foreach (sort {length $b <=> length $a} keys %common) {
 364                if ($common{$_} == $common_max) {
 365                        $longest_path = $_;
 366                        last;
 367                }
 368        }
 369        $longest_path;
 370}
 371
 372sub gs_fetch_loop_common {
 373        my ($self, $base, $head, $gsv, $globs) = @_;
 374        return if ($base > $head);
 375        my $gpool = SVN::Pool->new_default;
 376        my $ra_url = $self->url;
 377        my $reload_ra = sub {
 378                $_[0] = undef;
 379                $self = undef;
 380                $RA = undef;
 381                $gpool->clear;
 382                $self = Git::SVN::Ra->new($ra_url);
 383                $ra_invalid = undef;
 384        };
 385        my $inc = $_log_window_size;
 386        my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
 387        my $longest_path = longest_common_path($gsv, $globs);
 388        my $find_trailing_edge;
 389        while (1) {
 390                my %revs;
 391                my $err;
 392                my $err_handler = $SVN::Error::handler;
 393                $SVN::Error::handler = sub {
 394                        ($err) = @_;
 395                        skip_unknown_revs($err);
 396                };
 397                sub _cb {
 398                        my ($paths, $r, $author, $date, $log) = @_;
 399                        [ $paths,
 400                          { author => $author, date => $date, log => $log } ];
 401                }
 402                $self->get_log([$longest_path], $min, $max, 0, 1, 1,
 403                               sub { $revs{$_[1]} = _cb(@_) });
 404                if ($err) {
 405                        print "Checked through r$max\r";
 406                } else {
 407                        $find_trailing_edge = 1;
 408                }
 409                if ($err and $find_trailing_edge) {
 410                        print STDERR "Path '$longest_path' ",
 411                                     "was probably deleted:\n",
 412                                     $err->expanded_message,
 413                                     "\nWill attempt to follow ",
 414                                     "revisions r$min .. r$max ",
 415                                     "committed before the deletion\n";
 416                        my $hi = $max;
 417                        while (--$hi >= $min) {
 418                                my $ok;
 419                                $self->get_log([$longest_path], $min, $hi,
 420                                               0, 1, 1, sub {
 421                                               $ok = $_[1];
 422                                               $revs{$_[1]} = _cb(@_) });
 423                                if ($ok) {
 424                                        print STDERR "r$min .. r$ok OK\n";
 425                                        last;
 426                                }
 427                        }
 428                        $find_trailing_edge = 0;
 429                }
 430                $SVN::Error::handler = $err_handler;
 431
 432                my %exists = map { $_->path => $_ } @$gsv;
 433                foreach my $r (sort {$a <=> $b} keys %revs) {
 434                        my ($paths, $logged) = @{$revs{$r}};
 435
 436                        foreach my $gs ($self->match_globs(\%exists, $paths,
 437                                                           $globs, $r)) {
 438                                if ($gs->rev_map_max >= $r) {
 439                                        next;
 440                                }
 441                                next unless $gs->match_paths($paths, $r);
 442                                $gs->{logged_rev_props} = $logged;
 443                                if (my $last_commit = $gs->last_commit) {
 444                                        $gs->assert_index_clean($last_commit);
 445                                }
 446                                my $log_entry = $gs->do_fetch($paths, $r);
 447                                if ($log_entry) {
 448                                        $gs->do_git_commit($log_entry);
 449                                }
 450                                $Git::SVN::INDEX_FILES{$gs->{index}} = 1;
 451                        }
 452                        foreach my $g (@$globs) {
 453                                my $k = "svn-remote.$g->{remote}." .
 454                                        "$g->{t}-maxRev";
 455                                Git::SVN::tmp_config($k, $r);
 456                        }
 457                        $reload_ra->() if $ra_invalid;
 458                }
 459                # pre-fill the .rev_db since it'll eventually get filled in
 460                # with '0' x40 if something new gets committed
 461                foreach my $gs (@$gsv) {
 462                        next if $gs->rev_map_max >= $max;
 463                        next if defined $gs->rev_map_get($max);
 464                        $gs->rev_map_set($max, 0 x40);
 465                }
 466                foreach my $g (@$globs) {
 467                        my $k = "svn-remote.$g->{remote}.$g->{t}-maxRev";
 468                        Git::SVN::tmp_config($k, $max);
 469                }
 470                last if $max >= $head;
 471                $min = $max + 1;
 472                $max += $inc;
 473                $max = $head if ($max > $head);
 474
 475                $reload_ra->();
 476        }
 477        Git::SVN::gc();
 478}
 479
 480sub get_dir_globbed {
 481        my ($self, $left, $depth, $r) = @_;
 482
 483        my @x = eval { $self->get_dir($left, $r) };
 484        return unless scalar @x == 3;
 485        my $dirents = $x[0];
 486        my @finalents;
 487        foreach my $de (keys %$dirents) {
 488                next if $dirents->{$de}->{kind} != $SVN::Node::dir;
 489                if ($depth > 1) {
 490                        my @args = ("$left/$de", $depth - 1, $r);
 491                        foreach my $dir ($self->get_dir_globbed(@args)) {
 492                                push @finalents, "$de/$dir";
 493                        }
 494                } else {
 495                        push @finalents, $de;
 496                }
 497        }
 498        @finalents;
 499}
 500
 501# return value: 0 -- don't ignore, 1 -- ignore
 502sub is_ref_ignored {
 503        my ($g, $p) = @_;
 504        my $refname = $g->{ref}->full_path($p);
 505        return 1 if defined($g->{ignore_refs_regex}) &&
 506                    $refname =~ m!$g->{ignore_refs_regex}!;
 507        return 0 unless defined($_ignore_refs_regex);
 508        return 1 if $refname =~ m!$_ignore_refs_regex!o;
 509        return 0;
 510}
 511
 512sub match_globs {
 513        my ($self, $exists, $paths, $globs, $r) = @_;
 514
 515        sub get_dir_check {
 516                my ($self, $exists, $g, $r) = @_;
 517
 518                my @dirs = $self->get_dir_globbed($g->{path}->{left},
 519                                                  $g->{path}->{depth},
 520                                                  $r);
 521
 522                foreach my $de (@dirs) {
 523                        my $p = $g->{path}->full_path($de);
 524                        next if $exists->{$p};
 525                        next if (length $g->{path}->{right} &&
 526                                 ($self->check_path($p, $r) !=
 527                                  $SVN::Node::dir));
 528                        next unless $p =~ /$g->{path}->{regex}/;
 529                        $exists->{$p} = Git::SVN->init($self->url, $p, undef,
 530                                         $g->{ref}->full_path($de), 1);
 531                }
 532        }
 533        foreach my $g (@$globs) {
 534                if (my $path = $paths->{"/$g->{path}->{left}"}) {
 535                        if ($path->{action} =~ /^[AR]$/) {
 536                                get_dir_check($self, $exists, $g, $r);
 537                        }
 538                }
 539                foreach (keys %$paths) {
 540                        if (/$g->{path}->{left_regex}/ &&
 541                            !/$g->{path}->{regex}/) {
 542                                next if $paths->{$_}->{action} !~ /^[AR]$/;
 543                                get_dir_check($self, $exists, $g, $r);
 544                        }
 545                        next unless /$g->{path}->{regex}/;
 546                        my $p = $1;
 547                        my $pathname = $g->{path}->full_path($p);
 548                        next if is_ref_ignored($g, $p);
 549                        next if $exists->{$pathname};
 550                        next if ($self->check_path($pathname, $r) !=
 551                                 $SVN::Node::dir);
 552                        $exists->{$pathname} = Git::SVN->init(
 553                                              $self->url, $pathname, undef,
 554                                              $g->{ref}->full_path($p), 1);
 555                }
 556                my $c = '';
 557                foreach (split m#/#, $g->{path}->{left}) {
 558                        $c .= "/$_";
 559                        next unless ($paths->{$c} &&
 560                                     ($paths->{$c}->{action} =~ /^[AR]$/));
 561                        get_dir_check($self, $exists, $g, $r);
 562                }
 563        }
 564        values %$exists;
 565}
 566
 567sub minimize_url {
 568        my ($self) = @_;
 569        return $self->url if ($self->url eq $self->{repos_root});
 570        my $url = $self->{repos_root};
 571        my @components = split(m!/!, $self->{svn_path});
 572        my $c = '';
 573        do {
 574                $url = add_path_to_url($url, $c);
 575                eval {
 576                        my $ra = (ref $self)->new($url);
 577                        my $latest = $ra->get_latest_revnum;
 578                        $ra->get_log("", $latest, 0, 1, 0, 1, sub {});
 579                };
 580        } while ($@ && ($c = shift @components));
 581
 582        return canonicalize_url($url);
 583}
 584
 585sub can_do_switch {
 586        my $self = shift;
 587        unless (defined $can_do_switch) {
 588                my $pool = SVN::Pool->new;
 589                my $rep = eval {
 590                        $self->do_switch(1, '', 0, $self->url,
 591                                         SVN::Delta::Editor->new, $pool);
 592                };
 593                if ($@) {
 594                        $can_do_switch = 0;
 595                } else {
 596                        $rep->abort_report($pool);
 597                        $can_do_switch = 1;
 598                }
 599                $pool->clear;
 600        }
 601        $can_do_switch;
 602}
 603
 604sub skip_unknown_revs {
 605        my ($err) = @_;
 606        my $errno = $err->apr_err();
 607        # Maybe the branch we're tracking didn't
 608        # exist when the repo started, so it's
 609        # not an error if it doesn't, just continue
 610        #
 611        # Wonderfully consistent library, eh?
 612        # 160013 - svn:// and file://
 613        # 175002 - http(s)://
 614        # 175007 - http(s):// (this repo required authorization, too...)
 615        #   More codes may be discovered later...
 616        if ($errno == 175007 || $errno == 175002 || $errno == 160013) {
 617                my $err_key = $err->expanded_message;
 618                # revision numbers change every time, filter them out
 619                $err_key =~ s/\d+/\0/g;
 620                $err_key = "$errno\0$err_key";
 621                unless ($ignored_err{$err_key}) {
 622                        warn "W: Ignoring error from SVN, path probably ",
 623                             "does not exist: ($errno): ",
 624                             $err->expanded_message,"\n";
 625                        warn "W: Do not be alarmed at the above message ",
 626                             "git-svn is just searching aggressively for ",
 627                             "old history.\n",
 628                             "This may take a while on large repositories\n";
 629                        $ignored_err{$err_key} = 1;
 630                }
 631                return;
 632        }
 633        die "Error from SVN, ($errno): ", $err->expanded_message,"\n";
 634}
 635
 6361;
 637__END__
 638
 639=head1 NAME
 640
 641Git::SVN::Ra - Subversion remote access functions for git-svn
 642
 643=head1 SYNOPSIS
 644
 645    use Git::SVN::Ra;
 646
 647    my $ra = Git::SVN::Ra->new($branchurl);
 648    my ($dirents, $fetched_revnum, $props) =
 649        $ra->get_dir('.', $SVN::Core::INVALID_REVNUM);
 650
 651=head1 DESCRIPTION
 652
 653This is a wrapper around the L<SVN::Ra> module for use by B<git-svn>.
 654It fills in some default parameters (such as the authentication
 655scheme), smooths over incompatibilities between libsvn versions, adds
 656caching, and implements some functions specific to B<git-svn>.
 657
 658Do not use it unless you are developing git-svn.  The interface will
 659change as git-svn evolves.
 660
 661=head1 DEPENDENCIES
 662
 663Subversion perl bindings,
 664L<Git::SVN>.
 665
 666C<Git::SVN::Ra> has not been tested using callers other than
 667B<git-svn> itself.
 668
 669=head1 SEE ALSO
 670
 671L<SVN::Ra>.
 672
 673=head1 INCOMPATIBILITIES
 674
 675None reported.
 676
 677=head1 BUGS
 678
 679None.