Fix adding symlinks pointing at working copy roots to version control, which had been broken since r1395027.
Fixes special_tests 23, "externals as symlink targets", which adds a symlink pointing at an external. This test failed because the symlink path itself was cached as WC root when adding the symlink to the external's parent WC. The code then tried a propset on the symlink path to set the svn:special prop and was redirected at the external working copy which it didn't have a lock for.
We can fix this by never caching a symlink itself as a WC root but caching the directory the symlink points to as a WC root instead.
* subversion/libsvn_wc/wc_db_wcroot.c (read_link_target): New helper function to calculate the absolute path of a symlink target. (svn_wc__db_wcroot_parse_local_abspath): When retrying the scan through a symlink, resolve the symlink and scan up from the link target, rather than treating the symlink itself as a directory. If the symlink points at a WC root, this prevents the symlink itself from being added to the WC root cache -- the cache should only contain directories anyway.
* subversion/tests/cmdline/special_tests.py (symlink_to_wc_basic): When operating on a WC through a symlink, we'll now see the resolved symlink target path as Working Copy Root path in 'svn info' output. Adjust test expectations accordingly. This test was expecting to see the symlink itself as WC root path.
Fix working copy access via a symlink which points to a working copy nested within an unrelated working copy of an unsupported format.
This patch fixes special_tests 19 and 20 on the 1.7.x branch when run within a format 30 working copy (backport nomination will follow).
To reproduce the problem fixed by this commit with just a trunk client: - Check out a working copy WC1. - Check out one nested working copy WC2 within WC1's root dir. - Use sqlite3 to set "pragma user_version = 31" in WC1's .svn/wc.db. - Create a symlink S within WC1 which points at WC2. - Try to run 'svn status' on the symlink S.
* subversion/libsvn_wc/wc_db_wcroot.c (svn_wc__db_wcroot_parse_local_abspath): If we find an unsupported working copy after traversing upwards from a symlink, and the symlink points to a directory, try to find a working copy at that directory instead.