incremental recursion is active. Added test.
}
} while ((cur_flist = cur_flist->next) != NULL);
}
} while ((cur_flist = cur_flist->next) != NULL);
+ if (read_batch)
+ write_ndx(f_out, NDX_DONE);
+
if (delete_during)
delete_in_dir(NULL, NULL, &dev_zero);
phase++;
if (delete_during)
delete_in_dir(NULL, NULL, &dev_zero);
phase++;
static int get_next_gen_ndx(int fd, int next_gen_ndx, int desired_ndx)
{
static int get_next_gen_ndx(int fd, int next_gen_ndx, int desired_ndx)
{
+ static int batch_eof = 0;
+
while (next_gen_ndx < desired_ndx) {
if (next_gen_ndx >= 0) {
struct file_struct *file = cur_flist->files[next_gen_ndx];
while (next_gen_ndx < desired_ndx) {
if (next_gen_ndx >= 0) {
struct file_struct *file = cur_flist->files[next_gen_ndx];
file->flags & FLAG_FILE_SENT ? " resend of" : "",
f_name(file, NULL));
}
file->flags & FLAG_FILE_SENT ? " resend of" : "",
f_name(file, NULL));
}
- next_gen_ndx = read_int(fd);
+ next_gen_ndx = batch_eof ? -1 : read_int(fd);
if (next_gen_ndx == -1) {
if (inc_recurse)
next_gen_ndx = first_flist->prev->used + first_flist->prev->ndx_start;
else
next_gen_ndx = cur_flist->used;
if (next_gen_ndx == -1) {
if (inc_recurse)
next_gen_ndx = first_flist->prev->used + first_flist->prev->ndx_start;
else
next_gen_ndx = cur_flist->used;
"(Skipping batched update for \"%s\")\n",
fname);
discard_receive_data(f_in, F_LENGTH(file));
"(Skipping batched update for \"%s\")\n",
fname);
discard_receive_data(f_in, F_LENGTH(file));
- if (inc_recurse)
- send_msg_int(MSG_NO_SEND, ndx);
continue;
}
next_gen_ndx = -1;
continue;
}
next_gen_ndx = -1;
rm -rf "$todir"
runtest "BATCH.sh use of --read-batch" 'checkit "./BATCH.sh" "$chkdir" "$todir"'
rm -rf "$todir"
runtest "BATCH.sh use of --read-batch" 'checkit "./BATCH.sh" "$chkdir" "$todir"'
+runtest "do-nothing re-run of batch" 'checkit "./BATCH.sh" "$chkdir" "$todir"'
+
rm -rf "$todir"
mkdir "$todir" || test_fail "failed to restore empty destination directory"
runtest "daemon recv --write-batch" 'checkit "\"$ignore23\" $RSYNC -av --write-batch=BATCH \"$fromdir/\" rsync://localhost/test-to" "$chkdir" "$todir"'
rm -rf "$todir"
mkdir "$todir" || test_fail "failed to restore empty destination directory"
runtest "daemon recv --write-batch" 'checkit "\"$ignore23\" $RSYNC -av --write-batch=BATCH \"$fromdir/\" rsync://localhost/test-to" "$chkdir" "$todir"'