Changeset 296

Show
Ignore:
Timestamp:
02/10/2007 01:46:16 PM
Author:
luedi
Message:

When building a valid path, we first check for non-deleted contexts, even though these item pathes are valid. A deleted context means, that an item existed in this context in a specific version, but was later deleted from that context. So it is normally not possible to perform any further action on this item. Therefore we prefer non-deleted contexts.

Files:

Legend:

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

    r295 r296  
    11121112#  _get_valid_path 
    11131113# This function returns an itempath for the physical file, that was valid in 
    1114 # the previous version. Since all activities that create a new version of a file 
    1115 # must be done on at least one active path, there should be at least one valid 
    1116 # item path for the version. 
     1114# the previous version. Since all activities that create new versions of a file 
     1115# must be done on an active path, there should be at least one valid item path 
     1116# for the version. 
    11171117# If we can't find any valid itempath, we can not perform a "copy from" revision 
    11181118# In this case, we need to recheckin the current content of the item 
     
    11201120sub _get_valid_path { 
    11211121    my($self, $physname, $parentphys, $version) = @_; 
     1122     
     1123    # 1.) We first check for non-deleted contexts, even though these item pathes  
     1124    #     are valid. A deleted context means, that an item existed in this context  
     1125    #     in a specific version, but was later deleted from that context. So it is 
     1126    #     normally not possible to perform any further action on this item. Therefore 
     1127    #     we prefer non-deleted contexts. 
     1128    my $path = $self->_get_valid_path2 ($physname, $parentphys, $version, 0); 
     1129    return $path if defined $path; 
     1130 
     1131    # 2.) now we also check for deleted contexts 
     1132    $path = $self->_get_valid_path2 ($physname, $parentphys, $version, 1); 
     1133    return $path; 
     1134} # End _get_valid_path 
     1135 
     1136############################################################################### 
     1137#  _get_valid_path2 
     1138# This function is an internal helper: It will check for active and inactive, 
     1139# but valid item pathes, depending on the $deleted flag, see also _get_valid_path 
     1140############################################################################### 
     1141sub _get_valid_path2 { 
     1142    my($self, $physname, $parentphys, $version, $deleted) = @_; 
    11221143 
    11231144    my $physinfo = $gPhysInfo{$physname}; 
     
    11311152     
    11321153    # 1. check the parent requested, if there was an item name for this version 
    1133     # we can use this item name, since it was valid in that time 
     1154    #    we can use this item name, since it was valid in that time 
    11341155    my $parent = $physinfo->{parents}->{$parentphys}; 
    11351156    if (defined $parent && 
    1136 #        $parentphys ne '99999999' && 
     1157        (!defined $parent->{deleted} || $deleted == 1) && 
    11371158        $parent->{versions}->[$version]) { 
    11381159        return $parent->{versions}->[$version]; 
     
    11471168        $parent = $physinfo->{parents}->{$parentphys}; 
    11481169        if (defined $parent && 
    1149 #            $parentphys ne '99999999' && 
     1170            (!defined $parent->{deleted} || $deleted == 1) && 
    11501171            $parent->{versions}->[$version]) { 
    11511172            return $parent->{versions}->[$version]; 
     
    11541175     
    11551176    return undef; 
    1156 }  #  End _get_valid_path 
     1177}  #  End _get_valid_path2 
    11571178 
    11581179############################################################################### 

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.