Changeset 307

Show
Ignore:
Timestamp:
03/22/2007 01:14:38 PM
Author:
luedi
Message:
  • added support for version lables (alias Label promotion)
  • added better support for incremental updates. This will help, if your archive has changed and you run the converter with the "--resume --task INIT" flags. In this case, the cache is not cleaned and the extracted physical files are kept and updated if newer versions are available.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/script/vss2svn.pl

    r306 r307  
    451451                    $sortkey, $parentdata, $label, $comment); 
    452452 
    453         # Handle version comments as a secondary action for the same  
    454 #        if (defined $version->{Label} && !ref($version->{Label})) { 
    455 #            my ($labelComment); 
    456 #             
    457 #            if ($version->{LabelComment} && !ref($version->{LabelComment})) { 
    458 #                $labelComment = $version->{LabelComment}; 
    459 #            } 
    460 #            $cache->add($tphysname, $vernum, $parentphys, 'LABEL', $itemname, 
    461 #                        $itemtype, $timestamp, $user, $is_binary, $info, 5, 
    462 #                        $sortkey, $parentdata, $version->{Label}, $labelComment); 
    463 #        } 
    464          
     453        # Handle version labels as a secondary action for the same version 
     454        # version labels and label action use the same location to store the 
     455        # label. Therefore it is not possible to assign a version label to 
     456        # version where the actiontype was LABEL. But ssphys will report the 
     457        # same label twice. Therefore filter the Labeling versions here. 
     458        if (defined $version->{Label} && !ref($version->{Label}) 
     459            && $actiontype ne 'LABEL') { 
     460            my ($labelComment); 
     461             
     462            if ($version->{LabelComment} && !ref($version->{LabelComment})) { 
     463                $labelComment = $version->{LabelComment}; 
     464            } 
     465            else { 
     466                $labelComment = "assigned label '$version->{Label}' to version $vernum of physical file '$tphysname'"; 
     467            } 
     468            $cache->add($tphysname, $vernum, $parentphys, 'LABEL', $itemname, 
     469                        $itemtype, $timestamp, $user, $is_binary, $info, 5, 
     470                        $sortkey, $parentdata, $version->{Label}, $labelComment); 
     471        } 
    465472    } 
    466473 
     
    895902            $itemtype = $action->{itemtype}; 
    896903 
    897             if (!exists $exported{$physname}) { 
    898                 if ($itemtype == 2) { 
    899                     $exported{$physname} = &ExportVssPhysFile($physname, $action->{version}); 
     904#            if (!exists $exported{$physname}) { 
     905                my $version = $action->{version}; 
     906                if (   !defined $version 
     907                    && (   $action->{action} eq 'ADD' 
     908                        || $action->{action} eq 'COMMIT')) { 
     909                    &ThrowWarning("'$physname': no version specified for retrieval"); 
     910             
     911                    # fall through and try with version 1. 
     912                    $version = 1; 
     913                } 
     914             
     915                if ($itemtype == 2 && defined $version) { 
     916                    $exported{$physname} = &ExportVssPhysFile($physname, $version); 
    900917                } else { 
    901918                    $exported{$physname} = undef; 
    902919                } 
    903             } 
     920#            } 
    904921 
    905922            # do_action needs to know the revision_id, so paste it on 
    906923            $action->{revision_id} = $revision; 
    907  
    908924            $dumpfile->do_action($action, $exported{$physname}); 
    909925        } 
     
    16541670    $gCfg{starttime} = scalar localtime($^T); 
    16551671 
    1656     # trunkdir should (must?) be without leading slash 
     1672    # trunkdir should (must?) be without trailing slash 
    16571673    $gCfg{trunkdir} = '' unless defined $gCfg{trunkdir}; 
    16581674    $gCfg{trunkdir} =~ s:\\:/:g; 

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.