Skip to content

Commit ca5e880

Browse files
bjjEric Wong
authored andcommitted
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 <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent 9a8c92a commit ca5e880

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

git-svn.perl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,6 +3171,8 @@ sub find_rev_before {
31713171
my ($self, $rev, $eq_ok, $min_rev) = @_;
31723172
--$rev unless $eq_ok;
31733173
$min_rev ||= 1;
3174+
my $max_rev = $self->rev_map_max;
3175+
$rev = $max_rev if ($rev > $max_rev);
31743176
while ($rev >= $min_rev) {
31753177
if (my $c = $self->rev_map_get($rev)) {
31763178
return ($rev, $c);

0 commit comments

Comments
 (0)