[svk-commit] r2710 - trunk/lib/SVK

nobody at bestpractical.com nobody at bestpractical.com
Wed Mar 26 01:44:47 EDT 2008


Author: clkao
Date: Wed Mar 26 01:44:46 2008
New Revision: 2710

Modified:
   trunk/lib/SVK/Mirror.pm

Log:
Bring back find_local_rev cache for svk::mirror.

Modified: trunk/lib/SVK/Mirror.pm
==============================================================================
--- trunk/lib/SVK/Mirror.pm	(original)
+++ trunk/lib/SVK/Mirror.pm	Wed Mar 26 01:44:46 2008
@@ -61,7 +61,7 @@
 
 use base 'Class::Accessor::Fast';
 
-__PACKAGE__->mk_accessors(qw(depot path server_uuid source_uuid pool url _backend _locked follow_anchor_copy));
+__PACKAGE__->mk_accessors(qw(depot path server_uuid source_uuid pool url _backend _locked follow_anchor_copy _rev_cache));
 
 *repos = sub { Carp::cluck unless $_[0]->depot; shift->depot->repos };
 
@@ -347,7 +347,9 @@
 
 sub find_local_rev {
     my ($self, $changeset, $uuid) = @_;
-    $self->find_rev_from_changeset($changeset, $uuid);
+    $self->_rev_cache({}) unless $self->_rev_cache;
+    $self->_rev_cache->{$uuid || ''}{$changeset}
+        ||= $self->find_rev_from_changeset($changeset, $uuid);
 }
 
 sub find_remote_rev {


More information about the svk-commit mailing list