Fossil SCM
Fix some commenting and variable naming convensions in the diff code. No logical changes.
Commit
4140eb35757eea1f20e9c0f457198ecd5c897230
Parent
cc0c939202be2a6…
1 file changed
+15
-14
+15
-14
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -287,16 +287,16 @@ | ||
| 287 | 287 | ** When using an external diff program, zBinGlob contains the GLOB patterns |
| 288 | 288 | ** for file names to treat as binary. If fIncludeBinary is zero, these files |
| 289 | 289 | ** will be skipped in addition to files that may contain binary content. |
| 290 | 290 | */ |
| 291 | 291 | static void diff_one_against_disk( |
| 292 | - const char *zFrom, /* Name of file */ | |
| 292 | + const char *zFrom, /* Version tag for the "before" file */ | |
| 293 | 293 | const char *zDiffCmd, /* Use this "diff" command */ |
| 294 | 294 | const char *zBinGlob, /* Treat file names matching this as binary */ |
| 295 | 295 | int fIncludeBinary, /* Include binary files for external diff */ |
| 296 | 296 | u64 diffFlags, /* Diff control flags */ |
| 297 | - const char *zFileTreeName | |
| 297 | + const char *zFileTreeName /* Name of the file to be diffed */ | |
| 298 | 298 | ){ |
| 299 | 299 | Blob fname; |
| 300 | 300 | Blob content; |
| 301 | 301 | int isLink; |
| 302 | 302 | int isBin; |
| @@ -440,17 +440,17 @@ | ||
| 440 | 440 | ** When using an external diff program, zBinGlob contains the GLOB patterns |
| 441 | 441 | ** for file names to treat as binary. If fIncludeBinary is zero, these files |
| 442 | 442 | ** will be skipped in addition to files that may contain binary content. |
| 443 | 443 | */ |
| 444 | 444 | static void diff_one_two_versions( |
| 445 | - const char *zFrom, | |
| 446 | - const char *zTo, | |
| 447 | - const char *zDiffCmd, | |
| 448 | - const char *zBinGlob, | |
| 449 | - int fIncludeBinary, | |
| 450 | - u64 diffFlags, | |
| 451 | - const char *zFileTreeName | |
| 445 | + const char *zFrom, /* Version tag for the "before" file */ | |
| 446 | + const char *zTo, /* Version tag for the "after" file */ | |
| 447 | + const char *zDiffCmd, /* Use this "diff" command */ | |
| 448 | + const char *zBinGlob, /* GLOB pattern for files that are binary */ | |
| 449 | + int fIncludeBinary, /* True to show binary files */ | |
| 450 | + u64 diffFlags, /* Diff flags */ | |
| 451 | + const char *zFileTreeName /* Name of the file to be diffed */ | |
| 452 | 452 | ){ |
| 453 | 453 | char *zName; |
| 454 | 454 | Blob fname; |
| 455 | 455 | Blob v1, v2; |
| 456 | 456 | int isLink1, isLink2; |
| @@ -770,11 +770,10 @@ | ||
| 770 | 770 | const char *zBranch; /* Branch to diff */ |
| 771 | 771 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 772 | 772 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| 773 | 773 | int fIncludeBinary = 0; /* Include binary files for external diff */ |
| 774 | 774 | u64 diffFlags = 0; /* Flags to control the DIFF */ |
| 775 | - int f; | |
| 776 | 775 | |
| 777 | 776 | if( find_option("tk",0,0)!=0 ){ |
| 778 | 777 | diff_tk("diff", 2); |
| 779 | 778 | return; |
| 780 | 779 | } |
| @@ -803,13 +802,14 @@ | ||
| 803 | 802 | } |
| 804 | 803 | zBinGlob = diff_get_binary_glob(); |
| 805 | 804 | fIncludeBinary = diff_include_binary_files(); |
| 806 | 805 | verify_all_options(); |
| 807 | 806 | if( g.argc>=3 ){ |
| 808 | - for(f=2; f<g.argc; ++f){ | |
| 807 | + int i; | |
| 808 | + for(i=2; i<g.argc; i++){ | |
| 809 | 809 | diff_one_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary, |
| 810 | - diffFlags, g.argv[f]); | |
| 810 | + diffFlags, g.argv[i]); | |
| 811 | 811 | } |
| 812 | 812 | }else{ |
| 813 | 813 | diff_all_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary, |
| 814 | 814 | diffFlags); |
| 815 | 815 | } |
| @@ -822,13 +822,14 @@ | ||
| 822 | 822 | } |
| 823 | 823 | zBinGlob = diff_get_binary_glob(); |
| 824 | 824 | fIncludeBinary = diff_include_binary_files(); |
| 825 | 825 | verify_all_options(); |
| 826 | 826 | if( g.argc>=3 ){ |
| 827 | - for(f=2; f<g.argc; ++f){ | |
| 827 | + int i; | |
| 828 | + for(i=2; i<g.argc; i++){ | |
| 828 | 829 | diff_one_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary, |
| 829 | - diffFlags, g.argv[f]); | |
| 830 | + diffFlags, g.argv[i]); | |
| 830 | 831 | } |
| 831 | 832 | }else{ |
| 832 | 833 | diff_all_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary, |
| 833 | 834 | diffFlags); |
| 834 | 835 | } |
| 835 | 836 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -287,16 +287,16 @@ | |
| 287 | ** When using an external diff program, zBinGlob contains the GLOB patterns |
| 288 | ** for file names to treat as binary. If fIncludeBinary is zero, these files |
| 289 | ** will be skipped in addition to files that may contain binary content. |
| 290 | */ |
| 291 | static void diff_one_against_disk( |
| 292 | const char *zFrom, /* Name of file */ |
| 293 | const char *zDiffCmd, /* Use this "diff" command */ |
| 294 | const char *zBinGlob, /* Treat file names matching this as binary */ |
| 295 | int fIncludeBinary, /* Include binary files for external diff */ |
| 296 | u64 diffFlags, /* Diff control flags */ |
| 297 | const char *zFileTreeName |
| 298 | ){ |
| 299 | Blob fname; |
| 300 | Blob content; |
| 301 | int isLink; |
| 302 | int isBin; |
| @@ -440,17 +440,17 @@ | |
| 440 | ** When using an external diff program, zBinGlob contains the GLOB patterns |
| 441 | ** for file names to treat as binary. If fIncludeBinary is zero, these files |
| 442 | ** will be skipped in addition to files that may contain binary content. |
| 443 | */ |
| 444 | static void diff_one_two_versions( |
| 445 | const char *zFrom, |
| 446 | const char *zTo, |
| 447 | const char *zDiffCmd, |
| 448 | const char *zBinGlob, |
| 449 | int fIncludeBinary, |
| 450 | u64 diffFlags, |
| 451 | const char *zFileTreeName |
| 452 | ){ |
| 453 | char *zName; |
| 454 | Blob fname; |
| 455 | Blob v1, v2; |
| 456 | int isLink1, isLink2; |
| @@ -770,11 +770,10 @@ | |
| 770 | const char *zBranch; /* Branch to diff */ |
| 771 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 772 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| 773 | int fIncludeBinary = 0; /* Include binary files for external diff */ |
| 774 | u64 diffFlags = 0; /* Flags to control the DIFF */ |
| 775 | int f; |
| 776 | |
| 777 | if( find_option("tk",0,0)!=0 ){ |
| 778 | diff_tk("diff", 2); |
| 779 | return; |
| 780 | } |
| @@ -803,13 +802,14 @@ | |
| 803 | } |
| 804 | zBinGlob = diff_get_binary_glob(); |
| 805 | fIncludeBinary = diff_include_binary_files(); |
| 806 | verify_all_options(); |
| 807 | if( g.argc>=3 ){ |
| 808 | for(f=2; f<g.argc; ++f){ |
| 809 | diff_one_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary, |
| 810 | diffFlags, g.argv[f]); |
| 811 | } |
| 812 | }else{ |
| 813 | diff_all_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary, |
| 814 | diffFlags); |
| 815 | } |
| @@ -822,13 +822,14 @@ | |
| 822 | } |
| 823 | zBinGlob = diff_get_binary_glob(); |
| 824 | fIncludeBinary = diff_include_binary_files(); |
| 825 | verify_all_options(); |
| 826 | if( g.argc>=3 ){ |
| 827 | for(f=2; f<g.argc; ++f){ |
| 828 | diff_one_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary, |
| 829 | diffFlags, g.argv[f]); |
| 830 | } |
| 831 | }else{ |
| 832 | diff_all_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary, |
| 833 | diffFlags); |
| 834 | } |
| 835 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -287,16 +287,16 @@ | |
| 287 | ** When using an external diff program, zBinGlob contains the GLOB patterns |
| 288 | ** for file names to treat as binary. If fIncludeBinary is zero, these files |
| 289 | ** will be skipped in addition to files that may contain binary content. |
| 290 | */ |
| 291 | static void diff_one_against_disk( |
| 292 | const char *zFrom, /* Version tag for the "before" file */ |
| 293 | const char *zDiffCmd, /* Use this "diff" command */ |
| 294 | const char *zBinGlob, /* Treat file names matching this as binary */ |
| 295 | int fIncludeBinary, /* Include binary files for external diff */ |
| 296 | u64 diffFlags, /* Diff control flags */ |
| 297 | const char *zFileTreeName /* Name of the file to be diffed */ |
| 298 | ){ |
| 299 | Blob fname; |
| 300 | Blob content; |
| 301 | int isLink; |
| 302 | int isBin; |
| @@ -440,17 +440,17 @@ | |
| 440 | ** When using an external diff program, zBinGlob contains the GLOB patterns |
| 441 | ** for file names to treat as binary. If fIncludeBinary is zero, these files |
| 442 | ** will be skipped in addition to files that may contain binary content. |
| 443 | */ |
| 444 | static void diff_one_two_versions( |
| 445 | const char *zFrom, /* Version tag for the "before" file */ |
| 446 | const char *zTo, /* Version tag for the "after" file */ |
| 447 | const char *zDiffCmd, /* Use this "diff" command */ |
| 448 | const char *zBinGlob, /* GLOB pattern for files that are binary */ |
| 449 | int fIncludeBinary, /* True to show binary files */ |
| 450 | u64 diffFlags, /* Diff flags */ |
| 451 | const char *zFileTreeName /* Name of the file to be diffed */ |
| 452 | ){ |
| 453 | char *zName; |
| 454 | Blob fname; |
| 455 | Blob v1, v2; |
| 456 | int isLink1, isLink2; |
| @@ -770,11 +770,10 @@ | |
| 770 | const char *zBranch; /* Branch to diff */ |
| 771 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 772 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| 773 | int fIncludeBinary = 0; /* Include binary files for external diff */ |
| 774 | u64 diffFlags = 0; /* Flags to control the DIFF */ |
| 775 | |
| 776 | if( find_option("tk",0,0)!=0 ){ |
| 777 | diff_tk("diff", 2); |
| 778 | return; |
| 779 | } |
| @@ -803,13 +802,14 @@ | |
| 802 | } |
| 803 | zBinGlob = diff_get_binary_glob(); |
| 804 | fIncludeBinary = diff_include_binary_files(); |
| 805 | verify_all_options(); |
| 806 | if( g.argc>=3 ){ |
| 807 | int i; |
| 808 | for(i=2; i<g.argc; i++){ |
| 809 | diff_one_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary, |
| 810 | diffFlags, g.argv[i]); |
| 811 | } |
| 812 | }else{ |
| 813 | diff_all_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary, |
| 814 | diffFlags); |
| 815 | } |
| @@ -822,13 +822,14 @@ | |
| 822 | } |
| 823 | zBinGlob = diff_get_binary_glob(); |
| 824 | fIncludeBinary = diff_include_binary_files(); |
| 825 | verify_all_options(); |
| 826 | if( g.argc>=3 ){ |
| 827 | int i; |
| 828 | for(i=2; i<g.argc; i++){ |
| 829 | diff_one_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary, |
| 830 | diffFlags, g.argv[i]); |
| 831 | } |
| 832 | }else{ |
| 833 | diff_all_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary, |
| 834 | diffFlags); |
| 835 | } |
| 836 |