[tool] perforce

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:

CountMeaning

n yours

n non-conflicting segments of yours are different than base.

n theirs

n non-conflicting segments of theirs are different than base.

n both

n non-conflicting segments appear identically in both theirs and yours, but are different from base.

n conflicting

n segments of theirs and yours are different from base and different from each other.


p4 copy 

p4 copy [-c change] [-n -f -v -q] [-m max] fromFile[rev] toFile

-m max

Specify the maximum number of files to copy, to limit the size of the operation.

-n

Preview the copy.

-q

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.

-t

Display the time as well as the date of each change.

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 templatelabelname
p4 [g-opts] label -i [-f -g]

 

Options

-d [-f]

Delete the named label if it's unlocked. The -f option forces the deletion even if the label is locked. (Deleting a locked label requires admin or super access.)

-f

Allow the Update: field's date to be set. Can be used with either the -i option or the -t option for the same purpose.

-g

In distributed environments, use the -g option to control whether the label is local to an edge server, or globally available from the commit server.

-i

Read the label definition from standard input without invoking the editor.

-o

Write the label definition to standard output without invoking the editor.

No files are actually tagged until p4 labelsync is invoked.

-t template

Copy label template's view and options into the View: and Options: fields of this label. You can specify a default label template using the template.label configure variable. If you do so, you do not have to specify this option.

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值