#!/usr/local/bin/perl -w =head1 NAME 00rev.t - testing of VCP::Rev services =cut use strict ; use Carp ; use Test ; use VCP::Rev ; ## TODO: Add lots of tests to 00rev.t my $r ; my @tests = ( sub { ok join( ",", VCP::Rev->split_id( "1" ) ), "1" }, sub { ok join( ",", VCP::Rev->split_id( "1a" ) ), "1,a" }, sub { ok join( ",", VCP::Rev->split_id( "1.2" ) ), "1,,2" }, sub { ok join( ",", VCP::Rev->split_id( "1a.2" ) ), "1,a,2" }, sub { ok join( ",", VCP::Rev->split_id( "1a.2b" ) ), "1,a,2,b" }, sub { ok( VCP::Rev->cmp_id( [qw( 1 a 2 )], [qw( 1 b 1 )] ) < 0 ) }, sub { ok( VCP::Rev->cmp_id( "1a2", "1b1" ) < 0 ) }, sub { ok( VCP::Rev->cmp_id( [qw( 1 a 2 )], [qw( 1 a 1 )] ) > 0 ) }, sub { ok( VCP::Rev->cmp_id( [qw( 1 b 2 )], [qw( 1 a 1 )] ) > 0 ) }, sub { ok( VCP::Rev->cmp_id( [qw( 10 )], [qw( 1 )] ) > 0 ) }, sub { $r = VCP::Rev->new() ; ok( ref $r, "VCP::Rev" ) }, sub { ok( ! $r->labels, ! 0 ) }, sub { $r->add_label( "l1" ) ; ok( join( ",", $r->labels ), "l1" ) ; }, sub { $r->add_label( "l2", "l3" ) ; ok( join( ",", $r->labels ), "l1,l2,l3" ) ; }, sub { $r->add_label( "l2", "l3" ) ; ok( join( ",", $r->labels ), "l1,l2,l3" ) ; }, sub { $r->labels( "l4", "l5" ) ; ok( join( ",", $r->labels ), "l4,l5" ) ; }, sub { $r->name( "foo" ); $r->rev_id( "1" ); ok $r->id, "foo#1"; }, sub { my $comment = "hi, ho the gang's all here"; $r->comment( $comment ); ok $r->comment, $comment; }, # test time, sort_time accessors sub { $r->time(10); ok $r->time, 10; }, sub { $r->sort_time(15); ok $r->sort_time, 15; }, ) ; plan tests => scalar( @tests ) ; $_->() for @tests ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#19 | 4514 | Barrie Slaymaker | - VCP::Rev::earlier_ids and <release_id> added | ||
#18 | 3970 | Barrie Slaymaker |
- VCP::Source handles rev queing, uses disk to reduce RAM - Lots of other fixes |
||
#17 | 3850 | Barrie Slaymaker | - No longer stores all revs in memory | ||
#16 | 3813 | Barrie Slaymaker | - VCP::Rev::previous() is no more | ||
#15 | 3776 | Barrie Slaymaker | - test suite for serialization/deserialization | ||
#14 | 3769 | Barrie Slaymaker | - avg_comment_time sort key removed | ||
#13 | 3761 | Barrie Slaymaker | - sort_time() is no more | ||
#12 | 3117 | Barrie Slaymaker |
Cut over to faster VCP::Rev::new, remove symbolic method calls. |
||
#11 | 3116 | Barrie Slaymaker | Cleanup, test tweaks | ||
#10 | 3112 | Barrie Slaymaker |
Reduce memory footprint when handling large numbers of revisions. |
||
#9 | 3063 | Barrie Slaymaker | Fix test. | ||
#8 | 3060 | Barrie Slaymaker | Note arglist too long error in p4->p4 conversion | ||
#7 | 3027 | Barrie Slaymaker | VCP::Filter::labelmap | ||
#6 | 2372 | John Fetkovich | Remove time, sort_time methods, allow them to be autogenerated. | ||
#5 | 2240 | Barrie Slaymaker | Start on cvs -r option support. | ||
#4 | 2232 | Barrie Slaymaker | Major memory and sort speed enhancements. | ||
#3 | 2017 | Barrie Slaymaker |
Interim checkin of id=/base_version_id for revml: and branch_diagram: |
||
#2 | 2015 | Barrie Slaymaker | submit changes | ||
#1 | 468 | Barrie Slaymaker |
- VCP::Dest::p4 now does change number aggregation based on the comment field changing or whenever a new revision of a file with unsubmitted changes shows up on the input stream. Since revisions of files are normally sorted in time order, this should work in a number of cases. I'm sure we'll need to generalize it, perhaps with a time thresholding function. - t/90cvs.t now tests cvs->p4 replication. - VCP::Dest::p4 now doesn't try to `p4 submit` when no changes are pending. - VCP::Rev now prevents the same label from being applied twice to a revision. This was occuring because the "r_1"-style label that gets added to a target revision by VCP::Dest::p4 could duplicate a label "r_1" that happened to already be on a revision. - Added t/00rev.t, the beginnings of a test suite for VCP::Rev. - Tweaked bin/gentrevml to comment revisions with their change number instead of using a unique comment for every revision for non-p4 t/test-*-in-0.revml files. This was necessary to test cvs->p4 functionality. |