summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8d0ea31)
raw | patch | inline | side by side (parent: 8d0ea31)
author | Sven Verdoolaege <skimo@kotnet.org> | |
Sun, 3 Jul 2005 11:02:06 +0000 (13:02 +0200) | ||
committer | Sven Verdoolaege <skimo@kotnet.org> | |
Sun, 3 Jul 2005 11:02:06 +0000 (13:02 +0200) |
Documentation/git-cvsimport-script.txt | patch | blob | history | |
git-cvsimport-script | patch | blob | history |
index 23a79059f55745d11b8e9b5392f03603352f7670..4eb0f432469797809a2c25171b53a17a5be5725a 100644 (file)
-------
-d <CVSROOT>::
The root of the CVS archive. May be local (a simple path) or remote;
- currently, only the :pserver: access method is supported.
+ currently, only the :local:, :ext: and :pserver: access methods
+ are supported.
-o <branch-for-HEAD>::
The 'HEAD' branch from CVS is imported to the 'origin' branch within
diff --git a/git-cvsimport-script b/git-cvsimport-script
index c514d14c3f2988dd8d7e3fb415a085d60d05757e..cdd4963695164e8b1a88e41660148364c522a51e 100755 (executable)
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
}
$self->{'socketo'} = $s;
$self->{'socketi'} = $s;
- } else { # local: Fork off our own cvs server.
+ } else { # local or ext: Fork off our own cvs server.
my $pr = IO::Pipe->new();
my $pw = IO::Pipe->new();
my $pid = fork();
die "Fork: $!\n" unless defined $pid;
my $cvs = 'cvs';
$cvs = $ENV{CVS_SERVER} if exists $ENV{CVS_SERVER};
+ my $rsh = 'rsh';
+ $rsh = $ENV{CVS_RSH} if exists $ENV{CVS_RSH};
+
+ my @cvs = ($cvs, 'server');
+ my ($local, $user, $host);
+ $local = $repo =~ s/:local://;
+ if (!$local) {
+ $repo =~ s/:ext://;
+ $local = !($repo =~ s/^(?:([^\@:]+)\@)?([^:]+)://);
+ ($user, $host) = ($1, $2);
+ }
+ if (!$local) {
+ if ($user) {
+ unshift @cvs, $rsh, '-l', $user, $host;
+ } else {
+ unshift @cvs, $rsh, $host;
+ }
+ }
+
unless($pid) {
$pr->writer();
$pw->reader();
dup2($pr->fileno(),1);
$pr->close();
$pw->close();
- exec($cvs,"server");
+ exec(@cvs);
}
$pw->writer();
$pr->reader();