当前位置:网站首页>[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
边栏推荐
- Airiot Q & A issue 6 | how to use the secondary development engine?
- A treasure simulates login and reduces the method of secondary verification
- [wrong question]mocha and railgun
- After reading MySQL database advanced practice (SQL xiaoxuzhu)
- Response to questions about the balanced beacon group of Hubei University of Arts and Sciences
- Xctf attack and defense world web master advanced area php2
- Qt:QMessageBox消息框、自定义信号和槽
- How to solve MySQL deep paging problem
- Golang gets the tag of the loop nested structure
- 收藏|0 基础开源数据可视化平台 FlyFish 大屏开发指南
猜你喜欢

Weekly recommended short video: how to correctly understand the word "lean"?

VMware virtual machine network settings

Daily practice ----- realize the lottery function of two-color ball. Rules: Six non repeating numbers are randomly selected from 36 red balls, and one from 15 basketball is randomly selected to form a

STM32 RT thread virtual file system mount operation

Light year admin background management system template

Illustrated: detailed explanation of JVM memory layout

Tensorboard usage record

Shell: one click deployment PXE

tensorboard使用记录

Robot development -- lead screw and guide rail
随机推荐
SAP UI5 FileUploader 控件深入介绍 - 为什么需要一个隐藏的 iframe 试读版
MySQL stored procedures use cursors to synchronize data between two tables
Asemi rectifier bridge gbpc5010, gbpc5010 parameters, gbpc5010 size
2022-07-27: Xiao Hong got an array arr with a length of N. she is going to modify it only once. She can modify any number arr[i] in the array to a positive number not greater than P (the modified numb
Capacity expansion and reduction of RBD block storage device (VI)
The latest version of pagoda installs the zip extension, and PHP -m does not display the processing method
高等数学(第七版)同济大学 习题3-6 个人解答
Vertical align align the elements in the row are vertically centered
Msgan is used for pattern search of multiple image synthesis to generate confrontation Network -- to solve the problem of pattern collapse
deepstream 检测结果截图
[错题]Concatenation
Responsive high-end website template source code Gallery material resource download platform source code
203. Remove linked list elements
动态规划——416. 分割等和子集
Xctf attack and defense world web master advanced area php2
leetcode刷题:动态规划08(分割等和子集)
Billions of asset addresses are blacklisted? How to use the tether address freezing function?
Illustrated: detailed explanation of JVM memory layout
Server memory failure prediction can actually do this!
tensorboard使用记录