p4 – perforce common commands for batch operations

p4 help
get online help
p4 dirs //Drivers/*
list direct directories under given path (//Drivers)
p4 files //Drivers/…
list files (recursively) under given path (//Drivers)
p4 labels -m 5 //Drivers/…
list latest 5 labels of a path
p4 changes -m 1 //Drivers/…
list  the latest change list
p4 user jason
list user jason’s information
p4 client
show current client
p4 opened
list opened files (that are in the pending change lists)
p4 sync
get files to the workspace

p4 sync file#rev
p4 sync @label
p4 sync //depot/proj/...@rev
p4 sync @2011/06/24
p4 sync file#none           # delete from workspace
p4 unshelve -s changelist [ file_pattern … ]
unshelve a file/change list

perforce file name format

file#n              the n-th revision of file
file#m,n            revision range m,n
file#none           nonexistent revision (delete from workspace)
file#0
file#head           head (latest) revision
file#have           the revision on the current client
file@=n             change number
file@n
file@label          file in label
file@clientname     revision of file last taken into client workspace
file@datespec       datespec    yyyy/mm/dd([ :]hh:mm:ss)?
file@now
Advertisements