summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorFlorian Weimer <fw@deneb.enyo.de>2008-08-31 17:47:09 +0200
committerEric Wong <normalperson@yhbt.net>2008-09-05 16:58:38 -0700
commit8598db935b653c638109aecab3e345c45d53af07 (patch)
tree952b3edbce9cc0eb56dfb0567eb006d8de7d9a1f /git-svn.perl
parent214a34d22ec59ec7e1166772f06ecf8799f96c96 (diff)
downloadgit-8598db935b653c638109aecab3e345c45d53af07.tar.gz
git-svn: Send deltas during commits
Signed-off-by: Florian Weimer <fw@deneb.enyo.de> Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl18
1 files changed, 13 insertions, 5 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 2c3e13f230..fdf4e4a455 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3691,12 +3691,20 @@ sub chg_file {
} elsif ($m->{mode_b} !~ /755$/ && $m->{mode_a} =~ /755$/) {
$self->change_file_prop($fbat,'svn:executable',undef);
}
- my ($fh, $exp) = _chg_file_get_blob $self, $fbat, $m, 'b';
+ my ($fh_a, $exp_a) = _chg_file_get_blob $self, $fbat, $m, 'a';
+ my ($fh_b, $exp_b) = _chg_file_get_blob $self, $fbat, $m, 'b';
my $pool = SVN::Pool->new;
- my $atd = $self->apply_textdelta($fbat, undef, $pool);
- my $got = SVN::TxDelta::send_stream($fh, @$atd, $pool);
- die "Checksum mismatch\nexpected: $exp\ngot: $got\n" if ($got ne $exp);
- Git::temp_release($fh, 1);
+ my $atd = $self->apply_textdelta($fbat, $exp_a, $pool);
+ if (-s $fh_a) {
+ my $txstream = SVN::TxDelta::new ($fh_a, $fh_b, $pool);
+ SVN::TxDelta::send_txstream($txstream, @$atd, $pool);
+ } else {
+ my $got = SVN::TxDelta::send_stream($fh_b, @$atd, $pool);
+ die "Checksum mismatch\nexpected: $exp_b\ngot: $got\n"
+ if ($got ne $exp_b);
+ }
+ Git::temp_release($fh_b, 1);
+ Git::temp_release($fh_a, 1);
$pool->clear;
}