Changeset 284
- Timestamp:
- 01/27/2007 06:49:31 PM
- Files:
-
- trunk/script/Vss2Svn/Dumpfile.pm (modified) (5 diffs)
- trunk/script/Vss2Svn/Dumpfile/AutoProps.pm (modified) (3 diffs)
- trunk/script/Vss2Svn/Dumpfile/Node.pm (modified) (2 diffs)
- trunk/script/vss2svn.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/script/Vss2Svn/Dumpfile.pm
r280 r284 3 3 use Vss2Svn::Dumpfile::Node; 4 4 use Vss2Svn::Dumpfile::SanityChecker; 5 use Vss2Svn::Dumpfile::AutoProps; 6 5 7 require Time::Local; 6 8 … … 33 35 ############################################################################### 34 36 sub new { 35 my($class, $fh ) = @_;37 my($class, $fh, $autoprops) = @_; 36 38 37 39 my $self = … … 43 45 version_cache => [], 44 46 repository => Vss2Svn::Dumpfile::SanityChecker->new(), 47 auto_props => $autoprops, 45 48 }; 46 49 … … 202 205 my $node = Vss2Svn::Dumpfile::Node->new(); 203 206 $node->set_initial_props($itempath, $data); 207 if (defined $self->{auto_props}) { 208 $node->add_props ($self->{auto_props}->get_props ($itempath)); 209 } 210 204 211 $node->{action} = 'add'; 205 212 … … 725 732 foreach my $prop (@$props) { 726 733 ($key, $value) = @$prop; 727 $propout .= 'K ' . length($key) . "\n$key\nV " . length($value) 728 . "\n$value\n"; 734 $propout .= 'K ' . length($key) . "\n$key\n"; 735 if (defined $value) { 736 $propout .= 'V ' . length($value) . "\n$value\n"; 737 } 738 else { 739 $propout .= "V 0\n\n"; 740 } 729 741 } 730 742 trunk/script/Vss2Svn/Dumpfile/AutoProps.pm
r281 r284 4 4 use strict; 5 5 use Config::Ini; 6 use Text::Glob; 6 7 7 8 ############################################################################### … … 19 20 if (defined $enabled && $enabled eq "yes") 20 21 { 21 my ($autoprops)= $self->{config}->get (['auto-props']);22 $self->{autoprops} = $self->{config}->get (['auto-props']); 22 23 } 23 24 … … 27 28 } # End new 28 29 30 ############################################################################### 31 # get_props 32 ############################################################################### 33 sub get_props { 34 my($self, $path) = @_; 29 35 36 my (@newprops); 37 38 $path =~ s:^/::; 39 my @subdirs = split '/', $path; 40 my $item = pop(@subdirs); 41 42 my ($glob, $autoprops); 43 while (($glob, $autoprops) = each %{ $self->{autoprops} }) { 44 print $glob, $item, "\n"; 45 if (Text::Glob::match_glob($glob, $item)) { 46 foreach my $autoprop (@$autoprops) 47 { 48 my @props = split ';', $autoprop; 49 foreach my $prop (@props) 50 { 51 my @keyvalue = split '=', $prop; 52 push @newprops, [@keyvalue]; 53 } 54 } 55 } 56 } 57 58 return @newprops; 59 } 30 60 31 61 trunk/script/Vss2Svn/Dumpfile/Node.pm
r164 r284 31 31 copyrev => undef, 32 32 copypath => undef, 33 props => [],33 props => undef, 34 34 hideprops => 0, 35 35 text => undef, … … 65 65 66 66 ############################################################################### 67 # add_props 68 ############################################################################### 69 sub add_props { 70 my($self, @props) = @_; 71 push @{ $self->{props} }, @props; 72 } # End add_props 73 74 ############################################################################### 67 75 # get_headers 68 76 ############################################################################### trunk/script/vss2svn.pl
r279 r284 834 834 $action_sth = $gCfg{dbh}->prepare($sql); 835 835 836 my $dumpfile = Vss2Svn::Dumpfile->new($fh); 836 my $autoprops = Vss2Svn::Dumpfile::AutoProps->new() if $gCfg{auto_props}; 837 my $dumpfile = Vss2Svn::Dumpfile->new($fh, $autoprops); 837 838 838 839 REVISION: … … 1122 1123 $rv = 0; 1123 1124 } elsif ($?) { 1124 &ThrowWarning(sprintf "FAILED with non-zero exit status %d ", $? >> 8);1125 &ThrowWarning(sprintf "FAILED with non-zero exit status %d (cmd: %s)", $? >> 8, $cmd); 1125 1126 die unless $allowfail; 1126 1127 … … 1577 1578 sub Initialize { 1578 1579 GetOptions(\%gCfg,'vssdir=s','tempdir=s','dumpfile=s','resume','verbose', 1579 'debug','timing+','task=s','revtimerange=i','ssphys=s','encoding=s','trunkdir=s'); 1580 'debug','timing+','task=s','revtimerange=i','ssphys=s','encoding=s', 1581 'trunkdir=s', 'auto_props=s'); 1580 1582 1581 1583 &GiveHelp("Must specify --vssdir") if !defined($gCfg{vssdir}); … … 1726 1728 --trunkdir : Specify where to map the VSS Project Root in the 1727 1729 converted repository (default = "/") 1730 --auto_props : Specify an autoprops ini file to use, e.g. 1731 --auto_props="c:/Dokumente und Einstellungen/user/Anwendungsdaten/Subversion/config" 1728 1732 EOTXT 1729 1733
