Fossil SCM

Rename the test-udiff command to test-diff and give it the capability to use the --tk option.

drh 2012-12-14 18:58 UTC trunk
Commit 4cf8c16cd82f160a61038ea34dba1ca7a06d096b
1 file changed +11 -2
+11 -2
--- src/diff.c
+++ src/diff.c
@@ -1873,19 +1873,28 @@
18731873
blob_reset(&b);
18741874
}
18751875
}
18761876
18771877
/*
1878
-** COMMAND: test-udiff
1878
+** COMMAND: test-diff
1879
+**
1880
+** Usage: %fossil [options] FILE1 FILE2
18791881
**
18801882
** Print the difference between two files. The usual diff options apply.
18811883
*/
18821884
void test_udiff_cmd(void){
18831885
Blob a, b, out;
1884
- u64 diffFlag = diff_options();
1886
+ u64 diffFlag;
18851887
1888
+ if( find_option("tk",0,0)!=0 ){
1889
+ diff_tk("test-diff", 2);
1890
+ return;
1891
+ }
1892
+ find_option("i",0,0);
1893
+ diffFlag = diff_options();
18861894
if( g.argc!=4 ) usage("FILE1 FILE2");
1895
+ diff_print_filenames(g.argv[2], g.argv[3], diffFlag);
18871896
blob_read_from_file(&a, g.argv[2]);
18881897
blob_read_from_file(&b, g.argv[3]);
18891898
blob_zero(&out);
18901899
text_diff(&a, &b, &out, diffFlag);
18911900
blob_write_to_file(&out, "-");
18921901
--- src/diff.c
+++ src/diff.c
@@ -1873,19 +1873,28 @@
1873 blob_reset(&b);
1874 }
1875 }
1876
1877 /*
1878 ** COMMAND: test-udiff
 
 
1879 **
1880 ** Print the difference between two files. The usual diff options apply.
1881 */
1882 void test_udiff_cmd(void){
1883 Blob a, b, out;
1884 u64 diffFlag = diff_options();
1885
 
 
 
 
 
 
1886 if( g.argc!=4 ) usage("FILE1 FILE2");
 
1887 blob_read_from_file(&a, g.argv[2]);
1888 blob_read_from_file(&b, g.argv[3]);
1889 blob_zero(&out);
1890 text_diff(&a, &b, &out, diffFlag);
1891 blob_write_to_file(&out, "-");
1892
--- src/diff.c
+++ src/diff.c
@@ -1873,19 +1873,28 @@
1873 blob_reset(&b);
1874 }
1875 }
1876
1877 /*
1878 ** COMMAND: test-diff
1879 **
1880 ** Usage: %fossil [options] FILE1 FILE2
1881 **
1882 ** Print the difference between two files. The usual diff options apply.
1883 */
1884 void test_udiff_cmd(void){
1885 Blob a, b, out;
1886 u64 diffFlag;
1887
1888 if( find_option("tk",0,0)!=0 ){
1889 diff_tk("test-diff", 2);
1890 return;
1891 }
1892 find_option("i",0,0);
1893 diffFlag = diff_options();
1894 if( g.argc!=4 ) usage("FILE1 FILE2");
1895 diff_print_filenames(g.argv[2], g.argv[3], diffFlag);
1896 blob_read_from_file(&a, g.argv[2]);
1897 blob_read_from_file(&b, g.argv[3]);
1898 blob_zero(&out);
1899 text_diff(&a, &b, &out, diffFlag);
1900 blob_write_to_file(&out, "-");
1901

Keyboard Shortcuts

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