summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47a0b75)
raw | patch | inline | side by side (parent: 47a0b75)
author | Eric Wong <normalperson@yhbt.net> | |
Wed, 31 Jan 2007 20:28:10 +0000 (12:28 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 23 Feb 2007 08:57:11 +0000 (00:57 -0800) |
Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index ddb038260851659c90070fb0e42ad4458e86ce2f..1fd65526d186e017640543af240dea0ccb2b421a 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
$sha1 = qr/[a-f\d]{40}/;
$sha1_short = qr/[a-f\d]{4,40}/;
my ($_stdin, $_help, $_edit,
- $_repack, $_repack_nr, $_repack_flags,
$_message, $_file,
$_template, $_shared,
$_version,
'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache );
my %fc_opts = ( 'follow-parent|follow' => \$Git::SVN::_follow_parent,
'authors-file|A=s' => \$_authors,
- 'repack:i' => \$_repack,
+ 'repack:i' => \$Git::SVN::_repack,
'no-metadata' => \$Git::SVN::_no_metadata,
'quiet|q' => \$_q,
- 'repack-flags|repack-args|repack-opts=s' => \$_repack_flags,
+ 'repack-flags|repack-args|repack-opts=s' =>
+ \$Git::SVN::_repack_flags,
%remote_opts );
my ($_trunk, $_tags, $_branches);
unless ($cmd =~ /^(?:init|multi-init|commit-diff)$/) {
Git::SVN::Migration::migration_check();
}
+Git::SVN::init_vars();
eval {
Git::SVN::verify_remotes_sanity();
$cmd{$cmd}->[0]->(@ARGV);
package Git::SVN;
use strict;
use warnings;
-use vars qw/$default_repo_id $default_ref_id $_no_metadata $_follow_parent/;
+use vars qw/$default_repo_id $default_ref_id $_no_metadata $_follow_parent
+ $_repack $_repack_flags/;
use Carp qw/croak/;
use File::Path qw/mkpath/;
use IPC::Open3;
+my $_repack_nr;
# properties that we do not log:
my %SKIP_PROP;
BEGIN {
$r;
}
+sub init_vars {
+ if (defined $_repack) {
+ $_repack = 1000 if ($_repack <= 0);
+ $_repack_nr = $_repack;
+ $_repack_flags ||= '-d';
+ }
+}
+
sub verify_remotes_sanity {
return unless -d $ENV{GIT_DIR};
my %seen;
$self->{last_rev} = $log_entry->{revision};
$self->{last_commit} = $commit;
print "r$log_entry->{revision} = $commit ($self->{ref_id})\n";
+ if (defined $_repack && (--$_repack_nr == 0)) {
+ $_repack_nr = $_repack;
+ # repack doesn't use any arguments with spaces in them, does it?
+ print "Running git repack $_repack_flags ...\n";
+ command_noisy('repack', split(/\s+/, $_repack_flags));
+ print "Done repacking\n";
+ }
return $commit;
}