Fossil SCM

corrections for erroneous merge of [4b432961ac|retro-sbsdiff]

bch 2012-01-06 05:28 status_redo
Commit d7ff893259bd3996b03752e69263349327141c8e
+184
--- src/diff.c
+++ src/diff.c
@@ -805,10 +805,194 @@
805805
free(c.aFrom);
806806
free(c.aTo);
807807
return c.aEdit;
808808
}
809809
}
810
+
811
+/*
812
+** Copy a line with a limit. Used for side-by-side diffs to enforce a maximum
813
+** line length limit.
814
+*/
815
+static char *copylimline(char *out, DLine *dl, int lim){
816
+ int len;
817
+ len = dl->h & LENGTH_MASK;
818
+ if( lim && len > lim ){
819
+ memcpy(out, dl->z, lim-3);
820
+ memcpy(&out[lim-3], "...", 4);
821
+ }else{
822
+ memcpy(out, dl->z, len);
823
+ out[len] = '\0';
824
+ }
825
+ return out;
826
+}
827
+
828
+/*
829
+** Output table body of a side-by-side diff. Prior to the call, the caller
830
+** should have output:
831
+** <table class="sbsdiff">
832
+** <tr><th colspan="2" class="diffhdr">Old title</th><th/>
833
+** <th colspan="2" class="diffhdr">New title</th></tr>
834
+**
835
+** And after the call, it should output:
836
+** </table>
837
+**
838
+** Some good reference diffs in the fossil repository for testing:
839
+** /vdiff?from=080d27a&to=4b0f813&detail=1
840
+** /vdiff?from=636804745b&to=c1d78e0556&detail=1
841
+** /vdiff?from=c0b6c28d29&to=25169506b7&detail=1
842
+** /vdiff?from=e3d022dffa&to=48bcfbd47b&detail=1
843
+*/
844
+int html_sbsdiff(
845
+ Blob *pA_Blob, /* FROM file */
846
+ Blob *pB_Blob, /* TO file */
847
+ int nContext, /* Amount of context to unified diff */
848
+ int ignoreEolWs /* Ignore whitespace at the end of lines */
849
+){
850
+ DContext c;
851
+ int i;
852
+ int iFrom, iTo;
853
+ char *linebuf;
854
+ int collim=0; /* Currently not settable; allows a column limit for diffs */
855
+ int allowExp=0; /* Currently not settable; (dis)allow expansion of rows */
856
+
857
+ /* Prepare the input files */
858
+ memset(&c, 0, sizeof(c));
859
+ c.aFrom = break_into_lines(blob_str(pA_Blob), blob_size(pA_Blob),
860
+ &c.nFrom, ignoreEolWs);
861
+ c.aTo = break_into_lines(blob_str(pB_Blob), blob_size(pB_Blob),
862
+ &c.nTo, ignoreEolWs);
863
+ if( c.aFrom==0 || c.aTo==0 ){
864
+ free(c.aFrom);
865
+ free(c.aTo);
866
+ /* Note: This would be generated within a table. */
867
+ @ <p class="generalError" style="white-space: nowrap">cannot compute
868
+ @ difference between binary files</p>
869
+ return 0;
870
+ }
871
+
872
+ collim = collim < 4 ? 0 : collim;
873
+
874
+ /* Compute the difference */
875
+ diff_all(&c);
876
+
877
+ linebuf = fossil_malloc(LENGTH_MASK+1);
878
+ if( !linebuf ){
879
+ free(c.aFrom);
880
+ free(c.aTo);
881
+ free(c.aEdit);
882
+ return 0;
883
+ }
884
+
885
+ iFrom=iTo=0;
886
+ i=0;
887
+ while( i<c.nEdit ){
888
+ int j;
889
+ /* Copied lines */
890
+ for( j=0; j<c.aEdit[i]; j++){
891
+ /* Hide lines which are copied and are further away from block boundaries
892
+ ** than nContext lines. For each block with hidden lines, show a row
893
+ ** notifying the user about the hidden rows.
894
+ */
895
+ if( j<nContext || j>c.aEdit[i]-nContext-1 ){
896
+ @ <tr>
897
+ }else if( j==nContext && j<c.aEdit[i]-nContext-1 ){
898
+ @ <tr>
899
+ @ <td class="meta" colspan="5" style="white-space: nowrap;">
900
+ @ %d(c.aEdit[i]-2*nContext) hidden lines</td>
901
+ @ </tr>
902
+ if( !allowExp )
903
+ continue;
904
+ @ <tr style="display:none;">
905
+ }else{
906
+ if( !allowExp )
907
+ continue;
908
+ @ <tr style="display:none;">
909
+ }
910
+
911
+ copylimline(linebuf, &c.aFrom[iFrom+j], collim);
912
+ @ <td class="lineno">%d(iFrom+j+1)</td>
913
+ @ <td class="srcline">%h(linebuf)</td>
914
+
915
+ @ <td> </td>
916
+
917
+ copylimline(linebuf, &c.aTo[iTo+j], collim);
918
+ @ <td class="lineno">%d(iTo+j+1)</td>
919
+ @ <td class="srcline">%h(linebuf)</td>
920
+
921
+ @ </tr>
922
+ }
923
+ iFrom+=c.aEdit[i];
924
+ iTo+=c.aEdit[i];
925
+
926
+ if( c.aEdit[i+1]!=0 && c.aEdit[i+2]!=0 ){
927
+ int lim;
928
+ lim = c.aEdit[i+1] > c.aEdit[i+2] ? c.aEdit[i+1] : c.aEdit[i+2];
929
+
930
+ /* Assume changed lines */
931
+ for( j=0; j<lim; j++ ){
932
+ @ <tr>
933
+
934
+ if( j<c.aEdit[i+1] ){
935
+ copylimline(linebuf, &c.aFrom[iFrom+j], collim);
936
+ @ <td class="changed lineno">%d(iFrom+j+1)</td>
937
+ @ <td class="changed srcline">%h(linebuf)</td>
938
+ }else{
939
+ @ <td colspan="2" class="changedvoid"/>
940
+ }
941
+
942
+ @ <td class="changed">|</td>
943
+
944
+ if( j<c.aEdit[i+2] ){
945
+ copylimline(linebuf, &c.aTo[iTo+j], collim);
946
+ @ <td class="changed lineno">%d(iTo+j+1)</td>
947
+ @ <td class="changed srcline">%h(linebuf)</td>
948
+ }else{
949
+ @ <td colspan="2" class="changedvoid"/>
950
+ }
951
+
952
+ @ </tr>
953
+ }
954
+ iFrom+=c.aEdit[i+1];
955
+ iTo+=c.aEdit[i+2];
956
+ }else{
957
+
958
+ /* Process deleted lines */
959
+ for( j=0; j<c.aEdit[i+1]; j++ ){
960
+ @ <tr>
961
+
962
+ copylimline(linebuf, &c.aFrom[iFrom+j], collim);
963
+ @ <td class="removed lineno">%d(iFrom+j+1)</td>
964
+ @ <td class="removed srcline">%h(linebuf)</td>
965
+ @ <td>&lt;</td>
966
+ @ <td colspan="2" class="removedvoid"/>
967
+ @ </tr>
968
+ }
969
+ iFrom+=c.aEdit[i+1];
970
+
971
+ /* Process inserted lines */
972
+ for( j=0; j<c.aEdit[i+2]; j++ ){
973
+ @ <tr>
974
+ @ <td colspan="2" class="addedvoid"/>
975
+ @ <td>&gt;</td>
976
+ copylimline(linebuf, &c.aTo[iTo+j], collim);
977
+ @ <td class="added lineno">%d(iTo+j+1)</td>
978
+ @ <td class="added srcline">%h(linebuf)</td>
979
+ @ </tr>
980
+ }
981
+ iTo+=c.aEdit[i+2];
982
+ }
983
+
984
+ i+=3;
985
+ }
986
+
987
+ free(linebuf);
988
+ free(c.aFrom);
989
+ free(c.aTo);
990
+ free(c.aEdit);
991
+ return 1;
992
+}
993
+
810994
811995
/*
812996
** COMMAND: test-rawdiff
813997
*/
814998
void test_rawdiff_cmd(void){
815999
--- src/diff.c
+++ src/diff.c
@@ -805,10 +805,194 @@
805 free(c.aFrom);
806 free(c.aTo);
807 return c.aEdit;
808 }
809 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
810
811 /*
812 ** COMMAND: test-rawdiff
813 */
814 void test_rawdiff_cmd(void){
815
--- src/diff.c
+++ src/diff.c
@@ -805,10 +805,194 @@
805 free(c.aFrom);
806 free(c.aTo);
807 return c.aEdit;
808 }
809 }
810
811 /*
812 ** Copy a line with a limit. Used for side-by-side diffs to enforce a maximum
813 ** line length limit.
814 */
815 static char *copylimline(char *out, DLine *dl, int lim){
816 int len;
817 len = dl->h & LENGTH_MASK;
818 if( lim && len > lim ){
819 memcpy(out, dl->z, lim-3);
820 memcpy(&out[lim-3], "...", 4);
821 }else{
822 memcpy(out, dl->z, len);
823 out[len] = '\0';
824 }
825 return out;
826 }
827
828 /*
829 ** Output table body of a side-by-side diff. Prior to the call, the caller
830 ** should have output:
831 ** <table class="sbsdiff">
832 ** <tr><th colspan="2" class="diffhdr">Old title</th><th/>
833 ** <th colspan="2" class="diffhdr">New title</th></tr>
834 **
835 ** And after the call, it should output:
836 ** </table>
837 **
838 ** Some good reference diffs in the fossil repository for testing:
839 ** /vdiff?from=080d27a&to=4b0f813&detail=1
840 ** /vdiff?from=636804745b&to=c1d78e0556&detail=1
841 ** /vdiff?from=c0b6c28d29&to=25169506b7&detail=1
842 ** /vdiff?from=e3d022dffa&to=48bcfbd47b&detail=1
843 */
844 int html_sbsdiff(
845 Blob *pA_Blob, /* FROM file */
846 Blob *pB_Blob, /* TO file */
847 int nContext, /* Amount of context to unified diff */
848 int ignoreEolWs /* Ignore whitespace at the end of lines */
849 ){
850 DContext c;
851 int i;
852 int iFrom, iTo;
853 char *linebuf;
854 int collim=0; /* Currently not settable; allows a column limit for diffs */
855 int allowExp=0; /* Currently not settable; (dis)allow expansion of rows */
856
857 /* Prepare the input files */
858 memset(&c, 0, sizeof(c));
859 c.aFrom = break_into_lines(blob_str(pA_Blob), blob_size(pA_Blob),
860 &c.nFrom, ignoreEolWs);
861 c.aTo = break_into_lines(blob_str(pB_Blob), blob_size(pB_Blob),
862 &c.nTo, ignoreEolWs);
863 if( c.aFrom==0 || c.aTo==0 ){
864 free(c.aFrom);
865 free(c.aTo);
866 /* Note: This would be generated within a table. */
867 @ <p class="generalError" style="white-space: nowrap">cannot compute
868 @ difference between binary files</p>
869 return 0;
870 }
871
872 collim = collim < 4 ? 0 : collim;
873
874 /* Compute the difference */
875 diff_all(&c);
876
877 linebuf = fossil_malloc(LENGTH_MASK+1);
878 if( !linebuf ){
879 free(c.aFrom);
880 free(c.aTo);
881 free(c.aEdit);
882 return 0;
883 }
884
885 iFrom=iTo=0;
886 i=0;
887 while( i<c.nEdit ){
888 int j;
889 /* Copied lines */
890 for( j=0; j<c.aEdit[i]; j++){
891 /* Hide lines which are copied and are further away from block boundaries
892 ** than nContext lines. For each block with hidden lines, show a row
893 ** notifying the user about the hidden rows.
894 */
895 if( j<nContext || j>c.aEdit[i]-nContext-1 ){
896 @ <tr>
897 }else if( j==nContext && j<c.aEdit[i]-nContext-1 ){
898 @ <tr>
899 @ <td class="meta" colspan="5" style="white-space: nowrap;">
900 @ %d(c.aEdit[i]-2*nContext) hidden lines</td>
901 @ </tr>
902 if( !allowExp )
903 continue;
904 @ <tr style="display:none;">
905 }else{
906 if( !allowExp )
907 continue;
908 @ <tr style="display:none;">
909 }
910
911 copylimline(linebuf, &c.aFrom[iFrom+j], collim);
912 @ <td class="lineno">%d(iFrom+j+1)</td>
913 @ <td class="srcline">%h(linebuf)</td>
914
915 @ <td> </td>
916
917 copylimline(linebuf, &c.aTo[iTo+j], collim);
918 @ <td class="lineno">%d(iTo+j+1)</td>
919 @ <td class="srcline">%h(linebuf)</td>
920
921 @ </tr>
922 }
923 iFrom+=c.aEdit[i];
924 iTo+=c.aEdit[i];
925
926 if( c.aEdit[i+1]!=0 && c.aEdit[i+2]!=0 ){
927 int lim;
928 lim = c.aEdit[i+1] > c.aEdit[i+2] ? c.aEdit[i+1] : c.aEdit[i+2];
929
930 /* Assume changed lines */
931 for( j=0; j<lim; j++ ){
932 @ <tr>
933
934 if( j<c.aEdit[i+1] ){
935 copylimline(linebuf, &c.aFrom[iFrom+j], collim);
936 @ <td class="changed lineno">%d(iFrom+j+1)</td>
937 @ <td class="changed srcline">%h(linebuf)</td>
938 }else{
939 @ <td colspan="2" class="changedvoid"/>
940 }
941
942 @ <td class="changed">|</td>
943
944 if( j<c.aEdit[i+2] ){
945 copylimline(linebuf, &c.aTo[iTo+j], collim);
946 @ <td class="changed lineno">%d(iTo+j+1)</td>
947 @ <td class="changed srcline">%h(linebuf)</td>
948 }else{
949 @ <td colspan="2" class="changedvoid"/>
950 }
951
952 @ </tr>
953 }
954 iFrom+=c.aEdit[i+1];
955 iTo+=c.aEdit[i+2];
956 }else{
957
958 /* Process deleted lines */
959 for( j=0; j<c.aEdit[i+1]; j++ ){
960 @ <tr>
961
962 copylimline(linebuf, &c.aFrom[iFrom+j], collim);
963 @ <td class="removed lineno">%d(iFrom+j+1)</td>
964 @ <td class="removed srcline">%h(linebuf)</td>
965 @ <td>&lt;</td>
966 @ <td colspan="2" class="removedvoid"/>
967 @ </tr>
968 }
969 iFrom+=c.aEdit[i+1];
970
971 /* Process inserted lines */
972 for( j=0; j<c.aEdit[i+2]; j++ ){
973 @ <tr>
974 @ <td colspan="2" class="addedvoid"/>
975 @ <td>&gt;</td>
976 copylimline(linebuf, &c.aTo[iTo+j], collim);
977 @ <td class="added lineno">%d(iTo+j+1)</td>
978 @ <td class="added srcline">%h(linebuf)</td>
979 @ </tr>
980 }
981 iTo+=c.aEdit[i+2];
982 }
983
984 i+=3;
985 }
986
987 free(linebuf);
988 free(c.aFrom);
989 free(c.aTo);
990 free(c.aEdit);
991 return 1;
992 }
993
994
995 /*
996 ** COMMAND: test-rawdiff
997 */
998 void test_rawdiff_cmd(void){
999
+60 -28
--- src/info.c
+++ src/info.c
@@ -251,11 +251,11 @@
251251
252252
253253
/*
254254
** Append the difference between two RIDs to the output
255255
*/
256
-static void append_diff(const char *zFrom, const char *zTo, int diffFlags){
256
+static void append_diff(const char *zFrom, const char *zTo){
257257
int fromid;
258258
int toid;
259259
Blob from, to, out;
260260
if( zFrom ){
261261
fromid = uuid_to_rid(zFrom, 0);
@@ -268,17 +268,46 @@
268268
content_get(toid, &to);
269269
}else{
270270
blob_zero(&to);
271271
}
272272
blob_zero(&out);
273
- text_diff(&from, &to, &out, diffFlags);
273
+ text_diff(&from, &to, &out, DIFF_IGNORE_EOLWS | 5);
274274
@ %h(blob_str(&out))
275275
blob_reset(&from);
276276
blob_reset(&to);
277277
blob_reset(&out);
278278
}
279279
280
+
281
+/*
282
+** Write the difference between two RIDs to the output
283
+*/
284
+static void generate_sbsdiff(const char *zFrom, const char *zTo){
285
+ int fromid;
286
+ int toid;
287
+ Blob from, to;
288
+ if( zFrom ){
289
+ fromid = uuid_to_rid(zFrom, 0);
290
+ content_get(fromid, &from);
291
+ }else{
292
+ blob_zero(&from);
293
+ }
294
+ if( zTo ){
295
+ toid = uuid_to_rid(zTo, 0);
296
+ content_get(toid, &to);
297
+ }else{
298
+ blob_zero(&to);
299
+ }
300
+ @ <table class="sbsdiff">
301
+ @ <tr><th colspan="2" class="diffhdr">Old (%S(zFrom))</th><th/>
302
+ @ <th colspan="2" class="diffhdr">New (%S(zTo))</th></tr>
303
+ html_sbsdiff(&from, &to, 5, 1);
304
+ @ </table>
305
+ blob_reset(&from);
306
+ blob_reset(&to);
307
+}
308
+
280309
281310
/*
282311
** Write a line of web-page output that shows changes that have occurred
283312
** to a file between two check-ins.
284313
*/
@@ -289,14 +318,10 @@
289318
const char *zOldName, /* Prior name. NULL if no name change. */
290319
int showDiff, /* Show edit diffs if true */
291320
int sideBySide, /* Show diffs side-by-side */
292321
int mperm /* executable or symlink permission for zNew */
293322
){
294
- int diffFlags = DIFF_IGNORE_EOLWS | 7;
295
- if( sideBySide ){
296
- diffFlags |= DIFF_SIDEBYSIDE;
297
- }
298323
if( !g.perm.History ){
299324
if( zNew==0 ){
300325
@ <p>Deleted %h(zName)</p>
301326
}else if( zOld==0 ){
302327
@ <p>Added %h(zName)</p>
@@ -307,13 +332,17 @@
307332
@ for %h(zName)</p>
308333
}else{
309334
@ <p>Changes to %h(zName)</p>
310335
}
311336
if( showDiff ){
312
- @ <pre style="white-space:pre;">
313
- append_diff(zOld, zNew, diffFlags);
314
- @ </pre>
337
+ if( sideBySide ){
338
+ generate_sbsdiff(zOld, zNew);
339
+ }else{
340
+ @ <blockquote><pre>
341
+ append_diff(zOld, zNew);
342
+ @ </pre></blockquote>
343
+ }
315344
}
316345
}else{
317346
if( zOld && zNew ){
318347
if( fossil_strcmp(zOld, zNew)!=0 ){
319348
@ <p>Modified <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
@@ -333,13 +362,17 @@
333362
}else{
334363
@ <p>Added <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
335364
@ version <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)]</a>
336365
}
337366
if( showDiff ){
338
- @ <pre style="white-space:pre;">
339
- append_diff(zOld, zNew, diffFlags);
340
- @ </pre>
367
+ if( sideBySide ){
368
+ generate_sbsdiff(zOld, zNew);
369
+ }else{
370
+ @ <blockquote><pre>
371
+ append_diff(zOld, zNew);
372
+ @ </pre></blockquote>
373
+ }
341374
}else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
342375
@ &nbsp;&nbsp;
343376
@ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&amp;v2=%S(zNew)">[diff]</a>
344377
}
345378
@ </p>
@@ -1036,11 +1069,10 @@
10361069
int isPatch;
10371070
int sideBySide;
10381071
Blob c1, c2, diff, *pOut;
10391072
char *zV1;
10401073
char *zV2;
1041
- int diffFlags;
10421074
10431075
login_check_credentials();
10441076
if( !g.perm.Read ){ login_needed(); return; }
10451077
v1 = name_to_rid_www("v1");
10461078
v2 = name_to_rid_www("v2");
@@ -1050,25 +1082,21 @@
10501082
zV2 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v2);
10511083
isPatch = P("patch")!=0;
10521084
if( isPatch ){
10531085
pOut = cgi_output_blob();
10541086
cgi_set_content_type("text/plain");
1055
- diffFlags = 4;
10561087
}else{
10571088
blob_zero(&diff);
10581089
pOut = &diff;
1059
- if( sideBySide ){
1060
- diffFlags = DIFF_IGNORE_EOLWS | DIFF_SIDEBYSIDE | 7;
1061
- }else{
1062
- diffFlags = DIFF_IGNORE_EOLWS | 7;
1063
- }
1064
- }
1065
- content_get(v1, &c1);
1066
- content_get(v2, &c2);
1067
- text_diff(&c1, &c2, pOut, diffFlags);
1068
- blob_reset(&c1);
1069
- blob_reset(&c2);
1090
+ }
1091
+ if( !sideBySide || isPatch ){
1092
+ content_get(v1, &c1);
1093
+ content_get(v2, &c2);
1094
+ text_diff(&c1, &c2, pOut, 4 | 0);
1095
+ blob_reset(&c1);
1096
+ blob_reset(&c2);
1097
+ }
10701098
if( !isPatch ){
10711099
style_header("Diff");
10721100
style_submenu_element("Patch", "Patch", "%s/fdiff?v1=%T&v2=%T&patch",
10731101
g.zTop, P("v1"), P("v2"));
10741102
if( !sideBySide ){
@@ -1085,13 +1113,17 @@
10851113
@ Artifact <a href="%s(g.zTop)/artifact/%S(zV1)">[%S(zV1)]</a>:</h2>
10861114
object_description(v1, 0, 0);
10871115
@ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
10881116
object_description(v2, 0, 0);
10891117
@ <hr />
1090
- @ <pre style="while-space:pre;">
1091
- @ %h(blob_str(&diff))
1092
- @ </pre>
1118
+ if( sideBySide ){
1119
+ generate_sbsdiff(zV1, zV2);
1120
+ }else{
1121
+ @ <blockquote><pre>
1122
+ @ %h(blob_str(&diff))
1123
+ @ </pre></blockquote>
1124
+ }
10931125
blob_reset(&diff);
10941126
style_footer();
10951127
}
10961128
}
10971129
10981130
--- src/info.c
+++ src/info.c
@@ -251,11 +251,11 @@
251
252
253 /*
254 ** Append the difference between two RIDs to the output
255 */
256 static void append_diff(const char *zFrom, const char *zTo, int diffFlags){
257 int fromid;
258 int toid;
259 Blob from, to, out;
260 if( zFrom ){
261 fromid = uuid_to_rid(zFrom, 0);
@@ -268,17 +268,46 @@
268 content_get(toid, &to);
269 }else{
270 blob_zero(&to);
271 }
272 blob_zero(&out);
273 text_diff(&from, &to, &out, diffFlags);
274 @ %h(blob_str(&out))
275 blob_reset(&from);
276 blob_reset(&to);
277 blob_reset(&out);
278 }
279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
281 /*
282 ** Write a line of web-page output that shows changes that have occurred
283 ** to a file between two check-ins.
284 */
@@ -289,14 +318,10 @@
289 const char *zOldName, /* Prior name. NULL if no name change. */
290 int showDiff, /* Show edit diffs if true */
291 int sideBySide, /* Show diffs side-by-side */
292 int mperm /* executable or symlink permission for zNew */
293 ){
294 int diffFlags = DIFF_IGNORE_EOLWS | 7;
295 if( sideBySide ){
296 diffFlags |= DIFF_SIDEBYSIDE;
297 }
298 if( !g.perm.History ){
299 if( zNew==0 ){
300 @ <p>Deleted %h(zName)</p>
301 }else if( zOld==0 ){
302 @ <p>Added %h(zName)</p>
@@ -307,13 +332,17 @@
307 @ for %h(zName)</p>
308 }else{
309 @ <p>Changes to %h(zName)</p>
310 }
311 if( showDiff ){
312 @ <pre style="white-space:pre;">
313 append_diff(zOld, zNew, diffFlags);
314 @ </pre>
 
 
 
 
315 }
316 }else{
317 if( zOld && zNew ){
318 if( fossil_strcmp(zOld, zNew)!=0 ){
319 @ <p>Modified <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
@@ -333,13 +362,17 @@
333 }else{
334 @ <p>Added <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
335 @ version <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)]</a>
336 }
337 if( showDiff ){
338 @ <pre style="white-space:pre;">
339 append_diff(zOld, zNew, diffFlags);
340 @ </pre>
 
 
 
 
341 }else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
342 @ &nbsp;&nbsp;
343 @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&amp;v2=%S(zNew)">[diff]</a>
344 }
345 @ </p>
@@ -1036,11 +1069,10 @@
1036 int isPatch;
1037 int sideBySide;
1038 Blob c1, c2, diff, *pOut;
1039 char *zV1;
1040 char *zV2;
1041 int diffFlags;
1042
1043 login_check_credentials();
1044 if( !g.perm.Read ){ login_needed(); return; }
1045 v1 = name_to_rid_www("v1");
1046 v2 = name_to_rid_www("v2");
@@ -1050,25 +1082,21 @@
1050 zV2 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v2);
1051 isPatch = P("patch")!=0;
1052 if( isPatch ){
1053 pOut = cgi_output_blob();
1054 cgi_set_content_type("text/plain");
1055 diffFlags = 4;
1056 }else{
1057 blob_zero(&diff);
1058 pOut = &diff;
1059 if( sideBySide ){
1060 diffFlags = DIFF_IGNORE_EOLWS | DIFF_SIDEBYSIDE | 7;
1061 }else{
1062 diffFlags = DIFF_IGNORE_EOLWS | 7;
1063 }
1064 }
1065 content_get(v1, &c1);
1066 content_get(v2, &c2);
1067 text_diff(&c1, &c2, pOut, diffFlags);
1068 blob_reset(&c1);
1069 blob_reset(&c2);
1070 if( !isPatch ){
1071 style_header("Diff");
1072 style_submenu_element("Patch", "Patch", "%s/fdiff?v1=%T&v2=%T&patch",
1073 g.zTop, P("v1"), P("v2"));
1074 if( !sideBySide ){
@@ -1085,13 +1113,17 @@
1085 @ Artifact <a href="%s(g.zTop)/artifact/%S(zV1)">[%S(zV1)]</a>:</h2>
1086 object_description(v1, 0, 0);
1087 @ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
1088 object_description(v2, 0, 0);
1089 @ <hr />
1090 @ <pre style="while-space:pre;">
1091 @ %h(blob_str(&diff))
1092 @ </pre>
 
 
 
 
1093 blob_reset(&diff);
1094 style_footer();
1095 }
1096 }
1097
1098
--- src/info.c
+++ src/info.c
@@ -251,11 +251,11 @@
251
252
253 /*
254 ** Append the difference between two RIDs to the output
255 */
256 static void append_diff(const char *zFrom, const char *zTo){
257 int fromid;
258 int toid;
259 Blob from, to, out;
260 if( zFrom ){
261 fromid = uuid_to_rid(zFrom, 0);
@@ -268,17 +268,46 @@
268 content_get(toid, &to);
269 }else{
270 blob_zero(&to);
271 }
272 blob_zero(&out);
273 text_diff(&from, &to, &out, DIFF_IGNORE_EOLWS | 5);
274 @ %h(blob_str(&out))
275 blob_reset(&from);
276 blob_reset(&to);
277 blob_reset(&out);
278 }
279
280
281 /*
282 ** Write the difference between two RIDs to the output
283 */
284 static void generate_sbsdiff(const char *zFrom, const char *zTo){
285 int fromid;
286 int toid;
287 Blob from, to;
288 if( zFrom ){
289 fromid = uuid_to_rid(zFrom, 0);
290 content_get(fromid, &from);
291 }else{
292 blob_zero(&from);
293 }
294 if( zTo ){
295 toid = uuid_to_rid(zTo, 0);
296 content_get(toid, &to);
297 }else{
298 blob_zero(&to);
299 }
300 @ <table class="sbsdiff">
301 @ <tr><th colspan="2" class="diffhdr">Old (%S(zFrom))</th><th/>
302 @ <th colspan="2" class="diffhdr">New (%S(zTo))</th></tr>
303 html_sbsdiff(&from, &to, 5, 1);
304 @ </table>
305 blob_reset(&from);
306 blob_reset(&to);
307 }
308
309
310 /*
311 ** Write a line of web-page output that shows changes that have occurred
312 ** to a file between two check-ins.
313 */
@@ -289,14 +318,10 @@
318 const char *zOldName, /* Prior name. NULL if no name change. */
319 int showDiff, /* Show edit diffs if true */
320 int sideBySide, /* Show diffs side-by-side */
321 int mperm /* executable or symlink permission for zNew */
322 ){
 
 
 
 
323 if( !g.perm.History ){
324 if( zNew==0 ){
325 @ <p>Deleted %h(zName)</p>
326 }else if( zOld==0 ){
327 @ <p>Added %h(zName)</p>
@@ -307,13 +332,17 @@
332 @ for %h(zName)</p>
333 }else{
334 @ <p>Changes to %h(zName)</p>
335 }
336 if( showDiff ){
337 if( sideBySide ){
338 generate_sbsdiff(zOld, zNew);
339 }else{
340 @ <blockquote><pre>
341 append_diff(zOld, zNew);
342 @ </pre></blockquote>
343 }
344 }
345 }else{
346 if( zOld && zNew ){
347 if( fossil_strcmp(zOld, zNew)!=0 ){
348 @ <p>Modified <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
@@ -333,13 +362,17 @@
362 }else{
363 @ <p>Added <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
364 @ version <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)]</a>
365 }
366 if( showDiff ){
367 if( sideBySide ){
368 generate_sbsdiff(zOld, zNew);
369 }else{
370 @ <blockquote><pre>
371 append_diff(zOld, zNew);
372 @ </pre></blockquote>
373 }
374 }else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){
375 @ &nbsp;&nbsp;
376 @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&amp;v2=%S(zNew)">[diff]</a>
377 }
378 @ </p>
@@ -1036,11 +1069,10 @@
1069 int isPatch;
1070 int sideBySide;
1071 Blob c1, c2, diff, *pOut;
1072 char *zV1;
1073 char *zV2;
 
1074
1075 login_check_credentials();
1076 if( !g.perm.Read ){ login_needed(); return; }
1077 v1 = name_to_rid_www("v1");
1078 v2 = name_to_rid_www("v2");
@@ -1050,25 +1082,21 @@
1082 zV2 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v2);
1083 isPatch = P("patch")!=0;
1084 if( isPatch ){
1085 pOut = cgi_output_blob();
1086 cgi_set_content_type("text/plain");
 
1087 }else{
1088 blob_zero(&diff);
1089 pOut = &diff;
1090 }
1091 if( !sideBySide || isPatch ){
1092 content_get(v1, &c1);
1093 content_get(v2, &c2);
1094 text_diff(&c1, &c2, pOut, 4 | 0);
1095 blob_reset(&c1);
1096 blob_reset(&c2);
1097 }
 
 
 
1098 if( !isPatch ){
1099 style_header("Diff");
1100 style_submenu_element("Patch", "Patch", "%s/fdiff?v1=%T&v2=%T&patch",
1101 g.zTop, P("v1"), P("v2"));
1102 if( !sideBySide ){
@@ -1085,13 +1113,17 @@
1113 @ Artifact <a href="%s(g.zTop)/artifact/%S(zV1)">[%S(zV1)]</a>:</h2>
1114 object_description(v1, 0, 0);
1115 @ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
1116 object_description(v2, 0, 0);
1117 @ <hr />
1118 if( sideBySide ){
1119 generate_sbsdiff(zV1, zV2);
1120 }else{
1121 @ <blockquote><pre>
1122 @ %h(blob_str(&diff))
1123 @ </pre></blockquote>
1124 }
1125 blob_reset(&diff);
1126 style_footer();
1127 }
1128 }
1129
1130
+202
--- src/skins.c
+++ src/skins.c
@@ -153,10 +153,55 @@
153153
@ /* The label/value pairs on (for example) the vinfo page */
154154
@ table.label-value th {
155155
@ vertical-align: top;
156156
@ text-align: right;
157157
@ padding: 0.2ex 2ex;
158
+@ }
159
+@
160
+@ /* Side-by-side diff */
161
+@ table.sbsdiff {
162
+@ background-color: white;
163
+@ font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
164
+@ font-size: 8pt;
165
+@ border-collapse:collapse;
166
+@ white-space: pre;
167
+@ width: 98%;
168
+@ border: 1px #000 dashed;
169
+@ }
170
+@
171
+@ table.sbsdiff th.diffhdr {
172
+@ border-bottom: dotted;
173
+@ border-width: 1px;
174
+@ }
175
+@
176
+@ table.sbsdiff tr td {
177
+@ white-space: pre;
178
+@ padding-left: 3px;
179
+@ padding-right: 3px;
180
+@ margin: 0px;
181
+@ }
182
+@
183
+@ table.sbsdiff tr td.lineno {
184
+@ text-align: right;
185
+@ }
186
+@
187
+@ table.sbsdiff tr td.meta {
188
+@ color: white;
189
+@ background-color: rgb(20, 20, 20);
190
+@ text-align: center;
191
+@ }
192
+@
193
+@ table.sbsdiff tr td.added {
194
+@ background-color: rgb(230, 230, 230);
195
+@ }
196
+@
197
+@ table.sbsdiff tr td.removed {
198
+@ background-color: rgb(200, 200, 200);
199
+@ }
200
+@
201
+@ table.sbsdiff tr td.changed {
202
+@ background-color: rgb(220, 220, 220);
158203
@ }');
159204
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
160205
@ <head>
161206
@ <title>$<project_name>: $<title></title>
162207
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@@ -355,10 +400,54 @@
355400
@ /* The label/value pairs on (for example) the ci page */
356401
@ table.label-value th {
357402
@ vertical-align: top;
358403
@ text-align: right;
359404
@ padding: 0.2ex 2ex;
405
+@ }
406
+@
407
+@ /* Side-by-side diff */
408
+@ table.sbsdiff {
409
+@ background-color: #ffffc5;
410
+@ font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
411
+@ font-size: 8pt;
412
+@ border-collapse:collapse;
413
+@ white-space: pre;
414
+@ width: 98%;
415
+@ border: 1px #000 dashed;
416
+@ }
417
+@
418
+@ table.sbsdiff th.diffhdr {
419
+@ border-bottom: dotted;
420
+@ border-width: 1px;
421
+@ }
422
+@
423
+@ table.sbsdiff tr td {
424
+@ white-space: pre;
425
+@ padding-left: 3px;
426
+@ padding-right: 3px;
427
+@ margin: 0px;
428
+@ }
429
+@
430
+@ table.sbsdiff tr td.lineno {
431
+@ text-align: right;
432
+@ }
433
+@
434
+@ table.sbsdiff tr td.meta {
435
+@ background-color: #a09048;
436
+@ text-align: center;
437
+@ }
438
+@
439
+@ table.sbsdiff tr td.added {
440
+@ background-color: rgb(210, 210, 100);
441
+@ }
442
+@
443
+@ table.sbsdiff tr td.removed {
444
+@ background-color: rgb(190, 200, 110);
445
+@ }
446
+@
447
+@ table.sbsdiff tr td.changed {
448
+@ background-color: rgb(200, 210, 120);
360449
@ }');
361450
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
362451
@ <head>
363452
@ <title>$<project_name>: $<title></title>
364453
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@@ -591,10 +680,56 @@
591680
@ /* The label/value pairs on (for example) the ci page */
592681
@ table.label-value th {
593682
@ vertical-align: top;
594683
@ text-align: right;
595684
@ padding: 0.2ex 2ex;
685
+@ }
686
+@
687
+@ /* Side-by-side diff */
688
+@ table.sbsdiff {
689
+@ background-color: white;
690
+@ font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
691
+@ font-size: 6pt;
692
+@ border-collapse:collapse;
693
+@ white-space: pre;
694
+@ width: 98%;
695
+@ border: 1px #000 dashed;
696
+@ }
697
+@
698
+@ table.sbsdiff th.diffhdr {
699
+@ border-bottom: dotted;
700
+@ border-width: 1px;
701
+@ }
702
+@
703
+@ table.sbsdiff tr td {
704
+@ white-space: pre;
705
+@ padding-left: 3px;
706
+@ padding-right: 3px;
707
+@ margin: 0px;
708
+@ }
709
+@
710
+@ table.sbsdiff tr td.lineno {
711
+@ text-align: right;
712
+@ }
713
+@
714
+@ table.sbsdiff tr td.meta {
715
+@ color: white;
716
+@ background-color: black;
717
+@ text-align: center;
718
+@ }
719
+@
720
+@ table.sbsdiff tr td.added {
721
+@ background-color: white;
722
+@ }
723
+@
724
+@ table.sbsdiff tr td.removed {
725
+@ background-color: white;
726
+@ text-decoration: line-through;
727
+@ }
728
+@
729
+@ table.sbsdiff tr td.changed {
730
+@ background-color: white;
596731
@ }');
597732
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
598733
@ <head>
599734
@ <title>$<project_name>: $<title></title>
600735
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@@ -889,10 +1024,77 @@
8891024
@ padding: 3px 5px;
8901025
@ }
8911026
@
8921027
@ textarea {
8931028
@ font-size: 1em;
1029
+@ }
1030
+@
1031
+@ /* Side-by-side diff */
1032
+@ table.sbsdiff {
1033
+@ background-color: white;
1034
+@ font-family: Dejavu Sans Mono, Monaco, Lucida Console, monospace;
1035
+@ font-size: 6pt;
1036
+@ border-collapse:collapse;
1037
+@ width: 98%;
1038
+@ border: 1px #000 dashed;
1039
+@ margin-left: auto;
1040
+@ margin-right: auto;
1041
+@ }
1042
+@
1043
+@ table.sbsdiff th.diffhdr {
1044
+@ border-bottom: dotted;
1045
+@ border-width: 1px;
1046
+@ }
1047
+@
1048
+@ table.sbsdiff tr td {
1049
+@ padding-left: 3px;
1050
+@ padding-right: 3px;
1051
+@ margin: 0px;
1052
+@ vertical-align: top;
1053
+@ white-space: pre-wrap;
1054
+@ }
1055
+@
1056
+@ table.sbsdiff tr td.lineno {
1057
+@ text-align: right;
1058
+@ /* border-bottom: 1px solid rgb(220, 220, 220); */
1059
+@ }
1060
+@
1061
+@ table.sbsdiff tr td.srcline {
1062
+@ /* max-width: 400px; */
1063
+@ /* Note: May partially hide long lines without whitespaces */
1064
+@ /* overflow: hidden; */
1065
+@ /* border-bottom: 1px solid rgb(220, 220, 220); */
1066
+@ }
1067
+@
1068
+@ table.sbsdiff tr td.meta {
1069
+@ background-color: rgb(170, 160, 255);
1070
+@ padding-top: 0.25em;
1071
+@ padding-bottom: 0.25em;
1072
+@ text-align: center;
1073
+@ -moz-border-radius: 5px;
1074
+@ -moz-border-radius: 5px;
1075
+@ -webkit-border-radius: 5px;
1076
+@ -webkit-border-radius: 5px;
1077
+@ -border-radius: 5px;
1078
+@ -border-radius: 5px;
1079
+@ border-radius: 5px;
1080
+@ border-radius: 5px;
1081
+@ }
1082
+@
1083
+@ table.sbsdiff tr td.added {
1084
+@ background-color: rgb(180, 250, 180);
1085
+@ /* border-bottom: 1px solid rgb(160, 230, 160); */
1086
+@ }
1087
+@
1088
+@ table.sbsdiff tr td.removed {
1089
+@ background-color: rgb(250, 130, 130);
1090
+@ /* border-bottom: 1px solid rgb(230, 110, 110); */
1091
+@ }
1092
+@
1093
+@ table.sbsdiff tr td.changed {
1094
+@ background-color: rgb(210, 210, 200);
1095
+@ /* border-bottom: 1px solid rgb(190, 190, 180); */
8941096
@ }');
8951097
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
8961098
@ <head>
8971099
@ <title>$<project_name>: $<title></title>
8981100
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
8991101
--- src/skins.c
+++ src/skins.c
@@ -153,10 +153,55 @@
153 @ /* The label/value pairs on (for example) the vinfo page */
154 @ table.label-value th {
155 @ vertical-align: top;
156 @ text-align: right;
157 @ padding: 0.2ex 2ex;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158 @ }');
159 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
160 @ <head>
161 @ <title>$<project_name>: $<title></title>
162 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@@ -355,10 +400,54 @@
355 @ /* The label/value pairs on (for example) the ci page */
356 @ table.label-value th {
357 @ vertical-align: top;
358 @ text-align: right;
359 @ padding: 0.2ex 2ex;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360 @ }');
361 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
362 @ <head>
363 @ <title>$<project_name>: $<title></title>
364 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@@ -591,10 +680,56 @@
591 @ /* The label/value pairs on (for example) the ci page */
592 @ table.label-value th {
593 @ vertical-align: top;
594 @ text-align: right;
595 @ padding: 0.2ex 2ex;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
596 @ }');
597 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
598 @ <head>
599 @ <title>$<project_name>: $<title></title>
600 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@@ -889,10 +1024,77 @@
889 @ padding: 3px 5px;
890 @ }
891 @
892 @ textarea {
893 @ font-size: 1em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
894 @ }');
895 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
896 @ <head>
897 @ <title>$<project_name>: $<title></title>
898 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
899
--- src/skins.c
+++ src/skins.c
@@ -153,10 +153,55 @@
153 @ /* The label/value pairs on (for example) the vinfo page */
154 @ table.label-value th {
155 @ vertical-align: top;
156 @ text-align: right;
157 @ padding: 0.2ex 2ex;
158 @ }
159 @
160 @ /* Side-by-side diff */
161 @ table.sbsdiff {
162 @ background-color: white;
163 @ font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
164 @ font-size: 8pt;
165 @ border-collapse:collapse;
166 @ white-space: pre;
167 @ width: 98%;
168 @ border: 1px #000 dashed;
169 @ }
170 @
171 @ table.sbsdiff th.diffhdr {
172 @ border-bottom: dotted;
173 @ border-width: 1px;
174 @ }
175 @
176 @ table.sbsdiff tr td {
177 @ white-space: pre;
178 @ padding-left: 3px;
179 @ padding-right: 3px;
180 @ margin: 0px;
181 @ }
182 @
183 @ table.sbsdiff tr td.lineno {
184 @ text-align: right;
185 @ }
186 @
187 @ table.sbsdiff tr td.meta {
188 @ color: white;
189 @ background-color: rgb(20, 20, 20);
190 @ text-align: center;
191 @ }
192 @
193 @ table.sbsdiff tr td.added {
194 @ background-color: rgb(230, 230, 230);
195 @ }
196 @
197 @ table.sbsdiff tr td.removed {
198 @ background-color: rgb(200, 200, 200);
199 @ }
200 @
201 @ table.sbsdiff tr td.changed {
202 @ background-color: rgb(220, 220, 220);
203 @ }');
204 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
205 @ <head>
206 @ <title>$<project_name>: $<title></title>
207 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@@ -355,10 +400,54 @@
400 @ /* The label/value pairs on (for example) the ci page */
401 @ table.label-value th {
402 @ vertical-align: top;
403 @ text-align: right;
404 @ padding: 0.2ex 2ex;
405 @ }
406 @
407 @ /* Side-by-side diff */
408 @ table.sbsdiff {
409 @ background-color: #ffffc5;
410 @ font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
411 @ font-size: 8pt;
412 @ border-collapse:collapse;
413 @ white-space: pre;
414 @ width: 98%;
415 @ border: 1px #000 dashed;
416 @ }
417 @
418 @ table.sbsdiff th.diffhdr {
419 @ border-bottom: dotted;
420 @ border-width: 1px;
421 @ }
422 @
423 @ table.sbsdiff tr td {
424 @ white-space: pre;
425 @ padding-left: 3px;
426 @ padding-right: 3px;
427 @ margin: 0px;
428 @ }
429 @
430 @ table.sbsdiff tr td.lineno {
431 @ text-align: right;
432 @ }
433 @
434 @ table.sbsdiff tr td.meta {
435 @ background-color: #a09048;
436 @ text-align: center;
437 @ }
438 @
439 @ table.sbsdiff tr td.added {
440 @ background-color: rgb(210, 210, 100);
441 @ }
442 @
443 @ table.sbsdiff tr td.removed {
444 @ background-color: rgb(190, 200, 110);
445 @ }
446 @
447 @ table.sbsdiff tr td.changed {
448 @ background-color: rgb(200, 210, 120);
449 @ }');
450 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
451 @ <head>
452 @ <title>$<project_name>: $<title></title>
453 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@@ -591,10 +680,56 @@
680 @ /* The label/value pairs on (for example) the ci page */
681 @ table.label-value th {
682 @ vertical-align: top;
683 @ text-align: right;
684 @ padding: 0.2ex 2ex;
685 @ }
686 @
687 @ /* Side-by-side diff */
688 @ table.sbsdiff {
689 @ background-color: white;
690 @ font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
691 @ font-size: 6pt;
692 @ border-collapse:collapse;
693 @ white-space: pre;
694 @ width: 98%;
695 @ border: 1px #000 dashed;
696 @ }
697 @
698 @ table.sbsdiff th.diffhdr {
699 @ border-bottom: dotted;
700 @ border-width: 1px;
701 @ }
702 @
703 @ table.sbsdiff tr td {
704 @ white-space: pre;
705 @ padding-left: 3px;
706 @ padding-right: 3px;
707 @ margin: 0px;
708 @ }
709 @
710 @ table.sbsdiff tr td.lineno {
711 @ text-align: right;
712 @ }
713 @
714 @ table.sbsdiff tr td.meta {
715 @ color: white;
716 @ background-color: black;
717 @ text-align: center;
718 @ }
719 @
720 @ table.sbsdiff tr td.added {
721 @ background-color: white;
722 @ }
723 @
724 @ table.sbsdiff tr td.removed {
725 @ background-color: white;
726 @ text-decoration: line-through;
727 @ }
728 @
729 @ table.sbsdiff tr td.changed {
730 @ background-color: white;
731 @ }');
732 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
733 @ <head>
734 @ <title>$<project_name>: $<title></title>
735 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@@ -889,10 +1024,77 @@
1024 @ padding: 3px 5px;
1025 @ }
1026 @
1027 @ textarea {
1028 @ font-size: 1em;
1029 @ }
1030 @
1031 @ /* Side-by-side diff */
1032 @ table.sbsdiff {
1033 @ background-color: white;
1034 @ font-family: Dejavu Sans Mono, Monaco, Lucida Console, monospace;
1035 @ font-size: 6pt;
1036 @ border-collapse:collapse;
1037 @ width: 98%;
1038 @ border: 1px #000 dashed;
1039 @ margin-left: auto;
1040 @ margin-right: auto;
1041 @ }
1042 @
1043 @ table.sbsdiff th.diffhdr {
1044 @ border-bottom: dotted;
1045 @ border-width: 1px;
1046 @ }
1047 @
1048 @ table.sbsdiff tr td {
1049 @ padding-left: 3px;
1050 @ padding-right: 3px;
1051 @ margin: 0px;
1052 @ vertical-align: top;
1053 @ white-space: pre-wrap;
1054 @ }
1055 @
1056 @ table.sbsdiff tr td.lineno {
1057 @ text-align: right;
1058 @ /* border-bottom: 1px solid rgb(220, 220, 220); */
1059 @ }
1060 @
1061 @ table.sbsdiff tr td.srcline {
1062 @ /* max-width: 400px; */
1063 @ /* Note: May partially hide long lines without whitespaces */
1064 @ /* overflow: hidden; */
1065 @ /* border-bottom: 1px solid rgb(220, 220, 220); */
1066 @ }
1067 @
1068 @ table.sbsdiff tr td.meta {
1069 @ background-color: rgb(170, 160, 255);
1070 @ padding-top: 0.25em;
1071 @ padding-bottom: 0.25em;
1072 @ text-align: center;
1073 @ -moz-border-radius: 5px;
1074 @ -moz-border-radius: 5px;
1075 @ -webkit-border-radius: 5px;
1076 @ -webkit-border-radius: 5px;
1077 @ -border-radius: 5px;
1078 @ -border-radius: 5px;
1079 @ border-radius: 5px;
1080 @ border-radius: 5px;
1081 @ }
1082 @
1083 @ table.sbsdiff tr td.added {
1084 @ background-color: rgb(180, 250, 180);
1085 @ /* border-bottom: 1px solid rgb(160, 230, 160); */
1086 @ }
1087 @
1088 @ table.sbsdiff tr td.removed {
1089 @ background-color: rgb(250, 130, 130);
1090 @ /* border-bottom: 1px solid rgb(230, 110, 110); */
1091 @ }
1092 @
1093 @ table.sbsdiff tr td.changed {
1094 @ background-color: rgb(210, 210, 200);
1095 @ /* border-bottom: 1px solid rgb(190, 190, 180); */
1096 @ }');
1097 @ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
1098 @ <head>
1099 @ <title>$<project_name>: $<title></title>
1100 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
1101
+60
--- src/style.c
+++ src/style.c
@@ -398,10 +398,70 @@
398398
@ table.label-value th {
399399
@ vertical-align: top;
400400
@ text-align: right;
401401
@ padding: 0.2ex 2ex;
402402
@ }
403
+@
404
+@ /* Side-by-side diff */
405
+@ table.sbsdiff {
406
+@ background-color: white;
407
+@ font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
408
+@ font-size: 8pt;
409
+@ border-collapse:collapse;
410
+@ white-space: pre;
411
+@ width: 98%;
412
+@ border: 1px #000 dashed;
413
+@ margin-left: auto;
414
+@ margin-right: auto;
415
+@ }
416
+@
417
+@ table.sbsdiff th.diffhdr {
418
+@ border-bottom: dotted;
419
+@ border-width: 1px;
420
+@ }
421
+@
422
+@ table.sbsdiff tr td {
423
+@ white-space: pre;
424
+@ padding-left: 3px;
425
+@ padding-right: 3px;
426
+@ margin: 0px;
427
+@ vertical-align: top;
428
+@ }
429
+@
430
+@ table.sbsdiff tr td.lineno {
431
+@ text-align: right;
432
+@ }
433
+@
434
+@ table.sbsdiff tr td.srcline {
435
+@ }
436
+@
437
+@ table.sbsdiff tr td.meta {
438
+@ background-color: rgb(170, 160, 255);
439
+@ text-align: center;
440
+@ }
441
+@
442
+@ table.sbsdiff tr td.added {
443
+@ background-color: rgb(180, 250, 180);
444
+@ }
445
+@ table.sbsdiff tr td.addedvoid {
446
+@ background-color: rgb(190, 190, 180);
447
+@ }
448
+@
449
+@ table.sbsdiff tr td.removed {
450
+@ background-color: rgb(250, 130, 130);
451
+@ }
452
+@ table.sbsdiff tr td.removedvoid {
453
+@ background-color: rgb(190, 190, 180);
454
+@ }
455
+@
456
+@ table.sbsdiff tr td.changed {
457
+@ background-color: rgb(210, 210, 200);
458
+@ }
459
+@ table.sbsdiff tr td.changedvoid {
460
+@ background-color: rgb(190, 190, 180);
461
+@ }
462
+@
403463
;
404464
405465
406466
/* The following table contains bits of default CSS that must
407467
** be included if they are not found in the application-defined
408468
--- src/style.c
+++ src/style.c
@@ -398,10 +398,70 @@
398 @ table.label-value th {
399 @ vertical-align: top;
400 @ text-align: right;
401 @ padding: 0.2ex 2ex;
402 @ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403 ;
404
405
406 /* The following table contains bits of default CSS that must
407 ** be included if they are not found in the application-defined
408
--- src/style.c
+++ src/style.c
@@ -398,10 +398,70 @@
398 @ table.label-value th {
399 @ vertical-align: top;
400 @ text-align: right;
401 @ padding: 0.2ex 2ex;
402 @ }
403 @
404 @ /* Side-by-side diff */
405 @ table.sbsdiff {
406 @ background-color: white;
407 @ font-family: fixed, Dejavu Sans Mono, Monaco, Lucida Console, monospace;
408 @ font-size: 8pt;
409 @ border-collapse:collapse;
410 @ white-space: pre;
411 @ width: 98%;
412 @ border: 1px #000 dashed;
413 @ margin-left: auto;
414 @ margin-right: auto;
415 @ }
416 @
417 @ table.sbsdiff th.diffhdr {
418 @ border-bottom: dotted;
419 @ border-width: 1px;
420 @ }
421 @
422 @ table.sbsdiff tr td {
423 @ white-space: pre;
424 @ padding-left: 3px;
425 @ padding-right: 3px;
426 @ margin: 0px;
427 @ vertical-align: top;
428 @ }
429 @
430 @ table.sbsdiff tr td.lineno {
431 @ text-align: right;
432 @ }
433 @
434 @ table.sbsdiff tr td.srcline {
435 @ }
436 @
437 @ table.sbsdiff tr td.meta {
438 @ background-color: rgb(170, 160, 255);
439 @ text-align: center;
440 @ }
441 @
442 @ table.sbsdiff tr td.added {
443 @ background-color: rgb(180, 250, 180);
444 @ }
445 @ table.sbsdiff tr td.addedvoid {
446 @ background-color: rgb(190, 190, 180);
447 @ }
448 @
449 @ table.sbsdiff tr td.removed {
450 @ background-color: rgb(250, 130, 130);
451 @ }
452 @ table.sbsdiff tr td.removedvoid {
453 @ background-color: rgb(190, 190, 180);
454 @ }
455 @
456 @ table.sbsdiff tr td.changed {
457 @ background-color: rgb(210, 210, 200);
458 @ }
459 @ table.sbsdiff tr td.changedvoid {
460 @ background-color: rgb(190, 190, 180);
461 @ }
462 @
463 ;
464
465
466 /* The following table contains bits of default CSS that must
467 ** be included if they are not found in the application-defined
468

Keyboard Shortcuts

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