Changeset 329

Show
Ignore:
Timestamp:
10/30/2007 05:32:07 PM
Author:
ldavis
Message:

Now matches auto-props in a case-insensitive manner (see subversion issue 2036 and comments for revision 25124). It was easiest to do this by storing the auto-props in a list and precompiling the regex.

Files:

Legend:

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

    r327 r329  
    1212    my($class, $conf) = @_; 
    1313 
    14     my $self = 
    15         { 
    16          config => new Config::Ini( $conf, -commentdelim => "#" ), 
    17         }; 
     14    my $config = new Config::Ini( $conf, -commentdelim => "#" ); 
    1815 
    19     my ($enabled) = $self->{config}->get (['miscellany', 'enable-auto-props']); 
     16    my $self = (); 
     17    $self->{entries} = (); 
     18 
     19    my ($enabled) = $config->get (['miscellany', 'enable-auto-props']); 
    2020    if (defined $enabled && $enabled eq "yes") 
    2121    { 
    22         $self->{autoprops} = $self->{config}->get (['auto-props']); 
     22        my $autoprops_list = $config->get (['auto-props']); 
     23 
     24        # see http://subversion.tigris.org/servlets/ReadMsg?list=svn&msgNo=29642 
     25        # matches are performed in a case-insensitive manner 
     26 
     27        my ($glob, $autoprops); 
     28        while (($glob, $autoprops) = each %{ $autoprops_list }) { 
     29            my $entry = (); 
     30            my $regex = Text::Glob::glob_to_regex_string($glob); 
     31            $entry->{glob} = qr/$regex/i; 
     32            $entry->{props} = $autoprops; 
     33            push @{$self->{entries}}, $entry;  
     34        } 
    2335    } 
    2436    
     
    4052    my $item = pop(@subdirs); 
    4153 
    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) 
     54    foreach my $entry (@{$self->{entries}}) { 
     55        if ($item =~ /$entry->{glob}/) { 
     56            foreach my $autoprop (@{$entry->{props}}) 
    4757            { 
    4858                my @props = split ';', $autoprop; 

PumaCode.org recommends CVSDude for fast, professional Subversion and Trac hosting:

CVSDude.com

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