Make the switch detection code much easier to understand by introducing a few
more preprocessor sql functions.

This is partly a showcase of how we can reduce some c code complexity using
these functions.

* build/transform_sql.py
  (process_file): Add RELPATH_JOIN(x, y), RELPATH_SKIP_ANCESTOR(x, y) and
                  RELPATH_SKIP_JOIN(x, y, z) which is a combination of the
                  other two.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_HAS_SWITCHED): Simplify query. Use additional argument instead of
    join.

  (STMT_HAS_SWITCHED_REPOS_ROOT,
   STMT_HAS_SWITCHED_WCROOT,
   STMT_HAS_SWITCHED_WCROOT_REPOS_ROOT): Remove queries that can now be
     handled by STMT_HAS_SWITCHED.

* subversion/libsvn_wc/wc_db.c
  (has_switched_subtrees): Use single query. Pass repository relative path.

* subversion/tests/libsvn_wc/wc-queries-test.c
  (slow_statements): Remove specialized selects on the entire wc.


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