[p4] Getting the size of a branch

Ivey, William william_ivey at bmc.com
Tue Apr 29 11:01:37 PDT 2008


I've discovered that on an older repository with an upgraded
p4d not all files may report a filesize. I believe running p4
verify on the older parts will fix that. (Apparently, with the
newer server it won't fall back on the old method of 
calculating the size if it doesn't find that information ready
to use.)

-Wm

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Robert Cowham


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
> 
_______________________________________________
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