当前位置:网站首页>[P4] check the differences between the two historical versions of the library file
[P4] check the differences between the two historical versions of the 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/125939746.
- ️ 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
Want to compare the difference between local files and files in the Library , It can be used p4 diff file. So how to compare two historical versions in the Library ? For example, compare files A Two versions of m and n, There are several ways :
- use
p4 diff2 A#m A#nTo compare , But this only shows the difference on the screen , It's not very intuitive . - Put two versions of the file check out Go locally and name them separately , And then use tkdiff、meld、bcompare And other tools to compare the two files . This method can show the difference between the two versions in the left and right columns , Comparison method 1 It is more intuitive in the display effect , But the operation is cumbersome . If the current file has been edit 了 , The process is even more cumbersome , You have to first revert, Wait until the comparison is over edit.
The above two methods have their own advantages and disadvantages , Is there any method that has good display effect and simple operation ? Write it yourself .
Script features
Today, I want to talk about methods, principles and methods 2 similar , But don't worry about the document being edit The problem of —— To borrow p4 print To transit . Ideas as follows : use p4 print Print two versions of the file to be compared to the local temporary file , then bcompare comparison , Finally, delete the temporary file .
Script
The script is called p4_diff2.sh, For convenience, please use ~/.bashrc in alias p4_diff2 'sh ~/script/p4_diff2.sh'.
#! /usr/bin/sh
# File Name : p4_diff2.sh
# Usage : sh p4_diff2.sh file v1 v2
file=$1
v1=$2
v2=$3
p4 print $file#$v1 > .$file.$v1
p4 print $file#$v2 > .$file.$v2
bcompare .$file.$v1 .$file.$v2
rm .$file.$v1 .$file.$v2
边栏推荐
- ES6 从入门到精通 # 07:解构赋值
- 动态规划——62. 不同路径
- Leetcode skimming: dynamic programming 08 (segmentation and subsets)
- 【力扣】1337.矩阵中战斗力最弱的k行
- 接口自动化测试,完整入门篇
- 20220727使用汇承科技的蓝牙模块HC-05配对手机进行蓝牙串口的演示
- 20220727 use the Bluetooth module hc-05 of Huicheng technology to pair mobile phones for Bluetooth serial port demonstration
- Mouse operation and response
- 做自动化测试,你后悔了吗?
- Swift中的协议
猜你喜欢

verticle-align行内元素垂直居中对齐

Tungsten Fabric SDN — BGP as a Service

Shell: resource monitoring script and high load alarm

每周推荐短视频:如何正确理解“精益”这个词?

The latest version of pagoda installs the zip extension, and PHP -m does not display the processing method

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

How does win11 display fixed applications?

How to uninstall clean ZABBIX service? (super detailed)

Prefix-Tuning: Optimizing Continuous Prompts for Generation

leetcode刷题:动态规划08(分割等和子集)
随机推荐
2022 summary of the latest Android handler related interview questions
Server memory failure prediction can actually do this!
容器相关的概念
动态规划——62. 不同路径
动态规划——474. 一和零
In December, the PMP Exam adopted the new syllabus for the first time. How to learn?
The wonderful use of asemi rectifier bridge GBPC3510 in DC brush motor
Tensorboard usage record
Responsive high-end website template source code Gallery material resource download platform source code
Response to questions about the balanced beacon group of Hubei University of Arts and Sciences
ES6 从入门到精通 # 07:解构赋值
整合SSM实现增删改查搜索
MySQL stored procedures use cursors to synchronize data between two tables
C语言实现动态版本的通讯录
95后阿里P7晒出工资单:真的是狠狠扎心了...
Swift中的协议
12月份PMP考试首次采用新考纲,该怎么学?
ES6 从入门到精通 # 09:Symbol 类型
How to uninstall clean ZABBIX service? (super detailed)
golang gorm查询任意字段的组装方法