1.设置使用者信息
export P4PORT=perforce-wsx.com:1966 && export P4CLIENT=build-toolchain-centos5-32-dev31 && export P4USER=wsx
export PATH=$PATH:/build/apps/bin
2.p4操作命令
$ p4 -h //查看帮助信息
$ p4 changes |grep wsx //查看wsx修改的changelist
$ p4 changes -s pending -u wsx //查看wsx修改的状态为pending的changelist
$ p4 change 1037167 //修改changelist中版本号是1037167
$ p4 change -d 1037167//从changelist中删除1037167
$ p4 client
find . -type f -print | p4 -x - add //把目录下的文件都添加到p4 open file list里
p4 info
p4 revert filename// To revert a file to its unopened state
p4 revert -a # 这个命令会将当前目录以及其子目录下所有的已打开并且没有修改的文件重置
p4 revert -c 12345 //... #to revert all files in my pending changelist 12345
p4 change -d 12345 #to delete the now-empty changelist
p4 add filename//
p4 add -c 13 * #Opens all the files within the user’s current directory foradd, and links these files to changelist13.
p4 opened // To list all opened files
p4 change // To create or edit a new changelist
p4 submit // To copy all open files to the depot
p4 submit -c 12345
p4 delete // To open a file for deletion
p4 change -d changelist(1234)
p4 sync // To read files from the depot into the client workspace
p4 move // To move(rename) a file
p4 edit // To open a file for edit
p4 edit filename 对文件进行编辑,相当于图形界面中的check out
find . -type f -print -name ToDo.txt| p4 -x - edit //把当前文件夹下的所有名字为ToDo.txt的文件进行check out
Root: /home/tcuser/workspace//工作空间
View:
//toolchain/main/src/... //build-toolchain-centos5-32-dev31/src/... //客户端相对Root的首层路径
//toolchain/main/lin32/... //build-toolchain-centos5-32-dev31/lin32/...
客户机器名
3.验证编译是否成功
strings -a * | grep -i openssl |less //查看编译的包
find ../../lin32/pwdutils-3.0-1/ -type f -exec strings -f {} \; | grep ": OpenSSL [0-9]" | more
post-review 1037167 --submit-as="wsx" --user="wsx"
$ p4 submit -c 1037167//本地提交文件到server
4.遇到错误和解决方法
1.error:
* You must fix these errors before submitting:
* - "Review URL" is required.
solve:p4 change NUM
增加post-review URL
Error: Client '' unknown - use 'client' command to create it. Solve:create the client by running p4 client on the command line (export P4CONFIG=.p4config)or using P4V
unable to connect to the server perforce as user. or Connect to server failed; check $P4PORT
Remember that P4PORT not only specifies the port you connect to but also the host.
Perforce password (P4PASSWD) invalid or unset. Solve: P4CONFIG没有设置,或者是你没有p4 login