当前位置:网站首页>[P4] solve the conflict between local file modification and library file
[P4] solve the conflict between local file modification and library file
2022-07-28 03:40:00 【MangoPapa】
Click to enter 【 Chip design verification 】 Community , See more
Statement :
- 🥭 Author URI :【MangoPapa Of CSDN Home page 】.
- ️ This article was first published in CSDN, Please indicate the source of reprint or quotation https://mangopapa.blog.csdn.net/article/details/125939590.
- ️ This paper is non-profit , The purpose is Personal learning record And Knowledge sharing . Limited by personal ability , There is a possibility of incorrect interpretation of the agreement . If you refer to this article for product design or other matters and cause adverse consequences , I will not bear relevant legal liabilities .
- ️ If the pictures or relevant references used in this article infringe upon your legitimate rights and interests , Please contact me to delete .
- Welcome to point out the mistakes in the article , Welcome colleagues to communicate with me ~
- mailbox :[email protected]
introduction
This column records some commonly used Command combination or Script . Scripts include but are not limited to shell、python、perl.
This article is 《【P4】 Solve the conflict between local file modification and library file 》.
More practical scripts Click to view the general directory .
List of articles
Demand is raised
Adopted by the company perforce Conduct code version management , The same team is in the same branch Work under the . Many people put code check out To local ,edit Later submit Upload to the Library . if A and B For the same file F the edit,A Precede B take file F Upload , stay B Upload time , There will be a problem that the local modification conflicts with the version of the library file .
The common method is p4 resolve Change yourself with others merge together .p4 resolve Of merge Parameters are shown in table 1 Shown .
| Parameters | paraphrase |
|---|---|
| -am | Who's with base Who does not agree to accept , If both of them are base atypism , If two people change without conflict, it will automatically merge, The conflict between the two changes is ignored . |
| -as | Who's with base Who does not agree to accept , If both of them are base atypism , Ignore whether it conflicts or not . |
| -ay | Accept our changes . |
| -at | Accept the changes of others . |
In most cases , The changes of the two people will conflict , We need to manually change our changes with others in the Library merge together . At this time, a series of operations are needed to complete manual merge. Consider every manual merge It's all a few commands , Just seal it .
Script features
- Generate a local backup of the original file , Add a timestamp to the original file name as the backup file name .
- The original document revert and sync To the latest version , Align with the library version .
- resolve After the completion of ,CL Still with resolve Before CL identical .
- need p4 diff Manual merge.
Script
The script is called m_resolve.sh, For convenience, please use ~/.bashrc in alias m_resolve 'sh ~/script/m_resolve.sh'.
#! /usr/bin/sh
# File Name: m_resolve.sh
# Usage : sh m_resolve.sh conflicted_file
timestamp=$(data +%Y%m%d%H%M%S)
ori_file=$1
bak_file=.$ori_file.$timestamp
# get CL
CL=`p4 opened $ori_file`
CL=`echo ${
CL#*\edit change}` # keep right
CL=`echo ${
CL%% *}` # keep left
#
cp $ori_file $bak_file
p4 revert $ori_file
p4 sync $ori_file
p4 edit $ori_file
cp $bak_file $ori_file
p4 reopen -c $CL $ori_file
p4 diff $ori_file
边栏推荐
- MangoPapa 的实用小脚本(目录篇)
- Version compatibility issues
- Log analysis tool (Splunk)
- Malloc, free, calloc, realloc dynamic memory development functions in dynamic memory management
- redis源码分析(谁说C语言就不能分析了?)
- 8000 word explanation of OBSA principle and application practice
- Qt:QMessageBox消息框、自定义信号和槽
- 203. Remove linked list elements
- Asemi rectifier bridge gbpc5010, gbpc5010 parameters, gbpc5010 size
- Leetcode 29th day
猜你喜欢

"Xiaodeng" network equipment monitoring in operation and maintenance

SAP UI5 FileUploader 控件深入介绍 - 为什么需要一个隐藏的 iframe 试读版

每日练习------实现双色球的彩票功能。规则:从36个红球中随机选择不重复的6个数,从15个篮球中随机选择1个组成一注彩票。可以选择买多注。

MySQL Basics (create, manage, add, delete, and modify tables)

redis源码分析(谁说C语言就不能分析了?)

Malloc, free, calloc, realloc dynamic memory development functions in dynamic memory management

Mysql基础篇(创建、管理、增删改表)
![[5g NR] RRC reject analysis](/img/51/fc39804b39a9014be3130c09e5444c.png)
[5g NR] RRC reject analysis

最新版宝塔安装zip扩展,php -m 不显示的处理方法

How to uninstall clean ZABBIX service? (super detailed)
随机推荐
Acid characteristics of MySQL transactions and example analysis of concurrency problems
203. Remove linked list elements
一篇文章掌握Postgresql中对于日期类数据的计算和处理
[错题]Concatenation
D2dengine edible tutorial (4) -- draw text
C language to achieve a dynamic version of the address book
[openvx] VX for basic use of objects_ convolution
【论文笔记】基于深度学习的移动机器人自主导航实验平台
[paper notes] mobile robot autonomous navigation experimental platform based on deep learning
Mouse operation and response
How does win11 display fixed applications?
695. Maximum area of the island
VBA reads the create document of SQL in batches to create tables
收藏|0 基础开源数据可视化平台 FlyFish 大屏开发指南
Xctf attack and defense world web master advanced area unserialize3
贪心——45. 跳跃游戏 II
What is tor? What is the use of tor browser update?
Outlook tutorial, how to use color categories and reminders in outlook?
"Xiaodeng" network equipment monitoring in operation and maintenance
「运维有小邓」网络设备监控