summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Jackson <ben@ben.com>2009-06-03 20:45:51 -0700
committerEric Wong <normalperson@yhbt.net>2009-06-25 00:38:16 -0700
commitca5e880ec2172f33dd0113129775f6eb65f2f678 (patch)
tree00c97849c44dd48e03169306e2ff0dfe4d9f71fe
parent9a8c92ac9e4698da150a413ce80f185005447f4c (diff)
downloadgit-ca5e880ec2172f33dd0113129775f6eb65f2f678.tar.gz
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>
-rwxr-xr-xgit-svn.perl2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-svn.perl b/git-svn.perl
index da1e1f64e9..f9a672d772 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);