Switch to an alternative implementation of svn_wc__format_from_context().

The previous implementation seems to have a potential issue in how it finds
the parent wcroot.  We were sorting the paths in the depth-first order by using
svn_path_compare_paths().  This function orders children in subdirectories
directly after their parents.  We would then check if the path of the previous
entry, closest to the `local_abspath`, is its parent path.  If it is, we would
use that entry, or stop searching for a parent otherwise.

The problem is that the previous entry in the sort order may point to the
sibling of the current path.  For example, if the sorted entries are
["/A", "/A/B", "/A/Z"], and we are looking for "/A/C", we would check
that "/A/B" is not a parent of that path, and stop before testing "/A" that
actually is a parent of the path.

This change switches to the implementation that doesn't require sorting all
context entries and instead checks the parents of the `local_abspath`, picking
the closest one.  It also attempts to have predictable behavior in case there's
no such parent, by returning the defaults instead of additionally scanning
through the other context entries that may be unrelated.  The fallback code
currently is not triggered in the test suite, and I assume that this should
not affect the visible behavior.

* subversion/include/private/svn_wc_private.h
  (svn_wc__format_from_context): Adjust documentation.

* subversion/libsvn_wc/wc_db_wcroot.c
  (): Remove include of "private/svn_sorts_private.h". 
  (svn_wc__format_from_context): Remove TODO. Switch to a new implementation.


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