Subject: | SVN::Record with no property block emits Prop-content-length:0 header |
The following lines emit a header "Prop-content-length: 0",
even though $n->set_property has never been called and
consequently $n->has_prop returns false:
my $n = SVN::Dump::Record->new;
$n->set_header("Node-path", "trunk/fubar.txt");
$n->set_header("Node-kind", "file");
$n->set_header("Node-action", "change");
$n->set_text("some text");
print $n->as_string;
The problem here is that "svnadmin load" will interpret that as
"delete all properties from trunk/fubar.txt" whereas a true
text-only Node record would leave the file's SVN properties unchanged.
Patch attached.
Cheers, Roderich
Subject: | empty-prop-block.patch |
--- lib/SVN/Dump/Record.pm.orig 2010-12-20 09:55:22.000000000 +0100
+++ lib/SVN/Dump/Record.pm 2010-12-20 09:56:08.000000000 +0100
@@ -87,7 +87,8 @@ sub update_headers {
$self->set_header( 'Text-content-length' => $textlen )
if defined $self->get_text_block();
- $self->set_header( 'Prop-content-length', $proplen );
+ $self->set_header( 'Prop-content-length', $proplen )
+ if defined $self->get_property_block();
$self->set_header( 'Content-length' => $proplen + $textlen );
}