extern int need_messages_from_generator;
extern int delete_mode, delete_before, delete_during, delete_after;
extern int delete_excluded;
+extern int detect_renamed;
extern int make_backups;
extern int need_messages_from_generator;
extern int delete_mode, delete_before, delete_during, delete_after;
extern int delete_excluded;
+extern int detect_renamed;
extern int make_backups;
- extern char *partial_dir;
-@@ -163,7 +164,7 @@ void setup_protocol(int f_out,int f_in)
- } else if (protocol_version >= 30) {
+@@ -204,7 +205,7 @@ void setup_protocol(int f_out,int f_in)
-@@ -1767,6 +1809,25 @@ struct file_list *recv_file_list(int f)
-
- clean_flist(flist, relative_paths, 1);
+@@ -1929,6 +1971,25 @@ struct file_list *send_file_list(int f,
+ if (verbose > 2)
+ rprintf(FINFO, "send_file_list done\n");
extern int backup_suffix_len;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct filter_list_struct server_filter_list;
+extern struct file_list the_fattr_list;
extern int backup_suffix_len;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct filter_list_struct server_filter_list;
+extern struct file_list the_fattr_list;
static int deldelay_size = 0, deldelay_cnt = 0;
static char *deldelay_buf = NULL;
static int deldelay_fd = -1;
static int deldelay_size = 0, deldelay_cnt = 0;
static char *deldelay_buf = NULL;
static int deldelay_fd = -1;
+ if (fmid->modtime == f->modtime
+ && f_name_cmp(fmid, f) == 0)
+ return -1; /* assume we can't help */
+ if (fmid->modtime == f->modtime
+ && f_name_cmp(fmid, f) == 0)
+ return -1; /* assume we can't help */
* its contents, otherwise just checks for content. Returns DR_SUCCESS or
* DR_NOT_EMPTY. Note that fname must point to a MAXPATHLEN buffer! (The
* buffer is used for recursion, but returned unchanged.)
* its contents, otherwise just checks for content. Returns DR_SUCCESS or
* DR_NOT_EMPTY. Note that fname must point to a MAXPATHLEN buffer! (The
* buffer is used for recursion, but returned unchanged.)
* all the --delete-WHEN options. Note that the fbuf pointer must point to a
* MAXPATHLEN buffer with the name of the directory in it (the functions we
* call will append names onto the end, but the old dir value will be restored
- * on exit). */
* all the --delete-WHEN options. Note that the fbuf pointer must point to a
* MAXPATHLEN buffer with the name of the directory in it (the functions we
* call will append names onto the end, but the old dir value will be restored
- * on exit). */
- static void delete_in_dir(struct file_list *flist, char *fbuf,
-- struct file_struct *file, dev_t *fs_dev)
-+ struct file_struct *file, dev_t *fs_dev, int flags)
++static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev,
++ int flags)
+ strlcpy(p, fp->basename, remainder);
+ look_for_rename(fp, fbuf);
+ }
+ strlcpy(p, fp->basename, remainder);
+ look_for_rename(fp, fbuf);
+ }
-- delete_in_dir(flist, fbuf, file, &st.st_dev);
-+ delete_in_dir(flist, fbuf, file, &st.st_dev, 0);
+- delete_in_dir(fbuf, file, &st.st_dev);
++ delete_in_dir(fbuf, file, &st.st_dev, 0);
-- delete_in_dir(NULL, NULL, NULL, &dev_zero);
-+ delete_in_dir(NULL, NULL, NULL, &dev_zero, 0);
+- delete_in_dir(NULL, NULL, &dev_zero);
++ delete_in_dir(NULL, NULL, &dev_zero, 0);
-@@ -1855,7 +2016,7 @@ void generate_files(int f_out, const cha
- dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
- } else
- dirdev = MAKEDEV(0, 0);
-- delete_in_dir(cur_flist, f_name(fp, fbuf), fp, &dirdev);
-+ delete_in_dir(cur_flist, f_name(fp, fbuf), fp, &dirdev, 0);
+@@ -1926,7 +2088,7 @@ void generate_files(int f_out, const cha
+ dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
+ } else
+ dirdev = MAKEDEV(0, 0);
+- delete_in_dir(f_name(fp, fbuf), fp, &dirdev);
++ delete_in_dir(f_name(fp, fbuf), fp, &dirdev, 0);
+ }
-- delete_in_dir(NULL, NULL, NULL, &dev_zero);
-+ delete_in_dir(NULL, NULL, NULL, &dev_zero, 0);
+- delete_in_dir(NULL, NULL, &dev_zero);
++ delete_in_dir(NULL, NULL, &dev_zero, 0);
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," --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," --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");
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");
{"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_NONE, &fuzzy_basis, 0, 0, 0 },
{"compress", 'z', POPT_ARG_NONE, 0, 'z', 0, 0 },
{"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_NONE, &fuzzy_basis, 0, 0, 0 },
{"compress", 'z', POPT_ARG_NONE, 0, 'z', 0, 0 },
- {"compress-level", 0, POPT_ARG_INT, &def_compress_level, 'z', 0, 0 },
-@@ -1402,7 +1405,7 @@ int parse_arguments(int *argc, const cha
+ {"no-compress", 0, POPT_ARG_VAL, &do_compression, 0, 0, 0 },
+@@ -1495,7 +1498,7 @@ int parse_arguments(int *argc, const cha
snprintf(err_buf, sizeof err_buf,
"--%s cannot be used with --%s\n",
append_mode ? "append" : "inplace",
snprintf(err_buf, sizeof err_buf,
"--%s cannot be used with --%s\n",
append_mode ? "append" : "inplace",
--modify-window=NUM compare mod-times with reduced accuracy
-T, --temp-dir=DIR create temporary files in directory DIR
-y, --fuzzy find similar file for basis if no dest file
--modify-window=NUM compare mod-times with reduced accuracy
-T, --temp-dir=DIR create temporary files in directory DIR
-y, --fuzzy find similar file for basis if no dest file
--compare-dest=DIR also compare received files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged
--compare-dest=DIR also compare received files relative to DIR
--copy-dest=DIR ... and include copies of unchanged files
--link-dest=DIR hardlink to files in DIR when unchanged