X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/088aac85971f3f1571c7f90569c95d5025b1fd82..ed521de52512ea778f39b16c5d8221a80281614c:/options.c diff --git a/options.c b/options.c index 6a73e3c6..7bb8e153 100644 --- a/options.c +++ b/options.c @@ -22,7 +22,18 @@ #include "popt.h" int make_backups = 0; + +/** + * Should we send the whole file as literal data rather than trying to + * create an incremental diff? This is on by default when both source + * and destination are local and we're not doing a batch delta, + * because there it's no cheaper to read the whole basis file than to + * just rewrite it. + * + * -1 means "unspecified", i.e. depend on is_local; 0 means off; 1 means on. + **/ int whole_file = -1; + int copy_links = 0; int preserve_links = 0; int preserve_hard_links = 0; @@ -459,6 +470,10 @@ int parse_arguments(int *argc, const char ***argv, int frommain) add_exclude_file(poptGetOptArg(pc), 1, 0); break; + case OPT_INCLUDE_FROM: + add_exclude_file(poptGetOptArg(pc), 1, 1); + break; + case OPT_NO_WHOLE_FILE: whole_file = 0; break; @@ -612,8 +627,11 @@ void server_options(char **args,int *argc) argstr[x++] = 'l'; if (copy_links) argstr[x++] = 'L'; + + assert(whole_file == 0 || whole_file == -1); if (whole_file) argstr[x++] = 'W'; + if (preserve_hard_links) argstr[x++] = 'H'; if (preserve_uid) @@ -754,7 +772,6 @@ void server_options(char **args,int *argc) args[ac++] = compare_dest; } - *argc = ac; }