Changeset 323

Show
Ignore:
Timestamp:
07/18/2007 12:19:19 PM
Author:
luedi
Message:

#51: the CRLF to LF conversion needs to be done on every commit of the file
#13: apply auto_props also on renames
#25, #53: if a specific version of an item is not recoverable the Copy patch fails to copy the missing file.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/script/Vss2Svn/Dumpfile.pm

    r319 r323  
    309309    my $node = Vss2Svn::Dumpfile::Node->new(); 
    310310    $node->set_initial_props($newpath, $data); 
     311    # change the properties according to the new name 
     312    if (defined $self->{auto_props}) { 
     313        $node->add_props ($self->{auto_props}->get_props ($newpath)); 
     314    } 
    311315    $node->{action} = 'add'; 
    312316 
     
    765769    my $fh = $self->{fh}; 
    766770 
     771    # only in an add or rename action the propery array is set. So we have 
     772    # to lookup the eol-style flag again. The best thing is to query the 
     773    # property always temporarirly 
     774    my %tmpProps = (); 
     775    if (defined $self->{auto_props}) { 
     776        %tmpProps = $self->{auto_props}->get_props ($node->{path}); 
     777    } 
     778    my $eolStyle = %tmpProps->{'svn:eol-style'}; 
     779    my $isNative = (defined $eolStyle && $eolStyle eq 'native') ? 1 : 0; 
     780 
    767781    my $string = $node->get_headers(); 
    768782    print $fh $string; 
    769783    $self->output_content($node->{hideprops}? undef : $node->{props}, 
    770                           $node->{text}, $node->{file}); 
     784                          $node->{text}, $node->{file}, $isNative); 
    771785}  #  End output_node 
    772786 
     
    775789############################################################################### 
    776790sub output_content { 
    777     my($self, $props, $text, $file) = @_; 
     791    my($self, $props, $text, $file, $isNative) = @_; 
    778792 
    779793    my $fh = $self->{fh}; 
     
    804818    $md5 = Digest::MD5->new if $self->{do_md5}; 
    805819 
     820    # prevent errors due to non existing files 
     821    if(!defined $text && defined $file && !-e $file) { 
     822        $text = ""; 
     823    } 
     824 
    806825    # convert CRLF -> LF before calculating the size and compute the md5 
    807826    if(!defined $text && defined $file) { 
    808        my ($input, $output); 
    809         my $style = $props->{'svn:eol-style'}
    810         if (defined $style && $style eq 'native') { 
     827             
     828        my ($input, $output)
     829        if (defined $isNative) { 
    811830            open ($input, "<:crlf", $file); 
    812831            my $tmpFile = "$gTmpDir/crlf_to_lf.tmp.txt"; 

These ads are automatically generated by Google based on the content of this page. Revenue from these ads helps to pay for hosting fees of this site; however, these ads do not constitute an endorsement by PumaCode.org.