From: Ben Jackson Date: Thu, 4 Jun 2009 03:45:51 +0000 (-0700) Subject: git-svn: speed up find_rev_before X-Git-Tag: v1.6.4-rc0~36^2~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ca5e880ec2172f33dd0113129775f6eb65f2f678;p=git.git git-svn: speed up find_rev_before By limiting start revision of find_rev_before to max existing revision. This avoids a long wait if you do 'git svn reset -r 9999999'. The linear search within the contiguous revisions doesn't seem to be a problem. [ew: expanded commit message] Signed-off-by: Ben Jackson Acked-by: Eric Wong --- diff --git a/git-svn.perl b/git-svn.perl index da1e1f64e..f9a672d77 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -3171,6 +3171,8 @@ sub find_rev_before { my ($self, $rev, $eq_ok, $min_rev) = @_; --$rev unless $eq_ok; $min_rev ||= 1; + my $max_rev = $self->rev_map_max; + $rev = $max_rev if ($rev > $max_rev); while ($rev >= $min_rev) { if (my $c = $self->rev_map_get($rev)) { return ($rev, $c);