#!/usr/bin/perl -w # # $Id: //guest/jeffery_g_smith/perforce/utils/sttop4/python/verify.py#1 $ # # StarTeam to Perforce Converter, phase V: verify Perforce depot # # Copyright 1998 Perforce Software. All rights reserved. # Based on VSStoP4: # Written by James Strickland, April 1998 # Maintained by Robert Cowham, since 2000 # Updated to support StarTeam conversions: # Jeffery G. Smith, MedPlus, Inc. 2004-2005 # # This script uses the metadata produced by earlier phases to direct a loop # which extracts StarTeam revisions and verifies that the Perforce version # stores the same information. require 5.0; use strict; use integer; use lib '.'; use convert; use Change; convert::openlog('open'); $ENV{P4CLIENT} = $convert::p4client; $ENV{P4USER} = $convert::p4user; my $last_change = convert::p4run(" changes -m 1"); die "Didn't recognize the output of p4 changes: $last_change" unless($last_change =~ /^Change\s+(\d+)/); $last_change=$1; print "There are $last_change changes in the depot.\n"; # open all our input files open(MAPPING, "$convert::metadata_dir/mapping.ns") or die "can't open: $!"; # overwrite client files with revisions from VSS, then use p4 diff # to verify that the file is the same as the version in the depot my $failed=0; my $prev_change_number=1; while(<MAPPING>) { chomp; my ($revision,$change_number,$depot_file,$vss_file)=split(/#/,$_,4); my $client_file; my $fstat = convert::p4run(" fstat \"$depot_file\@$change_number\""); if( $fstat =~ /clientfile (.*)\n/im ) { $client_file = convert::forward_slash($1); } else { $failed=$change_number; convert::log("WARNING!!! p4 fstat failed on change $failed\n"); next; } if( $fstat =~ /headtype tempobj\n/im ) { next; # ignore tempobj files - they will not match, by design } my $client_dir = $client_file; $client_dir =~ s@/[^/]*$@@; convert::get_vss_file($vss_file,$revision,$client_dir,$client_file); if(convert::p4run(" diff -f -se \"$depot_file\@$change_number\"")) { $failed=$change_number; convert::log("WARNING!!! $depot_file\@$change_number differs from StarTeam file $vss_file revision $revision\n"); print convert::p4run(" diff -f \"$depot_file\@$change_number\""); print "\n"; next; } if($change_number!=$prev_change_number) { print "Change $prev_change_number ok.\r" unless($failed == $prev_change_number); $prev_change_number=$change_number; } } if($failed) { print "VERIFY FAILED\n"; } else { print "Verify succeeded - all file revisions in Perforce match those in StarTeam.\n"; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 5264 | Jeffery G. Smith | Create branch for Python conversion. | ||
//guest/jeffery_g_smith/perforce/utils/sttop4/main/verify.pl | |||||
#6 | 4818 | Jeffery G. Smith |
Finished extracting metadata. Improved logging subsystem. |
||
#5 | 4793 | Jeffery G. Smith | Updated sources to more closely match VSStoP4 baseline. | ||
#4 | 4710 | Jeffery G. Smith | Initial changes for StarTeam support after combining PVCS and VSS converters. | ||
#3 | 4703 | Jeffery G. Smith | Merge with the VSS converter. | ||
#2 | 4701 | Jeffery G. Smith | Initial converion to StarTeam. | ||
#1 | 4700 | Jeffery G. Smith | Initialize branch from PVCS converter. | ||
//guest/perforce_software/utils/pvcstop4/main/verify.pl | |||||
#1 | 4664 | Robert Cowham | Branch into permanent location. | ||
//guest/robert_cowham/perforce/utils/pvcstop4/main/verify.pl | |||||
#1 | 4647 | Robert Cowham |
Rename //guest/robert_cowham/perforce/utils/pvcstop4/... To //guest/robert_cowham/perforce/utils/pvcstop4/main/... |
||
//guest/robert_cowham/perforce/utils/pvcstop4/verify.pl | |||||
#2 | 2290 | Robert Cowham |
Merged in some changes from the VSStoP4 scripts: - allow specification of depot and path within depot - cope with repository already existing - cope with multiple concurrent updates to server - slightly improved error detection Note this hasn't been tested with a branch configuration. |
||
#1 | 2289 | Robert Cowham | Initial version from Perforce web page |