From: Thomas Rast
Date: Wed, 25 Dec 2013 16:31:59 GMT
Subject: Re: Fwd: Error with git-svn pushing a rename
Message-ID: <87ha9wdh8g.fsf@linux-1gf2.Speedport_W723_V_Typ_A_1_00_098>
In-Reply-To: <1387919476-27921-1-git-send-email-rkagan@mail.ru>
Roman Kagan writes:
> --- a/perl/Git/SVN/Editor.pm
> +++ b/perl/Git/SVN/Editor.pm
> @@ -304,8 +304,9 @@ sub C {
> my ($self, $m, $deletions) = @_;
> my ($dir, $file) = split_path($m->{file_b});
> my $pbat = $self->ensure_path($dir, $deletions);
> + my $upa = $self->url_path($m->{file_a});
> my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
> - $self->url_path($m->{file_a}), $self->{r});
> + $upa, $self->{r});
> print "\tC\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
> $self->chg_file($fbat, $m);
> $self->close_file($fbat,undef,$self->{pool});
> @@ -323,8 +324,9 @@ sub R {
> my ($self, $m, $deletions) = @_;
> my ($dir, $file) = split_path($m->{file_b});
> my $pbat = $self->ensure_path($dir, $deletions);
> + my $upa = $self->url_path($m->{file_a});
> my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
> - $self->url_path($m->{file_a}), $self->{r});
> + $upa, $self->{r});
> print "\tR\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
> $self->apply_autoprops($file, $fbat);
> $self->chg_file($fbat, $m);
>
>
> What it does is store the value to be passed to add_file() in a local
> variable, and rely on perl to keep it alive through the end of function
> scope, beyond the call to close_file() where it's actually used.
>
> I'm going to submit a patch adding apr_pstrdup() to subversion folks.
> Meanwhile if people find the above workarond a sensible thing to do in
> git, I can submit a properly formed patch here too.
If you go this way, please add a comment that explains why we need the
local variable.
--
Thomas Rast
tr@thomasrast.ch