summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b7e5348)
raw | patch | inline | side by side (parent: b7e5348)
author | Eric Wong <normalperson@yhbt.net> | |
Sat, 17 Feb 2007 02:45:01 +0000 (18:45 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 23 Feb 2007 08:57:13 +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 571259fd098d7aa5ea280cdfb3c799f32492087c..2cc7c33381fe5394f08eb88e720e412ebe63ffb5 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
{ 'revision|r=s' => \$_revision,
'fetch-all|all' => \$_fetch_all,
%fc_opts } ],
+ clone => [ \&cmd_clone, "Initialize and fetch revisions",
+ { 'revision|r=s' => \$_revision,
+ %fc_opts, %init_opts } ],
init => [ \&cmd_init, "Initialize a repo for tracking" .
" (requires URL argument)",
\%init_opts ],
version() if $_version;
usage(1) unless defined $cmd;
load_authors() if $_authors;
-unless ($cmd =~ /^(?:init|multi-init|commit-diff)$/) {
+unless ($cmd =~ /^(?:clone|init|multi-init|commit-diff)$/) {
Git::SVN::Migration::migration_check();
}
Git::SVN::init_vars();
$ENV{GIT_DIR} = $repo_path . "/.git";
}
+sub cmd_clone {
+ my ($url, $path) = @_;
+ if (!defined $path &&
+ (defined $_trunk || defined $_branches || defined $_tags) &&
+ $url !~ m#^[a-z\+]+://#) {
+ $path = $url;
+ }
+ warn "--path: $path\n" if defined $path;
+ $path = basename($url) if !defined $path || !length $path;
+ warn "++path: $path\n" if defined $path;
+ mkpath([$path]);
+ chdir $path or die "Couldn't chdir to $path\n";
+ cmd_init(@_);
+ Git::SVN::fetch_all($Git::SVN::default_repo_id);
+}
+
sub cmd_init {
if (defined $_trunk || defined $_branches || defined $_tags) {
return cmd_multi_init(@_);