Fossil SCM

Add 'binary' query parameter to the 'vpatch' web page.

mistachkin 2019-09-30 16:11 trunk
Commit 39d146166adf02231bb8190929b64db6859d6a513c2581eac0ec4965f8cbda87
1 file changed +7 -1
+7 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -962,18 +962,24 @@
962962
}
963963
964964
/*
965965
** WEBPAGE: vpatch
966966
** URL: /vpatch?from=FROM&to=TO
967
+**
968
+** Query parameters:
969
+**
970
+** binary=1 Attempt to compute diff for binary files as well.
971
+**
967972
**
968973
** Show a patch that goes from check-in FROM to check-in TO.
969974
*/
970975
void vpatch_page(void){
971976
const char *zFrom = P("from");
972977
const char *zTo = P("to");
978
+ const char *zBinary = P("binary");
973979
login_check_credentials();
974980
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
975981
if( zFrom==0 || zTo==0 ) fossil_redirect_home();
976982
977983
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);
979985
}
980986
--- 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

Keyboard Shortcuts

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