Fossil SCM
Add 'binary' query parameter to the 'vpatch' web page.
Commit
39d146166adf02231bb8190929b64db6859d6a513c2581eac0ec4965f8cbda87
Parent
161958a49b7d284…
1 file changed
+7
-1
+7
-1
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -962,18 +962,24 @@ | ||
| 962 | 962 | } |
| 963 | 963 | |
| 964 | 964 | /* |
| 965 | 965 | ** WEBPAGE: vpatch |
| 966 | 966 | ** URL: /vpatch?from=FROM&to=TO |
| 967 | +** | |
| 968 | +** Query parameters: | |
| 969 | +** | |
| 970 | +** binary=1 Attempt to compute diff for binary files as well. | |
| 971 | +** | |
| 967 | 972 | ** |
| 968 | 973 | ** Show a patch that goes from check-in FROM to check-in TO. |
| 969 | 974 | */ |
| 970 | 975 | void vpatch_page(void){ |
| 971 | 976 | const char *zFrom = P("from"); |
| 972 | 977 | const char *zTo = P("to"); |
| 978 | + const char *zBinary = P("binary"); | |
| 973 | 979 | login_check_credentials(); |
| 974 | 980 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 975 | 981 | if( zFrom==0 || zTo==0 ) fossil_redirect_home(); |
| 976 | 982 | |
| 977 | 983 | cgi_set_content_type("text/plain"); |
| 978 | - diff_two_versions(zFrom, zTo, 0, 0, 0, DIFF_VERBOSE, 0); | |
| 984 | + diff_two_versions(zFrom, zTo, 0, 0, zBinary!=0, DIFF_VERBOSE, 0); | |
| 979 | 985 | } |
| 980 | 986 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -962,18 +962,24 @@ | |
| 962 | } |
| 963 | |
| 964 | /* |
| 965 | ** WEBPAGE: vpatch |
| 966 | ** URL: /vpatch?from=FROM&to=TO |
| 967 | ** |
| 968 | ** Show a patch that goes from check-in FROM to check-in TO. |
| 969 | */ |
| 970 | void vpatch_page(void){ |
| 971 | const char *zFrom = P("from"); |
| 972 | const char *zTo = P("to"); |
| 973 | login_check_credentials(); |
| 974 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 975 | if( zFrom==0 || zTo==0 ) fossil_redirect_home(); |
| 976 | |
| 977 | cgi_set_content_type("text/plain"); |
| 978 | diff_two_versions(zFrom, zTo, 0, 0, 0, DIFF_VERBOSE, 0); |
| 979 | } |
| 980 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -962,18 +962,24 @@ | |
| 962 | } |
| 963 | |
| 964 | /* |
| 965 | ** WEBPAGE: vpatch |
| 966 | ** URL: /vpatch?from=FROM&to=TO |
| 967 | ** |
| 968 | ** Query parameters: |
| 969 | ** |
| 970 | ** binary=1 Attempt to compute diff for binary files as well. |
| 971 | ** |
| 972 | ** |
| 973 | ** Show a patch that goes from check-in FROM to check-in TO. |
| 974 | */ |
| 975 | void vpatch_page(void){ |
| 976 | const char *zFrom = P("from"); |
| 977 | const char *zTo = P("to"); |
| 978 | const char *zBinary = P("binary"); |
| 979 | login_check_credentials(); |
| 980 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 981 | if( zFrom==0 || zTo==0 ) fossil_redirect_home(); |
| 982 | |
| 983 | cgi_set_content_type("text/plain"); |
| 984 | diff_two_versions(zFrom, zTo, 0, 0, zBinary!=0, DIFF_VERBOSE, 0); |
| 985 | } |
| 986 |