Fossil SCM
Rename the test-udiff command to test-diff and give it the capability to use the --tk option.
Commit
4cf8c16cd82f160a61038ea34dba1ca7a06d096b
Parent
0658068a237b8a5…
1 file changed
+11
-2
+11
-2
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -1873,19 +1873,28 @@ | ||
| 1873 | 1873 | blob_reset(&b); |
| 1874 | 1874 | } |
| 1875 | 1875 | } |
| 1876 | 1876 | |
| 1877 | 1877 | /* |
| 1878 | -** COMMAND: test-udiff | |
| 1878 | +** COMMAND: test-diff | |
| 1879 | +** | |
| 1880 | +** Usage: %fossil [options] FILE1 FILE2 | |
| 1879 | 1881 | ** |
| 1880 | 1882 | ** Print the difference between two files. The usual diff options apply. |
| 1881 | 1883 | */ |
| 1882 | 1884 | void test_udiff_cmd(void){ |
| 1883 | 1885 | Blob a, b, out; |
| 1884 | - u64 diffFlag = diff_options(); | |
| 1886 | + u64 diffFlag; | |
| 1885 | 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(); | |
| 1886 | 1894 | if( g.argc!=4 ) usage("FILE1 FILE2"); |
| 1895 | + diff_print_filenames(g.argv[2], g.argv[3], diffFlag); | |
| 1887 | 1896 | blob_read_from_file(&a, g.argv[2]); |
| 1888 | 1897 | blob_read_from_file(&b, g.argv[3]); |
| 1889 | 1898 | blob_zero(&out); |
| 1890 | 1899 | text_diff(&a, &b, &out, diffFlag); |
| 1891 | 1900 | blob_write_to_file(&out, "-"); |
| 1892 | 1901 |
| --- 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 |