Jason Winnebeck wrote:
I have found the bug and I'm seeing if I can fix it. In output_content the
file is converted from CRLF to LF if and only if "svn:eol-style" is
defined as
native, but the property is set only when the file is added. When change
nodes
are being output, the svn:eol-style property is not emitted (I presume
because
only property changes are needed?). This leads to a lack of conversion of
these nodes. I've never worked with Perl and I've never worked with vss2svn
code but I will see if I can figure out a hack. What we need to find out
is if
the node is a "text" node. What I don't understand is why does it matter if
the eol-style is native or not? This is because I'm not sure if the content
should always be in LF on every platform, or if it is based on platform, or
based on eol-style setting. At least I know in my case it should always
be LF
in the dumpfile.
The attached patch seems to work, except for XML files in SourceSafe 2005,
which are treated as Unicode but the ssphys thinks they are binary. For that I
wrote my own hack that works for my repository only (not in this patch). I
will continue testing to make sure the history works properly. I've also
noticed that the CRLF problem affects more than just annotate, it also affects
diff and merge over the affected areas, causing conflicts when the files are
identical on "export".
Jason
Index: Vss2Svn/Dumpfile.pm
===================================================================
--- Vss2Svn/Dumpfile.pm (revision 321)
+++ Vss2Svn/Dumpfile.pm (working copy)
@@ -767,14 +767,14 @@
my $string = $node->get_headers();
print $fh $string;
$self->output_content($node->{hideprops}? undef : $node->{props},
- $node->{text}, $node->{file});
+ $node->{text}, $node->{file}, $node->{is_binary});
} # End output_node
###############################################################################
# output_content
###############################################################################
sub output_content {
- my($self, $props, $text, $file) = @_;
+ my($self, $props, $text, $file, $is_binary) = @_;
my $fh = $self->{fh};
@@ -805,9 +805,9 @@
# convert CRLF -> LF before calculating the size and compute the md5
if(!defined $text && defined $file) {
- my ($input, $output);
+ my ($input, $output);
my $style = $props->{'svn:eol-style'};
- if (defined $style && $style eq 'native') {
+ if ( defined $is_binary && !$is_binary ) {
open ($input, "<:crlf", $file);
my $tmpFile = "$gTmpDir/crlf_to_lf.tmp.txt";
open ($output, ">", $tmpFile);
Index: Vss2Svn/Dumpfile/Node.pm
===================================================================
--- Vss2Svn/Dumpfile/Node.pm (revision 321)
+++ Vss2Svn/Dumpfile/Node.pm (working copy)
@@ -34,6 +34,7 @@
hideprops => 0,
file => undef,
text => undef,
+ is_binary => undef,
};
$self = bless($self, $class);
@@ -49,11 +50,8 @@
$self->{kind} = ($data->{itemtype} == 1)? 'dir' : 'file';
$self->{path} = $itempath;
+ $self->{is_binary} = $data->{is_binary};
-# if ($data->{is_binary}) {
-# $self->add_prop('svn:mime-type', 'application/octet-stream');
-# }
-
} # End set_initial_props
###############################################################################
_______________________________________________
vss2svn-users mailing list
Project homepage:
http://www.pumacode.org/projects/vss2svn/
Subscribe/Unsubscribe/Admin:
http://lists.pumacode.org/mailman/listinfo/vss2svn-users-lists.pumacode.org
Mailing list web interface (with searchable archives):
http://dir.gmane.org/gmane.comp.version-control.subversion.vss2svn.user