Fossil SCM

Tweak to the side-by-side diff alignment algorithm. Add diff test cases to the release checklist.

drh 2012-03-09 02:07 trunk
Commit 3be264b57fc46fb81d47ef2fc5188a588e7bab08
+1
--- src/diff.c
+++ src/diff.c
@@ -721,10 +721,11 @@
721721
while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; }
722722
if( nA>250 ) nA = 250;
723723
if( nB>250 ) nB = 250;
724724
avg = (nA+nB)/2;
725725
if( avg==0 ) return 0;
726
+ if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0;
726727
memset(aFirst, 0, sizeof(aFirst));
727728
zA--; zB--; /* Make both zA[] and zB[] 1-indexed */
728729
for(i=nB; i>0; i--){
729730
c = (unsigned char)zB[i];
730731
aNext[i] = aFirst[c];
731732
732733
ADDED test/diff-test-1.wiki
--- src/diff.c
+++ src/diff.c
@@ -721,10 +721,11 @@
721 while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; }
722 if( nA>250 ) nA = 250;
723 if( nB>250 ) nB = 250;
724 avg = (nA+nB)/2;
725 if( avg==0 ) return 0;
 
726 memset(aFirst, 0, sizeof(aFirst));
727 zA--; zB--; /* Make both zA[] and zB[] 1-indexed */
728 for(i=nB; i>0; i--){
729 c = (unsigned char)zB[i];
730 aNext[i] = aFirst[c];
731
732 DDED test/diff-test-1.wiki
--- src/diff.c
+++ src/diff.c
@@ -721,10 +721,11 @@
721 while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; }
722 if( nA>250 ) nA = 250;
723 if( nB>250 ) nB = 250;
724 avg = (nA+nB)/2;
725 if( avg==0 ) return 0;
726 if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0;
727 memset(aFirst, 0, sizeof(aFirst));
728 zA--; zB--; /* Make both zA[] and zB[] 1-indexed */
729 for(i=nB; i>0; i--){
730 c = (unsigned char)zB[i];
731 aNext[i] = aFirst[c];
732
733 DDED test/diff-test-1.wiki

No diff available

--- test/release-checklist.wiki
+++ test/release-checklist.wiki
@@ -13,10 +13,15 @@
1313
<li><p>
1414
Click on each of the links in in the
1515
[./graph-test-1.wiki] document and verify that all graphs are
1616
rendered correctly.
1717
18
+<li><p>
19
+Click on each of the links in in the
20
+[./diff-test-1.wiki] document and verify that all diffs are
21
+rendered correctly.
22
+
1823
<li><p>
1924
Verify correct name-change tracking behavior (no net changes) for:
2025
<blockquote><b>
2126
fossil test-name-changes --debug b120bc8b262ac 374920b20944b
2227
</b></blockquote>
2328
--- test/release-checklist.wiki
+++ test/release-checklist.wiki
@@ -13,10 +13,15 @@
13 <li><p>
14 Click on each of the links in in the
15 [./graph-test-1.wiki] document and verify that all graphs are
16 rendered correctly.
17
 
 
 
 
 
18 <li><p>
19 Verify correct name-change tracking behavior (no net changes) for:
20 <blockquote><b>
21 fossil test-name-changes --debug b120bc8b262ac 374920b20944b
22 </b></blockquote>
23
--- test/release-checklist.wiki
+++ test/release-checklist.wiki
@@ -13,10 +13,15 @@
13 <li><p>
14 Click on each of the links in in the
15 [./graph-test-1.wiki] document and verify that all graphs are
16 rendered correctly.
17
18 <li><p>
19 Click on each of the links in in the
20 [./diff-test-1.wiki] document and verify that all diffs are
21 rendered correctly.
22
23 <li><p>
24 Verify correct name-change tracking behavior (no net changes) for:
25 <blockquote><b>
26 fossil test-name-changes --debug b120bc8b262ac 374920b20944b
27 </b></blockquote>
28

Keyboard Shortcuts

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