Fossil SCM

Code documentation.

jan 2011-10-15 00:26 jan-sbsdiff
Commit 9b7955b5a43492c1b3479e6d4245e7fe09426819
1 file changed +16 -6
+16 -6
--- src/diff.c
+++ src/diff.c
@@ -597,16 +597,25 @@
597597
}
598598
return out;
599599
}
600600
601601
/*
602
- * References in the fossil repository:
603
- * /vdiff?from=080d27a&to=4b0f813&detail=1
604
- * /vdiff?from=636804745b&to=c1d78e0556&detail=1
605
- * /vdiff?from=c0b6c28d29&to=25169506b7&detail=1
606
- * /vdiff?from=e3d022dffa&to=48bcfbd47b&detail=1
607
- */
602
+** Output table body of a side-by-side diff. Prior to the call, the caller
603
+** should have output:
604
+** <table class="sbsdiff">
605
+** <tr><th colspan="2" class="diffhdr">Old title</th><th/>
606
+** <th colspan="2" class="diffhdr">New title</th></tr>
607
+**
608
+** And after the call, it should output:
609
+** </table>
610
+**
611
+** Some good reference diffs in the fossil repository for testing:
612
+** /vdiff?from=080d27a&to=4b0f813&detail=1
613
+** /vdiff?from=636804745b&to=c1d78e0556&detail=1
614
+** /vdiff?from=c0b6c28d29&to=25169506b7&detail=1
615
+** /vdiff?from=e3d022dffa&to=48bcfbd47b&detail=1
616
+*/
608617
int html_sbsdiff(
609618
Blob *pA_Blob, /* FROM file */
610619
Blob *pB_Blob, /* TO file */
611620
int nContext, /* Amount of context to unified diff */
612621
int ignoreEolWs /* Ignore whitespace at the end of lines */
@@ -625,10 +634,11 @@
625634
c.aTo = break_into_lines(blob_str(pB_Blob), blob_size(pB_Blob),
626635
&c.nTo, ignoreEolWs);
627636
if( c.aFrom==0 || c.aTo==0 ){
628637
free(c.aFrom);
629638
free(c.aTo);
639
+ /* Note: This would be generated within a table. */
630640
@ <p class="generalError" style="white-space: nowrap">cannot compute
631641
@ difference between binary files</p>
632642
return 0;
633643
}
634644
635645
--- src/diff.c
+++ src/diff.c
@@ -597,16 +597,25 @@
597 }
598 return out;
599 }
600
601 /*
602 * References in the fossil repository:
603 * /vdiff?from=080d27a&to=4b0f813&detail=1
604 * /vdiff?from=636804745b&to=c1d78e0556&detail=1
605 * /vdiff?from=c0b6c28d29&to=25169506b7&detail=1
606 * /vdiff?from=e3d022dffa&to=48bcfbd47b&detail=1
607 */
 
 
 
 
 
 
 
 
 
608 int html_sbsdiff(
609 Blob *pA_Blob, /* FROM file */
610 Blob *pB_Blob, /* TO file */
611 int nContext, /* Amount of context to unified diff */
612 int ignoreEolWs /* Ignore whitespace at the end of lines */
@@ -625,10 +634,11 @@
625 c.aTo = break_into_lines(blob_str(pB_Blob), blob_size(pB_Blob),
626 &c.nTo, ignoreEolWs);
627 if( c.aFrom==0 || c.aTo==0 ){
628 free(c.aFrom);
629 free(c.aTo);
 
630 @ <p class="generalError" style="white-space: nowrap">cannot compute
631 @ difference between binary files</p>
632 return 0;
633 }
634
635
--- src/diff.c
+++ src/diff.c
@@ -597,16 +597,25 @@
597 }
598 return out;
599 }
600
601 /*
602 ** Output table body of a side-by-side diff. Prior to the call, the caller
603 ** should have output:
604 ** <table class="sbsdiff">
605 ** <tr><th colspan="2" class="diffhdr">Old title</th><th/>
606 ** <th colspan="2" class="diffhdr">New title</th></tr>
607 **
608 ** And after the call, it should output:
609 ** </table>
610 **
611 ** Some good reference diffs in the fossil repository for testing:
612 ** /vdiff?from=080d27a&to=4b0f813&detail=1
613 ** /vdiff?from=636804745b&to=c1d78e0556&detail=1
614 ** /vdiff?from=c0b6c28d29&to=25169506b7&detail=1
615 ** /vdiff?from=e3d022dffa&to=48bcfbd47b&detail=1
616 */
617 int html_sbsdiff(
618 Blob *pA_Blob, /* FROM file */
619 Blob *pB_Blob, /* TO file */
620 int nContext, /* Amount of context to unified diff */
621 int ignoreEolWs /* Ignore whitespace at the end of lines */
@@ -625,10 +634,11 @@
634 c.aTo = break_into_lines(blob_str(pB_Blob), blob_size(pB_Blob),
635 &c.nTo, ignoreEolWs);
636 if( c.aFrom==0 || c.aTo==0 ){
637 free(c.aFrom);
638 free(c.aTo);
639 /* Note: This would be generated within a table. */
640 @ <p class="generalError" style="white-space: nowrap">cannot compute
641 @ difference between binary files</p>
642 return 0;
643 }
644
645

Keyboard Shortcuts

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