#!/usr/bin/perl -w # # $Id: //guest/jeffery_g_smith/perforce/utils/sttop4/python/sortmeta.py#1 $ # # StarTeam to Perforce Converter, phase IIa: sort metadata # # 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 sorts the metadata output (first step in phase II). require 5.0; use strict; use integer; use lib '.'; use convert; use Change; convert::openlog('open'); open(CHANGES, "<$convert::metadata_dir/changes.ns") or die "can't open for read: $!"; open(NEWCHANGES, ">$convert::metadata_dir/changes") or die "can't open for write: $!"; my ($index,$c,@timestamp_and_index); # read 'em in for($index=0;$c=get Change(\*CHANGES);$index++) { push(@timestamp_and_index, [ $c->timestamp, $index, $c ]); } # sort them by timestamp, then file location @timestamp_and_index = sort { ($$a[0] <=> $$b[0]) || ($$b[1] <=> $$a[1]) } @timestamp_and_index; # write 'em out my $ti; foreach $ti (@timestamp_and_index) { $$ti[2]->put(\*NEWCHANGES); } close(CHANGES); close(NEWCHANGES); unlink("$convert::metadata_dir/changes.ns"); # delete the "not sorted" version
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 5264 | Jeffery G. Smith | Create branch for Python conversion. | ||
//guest/jeffery_g_smith/perforce/utils/sttop4/main/sortmeta.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/sortmeta.pl | |||||
#1 | 4664 | Robert Cowham | Branch into permanent location. | ||
//guest/robert_cowham/perforce/utils/pvcstop4/main/sortmeta.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/sortmeta.pl | |||||
#1 | 2289 | Robert Cowham | Initial version from Perforce web page |