Use Sqlite to determine which pristines must be transferred on copy/move
operations to avoid having to do this for every node separately.

Extracting this from the copy/move code allows moving more copy handling in
the db state.

Avoid copying pristines that already exist in the destination working copy.

* subversion/libsvn_wc/copy.c
  (copy_versioned_file): Instead of moving every separate pristine here...
  (copy_or_move): Do this in a single step here.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_COPY_PRISTINES): New query, selecting pristines of all relevant
    layers.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_pristine_transfer): Document as recursive.

* subversion/libsvn_wc/wc_db_pristine.c
  (includes): Add svn_pools.h.
  (pristine_transfer_txn2): Remove function.
  (maybe_transfer_one_pristine): New function.

  (pristine_transfer_txn1): Rename to ...
  (pristine_transfer_txn): ... this. Use STMT_SELECT_COPY_PRISTINES to iterate
    through all nodes and to keep a read lock on src_wcroot.

  (svn_wc__db_pristine_transfer): Update caller.


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