| | @@ -722,52 +722,75 @@ |
| 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, "<h1>%h → (%h, %h) → %h</h1><pre>", |
| 727 | + blob_appendf(p->pOut, "<h1>%h → (%h, %h) → %h</h1>", |
| 728 | 728 | p->zPivot, p->zV1, p->zV2, p->zOut); |
| 729 | + /* Reminder; MergeBuilder does not currently contain enough state to |
| 730 | + ** let us include version info in this diff. We have the raw content |
| 731 | + ** of p->pPivot and p->pV2, but p->pV1 may be locally edited. We |
| 732 | + ** can't readily know whether we need to use SHA1 or SHA3 to find it |
| 733 | + ** in the blob table. */ |
| 734 | + blob_append(p->pOut, |
| 735 | + "<table class='diff'><tbody>" |
| 736 | + "<tr class='diffchunk'>\n", -1); |
| 737 | +#define DCOL(KEY,KLASS,DUMMY) \ |
| 738 | + blob_appendf(&pH->aCol[KEY], "<td class='" KLASS "'><pre>%h", DUMMY) |
| 739 | + DCOL(MBH_COL_BASELINE_LN, "mrgBaseLn diffln", "###"); |
| 740 | + DCOL(MBH_COL_BASELINE, "mrgBase", "merge base"); |
| 741 | + DCOL(MBH_COL_BASELINE_SEP, "mrgBaseSep diffsep", " "); |
| 742 | + DCOL(MBH_COL_LOCAL_LN, "mrgLocalLn diffln", "###"); |
| 743 | + DCOL(MBH_COL_LOCAL, "mrgLocal", "local"); |
| 744 | + DCOL(MBH_COL_LOCAL_SEP, "mrgLocalSep diffsep", " "); |
| 745 | + DCOL(MBH_COL_MERGEDIN_LN, "mrgMILn diffln", "###"); |
| 746 | + DCOL(MBH_COL_MERGEDIN, "mrgMI", "merged-in"); |
| 747 | + DCOL(MBH_COL_MERGEDIN_SEP, "mrgMISep diffsep", " "); |
| 748 | + DCOL(MBH_COL_RESULT_LN, "mrgResLn diffln", "###"); |
| 749 | + DCOL(MBH_COL_RESULT, "mrgRes", "merge result"); |
| 750 | +#undef DCOL |
| 729 | 751 | } |
| 730 | 752 | |
| 731 | 753 | /* MergeBuilderHtml::xEnd() */ |
| 732 | 754 | static void htmlEnd(MergeBuilder *p){ |
| 733 | 755 | MergeBuilderHtml *pH = (MergeBuilderHtml*)p; |
| 734 | 756 | unsigned int i; |
| 735 | 757 | |
| 736 | 758 | /* TODO: flush pH->aCol to p->pOut and close HTML table */ |
| 737 | 759 | for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){ |
| 738 | | - blob_reset(&pH->aCol[i]); |
| 760 | + blob_appendf(&pH->aCol[i], "</pre></td><!-- end col-#%u -->", i); |
| 761 | + blob_append_xfer(p->pOut, &pH->aCol[i]); |
| 739 | 762 | } |
| 740 | | - blob_append(p->pOut, "</pre>\n", -1); |
| 763 | + blob_append(p->pOut, "</tbody></table>\n", -1); |
| 741 | 764 | p->pV1 = p->pV2 = p->pPivot = p->pOut = 0; |
| 742 | 765 | p->zPivot = p->zV1 = p->zV2 = p->zOut = 0; |
| 743 | 766 | } |
| 744 | 767 | |
| 745 | 768 | /* MergeBuilderHtml::xSame() */ |
| 746 | 769 | static void htmlSame(MergeBuilder *p, unsigned int N){ |
| 747 | | - return dbgSame(p, N); |
| 770 | + /*dbgSame(p, N);*/ |
| 748 | 771 | } |
| 749 | 772 | /* MergeBuilderHtml::xChngV1() */ |
| 750 | 773 | static void htmlChngV1(MergeBuilder *p, unsigned int nPivot, unsigned int nV1){ |
| 751 | | - return dbgChngV1(p, nPivot, nV1); |
| 774 | + /*dbgChngV1(p, nPivot, nV1);*/ |
| 752 | 775 | } |
| 753 | 776 | /* MergeBuilderHtml::xChngV2() */ |
| 754 | 777 | static void htmlChngV2(MergeBuilder *p, unsigned int nPivot, unsigned int nV2){ |
| 755 | | - return dbgChngV2(p, nPivot, nV2); |
| 778 | + /*dbgChngV2(p, nPivot, nV2);*/ |
| 756 | 779 | } |
| 757 | 780 | /* MergeBuilderHtml::xChngBoth() */ |
| 758 | 781 | static void htmlChngBoth(MergeBuilder *p, unsigned int nPivot, unsigned int nV){ |
| 759 | | - return dbgChngBoth(p, nPivot, nV); |
| 782 | + /*dbgChngBoth(p, nPivot, nV);*/ |
| 760 | 783 | } |
| 761 | 784 | /* MergeBuilderHtml::xConflict() */ |
| 762 | 785 | static void htmlConflict( |
| 763 | 786 | MergeBuilder *p, |
| 764 | 787 | unsigned int nPivot, |
| 765 | 788 | unsigned int nV1, |
| 766 | 789 | unsigned int nV2 |
| 767 | 790 | ){ |
| 768 | | - return dbgConflict(p, nPivot, nV1, nV2); |
| 791 | + /*dbgConflict(p, nPivot, nV1, nV2);*/ |
| 769 | 792 | } |
| 770 | 793 | void mergebuilder_init_html(MergeBuilderHtml *pH){ |
| 771 | 794 | MergeBuilder *p = &pH->base; |
| 772 | 795 | unsigned int i; |
| 773 | 796 | mergebuilder_init(p); |
| 774 | 797 | |