Fossil SCM

When HTML diffs are generated from a webpage, include sufficient information in class names ids, and data- elements to permit JS to redraw the separators to include context fill-in buttons.

drh 2021-09-07 18:45 trunk
Commit c275a166b351d2b122ded0bbcfc0039c026f54db870faf19a7a08b3ca435d09b
2 files changed +45 -12 +3
+45 -12
--- src/diff.c
+++ src/diff.c
@@ -96,10 +96,11 @@
9696
int wColumn; /* Column width in -y mode */
9797
u32 nFile; /* Number of files diffed so far */
9898
const char *zDiffCmd; /* External diff command to use instead of builtin */
9999
const char *zBinGlob; /* GLOB pattern for binary files */
100100
ReCompiled *pRe; /* Show only changes matching this pattern */
101
+ const char *zLeftHash; /* HASH-id of the left file */
101102
};
102103
103104
#endif /* INTERFACE */
104105
105106
/*
@@ -897,10 +898,11 @@
897898
unsigned int nPending; /* Number of pending lines */
898899
int eState; /* State of the output */
899900
int width; /* Display width */
900901
Blob *pOut; /* Output blob */
901902
Blob aCol[5]; /* Holding blobs */
903
+ DiffConfig *pCfg; /* Configuration information */
902904
};
903905
904906
/************************* DiffBuilderDebug ********************************/
905907
/* This version of DiffBuilder is used for debugging the diff and diff
906908
** diff formatter logic. It is accessed using the (undocumented) --debug
@@ -1251,11 +1253,20 @@
12511253
blob_appendf(p->pOut,"<tr id=\"chunk%d\">"
12521254
"<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
12531255
}
12541256
static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
12551257
dfunifiedFinishRow(p);
1256
- blob_append(p->pOut, "<tr><td class=\"diffln difflne\">"
1258
+ if( p->pCfg && p->pCfg->zLeftHash ){
1259
+ blob_appendf(p->pOut,
1260
+ "<tr class=\"diffskip\" data-startln=\"%d\" data-endln=\"%d\""
1261
+ " id=\"skip%xh%xi%x\">\n",
1262
+ p->lnLeft+1, p->lnLeft+n,
1263
+ nChunk, p->lnLeft, n);
1264
+ }else{
1265
+ blob_append(p->pOut, "<tr>", 4);
1266
+ }
1267
+ blob_append(p->pOut, "<td class=\"diffln difflne\">"
12571268
"&#xfe19;</td><td></td><td></td></tr>\n", -1);
12581269
p->lnLeft += n;
12591270
p->lnRight += n;
12601271
}
12611272
static void dfunifiedCommon(DiffBuilder *p, const DLine *pLine){
@@ -1372,11 +1383,11 @@
13721383
static void dfunifiedEnd(DiffBuilder *p){
13731384
dfunifiedFinishRow(p);
13741385
blob_append(p->pOut, "</table>\n",-1);
13751386
fossil_free(p);
13761387
}
1377
-static DiffBuilder *dfunifiedNew(Blob *pOut){
1388
+static DiffBuilder *dfunifiedNew(Blob *pOut, DiffConfig *pCfg){
13781389
DiffBuilder *p = fossil_malloc(sizeof(*p));
13791390
p->xSkip = dfunifiedSkip;
13801391
p->xCommon = dfunifiedCommon;
13811392
p->xInsert = dfunifiedInsert;
13821393
p->xDelete = dfunifiedDelete;
@@ -1385,16 +1396,22 @@
13851396
p->xEnd = dfunifiedEnd;
13861397
p->lnLeft = p->lnRight = 0;
13871398
p->eState = 0;
13881399
p->nPending = 0;
13891400
p->pOut = pOut;
1390
- blob_append(pOut, "<table class=\"diff udiff\">\n", -1);
1401
+ if( pCfg->zLeftHash ){
1402
+ blob_appendf(pOut, "<table class=\"diff udiff\" data-lefthash=\"%s\">\n",
1403
+ pCfg->zLeftHash);
1404
+ }else{
1405
+ blob_append(pOut, "<table class=\"diff udiff\">\n", -1);
1406
+ }
13911407
blob_init(&p->aCol[0], 0, 0);
13921408
blob_init(&p->aCol[1], 0, 0);
13931409
blob_init(&p->aCol[2], 0, 0);
13941410
blob_init(&p->aCol[3], 0, 0);
13951411
blob_init(&p->aCol[4], 0, 0);
1412
+ p->pCfg = pCfg;
13961413
return p;
13971414
}
13981415
13991416
/************************* DiffBuilderSplit ******************************/
14001417
/* This formatter creates a side-by-side diff in HTML. The output is a
@@ -1463,15 +1480,24 @@
14631480
"<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
14641481
p->eState = 0;
14651482
}
14661483
static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
14671484
dfsplitFinishRow(p);
1468
- blob_append(p->pOut,
1469
- "<tr><td class=\"diffln difflnl difflne\">&#xfe19;</td>"
1470
- "<td></td><td></td>"
1471
- "<td class=\"diffln difflnr difflne\">&#xfe19;</td>"
1472
- "<td/td></tr>\n", -1);
1485
+ if( p->pCfg && p->pCfg->zLeftHash ){
1486
+ blob_appendf(p->pOut,
1487
+ "<tr class=\"diffskip\" data-startln=\"%d\" data-endln=\"%d\""
1488
+ " id=\"skip%xh%xi%x\">\n",
1489
+ p->lnLeft+1, p->lnLeft+n,
1490
+ nChunk,p->lnLeft,n);
1491
+ }else{
1492
+ blob_append(p->pOut, "<tr>", 4);
1493
+ }
1494
+ blob_append(p->pOut,
1495
+ "<td class=\"diffln difflnl difflne\">&#xfe19;</td>"
1496
+ "<td></td><td></td>"
1497
+ "<td class=\"diffln difflnr difflne\">&#xfe19;</td>"
1498
+ "<td/td></tr>\n", -1);
14731499
p->lnLeft += n;
14741500
p->lnRight += n;
14751501
}
14761502
static void dfsplitCommon(DiffBuilder *p, const DLine *pLine){
14771503
dfsplitStartRow(p);
@@ -1580,11 +1606,11 @@
15801606
static void dfsplitEnd(DiffBuilder *p){
15811607
dfsplitFinishRow(p);
15821608
blob_append(p->pOut, "</table>\n",-1);
15831609
fossil_free(p);
15841610
}
1585
-static DiffBuilder *dfsplitNew(Blob *pOut){
1611
+static DiffBuilder *dfsplitNew(Blob *pOut, DiffConfig *pCfg){
15861612
DiffBuilder *p = fossil_malloc(sizeof(*p));
15871613
p->xSkip = dfsplitSkip;
15881614
p->xCommon = dfsplitCommon;
15891615
p->xInsert = dfsplitInsert;
15901616
p->xDelete = dfsplitDelete;
@@ -1592,16 +1618,23 @@
15921618
p->xEdit = dfsplitEdit;
15931619
p->xEnd = dfsplitEnd;
15941620
p->lnLeft = p->lnRight = 0;
15951621
p->eState = 0;
15961622
p->pOut = pOut;
1597
- blob_append(pOut, "<table class=\"diff splitdiff\">\n", -1);
1623
+ if( pCfg->zLeftHash ){
1624
+ blob_appendf(pOut,
1625
+ "<table class=\"diff splitdiff\" data-lefthash=\"%s\">\n",
1626
+ pCfg->zLeftHash);
1627
+ }else{
1628
+ blob_append(pOut, "<table class=\"diff splitdiff\">\n", -1);
1629
+ }
15981630
blob_init(&p->aCol[0], 0, 0);
15991631
blob_init(&p->aCol[1], 0, 0);
16001632
blob_init(&p->aCol[2], 0, 0);
16011633
blob_init(&p->aCol[3], 0, 0);
16021634
blob_init(&p->aCol[4], 0, 0);
1635
+ p->pCfg = pCfg;
16031636
return p;
16041637
}
16051638
16061639
/************************* DiffBuilderSbs ******************************/
16071640
/* This formatter creates a side-by-side diff in text.
@@ -2714,20 +2747,20 @@
27142747
DiffBuilder *pBuilder = dftclNew(pOut);
27152748
formatDiff(&c, pCfg, pBuilder);
27162749
}else if( pCfg->diffFlags & DIFF_SIDEBYSIDE ){
27172750
DiffBuilder *pBuilder;
27182751
if( pCfg->diffFlags & DIFF_HTML ){
2719
- pBuilder = dfsplitNew(pOut);
2752
+ pBuilder = dfsplitNew(pOut, pCfg);
27202753
}else{
27212754
pBuilder = dfsbsNew(pOut, pCfg);
27222755
}
27232756
formatDiff(&c, pCfg, pBuilder);
27242757
}else if( pCfg->diffFlags & DIFF_DEBUG ){
27252758
DiffBuilder *pBuilder = dfdebugNew(pOut);
27262759
formatDiff(&c, pCfg, pBuilder);
27272760
}else if( pCfg->diffFlags & DIFF_HTML ){
2728
- DiffBuilder *pBuilder = dfunifiedNew(pOut);
2761
+ DiffBuilder *pBuilder = dfunifiedNew(pOut, pCfg);
27292762
formatDiff(&c, pCfg, pBuilder);
27302763
}else{
27312764
contextDiff(&c, pOut, pCfg);
27322765
}
27332766
fossil_free(c.aFrom);
27342767
--- src/diff.c
+++ src/diff.c
@@ -96,10 +96,11 @@
96 int wColumn; /* Column width in -y mode */
97 u32 nFile; /* Number of files diffed so far */
98 const char *zDiffCmd; /* External diff command to use instead of builtin */
99 const char *zBinGlob; /* GLOB pattern for binary files */
100 ReCompiled *pRe; /* Show only changes matching this pattern */
 
101 };
102
103 #endif /* INTERFACE */
104
105 /*
@@ -897,10 +898,11 @@
897 unsigned int nPending; /* Number of pending lines */
898 int eState; /* State of the output */
899 int width; /* Display width */
900 Blob *pOut; /* Output blob */
901 Blob aCol[5]; /* Holding blobs */
 
902 };
903
904 /************************* DiffBuilderDebug ********************************/
905 /* This version of DiffBuilder is used for debugging the diff and diff
906 ** diff formatter logic. It is accessed using the (undocumented) --debug
@@ -1251,11 +1253,20 @@
1251 blob_appendf(p->pOut,"<tr id=\"chunk%d\">"
1252 "<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
1253 }
1254 static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
1255 dfunifiedFinishRow(p);
1256 blob_append(p->pOut, "<tr><td class=\"diffln difflne\">"
 
 
 
 
 
 
 
 
 
1257 "&#xfe19;</td><td></td><td></td></tr>\n", -1);
1258 p->lnLeft += n;
1259 p->lnRight += n;
1260 }
1261 static void dfunifiedCommon(DiffBuilder *p, const DLine *pLine){
@@ -1372,11 +1383,11 @@
1372 static void dfunifiedEnd(DiffBuilder *p){
1373 dfunifiedFinishRow(p);
1374 blob_append(p->pOut, "</table>\n",-1);
1375 fossil_free(p);
1376 }
1377 static DiffBuilder *dfunifiedNew(Blob *pOut){
1378 DiffBuilder *p = fossil_malloc(sizeof(*p));
1379 p->xSkip = dfunifiedSkip;
1380 p->xCommon = dfunifiedCommon;
1381 p->xInsert = dfunifiedInsert;
1382 p->xDelete = dfunifiedDelete;
@@ -1385,16 +1396,22 @@
1385 p->xEnd = dfunifiedEnd;
1386 p->lnLeft = p->lnRight = 0;
1387 p->eState = 0;
1388 p->nPending = 0;
1389 p->pOut = pOut;
1390 blob_append(pOut, "<table class=\"diff udiff\">\n", -1);
 
 
 
 
 
1391 blob_init(&p->aCol[0], 0, 0);
1392 blob_init(&p->aCol[1], 0, 0);
1393 blob_init(&p->aCol[2], 0, 0);
1394 blob_init(&p->aCol[3], 0, 0);
1395 blob_init(&p->aCol[4], 0, 0);
 
1396 return p;
1397 }
1398
1399 /************************* DiffBuilderSplit ******************************/
1400 /* This formatter creates a side-by-side diff in HTML. The output is a
@@ -1463,15 +1480,24 @@
1463 "<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
1464 p->eState = 0;
1465 }
1466 static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
1467 dfsplitFinishRow(p);
1468 blob_append(p->pOut,
1469 "<tr><td class=\"diffln difflnl difflne\">&#xfe19;</td>"
1470 "<td></td><td></td>"
1471 "<td class=\"diffln difflnr difflne\">&#xfe19;</td>"
1472 "<td/td></tr>\n", -1);
 
 
 
 
 
 
 
 
 
1473 p->lnLeft += n;
1474 p->lnRight += n;
1475 }
1476 static void dfsplitCommon(DiffBuilder *p, const DLine *pLine){
1477 dfsplitStartRow(p);
@@ -1580,11 +1606,11 @@
1580 static void dfsplitEnd(DiffBuilder *p){
1581 dfsplitFinishRow(p);
1582 blob_append(p->pOut, "</table>\n",-1);
1583 fossil_free(p);
1584 }
1585 static DiffBuilder *dfsplitNew(Blob *pOut){
1586 DiffBuilder *p = fossil_malloc(sizeof(*p));
1587 p->xSkip = dfsplitSkip;
1588 p->xCommon = dfsplitCommon;
1589 p->xInsert = dfsplitInsert;
1590 p->xDelete = dfsplitDelete;
@@ -1592,16 +1618,23 @@
1592 p->xEdit = dfsplitEdit;
1593 p->xEnd = dfsplitEnd;
1594 p->lnLeft = p->lnRight = 0;
1595 p->eState = 0;
1596 p->pOut = pOut;
1597 blob_append(pOut, "<table class=\"diff splitdiff\">\n", -1);
 
 
 
 
 
 
1598 blob_init(&p->aCol[0], 0, 0);
1599 blob_init(&p->aCol[1], 0, 0);
1600 blob_init(&p->aCol[2], 0, 0);
1601 blob_init(&p->aCol[3], 0, 0);
1602 blob_init(&p->aCol[4], 0, 0);
 
1603 return p;
1604 }
1605
1606 /************************* DiffBuilderSbs ******************************/
1607 /* This formatter creates a side-by-side diff in text.
@@ -2714,20 +2747,20 @@
2714 DiffBuilder *pBuilder = dftclNew(pOut);
2715 formatDiff(&c, pCfg, pBuilder);
2716 }else if( pCfg->diffFlags & DIFF_SIDEBYSIDE ){
2717 DiffBuilder *pBuilder;
2718 if( pCfg->diffFlags & DIFF_HTML ){
2719 pBuilder = dfsplitNew(pOut);
2720 }else{
2721 pBuilder = dfsbsNew(pOut, pCfg);
2722 }
2723 formatDiff(&c, pCfg, pBuilder);
2724 }else if( pCfg->diffFlags & DIFF_DEBUG ){
2725 DiffBuilder *pBuilder = dfdebugNew(pOut);
2726 formatDiff(&c, pCfg, pBuilder);
2727 }else if( pCfg->diffFlags & DIFF_HTML ){
2728 DiffBuilder *pBuilder = dfunifiedNew(pOut);
2729 formatDiff(&c, pCfg, pBuilder);
2730 }else{
2731 contextDiff(&c, pOut, pCfg);
2732 }
2733 fossil_free(c.aFrom);
2734
--- src/diff.c
+++ src/diff.c
@@ -96,10 +96,11 @@
96 int wColumn; /* Column width in -y mode */
97 u32 nFile; /* Number of files diffed so far */
98 const char *zDiffCmd; /* External diff command to use instead of builtin */
99 const char *zBinGlob; /* GLOB pattern for binary files */
100 ReCompiled *pRe; /* Show only changes matching this pattern */
101 const char *zLeftHash; /* HASH-id of the left file */
102 };
103
104 #endif /* INTERFACE */
105
106 /*
@@ -897,10 +898,11 @@
898 unsigned int nPending; /* Number of pending lines */
899 int eState; /* State of the output */
900 int width; /* Display width */
901 Blob *pOut; /* Output blob */
902 Blob aCol[5]; /* Holding blobs */
903 DiffConfig *pCfg; /* Configuration information */
904 };
905
906 /************************* DiffBuilderDebug ********************************/
907 /* This version of DiffBuilder is used for debugging the diff and diff
908 ** diff formatter logic. It is accessed using the (undocumented) --debug
@@ -1251,11 +1253,20 @@
1253 blob_appendf(p->pOut,"<tr id=\"chunk%d\">"
1254 "<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
1255 }
1256 static void dfunifiedSkip(DiffBuilder *p, unsigned int n, int isFinal){
1257 dfunifiedFinishRow(p);
1258 if( p->pCfg && p->pCfg->zLeftHash ){
1259 blob_appendf(p->pOut,
1260 "<tr class=\"diffskip\" data-startln=\"%d\" data-endln=\"%d\""
1261 " id=\"skip%xh%xi%x\">\n",
1262 p->lnLeft+1, p->lnLeft+n,
1263 nChunk, p->lnLeft, n);
1264 }else{
1265 blob_append(p->pOut, "<tr>", 4);
1266 }
1267 blob_append(p->pOut, "<td class=\"diffln difflne\">"
1268 "&#xfe19;</td><td></td><td></td></tr>\n", -1);
1269 p->lnLeft += n;
1270 p->lnRight += n;
1271 }
1272 static void dfunifiedCommon(DiffBuilder *p, const DLine *pLine){
@@ -1372,11 +1383,11 @@
1383 static void dfunifiedEnd(DiffBuilder *p){
1384 dfunifiedFinishRow(p);
1385 blob_append(p->pOut, "</table>\n",-1);
1386 fossil_free(p);
1387 }
1388 static DiffBuilder *dfunifiedNew(Blob *pOut, DiffConfig *pCfg){
1389 DiffBuilder *p = fossil_malloc(sizeof(*p));
1390 p->xSkip = dfunifiedSkip;
1391 p->xCommon = dfunifiedCommon;
1392 p->xInsert = dfunifiedInsert;
1393 p->xDelete = dfunifiedDelete;
@@ -1385,16 +1396,22 @@
1396 p->xEnd = dfunifiedEnd;
1397 p->lnLeft = p->lnRight = 0;
1398 p->eState = 0;
1399 p->nPending = 0;
1400 p->pOut = pOut;
1401 if( pCfg->zLeftHash ){
1402 blob_appendf(pOut, "<table class=\"diff udiff\" data-lefthash=\"%s\">\n",
1403 pCfg->zLeftHash);
1404 }else{
1405 blob_append(pOut, "<table class=\"diff udiff\">\n", -1);
1406 }
1407 blob_init(&p->aCol[0], 0, 0);
1408 blob_init(&p->aCol[1], 0, 0);
1409 blob_init(&p->aCol[2], 0, 0);
1410 blob_init(&p->aCol[3], 0, 0);
1411 blob_init(&p->aCol[4], 0, 0);
1412 p->pCfg = pCfg;
1413 return p;
1414 }
1415
1416 /************************* DiffBuilderSplit ******************************/
1417 /* This formatter creates a side-by-side diff in HTML. The output is a
@@ -1463,15 +1480,24 @@
1480 "<td class=\"diffln difflnl\"><pre>\n", ++nChunk);
1481 p->eState = 0;
1482 }
1483 static void dfsplitSkip(DiffBuilder *p, unsigned int n, int isFinal){
1484 dfsplitFinishRow(p);
1485 if( p->pCfg && p->pCfg->zLeftHash ){
1486 blob_appendf(p->pOut,
1487 "<tr class=\"diffskip\" data-startln=\"%d\" data-endln=\"%d\""
1488 " id=\"skip%xh%xi%x\">\n",
1489 p->lnLeft+1, p->lnLeft+n,
1490 nChunk,p->lnLeft,n);
1491 }else{
1492 blob_append(p->pOut, "<tr>", 4);
1493 }
1494 blob_append(p->pOut,
1495 "<td class=\"diffln difflnl difflne\">&#xfe19;</td>"
1496 "<td></td><td></td>"
1497 "<td class=\"diffln difflnr difflne\">&#xfe19;</td>"
1498 "<td/td></tr>\n", -1);
1499 p->lnLeft += n;
1500 p->lnRight += n;
1501 }
1502 static void dfsplitCommon(DiffBuilder *p, const DLine *pLine){
1503 dfsplitStartRow(p);
@@ -1580,11 +1606,11 @@
1606 static void dfsplitEnd(DiffBuilder *p){
1607 dfsplitFinishRow(p);
1608 blob_append(p->pOut, "</table>\n",-1);
1609 fossil_free(p);
1610 }
1611 static DiffBuilder *dfsplitNew(Blob *pOut, DiffConfig *pCfg){
1612 DiffBuilder *p = fossil_malloc(sizeof(*p));
1613 p->xSkip = dfsplitSkip;
1614 p->xCommon = dfsplitCommon;
1615 p->xInsert = dfsplitInsert;
1616 p->xDelete = dfsplitDelete;
@@ -1592,16 +1618,23 @@
1618 p->xEdit = dfsplitEdit;
1619 p->xEnd = dfsplitEnd;
1620 p->lnLeft = p->lnRight = 0;
1621 p->eState = 0;
1622 p->pOut = pOut;
1623 if( pCfg->zLeftHash ){
1624 blob_appendf(pOut,
1625 "<table class=\"diff splitdiff\" data-lefthash=\"%s\">\n",
1626 pCfg->zLeftHash);
1627 }else{
1628 blob_append(pOut, "<table class=\"diff splitdiff\">\n", -1);
1629 }
1630 blob_init(&p->aCol[0], 0, 0);
1631 blob_init(&p->aCol[1], 0, 0);
1632 blob_init(&p->aCol[2], 0, 0);
1633 blob_init(&p->aCol[3], 0, 0);
1634 blob_init(&p->aCol[4], 0, 0);
1635 p->pCfg = pCfg;
1636 return p;
1637 }
1638
1639 /************************* DiffBuilderSbs ******************************/
1640 /* This formatter creates a side-by-side diff in text.
@@ -2714,20 +2747,20 @@
2747 DiffBuilder *pBuilder = dftclNew(pOut);
2748 formatDiff(&c, pCfg, pBuilder);
2749 }else if( pCfg->diffFlags & DIFF_SIDEBYSIDE ){
2750 DiffBuilder *pBuilder;
2751 if( pCfg->diffFlags & DIFF_HTML ){
2752 pBuilder = dfsplitNew(pOut, pCfg);
2753 }else{
2754 pBuilder = dfsbsNew(pOut, pCfg);
2755 }
2756 formatDiff(&c, pCfg, pBuilder);
2757 }else if( pCfg->diffFlags & DIFF_DEBUG ){
2758 DiffBuilder *pBuilder = dfdebugNew(pOut);
2759 formatDiff(&c, pCfg, pBuilder);
2760 }else if( pCfg->diffFlags & DIFF_HTML ){
2761 DiffBuilder *pBuilder = dfunifiedNew(pOut, pCfg);
2762 formatDiff(&c, pCfg, pBuilder);
2763 }else{
2764 contextDiff(&c, pOut, pCfg);
2765 }
2766 fossil_free(c.aFrom);
2767
+3
--- src/info.c
+++ src/info.c
@@ -338,12 +338,14 @@
338338
int toid;
339339
Blob from, to;
340340
if( zFrom ){
341341
fromid = uuid_to_rid(zFrom, 0);
342342
content_get(fromid, &from);
343
+ pCfg->zLeftHash = zFrom;
343344
}else{
344345
blob_zero(&from);
346
+ pCfg->zLeftHash = 0;
345347
}
346348
if( zTo ){
347349
toid = uuid_to_rid(zTo, 0);
348350
content_get(toid, &to);
349351
}else{
@@ -353,10 +355,11 @@
353355
pCfg->diffFlags |= DIFF_HTML | DIFF_NOTTOOBIG;
354356
}else{
355357
pCfg->diffFlags |= DIFF_LINENO | DIFF_HTML | DIFF_NOTTOOBIG;
356358
}
357359
text_diff(&from, &to, cgi_output_blob(), pCfg);
360
+ pCfg->zLeftHash = 0;
358361
blob_reset(&from);
359362
blob_reset(&to);
360363
}
361364
362365
/*
363366
--- src/info.c
+++ src/info.c
@@ -338,12 +338,14 @@
338 int toid;
339 Blob from, to;
340 if( zFrom ){
341 fromid = uuid_to_rid(zFrom, 0);
342 content_get(fromid, &from);
 
343 }else{
344 blob_zero(&from);
 
345 }
346 if( zTo ){
347 toid = uuid_to_rid(zTo, 0);
348 content_get(toid, &to);
349 }else{
@@ -353,10 +355,11 @@
353 pCfg->diffFlags |= DIFF_HTML | DIFF_NOTTOOBIG;
354 }else{
355 pCfg->diffFlags |= DIFF_LINENO | DIFF_HTML | DIFF_NOTTOOBIG;
356 }
357 text_diff(&from, &to, cgi_output_blob(), pCfg);
 
358 blob_reset(&from);
359 blob_reset(&to);
360 }
361
362 /*
363
--- src/info.c
+++ src/info.c
@@ -338,12 +338,14 @@
338 int toid;
339 Blob from, to;
340 if( zFrom ){
341 fromid = uuid_to_rid(zFrom, 0);
342 content_get(fromid, &from);
343 pCfg->zLeftHash = zFrom;
344 }else{
345 blob_zero(&from);
346 pCfg->zLeftHash = 0;
347 }
348 if( zTo ){
349 toid = uuid_to_rid(zTo, 0);
350 content_get(toid, &to);
351 }else{
@@ -353,10 +355,11 @@
355 pCfg->diffFlags |= DIFF_HTML | DIFF_NOTTOOBIG;
356 }else{
357 pCfg->diffFlags |= DIFF_LINENO | DIFF_HTML | DIFF_NOTTOOBIG;
358 }
359 text_diff(&from, &to, cgi_output_blob(), pCfg);
360 pCfg->zLeftHash = 0;
361 blob_reset(&from);
362 blob_reset(&to);
363 }
364
365 /*
366

Keyboard Shortcuts

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