summaryrefslogtreecommitdiff
path: root/git-svnimport.perl
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2006-04-17 06:58:39 -0400
committerJunio C Hamano <junkio@cox.net>2006-04-18 02:26:52 -0700
commit08ddd4f7649ccf8b9f61c903de420bfd0a8a602e (patch)
tree3d5568aa165e9896c392b32c3eb9d6dc64d85ed8 /git-svnimport.perl
parent2855d58079cd56361879cc03f7c769409bb445e5 (diff)
downloadgit-08ddd4f7649ccf8b9f61c903de420bfd0a8a602e.tar.gz
git-svnimport symlink support
added svn:special symlink support for access methods other than direct-http Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org> Acked-by: Matthias Urlichs <smurf@smurf.noris.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-svnimport.perl')
-rwxr-xr-xgit-svnimport.perl18
1 files changed, 16 insertions, 2 deletions
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 4d5371ca90..60ed7ae3ee 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -98,6 +98,7 @@ package SVNconn;
use File::Spec;
use File::Temp qw(tempfile);
use POSIX qw(strftime dup2);
+use Fcntl qw(SEEK_SET);
sub new {
my($what,$repo) = @_;
@@ -143,9 +144,22 @@ sub file {
}
my $mode;
if (exists $properties->{'svn:executable'}) {
- $mode = '0755';
+ $mode = '100755';
+ } elsif (exists $properties->{'svn:special'}) {
+ my ($special_content, $filesize);
+ $filesize = tell $fh;
+ seek $fh, 0, SEEK_SET;
+ read $fh, $special_content, $filesize;
+ if ($special_content =~ s/^link //) {
+ $mode = '120000';
+ seek $fh, 0, SEEK_SET;
+ truncate $fh, 0;
+ print $fh $special_content;
+ } else {
+ die "unexpected svn:special file encountered";
+ }
} else {
- $mode = '0644';
+ $mode = '100644';
}
close ($fh);