Fossil SCM

Updated comments. Slightly more centralization of sbsdiff table generation.

jan 2011-10-15 14:33 jan-sbsdiff
Commit c5ac4f800e3ba241933a903f6842e5f4536103a2
2 files changed +1 +8 -12
+1
--- src/diff.c
+++ src/diff.c
@@ -649,10 +649,11 @@
649649
650650
linebuf = fossil_malloc(LENGTH_MASK+1);
651651
if( !linebuf ){
652652
free(c.aFrom);
653653
free(c.aTo);
654
+ free(c.aEdit);
654655
return 0;
655656
}
656657
657658
iFrom=iTo=0;
658659
i=0;
659660
--- src/diff.c
+++ src/diff.c
@@ -649,10 +649,11 @@
649
650 linebuf = fossil_malloc(LENGTH_MASK+1);
651 if( !linebuf ){
652 free(c.aFrom);
653 free(c.aTo);
 
654 return 0;
655 }
656
657 iFrom=iTo=0;
658 i=0;
659
--- src/diff.c
+++ src/diff.c
@@ -649,10 +649,11 @@
649
650 linebuf = fossil_malloc(LENGTH_MASK+1);
651 if( !linebuf ){
652 free(c.aFrom);
653 free(c.aTo);
654 free(c.aEdit);
655 return 0;
656 }
657
658 iFrom=iTo=0;
659 i=0;
660
+8 -12
--- src/info.c
+++ src/info.c
@@ -297,11 +297,15 @@
297297
toid = uuid_to_rid(zTo, 0);
298298
content_get(toid, &to);
299299
}else{
300300
blob_zero(&to);
301301
}
302
+ @ <table class="sbsdiff">
303
+ @ <tr><th colspan="2" class="diffhdr">Old (%S(zFrom))</th><th/>
304
+ @ <th colspan="2" class="diffhdr">New (%S(zTo))</th></tr>
302305
html_sbsdiff(&from, &to, 5, 1);
306
+ @ </table>
303307
blob_reset(&from);
304308
blob_reset(&to);
305309
}
306310
307311
@@ -357,15 +361,11 @@
357361
@ <p>Added <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
358362
@ version <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)]</a>
359363
}
360364
if( showDiff ){
361365
if( sideBySide ){
362
- @ <table class="sbsdiff">
363
- @ <tr><th colspan="2" class="diffhdr">Old (%S(zOld))</th><th/>
364
- @ <th colspan="2" class="diffhdr">New (%S(zNew))</th></tr>
365366
generate_sbsdiff(zOld, zNew);
366
- @ </table>
367367
}else{
368368
@ <blockquote><pre>
369369
append_diff(zOld, zNew);
370370
@ </pre></blockquote>
371371
}
@@ -1022,15 +1022,15 @@
10221022
}
10231023
10241024
10251025
/*
10261026
** WEBPAGE: fdiff
1027
-** URL: fdiff?v1=UUID&v2=UUID&patch
1027
+** URL: fdiff?v1=UUID&v2=UUID&patch&sbs=BOOLEAN
10281028
**
1029
-** Two arguments, v1 and v2, identify the files to be diffed. Show the
1030
-** difference between the two artifacts. Generate plaintext if "patch"
1031
-** is present.
1029
+** Two arguments, v1 and v2, identify the files to be diffed. Show the
1030
+** difference between the two artifacts. Show diff side by side unless sbs
1031
+** is 0. Generate plaintext if "patch" is present.
10321032
*/
10331033
void diff_page(void){
10341034
int v1, v2;
10351035
int isPatch;
10361036
int sideBySide;
@@ -1070,15 +1070,11 @@
10701070
object_description(v1, 0, 0);
10711071
@ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
10721072
object_description(v2, 0, 0);
10731073
@ <hr />
10741074
if( sideBySide ){
1075
- @ <table class="sbsdiff">
1076
- @ <tr><th colspan="2" class="diffhdr">Old (%S(zV1))</th><th/>
1077
- @ <th colspan="2" class="diffhdr">New (%S(zV2))</th></tr>
10781075
generate_sbsdiff(zV1, zV2);
1079
- @ </table>
10801076
}else{
10811077
@ <blockquote><pre>
10821078
@ %h(blob_str(&diff))
10831079
@ </pre></blockquote>
10841080
}
10851081
--- src/info.c
+++ src/info.c
@@ -297,11 +297,15 @@
297 toid = uuid_to_rid(zTo, 0);
298 content_get(toid, &to);
299 }else{
300 blob_zero(&to);
301 }
 
 
 
302 html_sbsdiff(&from, &to, 5, 1);
 
303 blob_reset(&from);
304 blob_reset(&to);
305 }
306
307
@@ -357,15 +361,11 @@
357 @ <p>Added <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
358 @ version <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)]</a>
359 }
360 if( showDiff ){
361 if( sideBySide ){
362 @ <table class="sbsdiff">
363 @ <tr><th colspan="2" class="diffhdr">Old (%S(zOld))</th><th/>
364 @ <th colspan="2" class="diffhdr">New (%S(zNew))</th></tr>
365 generate_sbsdiff(zOld, zNew);
366 @ </table>
367 }else{
368 @ <blockquote><pre>
369 append_diff(zOld, zNew);
370 @ </pre></blockquote>
371 }
@@ -1022,15 +1022,15 @@
1022 }
1023
1024
1025 /*
1026 ** WEBPAGE: fdiff
1027 ** URL: fdiff?v1=UUID&v2=UUID&patch
1028 **
1029 ** Two arguments, v1 and v2, identify the files to be diffed. Show the
1030 ** difference between the two artifacts. Generate plaintext if "patch"
1031 ** is present.
1032 */
1033 void diff_page(void){
1034 int v1, v2;
1035 int isPatch;
1036 int sideBySide;
@@ -1070,15 +1070,11 @@
1070 object_description(v1, 0, 0);
1071 @ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
1072 object_description(v2, 0, 0);
1073 @ <hr />
1074 if( sideBySide ){
1075 @ <table class="sbsdiff">
1076 @ <tr><th colspan="2" class="diffhdr">Old (%S(zV1))</th><th/>
1077 @ <th colspan="2" class="diffhdr">New (%S(zV2))</th></tr>
1078 generate_sbsdiff(zV1, zV2);
1079 @ </table>
1080 }else{
1081 @ <blockquote><pre>
1082 @ %h(blob_str(&diff))
1083 @ </pre></blockquote>
1084 }
1085
--- src/info.c
+++ src/info.c
@@ -297,11 +297,15 @@
297 toid = uuid_to_rid(zTo, 0);
298 content_get(toid, &to);
299 }else{
300 blob_zero(&to);
301 }
302 @ <table class="sbsdiff">
303 @ <tr><th colspan="2" class="diffhdr">Old (%S(zFrom))</th><th/>
304 @ <th colspan="2" class="diffhdr">New (%S(zTo))</th></tr>
305 html_sbsdiff(&from, &to, 5, 1);
306 @ </table>
307 blob_reset(&from);
308 blob_reset(&to);
309 }
310
311
@@ -357,15 +361,11 @@
361 @ <p>Added <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
362 @ version <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)]</a>
363 }
364 if( showDiff ){
365 if( sideBySide ){
 
 
 
366 generate_sbsdiff(zOld, zNew);
 
367 }else{
368 @ <blockquote><pre>
369 append_diff(zOld, zNew);
370 @ </pre></blockquote>
371 }
@@ -1022,15 +1022,15 @@
1022 }
1023
1024
1025 /*
1026 ** WEBPAGE: fdiff
1027 ** URL: fdiff?v1=UUID&v2=UUID&patch&sbs=BOOLEAN
1028 **
1029 ** Two arguments, v1 and v2, identify the files to be diffed. Show the
1030 ** difference between the two artifacts. Show diff side by side unless sbs
1031 ** is 0. Generate plaintext if "patch" is present.
1032 */
1033 void diff_page(void){
1034 int v1, v2;
1035 int isPatch;
1036 int sideBySide;
@@ -1070,15 +1070,11 @@
1070 object_description(v1, 0, 0);
1071 @ <h2>To Artifact <a href="%s(g.zTop)/artifact/%S(zV2)">[%S(zV2)]</a>:</h2>
1072 object_description(v2, 0, 0);
1073 @ <hr />
1074 if( sideBySide ){
 
 
 
1075 generate_sbsdiff(zV1, zV2);
 
1076 }else{
1077 @ <blockquote><pre>
1078 @ %h(blob_str(&diff))
1079 @ </pre></blockquote>
1080 }
1081

Keyboard Shortcuts

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