p4 resolve
-am或-as参数
-am表示accept merged,具体为如果theirs与base一致,接受yours,如果yours与base一致,接受theirs,如果yours和theirs都与base不同,但是yours和theirs没有冲突,接受自动merged的结果,否则如果yours和theirs也有冲突,则忽略此文件。
-as比-am更严谨,不管yours与theirs是否有冲突,只要yours和theirs都与base有不同就忽略此文件。
-ay Accept Yours, ignore theirs.
-at Accept Theirs.
--------------------------------------------------------------------------------------------------------------------------------------------
解释下theirs,base和yours
theirs: The head revision of the file in the depot.(P4 上的最新版)
base: The file revision synced to the client workspace before it was opened for edit.(P4上open for edit之前的P4版本)
yours : The revision of the file in the client workspace(当前open for edit编辑的local file)
举个栗子:某个文件你在第3版时open for edit ,别人在此时进了一版,即最新版时第4版;此时,第四版是theirs,第三版是base,基于第三版编辑的local file是yours.
-------------------------------------------------------------------------------------------------------------------------------------------
在执行p4 resolve 时会show出diff的结果,比如
Diff Chunks: 2 yours + 3 theirs + 5 both + 7 conflicting
The meanings of these values are:
Count | Meaning |
---|---|
|
|
|
|
|
|
|
|
p4 copy
p4 copy [-c change] [-n -f -v -q] [-m max] fromFile[rev] toFile
| Specify the maximum number of files to copy, to limit the size of the operation. |
| Preview the copy. |
| Quiet mode, which suppresses normal output messages about the list of files being integrated, copied, or merged. Messages regarding errors or exceptional conditions are displayed. |
i.e.
p4 copy //HC/AT/sim/uvm/ttt.log //HC/BT/sim/uvm/ttt.log
p4 integrate / p4 integ
p4 integrate [options] fromFileSpec[revRange] toFile
用于branch file,比如把 //HC/AT/sim/uvm/ttt.log 覆盖//HC/BT/sim/uvm/ttt.log
p4 integrate //HC/AT/sim/uvm/ttt.log //HC/BT/sim/uvm/ttt.log
p4 resolve -at //HC/BT/sim/uvm/ttt.log
p4 sumbit //HC/BT/sim/uvm/ttt.log
在执行integrate时,服务器会比较两个文件的差异,如果两个文件完全一样,则此操作失败;
如果两个文件内容有差异,则需要执行resolve操作进行merge,
此时,theirs是//HC/AT/sim/uvm/ttt.log
p4 change
创建一个changelist
p4 change -o > change_spec.txt
sed "s/<.*>/<branch>/" -i change_spec.txt #修改描述
p4 change -i < change_spec.txt
p4 changes -s pending -u shaoxinw //查看shaoxinw修改的状态为pending的changelist
-m max | List only the highest numbered max changes. |
p4 info:
User name: joe
Client name: joes_client
Client host: joes_workstation
Client root: /usr/joe/projects
Current directory: /usr/joe/projects/source
Client address: 192.168.0.123
Server address: p4server:1666
Server root: /usr/depot/p4d
Server date: 2012/01/28 12:11:47 -0700 PDT
Server uptime: 752:41:33
Server version: P4D/FREEBSD/2012.1/406375 (2012/01/25)
Server license: P4Admin <p4adm> 20 users (expires 2013/01/01)
Server license-ip: 10.0.0.2
Case handling: sensitive
p4 labelsync
Synchronize a label with the contents of the current client workspace.
p4 [g-opts] labelsync [-a -d -n] -l labelname [file[revRange]...]
-d : Delete the label tag from the named files.
-a : Add the label to files that match the file pattern arguments, even if some of the files being labeled are deleted at their head revision.
-n : Display what p4 labelsync would do without actually performing the operation.
p4 [g-opts
] label -d [-f -g] labelname
p4 [g-opts
] label -o [-t template
] labelname
p4 [g-opts
] label -i [-f -g]
Options
| Delete the named label if it's |
| Allow the |
| In distributed environments, use the |
| Read the label definition from standard input without invoking the editor. |
| Write the label definition to standard output without invoking the editor. No files are actually tagged until p4 labelsync is invoked. |
| Copy label |