From ca5e880ec2172f33dd0113129775f6eb65f2f678 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Wed, 3 Jun 2009 20:45:51 -0700 Subject: [PATCH] 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 --- git-svn.perl | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.30.2