Method for performing conditionalized N-way merging of source code
First Claim
Patent Images
1. A method for performing conditionalized N-way merging of source code associated with a program, comprising:
- collecting differential information for each of N versions of source code, the source code having lines of text;
constructing a merge data structure using the differential information, the merge data structure comprising a plurality of common blocks and delta blocks, wherein each common block defines a respective sequence of textual lines of source code, each delta block defines an addition or deletion or change to a corresponding common block, each common block and delta block being associated with a respective set of exclusionary definitions indicative of any source code versions not including the respective block; and
merging the N versions into a single, semantically correct, unified version of source code associated with the program using the merge data structure, the single, semantically correct, unified version of source code associated with the program having preprocessing conditionals adapted to identify differences between the N versions.
7 Assignments
0 Petitions
Accused Products
Abstract
A method combines N versions of a C/C++ program into a single, semantically correct, unified program, while maintaining the semantics of each version within N. The problem of merge conflicts is avoided by conditionalizing changes that potentially conflict, according to a set of preprocessors definitions that uniquely define the version within N. Conditionalization is realized through C/C++ preprocessing directives (e.g., #if, #else, #elif).
-
Citations
17 Claims
-
1. A method for performing conditionalized N-way merging of source code associated with a program, comprising:
-
collecting differential information for each of N versions of source code, the source code having lines of text; constructing a merge data structure using the differential information, the merge data structure comprising a plurality of common blocks and delta blocks, wherein each common block defines a respective sequence of textual lines of source code, each delta block defines an addition or deletion or change to a corresponding common block, each common block and delta block being associated with a respective set of exclusionary definitions indicative of any source code versions not including the respective block; and merging the N versions into a single, semantically correct, unified version of source code associated with the program using the merge data structure, the single, semantically correct, unified version of source code associated with the program having preprocessing conditionals adapted to identify differences between the N versions. - View Dependent Claims (2, 3, 4, 5, 6, 10, 11, 12, 13, 14)
-
-
7. The method of claim one, wherein one or more of said common blocks comprise textual lines included in each of the N versions of the source code.
- 8. The method of claim one, wherein said step of constructing said merge data structure comprises splitting an initial common block representing the original version of the source code into said plurality of common blocks by splitting said initial common block into common blocks comprising textual lines included in each of the N versions of the source code and common blocks comprising textual lines included in only some of the N versions of the source code.
-
15. A system for performing conditionalized N-way merging of source code, comprising:
-
memory for storing program components; and a processor for executing the program components, the program components comprising; a differential collection component for collecting differential information for each of N versions of source code, the source code having lines of text; a constructor component for constructing a merge data structure using the differential information, the merge data structure comprising a plurality of common blocks and delta blocks, wherein each common block defines a respective sequence of textual lines of source code, each delta block defines an addition or deletion or change to a corresponding common block, each common block and delta block being associated with a respective set of exclusionary definitions indicative of any source code versions not including the respective block; and a merge component for merging the N versions into a single, semantically correct, unified version of source code associated with the program using the merge data structure, the single, semantically correct, unified version of source code associated with the program having preprocessing conditionals adapted to identify differences between the N versions.
-
-
16. A non-transitory computer-readable storage medium having instructions stored thereon for performing a method for performing conditionalized N-way merging of source code, the method comprising:
-
collecting differential information for each of N versions of source code, the source code having lines of text; constructing a merge data structure using the differential information, the merge data structure comprising a plurality of common blocks and delta blocks, wherein each common block defines a respective sequence of textual lines of source code, each delta block defines an addition or deletion or change to a corresponding common block, each common block and delta block being associated with a respective set of exclusionary definitions indicative of any source code versions not including the respective block; and merging the N versions into a single, semantically correct, unified version of source code associated with the program using the merge data structure, the single, semantically correct, unified version of source code associated with the program having preprocessing conditionals adapted to identify differences between the N versions.
-
-
17. A system for performing conditionalized N-way merging of source code, the system comprising:
-
means for collecting differential information for each of N versions of an original source code program, the original source code program having lines of text; means for constructing a merge data structure from the differential information; and means for merging the N versions into a single, semantically correct, unified program using the merge data structure, the single, semantically correct, unified program having preprocessing conditionals to represent differences between the N versions.
-
Specification