Browse Source

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>
maint
Ben Jackson 16 years ago committed by Eric Wong
parent
commit
ca5e880ec2
  1. 2
      git-svn.perl

2
git-svn.perl

@ -3171,6 +3171,8 @@ sub find_rev_before { @@ -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);

Loading…
Cancel
Save