p4_unmanaged

Roman Kurakin rik at cronyx.ru
Mon Nov 22 07:45:30 GMT 2004


Hi,

    By the way, is it possible to make a diff of two perforce branches with
behavior of usual diff -PN? Or I should write a script.

rik

Peter Wemm wrote:

>I've often been hosed by stray files laying around in my src trees.
>cvs update will identify them, but p4 doesn't.  Justin Gibbs pointed
>me to a windoze version of a script that finds stray files, and I tweaked
>it to run under unix.  Here it is, in case anybody is interested.  Just
>cd to the top of the tree you're interested in and run it.
>
>#! /usr/local/bin/perl
># ------------------------------------------------------------------------
># p4_unmanaged
># ------------------------------------------------------------------------
># List all the files in the current directory and subdirectories that
># are not checked into perforce, and therefore 'unmanaged'
># ------------------------------------------------------------------------
>
># Generate arrays of files perforce knows about 'havelist'
># and that exist in the filesystem 'locallist'
>@havelist  = `p4 have ...`;
>$cwd = `/bin/pwd`;
>chomp $cwd;
>@locallist = `find $cwd -type f -print`;
>
># Iterate over the havelist and add to a hash
>%havehash = ();
>for( @havelist )
>{
>    # $1=p4name $2=version $3=filename
>    /(.*)#(\d+) - (.*)/;
>    $havehash{$3} = $3;
>}
>
># Loop through the locallist
>for( @locallist )
>{
>    # $1=filename
>    if( /(.*)\n/ )
>    {
>        # if file is not in havelist then print its name
>        if( !exists($havehash{$1}) )
>        {
>            print "$1" . "\n";
>        }
>    }
>}
>
>  
>

To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list