Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
svnimport: Convert executable flag
author
Karl Hasselström
<kha@treskal.com>
Sun, 26 Feb 2006 05:11:27 +0000
(06:11 +0100)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 27 Feb 2006 05:34:42 +0000
(21:34 -0800)
Convert the svn:executable property to file mode 755 when converting
an SVN repository to GIT.
Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-svnimport.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
525c0d7
)
diff --git
a/git-svnimport.perl
b/git-svnimport.perl
index ee2940f4803955f2746baf3c78f64a67b4790cab..6603b96d622e8635f3e565ca7103150bbb15e33c 100755
(executable)
--- a/
git-svnimport.perl
+++ b/
git-svnimport.perl
@@
-112,16
+112,22
@@
sub file {
DIR => File::Spec->tmpdir(), UNLINK => 1);
print "... $rev $path ...\n" if $opt_v;
DIR => File::Spec->tmpdir(), UNLINK => 1);
print "... $rev $path ...\n" if $opt_v;
- my
$pool = SVN::Pool->new(
);
- eval {
$self->{'svn'}->get_file($path,$rev,$fh,$pool); };
-
$pool->clear
;
+ my
(undef, $properties
);
+ eval {
(undef, $properties)
+
= $self->{'svn'}->get_file($path,$rev,$fh); }
;
if($@) {
return undef if $@ =~ /Attempted to get checksum/;
die $@;
}
if($@) {
return undef if $@ =~ /Attempted to get checksum/;
die $@;
}
+ my $mode;
+ if (exists $properties->{'svn:executable'}) {
+ $mode = '0755';
+ } else {
+ $mode = '0644';
+ }
close ($fh);
close ($fh);
- return
$name
;
+ return
($name, $mode)
;
}
package main;
}
package main;
@@
-296,7
+302,7
@@
($$$)
my $svnpath = revert_split_path($branch,$path);
# now get it
my $svnpath = revert_split_path($branch,$path);
# now get it
- my
$name
;
+ my
($name,$mode)
;
if($opt_d) {
my($req,$res);
if($opt_d) {
my($req,$res);
@@
-316,8
+322,9
@@
($$$)
return undef if $res->code == 301; # directory?
die $res->status_line." at $url\n";
}
return undef if $res->code == 301; # directory?
die $res->status_line." at $url\n";
}
+ $mode = '0644'; # can't obtain mode via direct http request?
} else {
} else {
-
$name
= $svn->file("$svnpath",$rev);
+
($name,$mode)
= $svn->file("$svnpath",$rev);
return undef unless defined $name;
}
return undef unless defined $name;
}
@@
-331,7
+338,6
@@
($$$)
chomp $sha;
close $F;
unlink $name;
chomp $sha;
close $F;
unlink $name;
- my $mode = "0644"; # SV does not seem to store any file modes
return [$mode, $sha, $path];
}
return [$mode, $sha, $path];
}