149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
int blob_merge(Blob *pPivot, Blob *pV1, Blob *pV2, Blob *pOut){
int *aC1; /* Changes from pPivot to pV1 */
int *aC2; /* Changes from pPivot to pV2 */
int i1, i2; /* Index into aC1[] and aC2[] */
int nCpy, nDel, nIns; /* Number of lines to copy, delete, or insert */
int limit1, limit2; /* Sizes of aC1[] and aC2[] */
int nConflict = 0; /* Number of merge conflicts seen so far */
static const char zBegin[] = "<<<<<<< BEGIN MERGE CONFLICT\n";
static const char zMid[] = "============================\n";
static const char zEnd[] = ">>>>>>> END MERGE CONFLICT\n";
blob_zero(pOut); /* Merge results stored in pOut */
/* Compute the edits that occur from pPivot => pV1 (into aC1)
** and pPivot => pV2 (into aC2). Each of the aC1 and aC2 arrays is
** an array of integer triples. Within each triple, the first integer
** is the number of lines of text to copy directly from the pivot,
|
|
>
|
>
|
>
|
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
int blob_merge(Blob *pPivot, Blob *pV1, Blob *pV2, Blob *pOut){
int *aC1; /* Changes from pPivot to pV1 */
int *aC2; /* Changes from pPivot to pV2 */
int i1, i2; /* Index into aC1[] and aC2[] */
int nCpy, nDel, nIns; /* Number of lines to copy, delete, or insert */
int limit1, limit2; /* Sizes of aC1[] and aC2[] */
int nConflict = 0; /* Number of merge conflicts seen so far */
static const char zBegin[] =
"<<<<<<< BEGIN MERGE CONFLICT: original content first <<<<<<<\n";
static const char zMid[] =
"======= original content above; merged content below =======\n";
static const char zEnd[] =
">>>>>>> END MERGE CONFLICT: merged content last >>>>>>>>>>>>\n";
blob_zero(pOut); /* Merge results stored in pOut */
/* Compute the edits that occur from pPivot => pV1 (into aC1)
** and pPivot => pV2 (into aC2). Each of the aC1 and aC2 arrays is
** an array of integer triples. Within each triple, the first integer
** is the number of lines of text to copy directly from the pivot,
|