Changeset 318

Show
Ignore:
Timestamp:
07/09/2007 04:07:13 PM
Author:
luedi
Message:

fixed

  • #57: detect recursive share activities with comments
  • #58: detect recursive share activities with shared items
Files:

Legend:

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

    r248 r318  
    4646    $self->{author} = undef; 
    4747    $self->{comment} = undef; 
     48    $self->{lastcommentaction} = undef; 
    4849    $self->{seen} = {}; 
     50    $self->{last_action} = {}; 
    4951 
    5052}  #  End _init 
     
    5860    my($physname, $itemtype, $actiontype, $timestamp, $author, $comment) = 
    5961        @{ $data }{qw( physname itemtype actiontype timestamp author comment )}; 
    60     my($prevtimestamp, $prevauthor, $prevcomment) = 
    61         @{ $self }{qw( timestamp author comment )}; 
     62    my($prevtimestamp, $prevauthor, $prevcomment, $prevaction) = 
     63        @{ $self }{qw( timestamp author comment actiontype)}; 
    6264 
    6365    # Any of the following cause a new SVN revision: 
     
    6870 
    6971    my $wasseen = $self->{seen}->{$physname}; 
     72    my $last_action = $self->{last_action}->{$physname}; 
    7073 
    71  
     74    # in case the current action is the same as the last action 
     75    if ($actiontype eq 'SHARE' && $wasseen && $last_action eq $actiontype) { 
     76        $wasseen = 0; 
     77    } 
     78     
     79    # if an add is followed by a share we omit the check for the comment. In most 
     80    # cases this is a bulk share started with a project. But the comment is 
     81    # only recorded for the project ADDs and not for the files SHARES 
     82    if ($actiontype eq 'SHARE' && !defined $comment 
     83        && defined $self->{lastcommentaction} 
     84        && $self->{lastcommentaction} eq 'ADD') { 
     85        $comment = $prevcomment; 
     86    } 
     87    else { 
     88        $self->{lastcommentaction} = $actiontype; 
     89    } 
     90     
    7291    no warnings 'uninitialized'; 
    7392    if(($author ne $prevauthor) || ($comment ne $prevcomment) || $wasseen || 
     
    91110     
    92111    $self->{seen}->{$physname}++; 
     112    $self->{last_action}->{$physname} = $actiontype;; 
    93113 
    94     @{ $self }{qw( timestamp author comment)} = 
    95         ($timestamp, $author, $comment); 
     114    @{ $self }{qw( timestamp author comment actiontype)} = 
     115        ($timestamp, $author, $comment, $actiontype); 
    96116 
    97117}  #  End check 
     
    106126    $self->{revnum} = $self->{svncache}->{pkey}; 
    107127    $self->{seen} = {}; 
     128    $self->{last_action} = {}; 
    108129    $self->{commitPending} = undef; 
    109130 

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.