p4 integrate/resolve/copy

目录

p4 integrate/resolve/copy

p4 integrate/p4 integ

p4 resolve  -am或-as参数

p4 copy

p4 change

p4 labelsync


p4 integrate/p4 integ

  • 功能:用于不同stream之间文件的合并,比如把文件 //HC/AT/sim/uvm/ttt.log覆盖到文件 //HC/BT/sim/uvm/ttt.log
  • 基本语法
  • p4 integrate [options] fromFileSpec[revRange] toFile
  • Example
p4 integrate  //HC/AT/sim/uvm/ttt.log   //HC/BT/sim/uvm/ttt.logp4 resolve -at //HC/BT/sim/uvm/ttt.logp4 sumbit //HC/BT/sim/uvm/ttt.log
  • 注意:在执行integrate时,服务器会比较两个文件的差异,如果两个文件完全一样,则此操作失败;如果两个文件内容有差异,则需要执行resolve操作进行merge,此时,theirs是//HC/AT/sim/uvm/ttt.log

p4 resolve  -am或-as参数

  • -am表示accept merged,具体为:
  1. 如果theirs与base一致,接受yours,
  2. 如果yours与base一致,接受theirs,
  3. 如果yours和theirs都与base不同,但是yours和theirs没有冲突,接受自动merged的结果,
  4. 否则如果yours和theirs也有冲突,则忽略此文件。
  • -as比-am更严谨,不管yours与theirs是否有冲突,只要yours和theirs都与base有不同就忽略此文件。

-ay   Accept Yours, ignore theirs.

-at   Accept Theirs.


  • 解释下theirs,base和yours
  1. theirs: The head revision of the file in the depot.(P4 上的最新版)
  2. base: The file revision synced to the client workspace before it was opened for edit.(P4上open for edit之前的P4版本)
  3. 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
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

Option                                                                 Meaning
-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.
  • e.g.
 p4 copy  //HC/AT/sim/uvm/ttt.log   //HC/BT/sim/uvm/ttt.log

p4 change

  • 创建一个changelist
p4 change -o > change_spec.txt
sed -i "s/<.*>/<branch>/" change_spec.txt #修改描述
p4 change -i < change_spec.txt
  • p4 changes -s pending -u shaoxinw  //查看shaoxinw修改的状态为pending的changelist
Option                                                                 Meaning
-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]...]

  1. -d: Delete the label tag from the named files.
  2. -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.
  3. -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
Option                                                                 Meaning
-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.

[P4]p4 integrate/resolve/copy相关推荐

  1. P4编程环境安装(ubuntu16.04,p4c+bmv2+mininet+PI+tutorial)

    安装过程 我的安装过程大多参考(copy)P4编程环境搭建+实现tutorials中basic的案例,并对某些安装出现的问题进行简要说明. 我使用的版本环境如下: Ubuntu 16.04 Deskt ...

  2. P4学习笔记(一)初识P4

    P4学习笔记(一)初识P4 P4学习笔记(二)一个简单P4交换机实现 文章目录 P4简介 P4提供的核心抽象 P4的优点 本系列我学习P4的学习笔记,很多是翻译自官方文档, 很多不是很准确的地方,建议 ...

  3. P4 Tutorial 安装

    P4作为一门编程语言对于网络工程师来说还是有一定的入门难度的.不过还好万能的互联网上无所不有,P4 Tutorial 就是一个非常好的学习P4的项目. 今天主要学习并实践一下P4 Tutorial所需 ...

  4. STC89C52RC的P4口的应用问题

    所用芯片 STC89C52RC-40I LQFP-44 发现这个芯片有 P4 端口,但是直接如下操作会报错! P4 = OXff; 解决办法: 要选择 <reg52.h>,需要用到 sfr ...

  5. P4学习笔记(二)一个简单P4交换机实现

    P4学习笔记(一)初始P4 P4学习笔记(二)一个简单P4交换机实现 文章目录 1. 架构模型 2.预定义模块详细描述 2.1 Arbiter 模块 2.2 Parser runtime 模块 2.3 ...

  6. P4 tutorials实验后补习理论知识

    学习完P4 tutorials----Basic Forwarding和Basic Tunneling两个实验,也急需补充些理论知识. 透过实验的现象,再看理论也不是很枯燥难懂. 什么是P4 P4是& ...

  7. P4编程理论与实践——理论篇(转载)

    P4编程理论与实践--理论篇 由于对SDN充满着兴趣,在学习了一段时间OpenFlow之后,一次偶然的机会接触到了P4.P4可以实现很多新的Idea,但是无奈于国内的实践资料太少了(有些资料似乎比较陈 ...

  8. P4编程理论与实践——理论篇

    由于对SDN充满着兴趣,在学习了一段时间OpenFlow之后,一次偶然的机会接触到了P4.P4可以实现很多新的Idea,但是无奈于国内的实践资料太少了(有些资料似乎比较陈旧了).唯一的学习来源是官网的 ...

  9. P4实战特训营听课笔记(一)

    今天来参加未来网络学院举报的P4实战特训营,跟着课程记下笔记,帮助记忆,也便于分享给大家. 早期使用的ASIC器件虽然性能强大,但是是不可编程的(已经烧死的),所以只能处理特定的数据包 使用了P4可编 ...

最新文章

  1. 使用 python 的单人AI 扫雷游戏
  2. WINDOWS SERVER 2003从入门到精通之“域控制器安全策略”打开错误的解决方法
  3. VS2013和MATLAB相互调用混合编程
  4. GoogleReader的Likes操作数据如何获取?
  5. 细节无处不在!东莞网络推广分享哪些操作会影响网站优化效果?
  6. Android的AutoCompleteTextView在API17高版本添加的setText函数在低版本系统居然能正常调用?官方文档是不是不靠谱了?...
  7. 获取和设置mfc中Edit输入的文字
  8. 机器学习中样本不平衡处理办法
  9. XCTF-MISC-新手区:pdf
  10. python之网络编程 --- TCP编程
  11. 求关系模式r的所有候选码_2_1关系数据库的基本概念
  12. 翻译 | Learning React Without Using React Part 2
  13. 服务器虚拟化底层实现原理,虚拟化原理
  14. 异常解决——Tomcat启动异常:Cannot assign requested address
  15. php 二维码在线识别api
  16. 家庭装修是找设计师和施工队好,还是找装修公司好呀
  17. Linux下脚本编写局域网扫描工具
  18. error: failed to push some refs to ‘xx.git‘ hint: Updates were rejected because the tip of your curr
  19. Linux入门学习——ssh基础操作
  20. 用Latex写毕业论文-- 用 ctexset 重定义标题(如:第一章)

热门文章

  1. DZ拿shell总结
  2. 医疗器械标准目录 第二部分专业技术领域(1)
  3. serving inference
  4. 覃超数据结构(二) 栈和队列
  5. 变频泵 计算机控制技术,变频泵站节约能耗的计算机控制技术浅析
  6. xss-labs通关大详解
  7. android 新闻功能列表,news: 用Android基本技术实现的新闻App
  8. 阿里入股新浪微博:动机与前景分析
  9. mysql数据库中查看数据库当前连接数
  10. java 空格 char_java中如何判断char是否是空格