%# Never underestimate the bandwidth of a station wagon full of tapes. %# -- Dr. Warren Jackson, Director, UTCS <%PERL> my $basepath = $m->fetch_comp("/Foundry/Project/Source/index.html")->source_dir; require lib; lib->import("$basepath/lib"); require SVN::Web; require File::Spec; my $tmpdir = File::Spec->tmpdir . '/svn'; mkdir $tmpdir unless -d $tmpdir; my $config = { reposparent => "$RT::VarPath/Foundry/svn", tmpdir => $tmpdir, templatedir => "$basepath/template", map ( "\L$_\E_class" => "SVN::Web::$_" ), qw(Branch Branch Checkout Diff Log Revision RSS Template) }; my (undef, $repos, $action, $path) = split ('/', ($r->path_info), 4); $repos ||= $QueueObj->OriginObj->CustomFieldValue('UnixName'); $action ||= 'browse'; $path ||= ''; for (1 .. 3) { eval { SVN::Web::run({ repos => $repos, action => $action, path => '/'.$path, cgi => $r, ($action eq 'checkout') ? ( out => sub { $r->print(@_); $m->flush_buffer; }, header_out => sub { my %args = @_; $m->clear_buffer; $r->content_type($args{'-type'}); }, ) : ( out => sub { $m->print(@_); }, header_out => sub { 1 }, ), tmpdir => $config->{tmpdir}, params => \%ARGS, script => "${RT::WebURL}Foundry/Project/Source/index.html", }, $config) }; print "$@"; last unless $@; sleep 1; } $m->abort if $action eq 'checkout'; <%ATTR> AutoFlush => 0 <%ARGS> $QueueObj