Unsnarl missing_below/dry_run logic.
authorMatt McCutchen <matt@mattmccutchen.net>
Wed, 19 Mar 2008 02:16:41 +0000 (22:16 -0400)
committerWayne Davison <wayned@samba.org>
Wed, 19 Mar 2008 14:45:58 +0000 (07:45 -0700)
commit83a8ca7b14483826c85f7cc0e0e38ed9ce387d83
tree98cc044fa4a013171db6c1536abc096fd02c5954
parent100200d0d2c959a1bf215b1b42db94039bbbcb98
Unsnarl missing_below/dry_run logic.

The generator can skip a directory's contents altogether due to
--ignore-non-existing, a daemon exclude, or a mkdir failure.  On a
--dry-run, the generator can also note the missingness of a directory
while still scanning its contents.  These two scenarios were conflated
using a single set of missing_below/missing_dir variables in combination
with transient increments in dry_run; this caused at least three bugs.

Now recv_generator has separate variables for the two scenarios, called
skip_dir and dry_missing_dir, respectively.  For simplicity, we take the
F_DEPTH instead of having separate *_below variables.  We mark both
kinds of missing dirs with FLAG_MISSING_DIR.  (dry_run > 1) iff the
*root* of the destination does not exist; it is no longer incremented
for missing subdirs.  I added tests for the three fixed bugs in
missing.test.
generator.c
testsuite/missing.test [new file with mode: 0644]