hands_setup
makepath "$chkdir"
+makepath "$todir/extradir"
+makepath "$todir/emptydir/subdir"
+
+echo extra >"$todir"/remove1
+echo extra >"$todir"/remove2
+echo extra >"$todir"/extradir/remove3
+echo extra >"$todir"/emptydir/subdir/remove4
# Create two chk dirs, one with a copy of the source files, and one with
-# what we expect to be left behind by the copy using --remove-sent-files.
+# what we expect to be left behind by the copy using --remove-source-files.
$RSYNC -av "$fromdir/" "$chkdir/copy/"
$RSYNC -av -f 'exclude,! */' "$fromdir/" "$chkdir/empty/"
-checkit "$RSYNC -avv --remove-sent-files \
+checkit "$RSYNC -avv --del --remove-source-files \
\"$fromdir/\" \"$todir/\"" "$chkdir/copy" "$todir"
diff -r "$chkdir/empty" "$fromdir"
-# Make sure that --delete-excluded does not dump a per-dir merge-file filter.
+# Make sure that "P" but not "-" per-dir merge-file filters take effect with
+# --delete-excluded.
cat >"$todir/filters" <<EOF
P foo
+- bar
EOF
-touch "$todir/foo"
+touch "$todir/foo" "$todir/bar" "$todir/baz"
-$RSYNC -r --filter=': filters' --delete-excluded "$fromdir/" "$todir/"
+$RSYNC -r --exclude=baz --filter=': filters' --delete-excluded "$fromdir/" "$todir/"
-test -f "$todir/foo" || test_fail "rsync incorrectly elided the merge file"
+test -f "$todir/foo" || test_fail "rsync should NOT have deleted $todir/foo"
+test -f "$todir/bar" && test_fail "rsync SHOULD have deleted $todir/bar"
+test -f "$todir/baz" && test_fail "rsync SHOULD have deleted $todir/baz"
# The script would have aborted on error, so getting here means we've won.
exit 0