#!/usr/bin/perl -w # # VSS to Perforce converter, phase II: improve metadata # # This script sorts the metadata output (first step in phase II). require 5.0; use strict; use integer; use lib '.'; use convert; use Change; 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 | 1798 | Dave Hildebrandt | branch from //guest/robert_cowham | ||
//guest/robert_cowham/perforce/utils/vsstop4/sortmeta.pl | |||||
#2 | 1691 | Robert Cowham |
Latest changes, e.g. - allow restarts (from date and time) - add client name to config options |
||
#1 | 237 | Robert Cowham |
Improved version of vsstop4. Makes life easier if importing into a depot which already contains stuff you want to keep. Also handles other people updating the depot at the same time. See changes labelled RHGC, and new items in config file. |