summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3dfab99)
raw | patch | inline | side by side (parent: 3dfab99)
author | Sam Vilain <sam@vilain.net> | |
Sat, 30 Jun 2007 08:56:14 +0000 (20:56 +1200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 1 Jul 2007 06:36:32 +0000 (23:36 -0700) |
Cache the maximum revision for each rev_db URL rather than looking it
up each time. This saves a lot of time when rebuilding indexes on a
freshly cloned repository.
Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
up each time. This saves a lot of time when rebuilding indexes on a
freshly cloned repository.
Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index d111dc1442096a30431731b45aa0666604f07921..d5088eab9cacccb9bef2bd26acc65365ebe2f785 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
my ($head, $refs) = @_;
my ($fh, $ctx) = command_output_pipe('log', $head);
my $hash;
+ my %max;
while (<$fh>) {
if ( m{^commit ($::sha1)$} ) {
unshift @$refs, $hash if $hash and $refs;
next unless s{^\s*(git-svn-id:)}{$1};
my ($url, $rev, $uuid) = extract_metadata($_);
if (defined $url && defined $rev) {
+ next if $max{$url} and $max{$url} < $rev;
if (my $gs = Git::SVN->find_by_url($url)) {
my $c = $gs->rev_db_get($rev);
if ($c && $c eq $hash) {
close $fh; # break the pipe
return ($url, $rev, $uuid, $gs);
+ } else {
+ $max{$url} ||= $gs->rev_db_max;
}
}
}