[p4] Getting the size of a branch

Robert Cowham robert at vaccaperna.co.uk
Tue Apr 29 08:54:07 PDT 2008


I assume you mean size of files on disk (as opposed to number of files in
branch)?!

P4 fstat has the following option:

             -Ol     output a fileSize and digest field for each revision
                     (this may be expensive to compute) 

So process output of:

P4 fstat -Ol //depot/some/branch/...

C:\bruno_ws>p4 fstat -Ol //depot/jam/MAIN/... | grep fileSize | gawk "{s +=
$3} END{print s;}"
475980

Note that the file size for text files is only accurate with Unix line
endings.

Robert

> -----Original Message-----
> From: perforce-user-bounces at perforce.com 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of 
> Jamison, Shawn
> Sent: 29 April 2008 15:56
> To: perforce-user at perforce.com
> Subject: [p4] Getting the size of a branch
> 
> Howdy everyone,
> 
> Is there a way to get the size of a branch from Perforce 
> without having to sync the files out to local disk?
> 
> Thanks for all your help.
> -Shawn Jamison>
> Ciena Corp.
> Perforce Admin
> 
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com 
> http://maillist.perforce.com/mailman/listinfo/perforce-user
> 


More information about the perforce-user mailing list