+--- testsuite/exclude.test 22 May 2004 19:29:53 -0000 1.7
++++ testsuite/exclude.test 22 May 2004 19:32:13 -0000
+@@ -24,19 +24,47 @@ echo home-cvs-exclude >"$scratchdir"/.cv
+ makepath "$fromdir/foo/down/to/you"
+ makepath "$fromdir/bar/down/to/foo/too"
+ makepath "$fromdir/mid/for/foo/and/that/is/who"
++cat <<EOT >"$fromdir/.excl"
++.excl
++*.bak
++*.old
++*.junk
++EOT
+ echo kept >"$fromdir/foo/file1"
+ echo removed >"$fromdir/foo/file2"
+ echo cvsout >"$fromdir/foo/file2.old"
++cat <<EOT >"$fromdir/foo/.excl"
+++ .excl
++- file1
++EOT
++cat <<EOT >"$fromdir/bar/.excl"
++home-cvs-exclude
++. .excl2
+++ to
++EOT
+ echo cvsout >"$fromdir/bar/down/to/home-cvs-exclude"
++cat <<EOT >"$fromdir/bar/down/to/.excl2"
++.excl2
++EOT
+ echo keeper >"$fromdir/bar/down/to/foo/file1"
+ echo cvsout >"$fromdir/bar/down/to/foo/file1.bak"
+ echo gone >"$fromdir/bar/down/to/foo/file3"
+ echo lost >"$fromdir/bar/down/to/foo/file4"
+ echo cvsout >"$fromdir/bar/down/to/foo/file4.junk"
+ echo smashed >"$fromdir/bar/down/to/foo/to"
++cat <<EOT >"$fromdir/bar/down/to/foo/.excl2"
+++ *.junk
++EOT
++# This one should be ineffectual
++cat <<EOT >"$fromdir/mid/.excl2"
++extra
++EOT
+ echo cvsout >"$fromdir/mid/one-in-one-out"
+ echo one-in-one-out >"$fromdir/mid/.cvsignore"
+ echo cvsin >"$fromdir/mid/one-for-all"
++cat <<EOT >"$fromdir/mid/.excl"
++. .cvsignore
++EOT
+ echo cvsin >"$fromdir/mid/for/one-in-one-out"
+ echo expunged >"$fromdir/mid/for/foo/extra"
+ echo retained >"$fromdir/mid/for/foo/keep"
+@@ -97,5 +125,24 @@ $RSYNC -av --existing --include='*/' --e
+ checkit "$RSYNC -avvC --delete-excluded --exclude-from=$excl \
+ \"$fromdir/\" \"$todir/\"" "$chkdir" "$todir"
+
++# Modify the chk dir for our merge-exclude test and then tweak the dir times.
++
++rm "$chkdir"/.excl
++rm "$chkdir"/foo/file1
++rm "$chkdir"/bar/.excl
++rm "$chkdir"/bar/down/to/.excl2
++rm "$chkdir"/bar/down/to/foo/.excl2
++rm "$chkdir"/mid/.excl
++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 --include='*/' --exclude='*' "$fromdir/" "$chkdir/"
++
++# Now, test if rsync excludes the same files, this time with a merge-exclude
++# file.
++
++checkit "$RSYNC -avv --exclude='. .excl' --delete-excluded --exclude-from=$excl \
++ \"$fromdir/\" \"$todir/\"" "$chkdir" "$todir"
++
+ # The script would have aborted on error, so getting here means we've won.
+ exit 0