logo       

[PATCH] VCP::Filter::changesets bug causing revision loss: msg#00001

Subject: [PATCH] VCP::Filter::changesets bug causing revision loss
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:cvs@xxxxxxxxxxxxxxxxxxxx:/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

Attachment: pgpVrE3vzoMmb.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe