Improve the accuracy of the "Have props/contents changed between two nodes?"
check for all three backends.

First, we consider props / text contents as equal whenever the same physical
representation is being used - even if the uniquifiers differ.  There is no
such test for directories and it is not needed by any API, ATM.  Secondly,
file contents is considered equal when the SHA1 checksums match (same as in
the working copy).  We also compare the MD5 checksums as they are always
available and offer a quick mismatch test.

Lastly, if the SHA1 is not available, we actually compare the reconstructed
fulltexts - but only if the caller requires a strict equality test with no
false negatives.  The FS API currently calls the internal functionality in
non-strict, i.e. "quick check" mode.

Property lists use a similar checking scheme.  However, we limit the test to
MD5 (FSFS, FSX only) and use a fulltext comparison in strict mode only if
MD5s are not available.  As a side-effect of the extra accuracy, the commit
conflict detection / merge code in non-BDB now allows for equal directory
property lists to be committed to the same node in concurrent transactions
without creating a conflict.

The BDB implementation is the most straightforward of the three backends
because the respective function are directly at the vtable level.  We simply
add checksum and fulltext comparison as needed.

In FSFS, the actual comparison lies deeper in the caller hierarchy and is
being used by other functions as well.  We need to replace the generic "is
the rep equal" test by two tests, one for each kind of representation.  They
will then perform similar tests as in BDB but with more callers to update.
The prop comparison will also use the MD5 checksums when available.

The FSX code has the same structure as FSFS but it does need to cater for
legacy data.  Therefore, the file contents check is much simpler and can
always use the MD5 + SHA1 checksums.

* subversion/include/private/svn_fs_util.h
  (svn_fs__prop_lists_equal): Declare new private contents comparison API.
* subversion/libsvn_fs_util/fs-util.c
  (svn_fs__prop_lists_equal): Implement it.

* subversion/libsvn_fs_base/dag.c
  (svn_fs_base__things_different): Ignore uniquifier since we are only
                                   interested in actual content differences.
* subversion/libsvn_fs_base/tree.c
  (things_changed_args): Add the STRICT option to our parameter set.
  (txn_body_props_changed,
   txn_body_contents_changed): Add more comparisons to eliminate false
                               positives as described above. 
  (base_props_changed,
   base_contents_changed): FS API implementation is currently non-strict.

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__noderev_same_rep_key): Drop old test function.
  (svn_fs_fs__file_text_rep_equal,
   svn_fs_fs__prop_rep_equal): Introduce separate APIs for different types
                               of representations; provide more context
                               such that we may query missing information.
* subversion/libsvn_fs_fs/fs_fs.c
  (svn_fs_fs__noderev_same_rep_key): Drop old test function.
  (svn_fs_fs__file_text_rep_equal,
   svn_fs_fs__prop_rep_equal): Implement.

* subversion/libsvn_fs_fs/dag.h
  (svn_fs_fs__dag_things_different): Add STRICT option and provide a pool
                                     for FS queries as needed.
* subversion/libsvn_fs_fs/dag.c
  (svn_fs_fs__dag_things_different): Update implementation to call the new
                                     comparison functions.

* subversion/libsvn_fs_fs/tree.c
  (fs_props_changed,
   fs_contents_changed): Update callers and use non-strict mode for these
                         FS API functions.
  (merge): Adapt to API change and force strict prop comparison to prevent
           unnecessary conflicts.

* subversion/libsvn_fs_x/fs_x.h
  (svn_fs_x__noderev_same_rep_key): Drop old test function.
  (svn_fs_x__file_text_rep_equal): Similar to FSFS but with a simpler
                                   signature because there is no need to
                                   query for addition data. 
   svn_fs_x__prop_rep_equal): Similar to FSFS.
* subversion/libsvn_fs_x/fs_x.c
  (svn_fs_x__noderev_same_rep_key): Drop old test function.
  (svn_fs_x__file_text_rep_equal, 
   svn_fs_x__prop_rep_equal): Implement.

* subversion/libsvn_fs_x/dag.h
  (svn_fs_x__dag_things_different): Change similarly as FSFS.
* subversion/libsvn_fs_x/dag.c
  (svn_fs_x__dag_things_different): Ditto.

* subversion/libsvn_fs_x/tree.c
  (x_props_changed,
   merge, 
   x_contents_changed): Ditto.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1572336 13f79535-47bb-0310-9956-ffa450edef68