summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0d313b2)
raw | patch | inline | side by side (parent: 0d313b2)
author | Eric Wong <normalperson@yhbt.net> | |
Fri, 5 Jan 2007 02:09:56 +0000 (18:09 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 5 Jan 2007 06:28:46 +0000 (22:28 -0800) |
Since fetch reforks itself at most every 1000 revisions, we
need to update the counter in the parent process to have a
working count if we set our repack interval to be > ~1000
revisions. multi-fetch has always done this correctly
because of an extra process; now fetch uses the extra process;
as well.
While we're at it, only compile the $sha1 regex that checks for
repacking once.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
need to update the counter in the parent process to have a
working count if we set our repack interval to be > ~1000
revisions. multi-fetch has always done this correctly
because of an extra process; now fetch uses the extra process;
as well.
While we're at it, only compile the $sha1 regex that checks for
repacking once.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index 0fc386a7158c14e93f9f3c4fa19e01603aa9b05a..537776239cd87fd6e7d8af2197cef18a4a80fe96 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
);
my %cmd = (
- fetch => [ \&fetch, "Download new revisions from SVN",
+ fetch => [ \&cmd_fetch, "Download new revisions from SVN",
{ 'revision|r=s' => \$_revision, %fc_opts } ],
init => [ \&init, "Initialize a repo for tracking" .
" (requires URL argument)",
setup_git_svn();
}
+sub cmd_fetch {
+ fetch_child_id($GIT_SVN, @_);
+}
+
sub fetch {
check_upgrade_needed();
$SVN_URL ||= file_to_s("$GIT_SVN_DIR/info/url");
my $ref = "$GIT_DIR/refs/remotes/$id";
defined(my $pid = open my $fh, '-|') or croak $!;
if (!$pid) {
- $_repack = undef;
$GIT_SVN = $ENV{GIT_SVN_ID} = $id;
init_vars();
fetch(@_);
}
while (<$fh>) {
print $_;
- check_repack() if (/^r\d+ = $sha1/);
+ check_repack() if (/^r\d+ = $sha1/o);
}
close $fh or croak $?;
}
# this output is read via pipe, do not change:
print "r$log_msg->{revision} = $commit\n";
- check_repack();
return $commit;
}