+checkit "$RSYNC -avvC --filter=\"merge $excl\" --delete-excluded \
+ --delete-during \"$fromdir/\" \"$todir/\"" "$chkdir" "$todir"
+
+# Modify the chk dir for our merge-exclude test and then tweak the dir times.
+
+rm "$chkdir"/foo/file1
+rm "$chkdir"/bar/down/to/bar/baz/*.deep
+cp -p "$fromdir"/bar/down/to/foo/*.junk "$chkdir"/bar/down/to/foo
+cp -p "$fromdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo
+
+$RSYNC -av --existing --delete-excluded \
+ --include='.excl*' --filter='-! */' "$fromdir/" "$todir/"
+
+echo retained >"$todir"/bar/down/to/bar/baz/nodel.deep
+cp -p "$todir"/bar/down/to/bar/baz/nodel.deep "$chkdir"/bar/down/to/bar/baz
+
+$RSYNC -av --existing --filter='-! */' "$fromdir/" "$chkdir/"
+
+# Now, test if rsync excludes the same files, this time with a merge-exclude
+# file.
+
+checkit "sed '/!/d' \"$excl\" |
+ $RSYNC -avv -f dir-merge_.excl -f merge_- \
+ --delete-during \"$fromdir/\" \"$todir/\"" "$chkdir" "$todir"
+
+# Remove the files that --delete-excluded will delete.
+
+rm "$chkdir"/.excl
+rm "$chkdir"/bar/.excl
+rm "$chkdir"/bar/down/to/.excl2
+rm "$chkdir"/bar/down/to/foo/.excl2
+rm "$chkdir"/bar/down/to/bar/.excl2
+rm "$chkdir"/mid/.excl
+rm "$chkdir"/bar/down/to/bar/baz/nodel.deep
+
+$RSYNC -av --existing --filter='-! */' "$fromdir/" "$chkdir/"
+
+# Finally, try the prior command with --delete-before and --delete-excluded.
+
+checkit "sed '/!/d' \"$excl\" |
+ $RSYNC -avv -f :_.excl -f ._- --delete-excluded \
+ --delete-before \"$fromdir/\" \"$todir/\"" "$chkdir" "$todir"