Changeset 296
- Timestamp:
- 02/10/2007 01:46:16 PM
- Files:
-
- trunk/script/Vss2Svn/ActionHandler.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/script/Vss2Svn/ActionHandler.pm
r295 r296 1112 1112 # _get_valid_path 1113 1113 # This function returns an itempath for the physical file, that was valid in 1114 # the previous version. Since all activities that create a new versionof a file1115 # must be done on a t least one active path, there should be at least one valid1116 # item pathfor 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. 1117 1117 # If we can't find any valid itempath, we can not perform a "copy from" revision 1118 1118 # In this case, we need to recheckin the current content of the item … … 1120 1120 sub _get_valid_path { 1121 1121 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 ############################################################################### 1141 sub _get_valid_path2 { 1142 my($self, $physname, $parentphys, $version, $deleted) = @_; 1122 1143 1123 1144 my $physinfo = $gPhysInfo{$physname}; … … 1131 1152 1132 1153 # 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 time1154 # we can use this item name, since it was valid in that time 1134 1155 my $parent = $physinfo->{parents}->{$parentphys}; 1135 1156 if (defined $parent && 1136 # $parentphys ne '99999999'&&1157 (!defined $parent->{deleted} || $deleted == 1) && 1137 1158 $parent->{versions}->[$version]) { 1138 1159 return $parent->{versions}->[$version]; … … 1147 1168 $parent = $physinfo->{parents}->{$parentphys}; 1148 1169 if (defined $parent && 1149 # $parentphys ne '99999999'&&1170 (!defined $parent->{deleted} || $deleted == 1) && 1150 1171 $parent->{versions}->[$version]) { 1151 1172 return $parent->{versions}->[$version]; … … 1154 1175 1155 1176 return undef; 1156 } # End _get_valid_path 1177 } # End _get_valid_path2 1157 1178 1158 1179 ###############################################################################
