threads / patch / 16284

patchgit-svn: Update git-svn to use the ability to place temporary files within repository directory

Subject: [PATCH] git-svn: Update git-svn to use the ability to place temporary files within repository directory

## tl;dr

3 messages between Nov 12, 2008 and Nov 13, 2008. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Marten Svanfeldt (dev)· Nov 12, 2008, 14:33 UTC · lore

This fixes git-svn within msys where Perl will provide temporary files with path such as /tmp while the git suit expects native Windows paths.

Signed-off-by: Marten Svanfeldt <developer@svanfeldt.com>
---
 git-svn.perl |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
Show changes to git-svn.perl +5 −4
diff --git a/git-svn.perl b/git-svn.perl
index ef6d773..f09f981 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3312,11 +3312,11 @@ sub change_file_prop {

 sub apply_textdelta {
 	my ($self, $fb, $exp) = @_;
-	my $fh = Git::temp_acquire('svn_delta');
+	my $fh = $_repository->temp_acquire('svn_delta');
 	# $fh gets auto-closed() by SVN::TxDelta::apply(),
 	# (but $base does not,) so dup() it for reading in close_file
 	open my $dup, '<&', $fh or croak $!;
-	my $base = Git::temp_acquire('git_blob');
+	my $base = $_repository->temp_acquire('git_blob');
 	if ($fb->{blob}) {
 		print $base 'link ' if ($fb->{mode_a} == 120000);
 		my $size = $::_repository->cat_blob($fb->{blob}, $base);
@@ -3357,7 +3357,8 @@ sub close_file {
 				warn "$path has mode 120000",
 						" but is not a link\n";
 			} else {
-				my $tmp_fh = Git::temp_acquire('svn_hash');
+				my $tmp_fh = $_repository->temp_acquire(
+					'svn_hash');
 				my $res;
 				while ($res = sysread($fh, my $str, 1024)) {
 					my $out = syswrite($tmp_fh, $str, $res);
@@ -3745,7 +3746,7 @@ sub change_file_prop {

 sub _chg_file_get_blob ($$$$) {
 	my ($self, $fbat, $m, $which) = @_;
-	my $fh = Git::temp_acquire("git_blob_$which");
+	my $fh = $_repository->temp_acquire("git_blob_$which");
 	if ($m->{"mode_$which"} =~ /^120/) {
 		print $fh 'link ' or croak $!;
 		$self->change_file_prop($fbat,'svn:special','*');
-- 
1.6.0.3.1437.g6c121.dirty
Marten Svanfeldt (dev)· Nov 12, 2008, 16:38 UTC · re: Marten Svanfeldt (dev) · lore

[PATCH fixed] git-svn: Update git-svn to use the ability to place temporary files within repository directory

This fixes git-svn within msys where Perl will provide temporary files with path such as /tmp while the git suit expects native Windows paths.

Signed-off-by: Marten Svanfeldt <developer@svanfeldt.com>
---
Somehow I managed to screw up the last patch when getting it ready for
submission. This patch is a fixed version that actually works.
 git-svn.perl |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
Show changes to git-svn.perl +5 −4
diff --git a/git-svn.perl b/git-svn.perl
index ef6d773..23ceaff 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3312,11 +3312,11 @@ sub change_file_prop {

 sub apply_textdelta {
 	my ($self, $fb, $exp) = @_;
-	my $fh = Git::temp_acquire('svn_delta');
+	my $fh = $::_repository->temp_acquire('svn_delta');
 	# $fh gets auto-closed() by SVN::TxDelta::apply(),
 	# (but $base does not,) so dup() it for reading in close_file
 	open my $dup, '<&', $fh or croak $!;
-	my $base = Git::temp_acquire('git_blob');
+	my $base = $::_repository->temp_acquire('git_blob');
 	if ($fb->{blob}) {
 		print $base 'link ' if ($fb->{mode_a} == 120000);
 		my $size = $::_repository->cat_blob($fb->{blob}, $base);
@@ -3357,7 +3357,8 @@ sub close_file {
 				warn "$path has mode 120000",
 						" but is not a link\n";
 			} else {
-				my $tmp_fh = Git::temp_acquire('svn_hash');
+				my $tmp_fh = $::_repository->temp_acquire(
+					'svn_hash');
 				my $res;
 				while ($res = sysread($fh, my $str, 1024)) {
 					my $out = syswrite($tmp_fh, $str, $res);
@@ -3745,7 +3746,7 @@ sub change_file_prop {

 sub _chg_file_get_blob ($$$$) {
 	my ($self, $fbat, $m, $which) = @_;
-	my $fh = Git::temp_acquire("git_blob_$which");
+	my $fh = $::_repository->temp_acquire("git_blob_$which");
 	if ($m->{"mode_$which"} =~ /^120/) {
 		print $fh 'link ' or croak $!;
 		$self->change_file_prop($fbat,'svn:special','*');
-- 
1.6.0.3.1439.gc9385a
Eric Wong· Nov 13, 2008, 09:41 UTC · re: Marten Svanfeldt (dev) · lore

Re: [PATCH] git-svn: Update git-svn to use the ability to place temporary files within repository directory

"Marten Svanfeldt (dev)" <developer@svanfeldt.com> wrote:
> This fixes git-svn within msys where Perl will provide temporary files
> with path such as /tmp while the git suit expects native Windows paths.

Ah, I completely didn't understand the related Git.pm patch from you until I saw this sentence above.

Can you update that other patch and clarify this statement so it makes sense to UNIX-only folks?

 | This fixes issues when the Perl in use uses a different format for paths
 | than in use by native code in the git tools such as msysgit with msys-perl.
Thanks,
-- 
Eric Wong

← back to recent threads