[Bps-public-commit] r14443 - Pushmi/trunk/Pushmi-Admin/lib/Pushmi

clkao at bestpractical.com clkao at bestpractical.com
Wed Jul 23 17:55:23 EDT 2008


Author: clkao
Date: Wed Jul 23 17:55:22 2008
New Revision: 14443

Modified:
   Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm

Log:
use svn::ra instead of svn::client to get latest revnum.


Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm	(original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin.pm	Wed Jul 23 17:55:22 2008
@@ -3,6 +3,8 @@
 
 package Pushmi::Admin;
 
+use SVK::Util 'str2time';
+
 sub svn_info_for {
     my $class = shift;
     my ($url) = @_;
@@ -11,25 +13,15 @@
     my $props = $memcached->get( $url );
     return $props if defined $props;
 
-    my $client = SVN::Client->new(
-        auth => [
-            SVN::Client::get_simple_provider(),
-            SVN::Client::get_username_provider(),
-        ]
-    );
+    my ($baton, $ref) = SVN::Core::auth_open_helper(undef);
+    my $ra = SVN::Ra->new( url => $url, config => undef, auth => $baton);
 
     my $start = Time::HiRes::time;
     local $SIG{ALRM} = sub { die "Timeout!" };
     alarm 10;
     eval {
-        $client->info(
-            $url, undef, "HEAD",
-            sub {
-                $props->{rev}  = $_[1]->rev;
-                $props->{date} = $_[1]->last_changed_date;
-            },
-            0
-        );
+        $props->{rev} = $ra->get_latest_revnum;
+        $props->{date} = 1e6 * str2time($ra->rev_prop($props->{rev}, 'svn:date'));
     };
     warn "$@" if $@;
     alarm 0;



More information about the Bps-public-commit mailing list