Code branch merge detection method and device, computer device and storage medium
CN117667648BActive Publication Date: 2026-08-28TENCENT DIGITAL TIANJIN
Patent Information
- Application Number
- CN202211042728.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2042-08-29
AI Technical Summary
Technical Problem
然而,由于存在多条并行开发的代码分支,因此需要耗费大量时间针对每条分支的不同情况分别编写多条测试用例,也并不能保证所编写的测试用例均能有效地判定当前的合线是否正确
Benefits of technology
[0036]上述代码分支的合线检测方法、装置、计算机设备、存储介质和计算机程序产品,通过获取待合并代码分支的差异信息,并根据差异信息确定待合并代码分支的文件类型。其中,若文件类型为代码文件,根据待合并的第一分支的第一差异信息确定第一分支的第一删除行,以及根据待合并的第二分支的第二差异信息确定第二分支的第二删除行和新增行,进而基于第一删除行和第二删除行,获得完整删除行。进一步地,根据完整删除行,对新增行进行筛选,筛选得到目标新增行,可准确确定出修改内容,避免重复进行相同代码行的删除、新增处理,减少无效处理,提升开发效率。而基于目标新增行、以及第一分支的分支代码文件,进行合线检测,可生成合线检测结果,由于无需针对每条分支的不同实际情况分别编写多条测试用例,可减少时间消耗,根据待合并分支以及各自差异信息,即可准确获得合线成功与否的检测结果,提升了对分支合线的检测效率和准确度。
✦ Generated by Eureka AI based on patent content.
Smart Images

Figure CN117667648B_ABST
Abstract
The application relates to a code branch merging detection method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: obtaining difference information of code branches to be merged, and determining the file type of the code branches to be merged according to the difference information. If the file type is a code file, the first deletion line of a first branch to be merged is determined according to first difference information of the first branch to be merged, and the second deletion line and the newly added line of a second branch to be merged are determined according to second difference information of the second branch to be merged. Complete deletion lines are obtained based on the first deletion line and the second deletion line, the newly added line is screened according to the complete deletion lines, the target newly added line is screened out, the line merging detection is performed based on the target newly added line and the branch code file of the first branch, and a line merging detection result is generated. According to the branches to be merged and the respective difference information, the detection result of whether the line merging is successful or not can be accurately obtained, and the detection efficiency and accuracy of the branch line merging are improved.
Need to check novelty before this filing date? Find Prior Art
Citation Information
Patent Citations
Code checking method and device, storage medium and computer program product
CN114185591A
Branch code merging method and device, electronic equipment and storage medium
CN114296788A