Method and apparatus for merging a plurality of software code change versions
AssigneeHuawei Cloud Computing Technology Co., Ltd.
InventorsZhao Wei, Guangtai Liang, Lin Li, Qianxiang Wang
Life of this patent
Estimating the term…
Abstract
A method for merging a plurality of software code change versions, where a merging apparatus may first analyze code change areas in a software code preliminarily merged version and two different software code change versions. After change intents of the two code change areas are determined, the merging apparatus eliminates, based on a conflict elimination rule set and the change intents of the two code change areas, a conflict block in the software code preliminarily merged version.
Claims20
A method for merging a plurality of software code change versions, the method comprising:
- obtaining, based on original software code that has been changed, both a first software code change version of a conflict block in a software code preliminarily merged version and a second software code change version of the conflict block;
- analyzing both a first code area in the first software code change version and a second code area in the second software code change version;
- determining, based on analyzing both the first code area in the first software code change version and the second code area in the second software code change version, a first change intent of the first code area in the first software code change version and a second change intent of the second code area in the second software code change version;
- and
- eliminating the conflict block based on a conflict elimination rule set, the first change intent of the first code area in the first software code change version, and the second change intent of the second code area in the second software code change version,
- wherein the conflict elimination rule set comprises at least one conflict elimination rule, and
- wherein each of the at least one conflict elimination rule records a conflict elimination solution used for merging code change areas in different software code change versions for conflict blocks.
A computing device cluster comprising a plurality of computing devices, wherein the plurality of computing devices comprise:
- a memory configured to store computer program instructions;
- and
- a processor coupled to the memory and configured to execute the computer program instructions to cause the computing device cluster to:
- obtain, based on original software code that has been changed, both a first software code change version of a conflict block in a software code preliminarily merged version and a second software code change version of the conflict block;
- analyze both a first code area in the first software code change version and a second code area in the second software code change version;
- determine, based on analyzing both the first code area in the first software code change version and the second code area in the second software code change version, a first change intent of the first code area in the first software code change version and a second change intent of the second code area in the second software code change version;
- and
- eliminate the conflict block based on a conflict elimination rule set, the first change intent of the first code area in the first software code change version, and the second change intent of the second code area in the second software code change version,
- wherein the conflict elimination rule set comprises at least one conflict elimination rule, and
- wherein each of the at least one conflict elimination rule records a conflict elimination solution used for merging code change areas in different software code change versions for conflict blocks.
A computer program product comprising computer-executable instructions that are stored on a non-transitory computer-readable medium and that, when executed by a processor of an apparatus, cause the apparatus to:
- obtain, based on original software code that has been changed, both a first software code change version of a conflict block in a software code preliminarily merged version and a second software code change version of the conflict block;
- analyze both a first code area in the first software code change version and a second code area in the second software code change version;
- determine, based on analyzing both the first code area in the first software code change version and the second code area in the second software code change version, a first change intent of the first code area in the first software code change version and a second change intent of the second code area in the second software code change version;
- and
- eliminate the conflict block based on a conflict elimination rule set, the first change intent of the first code area in the first software code change version, and the second change intent of the second code area in the second software code change version,
- wherein the conflict elimination rule set comprises at least one conflict elimination rule, and
- wherein each of the at least one conflict elimination rule records a conflict elimination solution used for merging code change areas in different software code change versions for conflict blocks.
Dependencies are inferred from the claim text.