Fossil SCM

Plug the debug merge builder into the html builder's as-yet-unimplemented methods to assist in thinking through the next steps.

stephan 2024-12-07 20:14 merge-info-html
Commit d18f24e2ac96831dde8a6a63ae45ddeb777889c06d5f0ac7d4062fd261aa4e89
2 files changed +1 -1 +8 -3
+1 -1
--- src/merge.c
+++ src/merge.c
@@ -365,11 +365,11 @@
365365
int sz; /* File size */
366366
unsigned int i; /* Loop counter */
367367
368368
/* Most of this loop is copy/paste/slight adjust from
369369
** merge_info_tcl(). We can possibly consolidate this setup into a
370
- ** separate funciton. */
370
+ ** separate function. */
371371
372372
/* Set up the baseline/pivot... */
373373
zFN = db_column_text(&q, 0);
374374
if( zFN==0 ){
375375
/* No pivot because the file was added */
376376
--- src/merge.c
+++ src/merge.c
@@ -365,11 +365,11 @@
365 int sz; /* File size */
366 unsigned int i; /* Loop counter */
367
368 /* Most of this loop is copy/paste/slight adjust from
369 ** merge_info_tcl(). We can possibly consolidate this setup into a
370 ** separate funciton. */
371
372 /* Set up the baseline/pivot... */
373 zFN = db_column_text(&q, 0);
374 if( zFN==0 ){
375 /* No pivot because the file was added */
376
--- src/merge.c
+++ src/merge.c
@@ -365,11 +365,11 @@
365 int sz; /* File size */
366 unsigned int i; /* Loop counter */
367
368 /* Most of this loop is copy/paste/slight adjust from
369 ** merge_info_tcl(). We can possibly consolidate this setup into a
370 ** separate function. */
371
372 /* Set up the baseline/pivot... */
373 zFN = db_column_text(&q, 0);
374 if( zFN==0 ){
375 /* No pivot because the file was added */
376
+8 -3
--- src/merge3.c
+++ src/merge3.c
@@ -433,11 +433,11 @@
433433
unsigned int nV1,
434434
unsigned int nV2
435435
){
436436
int nRes; /* Lines in the computed conflict resolution */
437437
Blob res; /* Text of the conflict resolution */
438
-
438
+
439439
merge_try_to_resolve_conflict(p, nPivot, nV1, nV2, &res);
440440
nRes = blob_linecount(&res);
441441
442442
append_merge_mark(p->pOut, 0, p->lnV1+1, p->useCrLf);
443443
blob_copy_lines(p->pOut, p->pV1, nV1); p->lnV1 += nV1;
@@ -722,11 +722,11 @@
722722
723723
for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
724724
blob_zero(&pH->aCol[i]);
725725
}
726726
/* TODO: open HTML table in p->pOut */
727
- blob_appendf(p->pOut, "<li>%h &rarr; (%h, %h) &rarr; %h",
727
+ blob_appendf(p->pOut, "<h1>%h &rarr; (%h, %h) &rarr; %h</h1><pre>",
728728
p->zPivot, p->zV1, p->zV2, p->zOut);
729729
}
730730
731731
/* MergeBuilderHtml::xEnd() */
732732
static void htmlEnd(MergeBuilder *p){
@@ -735,34 +735,39 @@
735735
736736
/* TODO: flush pH->aCol to p->pOut and close HTML table */
737737
for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
738738
blob_reset(&pH->aCol[i]);
739739
}
740
- blob_append(p->pOut, "</li>\n", -1);
740
+ blob_append(p->pOut, "</pre>\n", -1);
741741
p->pV1 = p->pV2 = p->pPivot = p->pOut = 0;
742742
p->zPivot = p->zV1 = p->zV2 = p->zOut = 0;
743743
}
744744
745745
/* MergeBuilderHtml::xSame() */
746746
static void htmlSame(MergeBuilder *p, unsigned int N){
747
+ return dbgSame(p, N);
747748
}
748749
/* MergeBuilderHtml::xChngV1() */
749750
static void htmlChngV1(MergeBuilder *p, unsigned int nPivot, unsigned int nV1){
751
+ return dbgChngV1(p, nPivot, nV1);
750752
}
751753
/* MergeBuilderHtml::xChngV2() */
752754
static void htmlChngV2(MergeBuilder *p, unsigned int nPivot, unsigned int nV2){
755
+ return dbgChngV2(p, nPivot, nV2);
753756
}
754757
/* MergeBuilderHtml::xChngBoth() */
755758
static void htmlChngBoth(MergeBuilder *p, unsigned int nPivot, unsigned int nV){
759
+ return dbgChngBoth(p, nPivot, nV);
756760
}
757761
/* MergeBuilderHtml::xConflict() */
758762
static void htmlConflict(
759763
MergeBuilder *p,
760764
unsigned int nPivot,
761765
unsigned int nV1,
762766
unsigned int nV2
763767
){
768
+ return dbgConflict(p, nPivot, nV1, nV2);
764769
}
765770
void mergebuilder_init_html(MergeBuilderHtml *pH){
766771
MergeBuilder *p = &pH->base;
767772
unsigned int i;
768773
mergebuilder_init(p);
769774
--- src/merge3.c
+++ src/merge3.c
@@ -433,11 +433,11 @@
433 unsigned int nV1,
434 unsigned int nV2
435 ){
436 int nRes; /* Lines in the computed conflict resolution */
437 Blob res; /* Text of the conflict resolution */
438
439 merge_try_to_resolve_conflict(p, nPivot, nV1, nV2, &res);
440 nRes = blob_linecount(&res);
441
442 append_merge_mark(p->pOut, 0, p->lnV1+1, p->useCrLf);
443 blob_copy_lines(p->pOut, p->pV1, nV1); p->lnV1 += nV1;
@@ -722,11 +722,11 @@
722
723 for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
724 blob_zero(&pH->aCol[i]);
725 }
726 /* TODO: open HTML table in p->pOut */
727 blob_appendf(p->pOut, "<li>%h &rarr; (%h, %h) &rarr; %h",
728 p->zPivot, p->zV1, p->zV2, p->zOut);
729 }
730
731 /* MergeBuilderHtml::xEnd() */
732 static void htmlEnd(MergeBuilder *p){
@@ -735,34 +735,39 @@
735
736 /* TODO: flush pH->aCol to p->pOut and close HTML table */
737 for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
738 blob_reset(&pH->aCol[i]);
739 }
740 blob_append(p->pOut, "</li>\n", -1);
741 p->pV1 = p->pV2 = p->pPivot = p->pOut = 0;
742 p->zPivot = p->zV1 = p->zV2 = p->zOut = 0;
743 }
744
745 /* MergeBuilderHtml::xSame() */
746 static void htmlSame(MergeBuilder *p, unsigned int N){
 
747 }
748 /* MergeBuilderHtml::xChngV1() */
749 static void htmlChngV1(MergeBuilder *p, unsigned int nPivot, unsigned int nV1){
 
750 }
751 /* MergeBuilderHtml::xChngV2() */
752 static void htmlChngV2(MergeBuilder *p, unsigned int nPivot, unsigned int nV2){
 
753 }
754 /* MergeBuilderHtml::xChngBoth() */
755 static void htmlChngBoth(MergeBuilder *p, unsigned int nPivot, unsigned int nV){
 
756 }
757 /* MergeBuilderHtml::xConflict() */
758 static void htmlConflict(
759 MergeBuilder *p,
760 unsigned int nPivot,
761 unsigned int nV1,
762 unsigned int nV2
763 ){
 
764 }
765 void mergebuilder_init_html(MergeBuilderHtml *pH){
766 MergeBuilder *p = &pH->base;
767 unsigned int i;
768 mergebuilder_init(p);
769
--- src/merge3.c
+++ src/merge3.c
@@ -433,11 +433,11 @@
433 unsigned int nV1,
434 unsigned int nV2
435 ){
436 int nRes; /* Lines in the computed conflict resolution */
437 Blob res; /* Text of the conflict resolution */
438
439 merge_try_to_resolve_conflict(p, nPivot, nV1, nV2, &res);
440 nRes = blob_linecount(&res);
441
442 append_merge_mark(p->pOut, 0, p->lnV1+1, p->useCrLf);
443 blob_copy_lines(p->pOut, p->pV1, nV1); p->lnV1 += nV1;
@@ -722,11 +722,11 @@
722
723 for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
724 blob_zero(&pH->aCol[i]);
725 }
726 /* TODO: open HTML table in p->pOut */
727 blob_appendf(p->pOut, "<h1>%h &rarr; (%h, %h) &rarr; %h</h1><pre>",
728 p->zPivot, p->zV1, p->zV2, p->zOut);
729 }
730
731 /* MergeBuilderHtml::xEnd() */
732 static void htmlEnd(MergeBuilder *p){
@@ -735,34 +735,39 @@
735
736 /* TODO: flush pH->aCol to p->pOut and close HTML table */
737 for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
738 blob_reset(&pH->aCol[i]);
739 }
740 blob_append(p->pOut, "</pre>\n", -1);
741 p->pV1 = p->pV2 = p->pPivot = p->pOut = 0;
742 p->zPivot = p->zV1 = p->zV2 = p->zOut = 0;
743 }
744
745 /* MergeBuilderHtml::xSame() */
746 static void htmlSame(MergeBuilder *p, unsigned int N){
747 return dbgSame(p, N);
748 }
749 /* MergeBuilderHtml::xChngV1() */
750 static void htmlChngV1(MergeBuilder *p, unsigned int nPivot, unsigned int nV1){
751 return dbgChngV1(p, nPivot, nV1);
752 }
753 /* MergeBuilderHtml::xChngV2() */
754 static void htmlChngV2(MergeBuilder *p, unsigned int nPivot, unsigned int nV2){
755 return dbgChngV2(p, nPivot, nV2);
756 }
757 /* MergeBuilderHtml::xChngBoth() */
758 static void htmlChngBoth(MergeBuilder *p, unsigned int nPivot, unsigned int nV){
759 return dbgChngBoth(p, nPivot, nV);
760 }
761 /* MergeBuilderHtml::xConflict() */
762 static void htmlConflict(
763 MergeBuilder *p,
764 unsigned int nPivot,
765 unsigned int nV1,
766 unsigned int nV2
767 ){
768 return dbgConflict(p, nPivot, nV1, nV2);
769 }
770 void mergebuilder_init_html(MergeBuilderHtml *pH){
771 MergeBuilder *p = &pH->base;
772 unsigned int i;
773 mergebuilder_init(p);
774

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button