Changeset 297
- Timestamp:
- 02/10/2007 01:52:27 PM
- Files:
-
- trunk/script/Vss2Svn/Dumpfile.pm (modified) (4 diffs)
- trunk/script/Vss2Svn/Dumpfile/AutoProps.pm (modified) (4 diffs)
- trunk/script/Vss2Svn/Dumpfile/Node.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/script/Vss2Svn/Dumpfile.pm
r292 r297 82 82 @{ $data }{qw(revision_id author timestamp comment)}; 83 83 84 my $props = [];84 my $props = undef; 85 85 my $fh = $self->{fh}; 86 86 … … 91 91 92 92 if ($revision > 0) { 93 push @$props, ['svn:log', $comment]; 94 push @$props, ['svn:author', $author]; 95 } 96 97 push @$props, ['svn:date', $self->svn_timestamp($timestamp)]; 93 $props = { 'svn:log' => $comment, 94 'svn:author' => $author, 95 }; 96 } 97 98 $props->{'svn:date'} = $self->svn_timestamp($timestamp); 98 99 99 100 $self->output_content($props); … … 205 206 my $node = Vss2Svn::Dumpfile::Node->new(); 206 207 $node->set_initial_props($itempath, $data); 208 if ($data->{is_binary}) { 209 $node->add_prop('svn:mime-type', 'application/octet-stream'); 210 } 207 211 if (defined $self->{auto_props}) { 208 212 $node->add_props ($self->{auto_props}->get_props ($itempath)); 209 213 } 210 214 211 215 $node->{action} = 'add'; 212 216 … … 728 732 my($propout, $textout) = ('') x 2; 729 733 730 my($key, $value);731 732 734 if (defined($props)) { 733 foreach my $ prop (@$props) {734 ($key, $value) = @$prop;735 foreach my $key (keys %$props) { 736 my $value = $props->{$key}; 735 737 $propout .= 'K ' . length($key) . "\n$key\n"; 736 738 if (defined $value) { trunk/script/Vss2Svn/Dumpfile/AutoProps.pm
r284 r297 34 34 my($self, $path) = @_; 35 35 36 my ( @newprops);36 my (%newprops); 37 37 38 38 $path =~ s:^/::; … … 42 42 my ($glob, $autoprops); 43 43 while (($glob, $autoprops) = each %{ $self->{autoprops} }) { 44 print $glob, $item, "\n";44 # print $glob, $item, "\n"; 45 45 if (Text::Glob::match_glob($glob, $item)) { 46 46 foreach my $autoprop (@$autoprops) … … 49 49 foreach my $prop (@props) 50 50 { 51 my @keyvalue= split '=', $prop;52 push @newprops, [@keyvalue];51 my ($key, $value) = split '=', $prop; 52 $newprops{$key} = $value; 53 53 } 54 54 } … … 56 56 } 57 57 58 return @newprops;58 return %newprops; 59 59 } 60 60 trunk/script/Vss2Svn/Dumpfile/Node.pm
r284 r297 50 50 $self->{path} = $itempath; 51 51 52 if ($data->{is_binary}) {53 $self->add_prop('svn:mime-type', 'application/octet-stream');54 }52 # if ($data->{is_binary}) { 53 # $self->add_prop('svn:mime-type', 'application/octet-stream'); 54 # } 55 55 56 56 } # End set_initial_props … … 61 61 sub add_prop { 62 62 my($self, $key, $value) = @_; 63 push @{ $self->{props} }, [$key, $value];63 $self->{props}->{$key} = $value; 64 64 } # End add_prop 65 65 … … 68 68 ############################################################################### 69 69 sub add_props { 70 my($self, @props) = @_; 71 push @{ $self->{props} }, @props; 70 my($self, %props) = @_; 71 foreach my $prop (keys %props) { 72 $self->{props}->{$prop} = $props{$prop}; 73 } 72 74 } # End add_props 73 75
