--- embedaddon/rsync/options.c 2012/02/17 15:09:30 1.1.1.1 +++ embedaddon/rsync/options.c 2013/07/22 00:20:20 1.1.1.1.2.1 @@ -81,6 +81,7 @@ int am_sender = 0; int am_starting_up = 1; int relative_paths = -1; int implied_dirs = 1; +int detect_renamed = 0; int numeric_ids = 0; int allow_8bit_chars = 0; int force_delete = 0; @@ -390,6 +391,7 @@ void usage(enum logcode F) rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n"); rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n"); rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n"); + rprintf(F," --detect-renamed try to find renamed files to speed up the transfer\n"); rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n"); rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n"); rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n"); @@ -577,6 +579,7 @@ static struct poptOption long_options[] = { {"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 }, {"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 }, {"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 }, + {"detect-renamed", 0, POPT_ARG_NONE, &detect_renamed, 0, 0, 0 }, {"fuzzy", 'y', POPT_ARG_VAL, &fuzzy_basis, 1, 0, 0 }, {"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 }, {"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 }, @@ -1601,7 +1604,7 @@ int parse_arguments(int *argc_p, const char ***argv_p) inplace = 1; } - if (delay_updates && !partial_dir) + if ((delay_updates || detect_renamed) && !partial_dir) partial_dir = tmp_partialdir; if (inplace) { @@ -1610,6 +1613,7 @@ int parse_arguments(int *argc_p, const char ***argv_p) snprintf(err_buf, sizeof err_buf, "--%s cannot be used with --%s\n", append_mode ? "append" : "inplace", + detect_renamed ? "detect-renamed" : delay_updates ? "delay-updates" : "partial-dir"); return 0; } @@ -1972,6 +1976,8 @@ void server_options(char **args, int *argc_p) args[ac++] = "--super"; if (size_only) args[ac++] = "--size-only"; + if (detect_renamed) + args[ac++] = "--detect-renamed"; } else { if (skip_compress) { if (asprintf(&arg, "--skip-compress=%s", skip_compress) < 0)