From 0384b5f5a0986aa8394d701b93bd1573bf689605 Mon Sep 17 00:00:00 2001 From: Cary Sandvig Date: Thu, 5 Oct 2000 22:34:10 +0000 Subject: [PATCH] minor fixes --- dtool/src/attach/ctcvs.pl | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/dtool/src/attach/ctcvs.pl b/dtool/src/attach/ctcvs.pl index 3c478451a9..3df3591c9f 100644 --- a/dtool/src/attach/ctcvs.pl +++ b/dtool/src/attach/ctcvs.pl @@ -323,7 +323,41 @@ sub CTCvsUncheckout { sub CTCvsIHave { &CTUDebug( "in CTCvsIHave\n" ) ; local( $ret ) = "" ; - print STDERR "I don't know how to do IHave yet!\n" ; + local( $proj ) = $_[0] ; + $proj =~ tr/a-z/A-Z/ ; + local( $line ) = "cd \$" . $proj . "; " ; + local( $serve ) = &CTCvsServerLine( $_[0], $_[2] ) ; + local( $ok ) = &CTCvsLogin( $serve ) ; + if ( $ok ) { + $line = $line . "cvs -n -d " . $serve . " update" ; + local( $hold ) = ""; + local( *OUTPUT ) ; + open( OUTPUT, $line . " |" ) ; + while ( ) { + $hold = $hold . $_ ; + } + close( OUTPUT ) ; + local( @lines ) = split( /\n/, $hold ) ; + local( $item ) ; + foreach $item ( @lines ) { + if ( $item =~ /^\?/ ) { + # things that start with a ? are ignored + } elsif ( $item =~ /^cvs/ ) { + # messages from the server are also ignored + } elsif ( $item =~ /^P/ ) { + # messages from the server are also ignored + } elsif ( $item =~ /^M/ ) { + # here's one we modified + local( @foo ) = split( / /, $item ) ; + $ret = $ret . $foo[1] . "\n" ; + } else { + # don't what this means, better complain + local( @foo ) = split( / /, $item ) ; + print STDERR "got unknown update code '" . $foo[0] . + "' for file '" . $foo[1] . "'\n" ; + } + } + } &CTUDebug( "out of CTCvsIHave\n" ) ; $ret ; }