5 messages in com.perforce.revml[revml] [PATCH] VCP::Filter::changese...
FromSent OnAttachments
Chia-liang Kao30 May 2004 16:09 
Barrie Slaymaker31 May 2004 08:02 
Chia-liang Kao31 May 2004 14:39 
Chia-liang Kao01 Jun 2004 06:24 
Chia-liang Kao17 Jul 2004 10:46 
Subject:[revml] [PATCH] VCP::Filter::changesets bug causing revision loss
From:Chia-liang Kao (clk@clkao.org)
Date:07/17/2004 10:46:45 AM
List:com.perforce.revml

This is finally tracked down and fixed after a few hours. Please see the log and apply the patch below. We all love Perl.

On Tue, Jun 01, 2004 at 02:24:42PM +0100, Chia-liang Kao wrote:

I have a smaller test case of missing revs, it's neither on branch nor using --continue.

vcp cvs::pserver:cv@cvs.simon-cozens.org:/var/cvs/modules:Apache-MVC/... \ map: '(...)<>' '$1<>' '...' '<<delete>>' -- \ p4:/tmp/p4-maypole://depot/maypole/... --run-p4d --init-p4d

(303 revs total)

% p4 filelog //depot/maypole/doc/About.pod //depot/maypole/doc/About.pod ... #1 change 79 add on 2004/03/10 by simon@vcp_tmp_95595 (text) 'Doc outline. '

while you could find there are other revs obviously at:

http://cvs.simon-cozens.org/viewcvs.cgi/Apache-MVC/doc/About.pod

---------------------------------------------------------------------- r1116: clkao | 2004-07-17T17:41:37.945934Z

VCP::Filter::changesets always loses the 49th revision and causes the descendents of it all lost. This is because the 'w' packed index is not checked safely. Also fix a dangerous "my $foo = $bar if $baz" construct.

---------------------------------------------------------------------- --- local/lib/VCP/Filter/changesets.pm (revision 1115) +++ local/lib/VCP/Filter/changesets.pm (revision 1116) @@ -666,8 +666,8 @@ sub split_and_send_changes { if ( !$change ) { my @future_indexes = grep $_ != $r_index, - unpack "w*", $changes->[$change_index] - if $changes->[$change_index]; + unpack "w*", + exists $changes->[$change_index] ? $changes->[$change_index] :
'';

undef $changes->[$change_index];

@@ -780,7 +780,7 @@ sub split_and_send_changes {

my $r_index = delete $self->{INDEXES_BY_ID}->{$r->id};

- if ( $children->[$r_index] ) { + if ( exists $children->[$r_index] ) { push @cur_indexes, unpack "w*", $children->[$r_index]; } undef $children->[$r_index]; ## undef $foo releases extra memory

Cheers, CLK