@matheusbsbs / matheus-bagliano / commits / ca5e880ec2
Fork 0

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 <ben@ben.com> Acked-by: Eric Wong <normalperson@yhbt.net>

Ben Jackson committed Jun 3, 2009 at 20:45 UTC ca5e880ec2172f33dd0113129775f6eb65f2f678
1 file changed +2
git-svn.perl
+2
@@ -3171,6 +3171,8 @@ sub find_rev_before {
3171 my ($self, $rev, $eq_ok, $min_rev) = @_;
3172 --$rev unless $eq_ok;
3173 $min_rev ||= 1;
3174 + my $max_rev = $self->rev_map_max;
3175 + $rev = $max_rev if ($rev > $max_rev);
3176 while ($rev >= $min_rev) {
3177 if (my $c = $self->rev_map_get($rev)) {
3178 return ($rev, $c);