Fossil SCM

Get stub table layout in place for merge-info --html. It's not yet clear whether this will suffice.

stephan 2024-12-09 07:08 merge-info-html
Commit 5a1da556d69b208a5b7dc6d452b8b89fdbc4dfcd98437552a8343f2ef72a1ccb
+1 -1
--- src/default.css
+++ src/default.css
@@ -1629,11 +1629,11 @@
16291629
-0.6836761,0.240014 -1.4255375,0.720042 V 3.0698267 q 0.8800513,-0.3054724 1.6073661,-0.4509353 \
16301630
0.7273151,-0.145463 1.403718,-0.145463 1.7746486,0 2.7056104,0.727315 0.930965,0.720042 \
16311631
0.930965,2.1092135 0,0.7127686 -0.283654,1.2800746 -0.283652,0.5600324 -0.967329,1.2073428 \
16321632
L 10.025425,8.2119439 Q 9.530851,8.6628792 9.3781148,8.9392588 9.2253789,9.2083654 \
16331633
9.2253789,9.535657 Z M 6.5997716,10.939376 h 2.6256073 v 2.589241 H 6.5997716 Z' \
1634
-style='fill:%23f8f8f8;stroke-width:1.35412836' /%3e%3c/svg%3e ");
1634
+style='fill:%23f8f8f8;stroke-width:1.35412836' /%3e%3c/svg%3e ");
16351635
background-repeat: no-repeat;
16361636
background-position: center;
16371637
/* When not using a background image, this additional style works
16381638
reasonably well along with a ::before content of "?": */
16391639
/*border-width: 1px;
16401640
--- src/default.css
+++ src/default.css
@@ -1629,11 +1629,11 @@
1629 -0.6836761,0.240014 -1.4255375,0.720042 V 3.0698267 q 0.8800513,-0.3054724 1.6073661,-0.4509353 \
1630 0.7273151,-0.145463 1.403718,-0.145463 1.7746486,0 2.7056104,0.727315 0.930965,0.720042 \
1631 0.930965,2.1092135 0,0.7127686 -0.283654,1.2800746 -0.283652,0.5600324 -0.967329,1.2073428 \
1632 L 10.025425,8.2119439 Q 9.530851,8.6628792 9.3781148,8.9392588 9.2253789,9.2083654 \
1633 9.2253789,9.535657 Z M 6.5997716,10.939376 h 2.6256073 v 2.589241 H 6.5997716 Z' \
1634 style='fill:%23f8f8f8;stroke-width:1.35412836' /%3e%3c/svg%3e ");
1635 background-repeat: no-repeat;
1636 background-position: center;
1637 /* When not using a background image, this additional style works
1638 reasonably well along with a ::before content of "?": */
1639 /*border-width: 1px;
1640
--- src/default.css
+++ src/default.css
@@ -1629,11 +1629,11 @@
1629 -0.6836761,0.240014 -1.4255375,0.720042 V 3.0698267 q 0.8800513,-0.3054724 1.6073661,-0.4509353 \
1630 0.7273151,-0.145463 1.403718,-0.145463 1.7746486,0 2.7056104,0.727315 0.930965,0.720042 \
1631 0.930965,2.1092135 0,0.7127686 -0.283654,1.2800746 -0.283652,0.5600324 -0.967329,1.2073428 \
1632 L 10.025425,8.2119439 Q 9.530851,8.6628792 9.3781148,8.9392588 9.2253789,9.2083654 \
1633 9.2253789,9.535657 Z M 6.5997716,10.939376 h 2.6256073 v 2.589241 H 6.5997716 Z' \
1634 style='fill:%23f8f8f8;stroke-width:1.35412836' /%3e%3c/svg%3e ");
1635 background-repeat: no-repeat;
1636 background-position: center;
1637 /* When not using a background image, this additional style works
1638 reasonably well along with a ::before content of "?": */
1639 /*border-width: 1px;
1640
--- src/merge.c
+++ src/merge.c
@@ -354,11 +354,10 @@
354354
/* 0 1 2 3 4 5 6 7 */
355355
"SELECT fnp, ridp, fn, ridv, sz, fnm, ridm, fnr"
356356
" FROM mergestat WHERE rowid IN mi_html"
357357
" ORDER BY coalesce(fnr,fn,fnp)"
358358
);
359
- blob_append(&out, "<ul>\n", 5);
360359
while( SQLITE_ROW==db_step(&q) ){
361360
const char * zFN; /* A filename */
362361
char * zToFree[5] = {0,0,0,0,0}; /* String memory to free */
363362
unsigned zToFreeNdx = 0; /* Current index into zToFree */
364363
int rid = 0; /* A blob rid */
@@ -449,11 +448,10 @@
449448
zToFree[i] = 0;
450449
}
451450
}/* for-each-file loop */
452451
db_finalize(&q);
453452
mb->xDestroy(mb);
454
- blob_append(&out, "</ul>\n", 6);
455453
456454
blob_append(&out, diff_webpage_footer(), -1);
457455
blob_reset(&v1);
458456
blob_reset(&v2);
459457
blob_reset(&pivot);
460458
--- src/merge.c
+++ src/merge.c
@@ -354,11 +354,10 @@
354 /* 0 1 2 3 4 5 6 7 */
355 "SELECT fnp, ridp, fn, ridv, sz, fnm, ridm, fnr"
356 " FROM mergestat WHERE rowid IN mi_html"
357 " ORDER BY coalesce(fnr,fn,fnp)"
358 );
359 blob_append(&out, "<ul>\n", 5);
360 while( SQLITE_ROW==db_step(&q) ){
361 const char * zFN; /* A filename */
362 char * zToFree[5] = {0,0,0,0,0}; /* String memory to free */
363 unsigned zToFreeNdx = 0; /* Current index into zToFree */
364 int rid = 0; /* A blob rid */
@@ -449,11 +448,10 @@
449 zToFree[i] = 0;
450 }
451 }/* for-each-file loop */
452 db_finalize(&q);
453 mb->xDestroy(mb);
454 blob_append(&out, "</ul>\n", 6);
455
456 blob_append(&out, diff_webpage_footer(), -1);
457 blob_reset(&v1);
458 blob_reset(&v2);
459 blob_reset(&pivot);
460
--- src/merge.c
+++ src/merge.c
@@ -354,11 +354,10 @@
354 /* 0 1 2 3 4 5 6 7 */
355 "SELECT fnp, ridp, fn, ridv, sz, fnm, ridm, fnr"
356 " FROM mergestat WHERE rowid IN mi_html"
357 " ORDER BY coalesce(fnr,fn,fnp)"
358 );
 
359 while( SQLITE_ROW==db_step(&q) ){
360 const char * zFN; /* A filename */
361 char * zToFree[5] = {0,0,0,0,0}; /* String memory to free */
362 unsigned zToFreeNdx = 0; /* Current index into zToFree */
363 int rid = 0; /* A blob rid */
@@ -449,11 +448,10 @@
448 zToFree[i] = 0;
449 }
450 }/* for-each-file loop */
451 db_finalize(&q);
452 mb->xDestroy(mb);
 
453
454 blob_append(&out, diff_webpage_footer(), -1);
455 blob_reset(&v1);
456 blob_reset(&v2);
457 blob_reset(&pivot);
458
+31 -8
--- src/merge3.c
+++ src/merge3.c
@@ -722,52 +722,75 @@
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, "<h1>%h &rarr; (%h, %h) &rarr; %h</h1><pre>",
727
+ blob_appendf(p->pOut, "<h1>%h &rarr; (%h, %h) &rarr; %h</h1>",
728728
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
729751
}
730752
731753
/* MergeBuilderHtml::xEnd() */
732754
static void htmlEnd(MergeBuilder *p){
733755
MergeBuilderHtml *pH = (MergeBuilderHtml*)p;
734756
unsigned int i;
735757
736758
/* TODO: flush pH->aCol to p->pOut and close HTML table */
737759
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]);
739762
}
740
- blob_append(p->pOut, "</pre>\n", -1);
763
+ blob_append(p->pOut, "</tbody></table>\n", -1);
741764
p->pV1 = p->pV2 = p->pPivot = p->pOut = 0;
742765
p->zPivot = p->zV1 = p->zV2 = p->zOut = 0;
743766
}
744767
745768
/* MergeBuilderHtml::xSame() */
746769
static void htmlSame(MergeBuilder *p, unsigned int N){
747
- return dbgSame(p, N);
770
+ /*dbgSame(p, N);*/
748771
}
749772
/* MergeBuilderHtml::xChngV1() */
750773
static void htmlChngV1(MergeBuilder *p, unsigned int nPivot, unsigned int nV1){
751
- return dbgChngV1(p, nPivot, nV1);
774
+ /*dbgChngV1(p, nPivot, nV1);*/
752775
}
753776
/* MergeBuilderHtml::xChngV2() */
754777
static void htmlChngV2(MergeBuilder *p, unsigned int nPivot, unsigned int nV2){
755
- return dbgChngV2(p, nPivot, nV2);
778
+ /*dbgChngV2(p, nPivot, nV2);*/
756779
}
757780
/* MergeBuilderHtml::xChngBoth() */
758781
static void htmlChngBoth(MergeBuilder *p, unsigned int nPivot, unsigned int nV){
759
- return dbgChngBoth(p, nPivot, nV);
782
+ /*dbgChngBoth(p, nPivot, nV);*/
760783
}
761784
/* MergeBuilderHtml::xConflict() */
762785
static void htmlConflict(
763786
MergeBuilder *p,
764787
unsigned int nPivot,
765788
unsigned int nV1,
766789
unsigned int nV2
767790
){
768
- return dbgConflict(p, nPivot, nV1, nV2);
791
+ /*dbgConflict(p, nPivot, nV1, nV2);*/
769792
}
770793
void mergebuilder_init_html(MergeBuilderHtml *pH){
771794
MergeBuilder *p = &pH->base;
772795
unsigned int i;
773796
mergebuilder_init(p);
774797
--- src/merge3.c
+++ src/merge3.c
@@ -722,52 +722,75 @@
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){
733 MergeBuilderHtml *pH = (MergeBuilderHtml*)p;
734 unsigned int i;
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
--- src/merge3.c
+++ src/merge3.c
@@ -722,52 +722,75 @@
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>",
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
751 }
752
753 /* MergeBuilderHtml::xEnd() */
754 static void htmlEnd(MergeBuilder *p){
755 MergeBuilderHtml *pH = (MergeBuilderHtml*)p;
756 unsigned int i;
757
758 /* TODO: flush pH->aCol to p->pOut and close HTML table */
759 for(i = 0; i < sizeof(pH->aCol)/sizeof(Blob); ++i){
760 blob_appendf(&pH->aCol[i], "</pre></td><!-- end col-#%u -->", i);
761 blob_append_xfer(p->pOut, &pH->aCol[i]);
762 }
763 blob_append(p->pOut, "</tbody></table>\n", -1);
764 p->pV1 = p->pV2 = p->pPivot = p->pOut = 0;
765 p->zPivot = p->zV1 = p->zV2 = p->zOut = 0;
766 }
767
768 /* MergeBuilderHtml::xSame() */
769 static void htmlSame(MergeBuilder *p, unsigned int N){
770 /*dbgSame(p, N);*/
771 }
772 /* MergeBuilderHtml::xChngV1() */
773 static void htmlChngV1(MergeBuilder *p, unsigned int nPivot, unsigned int nV1){
774 /*dbgChngV1(p, nPivot, nV1);*/
775 }
776 /* MergeBuilderHtml::xChngV2() */
777 static void htmlChngV2(MergeBuilder *p, unsigned int nPivot, unsigned int nV2){
778 /*dbgChngV2(p, nPivot, nV2);*/
779 }
780 /* MergeBuilderHtml::xChngBoth() */
781 static void htmlChngBoth(MergeBuilder *p, unsigned int nPivot, unsigned int nV){
782 /*dbgChngBoth(p, nPivot, nV);*/
783 }
784 /* MergeBuilderHtml::xConflict() */
785 static void htmlConflict(
786 MergeBuilder *p,
787 unsigned int nPivot,
788 unsigned int nV1,
789 unsigned int nV2
790 ){
791 /*dbgConflict(p, nPivot, nV1, nV2);*/
792 }
793 void mergebuilder_init_html(MergeBuilderHtml *pH){
794 MergeBuilder *p = &pH->base;
795 unsigned int i;
796 mergebuilder_init(p);
797

Keyboard Shortcuts

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