Fossil SCM
Plug the debug merge builder into the html builder's as-yet-unimplemented methods to assist in thinking through the next steps.
Commit
d18f24e2ac96831dde8a6a63ae45ddeb777889c06d5f0ac7d4062fd261aa4e89
Parent
814572550316830…
2 files changed
+1
-1
+8
-3
+1
-1
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -365,11 +365,11 @@ | ||
| 365 | 365 | int sz; /* File size */ |
| 366 | 366 | unsigned int i; /* Loop counter */ |
| 367 | 367 | |
| 368 | 368 | /* Most of this loop is copy/paste/slight adjust from |
| 369 | 369 | ** merge_info_tcl(). We can possibly consolidate this setup into a |
| 370 | - ** separate funciton. */ | |
| 370 | + ** separate function. */ | |
| 371 | 371 | |
| 372 | 372 | /* Set up the baseline/pivot... */ |
| 373 | 373 | zFN = db_column_text(&q, 0); |
| 374 | 374 | if( zFN==0 ){ |
| 375 | 375 | /* No pivot because the file was added */ |
| 376 | 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 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 @@ | ||
| 433 | 433 | unsigned int nV1, |
| 434 | 434 | unsigned int nV2 |
| 435 | 435 | ){ |
| 436 | 436 | int nRes; /* Lines in the computed conflict resolution */ |
| 437 | 437 | Blob res; /* Text of the conflict resolution */ |
| 438 | - | |
| 438 | + | |
| 439 | 439 | merge_try_to_resolve_conflict(p, nPivot, nV1, nV2, &res); |
| 440 | 440 | nRes = blob_linecount(&res); |
| 441 | 441 | |
| 442 | 442 | append_merge_mark(p->pOut, 0, p->lnV1+1, p->useCrLf); |
| 443 | 443 | blob_copy_lines(p->pOut, p->pV1, nV1); p->lnV1 += nV1; |
| @@ -722,11 +722,11 @@ | ||
| 722 | 722 | |
| 723 | 723 | for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){ |
| 724 | 724 | blob_zero(&pH->aCol[i]); |
| 725 | 725 | } |
| 726 | 726 | /* TODO: open HTML table in p->pOut */ |
| 727 | - blob_appendf(p->pOut, "<li>%h → (%h, %h) → %h", | |
| 727 | + blob_appendf(p->pOut, "<h1>%h → (%h, %h) → %h</h1><pre>", | |
| 728 | 728 | p->zPivot, p->zV1, p->zV2, p->zOut); |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | /* MergeBuilderHtml::xEnd() */ |
| 732 | 732 | static void htmlEnd(MergeBuilder *p){ |
| @@ -735,34 +735,39 @@ | ||
| 735 | 735 | |
| 736 | 736 | /* TODO: flush pH->aCol to p->pOut and close HTML table */ |
| 737 | 737 | for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){ |
| 738 | 738 | blob_reset(&pH->aCol[i]); |
| 739 | 739 | } |
| 740 | - blob_append(p->pOut, "</li>\n", -1); | |
| 740 | + blob_append(p->pOut, "</pre>\n", -1); | |
| 741 | 741 | p->pV1 = p->pV2 = p->pPivot = p->pOut = 0; |
| 742 | 742 | p->zPivot = p->zV1 = p->zV2 = p->zOut = 0; |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | /* MergeBuilderHtml::xSame() */ |
| 746 | 746 | static void htmlSame(MergeBuilder *p, unsigned int N){ |
| 747 | + return dbgSame(p, N); | |
| 747 | 748 | } |
| 748 | 749 | /* MergeBuilderHtml::xChngV1() */ |
| 749 | 750 | static void htmlChngV1(MergeBuilder *p, unsigned int nPivot, unsigned int nV1){ |
| 751 | + return dbgChngV1(p, nPivot, nV1); | |
| 750 | 752 | } |
| 751 | 753 | /* MergeBuilderHtml::xChngV2() */ |
| 752 | 754 | static void htmlChngV2(MergeBuilder *p, unsigned int nPivot, unsigned int nV2){ |
| 755 | + return dbgChngV2(p, nPivot, nV2); | |
| 753 | 756 | } |
| 754 | 757 | /* MergeBuilderHtml::xChngBoth() */ |
| 755 | 758 | static void htmlChngBoth(MergeBuilder *p, unsigned int nPivot, unsigned int nV){ |
| 759 | + return dbgChngBoth(p, nPivot, nV); | |
| 756 | 760 | } |
| 757 | 761 | /* MergeBuilderHtml::xConflict() */ |
| 758 | 762 | static void htmlConflict( |
| 759 | 763 | MergeBuilder *p, |
| 760 | 764 | unsigned int nPivot, |
| 761 | 765 | unsigned int nV1, |
| 762 | 766 | unsigned int nV2 |
| 763 | 767 | ){ |
| 768 | + return dbgConflict(p, nPivot, nV1, nV2); | |
| 764 | 769 | } |
| 765 | 770 | void mergebuilder_init_html(MergeBuilderHtml *pH){ |
| 766 | 771 | MergeBuilder *p = &pH->base; |
| 767 | 772 | unsigned int i; |
| 768 | 773 | mergebuilder_init(p); |
| 769 | 774 |
| --- 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 → (%h, %h) → %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 → (%h, %h) → %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 |