431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
|
MergeBuilder *p,
unsigned int nPivot,
unsigned int nV1,
unsigned int nV2
){
int nRes; /* Lines in the computed conflict resolution */
Blob res; /* Text of the conflict resolution */
merge_try_to_resolve_conflict(p, nPivot, nV1, nV2, &res);
nRes = blob_linecount(&res);
append_merge_mark(p->pOut, 0, p->lnV1+1, p->useCrLf);
blob_copy_lines(p->pOut, p->pV1, nV1); p->lnV1 += nV1;
if( nRes>0 ){
|
|
|
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
|
MergeBuilder *p,
unsigned int nPivot,
unsigned int nV1,
unsigned int nV2
){
int nRes; /* Lines in the computed conflict resolution */
Blob res; /* Text of the conflict resolution */
merge_try_to_resolve_conflict(p, nPivot, nV1, nV2, &res);
nRes = blob_linecount(&res);
append_merge_mark(p->pOut, 0, p->lnV1+1, p->useCrLf);
blob_copy_lines(p->pOut, p->pV1, nV1); p->lnV1 += nV1;
if( nRes>0 ){
|
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
|
MergeBuilderHtml *pH = (MergeBuilderHtml*)p;
unsigned int i;
for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
blob_zero(&pH->aCol[i]);
}
/* TODO: open HTML table in p->pOut */
blob_appendf(p->pOut, "<li>%h → (%h, %h) → %h",
p->zPivot, p->zV1, p->zV2, p->zOut);
}
/* MergeBuilderHtml::xEnd() */
static void htmlEnd(MergeBuilder *p){
MergeBuilderHtml *pH = (MergeBuilderHtml*)p;
unsigned int i;
/* TODO: flush pH->aCol to p->pOut and close HTML table */
for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
blob_reset(&pH->aCol[i]);
}
blob_append(p->pOut, "</li>\n", -1);
p->pV1 = p->pV2 = p->pPivot = p->pOut = 0;
p->zPivot = p->zV1 = p->zV2 = p->zOut = 0;
}
/* MergeBuilderHtml::xSame() */
static void htmlSame(MergeBuilder *p, unsigned int N){
}
/* MergeBuilderHtml::xChngV1() */
static void htmlChngV1(MergeBuilder *p, unsigned int nPivot, unsigned int nV1){
}
/* MergeBuilderHtml::xChngV2() */
static void htmlChngV2(MergeBuilder *p, unsigned int nPivot, unsigned int nV2){
}
/* MergeBuilderHtml::xChngBoth() */
static void htmlChngBoth(MergeBuilder *p, unsigned int nPivot, unsigned int nV){
}
/* MergeBuilderHtml::xConflict() */
static void htmlConflict(
MergeBuilder *p,
unsigned int nPivot,
unsigned int nV1,
unsigned int nV2
){
}
void mergebuilder_init_html(MergeBuilderHtml *pH){
MergeBuilder *p = &pH->base;
unsigned int i;
mergebuilder_init(p);
p->xStart = htmlStart;
p->xEnd = htmlEnd;
|
|
|
>
>
>
>
>
|
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
|
MergeBuilderHtml *pH = (MergeBuilderHtml*)p;
unsigned int i;
for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
blob_zero(&pH->aCol[i]);
}
/* TODO: open HTML table in p->pOut */
blob_appendf(p->pOut, "<h1>%h → (%h, %h) → %h</h1><pre>",
p->zPivot, p->zV1, p->zV2, p->zOut);
}
/* MergeBuilderHtml::xEnd() */
static void htmlEnd(MergeBuilder *p){
MergeBuilderHtml *pH = (MergeBuilderHtml*)p;
unsigned int i;
/* TODO: flush pH->aCol to p->pOut and close HTML table */
for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
blob_reset(&pH->aCol[i]);
}
blob_append(p->pOut, "</pre>\n", -1);
p->pV1 = p->pV2 = p->pPivot = p->pOut = 0;
p->zPivot = p->zV1 = p->zV2 = p->zOut = 0;
}
/* MergeBuilderHtml::xSame() */
static void htmlSame(MergeBuilder *p, unsigned int N){
return dbgSame(p, N);
}
/* MergeBuilderHtml::xChngV1() */
static void htmlChngV1(MergeBuilder *p, unsigned int nPivot, unsigned int nV1){
return dbgChngV1(p, nPivot, nV1);
}
/* MergeBuilderHtml::xChngV2() */
static void htmlChngV2(MergeBuilder *p, unsigned int nPivot, unsigned int nV2){
return dbgChngV2(p, nPivot, nV2);
}
/* MergeBuilderHtml::xChngBoth() */
static void htmlChngBoth(MergeBuilder *p, unsigned int nPivot, unsigned int nV){
return dbgChngBoth(p, nPivot, nV);
}
/* MergeBuilderHtml::xConflict() */
static void htmlConflict(
MergeBuilder *p,
unsigned int nPivot,
unsigned int nV1,
unsigned int nV2
){
return dbgConflict(p, nPivot, nV1, nV2);
}
void mergebuilder_init_html(MergeBuilderHtml *pH){
MergeBuilder *p = &pH->base;
unsigned int i;
mergebuilder_init(p);
p->xStart = htmlStart;
p->xEnd = htmlEnd;
|