aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-02-14 16:04:10 -0800
committerEric Wong <normalperson@yhbt.net>2007-02-23 00:57:12 -0800
commit6af1db447b10c03db4c04a55000efaa9aad38caa (patch)
treeb2bc48881af6be1a8477e5f994f8734e59affe98 /git-svn.perl
parentb4d57e5ea3349a6bf63c3626f6fb36bac11be3c0 (diff)
downloadgit-6af1db447b10c03db4c04a55000efaa9aad38caa.tar.gz
git-6af1db447b10c03db4c04a55000efaa9aad38caa.tar.xz
git-svn: allow --log-window-size to be specified, default to 100
The newer default value should should lower memory usage for large fetches and also help with fetching from less reliable servers. Previously the value was 1000 and memory usage got a bit high on some repositories and fetching became less reliable in some cases. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index f4573ed10..8a80f81ad 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -12,6 +12,7 @@ $VERSION = '@@GIT_VERSION@@';
$ENV{GIT_DIR} ||= '.git';
$Git::SVN::default_repo_id = 'svn';
$Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
+$Git::SVN::Ra::_log_window_size = 100;
$Git::SVN::Log::TZ = $ENV{TZ};
$ENV{TZ} = 'UTC';
@@ -65,6 +66,7 @@ my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
'repack:i' => \$Git::SVN::_repack,
'noMetadata' => \$Git::SVN::_no_metadata,
'useSvmProps' => \$Git::SVN::_use_svm_props,
+ 'log-window-size=i' => \$Git::SVN::Ra::_log_window_size,
'quiet|q' => \$_q,
'repack-flags|repack-args|repack-opts=s' =>
\$Git::SVN::_repack_flags,
@@ -2583,7 +2585,7 @@ sub apply_diff {
}
package Git::SVN::Ra;
-use vars qw/@ISA $config_dir/;
+use vars qw/@ISA $config_dir $_log_window_size/;
use strict;
use warnings;
my ($can_do_switch);
@@ -2747,7 +2749,7 @@ sub gs_do_switch {
sub gs_fetch_loop_common {
my ($self, $base, $head, $gsv, $globs) = @_;
return if ($base > $head);
- my $inc = 1000;
+ my $inc = $_log_window_size;
my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc);
my %common;
my $common_max = scalar @$gsv;
@@ -2954,6 +2956,9 @@ sub skip_unknown_revs {
# 175007 - http(s):// (this repo required authorization, too...)
# More codes may be discovered later...
if ($errno == 175007 || $errno == 175002 || $errno == 160013) {
+ warn "W: Ignoring error from SVN, path probably ",
+ "does not exist: ($errno): ",
+ $err->expanded_message,"\n";
return;
}
die "Error from SVN, ($errno): ", $err->expanded_message,"\n";