Subject: | [Patch?] Spurious \n in merged pages |
When you check out a page, and then append to the page on the wiki, and check out again
(without changes to local page), local/remote pages are shown as conflicting.
This seems to be a problem with Client.pm appending a spurious blank line.
sub _merge {
my ($self, $filename, $ref, $server, $local) = @_;
my $control = {
in => $\,
out => $/,
chomp => 1
};
$ref = VCS::Lite->new('ref', "\n", "$ref\n");
$server = VCS::Lite->new('server', "\n", "$server\n");
$local = VCS::Lite->new('local', "\n", "$local\n");
my $merge = $ref->merge($server, $local);
return scalar $merge->text();
}
In the above code, a "\n" is added to the $server and the $local
file. This causes the merged file to have an extra blank line, even
if server and local are identical. I assume the "\n" was added for a good reason,
(probably to do with merging the last line).
One solution might be to remove the "\n" from the end. Replace
return scalar $merge->text();
with
my $output = scalar $merge->text();
$output =~ s/\n$//s;
return $output;
This fixes the above problem, but it have other side effects.