* branches/fsfs-lock-many: Create branch for lock/unlock multiple paths.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1571740 13f79535-47bb-0310-9956-ffa450edef68
* branches/fsfs-lock-many/BRANCH-README: Create.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1571750 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch: implement the multiple path functions
svn_fs_lock2 and svn_fs_unlock2 for FSFS along with the the
corresponding repos wrappers.  All the locking now goes via the
multiple path functions but only passing a single path at a time.
Add some low-level regression tests to exercise the code with
multiple paths.  This also fixes issue 4472, digest/lock written
in wrong order.

Notes:
 - BDB just loops calling the single path function at a low-level.
 - FSX is currently non-working but will eventually be a duplicate
   of FSFS.

* subversion/include/svn_fs.h
  (svn_fs_lock_target_t,
   svn_fs_lock_result_t,
   svn_fs_lock2,
   svn_fs_unlock2): New.

* subversion/include/svn_repos.h
  (svn_repos_fs_lock2,
   svn_repos_fs_unlock2): New.

* subversion/libsvn_fs/fs-loader.c
  (svn_fs_lock2): New.
  (svn_fs_lock): Call svn_fs_lock2.
  (svn_fs_unlock2): New.
  (svn_fs_unlock): Call svn_fs_unlock2.

* subversion/libsvn_fs/fs-loader.h
  (lock, unlock): Change parameters.

* subversion/libsvn_fs_fs/lock.h
  (svn_fs_fs__lock,
   svn_fs_fs__unlock): Change parameters.

* subversion/libsvn_fs_fs/lock.c
  (set_lock,
   delete_lock): Just act on one file.
  (add_to_digest,
   delete_from_digest): New.
  (struct lock_baton): Change members.
  (check_lock,
   struct lock_info_t): New.
  (lock_body): Handle multiple paths.
  (struct unlock_baton): Change members.
  (check_unlock): New.
  (unlock_body): Handle multiple paths.
  (unlock_single): New.
  (svn_fs_fs__lock,
   svn_fs_fs__unlock): Change parameters.
 
* subversion/libsvn_fs_base/lock.c
  (svn_fs_base__lock,
   svn_fs_base__unlock): Change parameters.

* subversion/libsvn_fs_base/lock.h
  (svn_fs_base__lock,
   svn_fs_base__unlock): Change parameters.

* subversion/libsvn_repos/fs-wrap.c
  (svn_repos_fs_lock2): New.
  (svn_repos_fs_lock): Call svn_repos_fs_lock2.
  (svn_repos_fs_unlock2): New.
  (svn_repos_fs_unlock): Call svn_repos_fs_unlock2.

* subversion/libsvn_repos/repos.c
  (SVN_REPOS__HOOK_POST_LOCK): Tweak comments in prototype file.
  (SVN_REPOS__HOOK_POST_UNLOCK): Tweak comments in prototype file.

* subversion/tests/libsvn_fs/locks-test.c
  (lock_multiple_paths): New test.
  (test_funcs): Add new test.

* subversion/tests/libsvn_ra/ra-test.c
  (make_and_open_local_repos): Create auth baton.
  (commit_tree): New helper.
  (struct lock_baton_t): New.
  (lock_cb): New helper.
  (lock_test): New test.
  (test_funcs): Add new test.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1571812 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch: make ra_local and svnserve use
the new multiple path svn_fs_lock2 and svn_fs_unlock2.
mod_dav_svn is still using the single path variants as
the LOCK requests only ever supply a single path.  There
is a user visible behaviour change: most locking errors
now cause the client to warn rather than error.

* subversion/libsvn_ra_local/ra_plugin.c
  (svn_ra_local__lock): Convert to use svn_repos_fs_lock2.
  (svn_ra_local__unlock): Convert to use svn_repos_fs_unlock2.

* subversion/svnserve/serve.c
  (lock_many): Convert to use svn_repos_fs_lock2.
  (unlock_many): Convert to use svn_repos_fs_unlock2.

* subversion/include/svn_error.h
  (SVN_ERR_IS_LOCK_ERROR,
   SVN_ERR_IS_UNLOCK_ERROR): Add SVN_ERR_REPOS_HOOK_FAILURE.

* subversion/libsvn_client/locking_commands.c
  (store_locks_callback): Recognise SVN_ERR_REPOS_HOOK_FAILURE,
   check lock is non-NULL before attempting to use it.

* subversion/include/private/svn_log.h
  (svn_log__lock,
   svn_log__unlock): Change parameter from array to hash.

* subversion/libsvn_subr/log.c
  (svn_log__lock,
   svn_log__unlock): Change parameter from array to hash.
  (svn_log__lock_one_path,
   svn_log__unlock_one_path): Pass hash rather than array.

* subversion/tests/cmdline/authz_tests.py
  (authz_locking): Change expected error to expected warning.

* subversion/tests/cmdline/lock_tests.py
  (block_unlock_if_pre_unlock_hook_fails,
   lock_hook_messages): Change expected error to expected warning.
  (failing_post_hooks): New test, XFail for DAV.
  (test_list): Add new test.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1571895 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch, fix a bug that was causing hashes to be
removed from the "/" digest one-by-one rather than as a set.

* subversion/libsvn_fs_fs/lock.c
  (unlock_body): Special handling for "/".


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1572000 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-lock-many branch: convert svn_repos_fs_lock2 and
svn_repos_fs_unlock2 to dual pool.

* subversion/include/svn_repos.h
  (svn_repos_fs_lock2,
   svn_repos_fs_unlock2): Add second pool.

* subversion/libsvn_repos/fs-wrap.c
  (svn_repos_fs_lock2,
   svn_repos_fs_unlock2): Convert to dual pool, introduce an iteration pool.

* subversion/libsvn_ra_local/ra_plugin.c
  (svn_ra_local__lock,
   svn_ra_local__unlock): Pass second pool.

* subversion/svnserve/serve.c
  (lock_many,
   unlock_many): Pass second pool.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1572013 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-lock-many branch: convert the server-side unlocking that
happens after a commit to svn_repos_fs_unlock2.

* subversion/libsvn_ra_local/ra_plugin.c
  (deltify_etc): Use svn_repos_fs_unlock2.

* subversion/mod_dav_svn/version.c
  (release_locks): Use svn_repos_fs_unlock2.

* subversion/svnserve/serve.c
  (unlock_paths): Use svn_repos_fs_unlock2.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1572034 13f79535-47bb-0310-9956-ffa450edef68
On the fsfs-lock-many branch: fix dual pool use bug.

* subversion/libsvn_repos/fs-wrap.c
  (svn_repos_fs_lock2,
   svn_repos_fs_unlock2): Pass pools in correct order.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1572041 13f79535-47bb-0310-9956-ffa450edef68
* branches/fsfs-lock-many/BRANCH-README: Update.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1572169 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch: transfer the FSFS implementation to
FSX.  The FSFS and FSX implementations are the same apart from
some function name and include name changes.

* subversion/libsvn_fs_x/lock.c: Update to use FSFS algorithm.

* subversion/libsvn_fs_x/lock.h: Update to use FSFS algorithm.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1572210 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch: sync with trunk at r1572539.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1572541 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch: extend test.

* subversion/tests/libsvn_fs/locks-test.c
  (lock_multiple_paths): Test both force and unforced unlock.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1572641 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch: sync with trunk at r1573585.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1573603 13f79535-47bb-0310-9956-ffa450edef68
* subversion/tests/libsvn_ra/ra-test.c
  (lock_test): Extend to test force unlock.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1574150 13f79535-47bb-0310-9956-ffa450edef68
* subversion/tests/libsvn_fs/locks-test.c
  (lock_multiple_paths): Fix typo, no functional change.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1574154 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch: replace some macros with functions
for easier debugging.

* subversion/tests/libsvn_fs/locks-test.c
  (expect_lock, expect_error, expect_unlock, expect_unlock_error): New.
  (lock_multiple_paths): Remove macros, use functions.

* subversion/tests/libsvn_ra/ra-test.c
  (expect_lock, expect_error, expect_unlock, expect_unlock_error): New.
  (lock_test): Remove macros, use functions.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1574475 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch: sync with trunk at r1576815.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1576824 13f79535-47bb-0310-9956-ffa450edef68
On fsfs-lock-many branch: a corrupt working copy with svn:mergeinfo
missing from 'notes/' meant that the sync merges from trunk (r1576824,
r1573603 and r1572541) did not get recorded on 'notes/' on the branch.

* notes: Subtree merge to fix svn:mergeinfo, no other changes.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/fsfs-lock-many@1577217 13f79535-47bb-0310-9956-ffa450edef68
Merge the fsfs-lock-many branch to trunk.  This introduce multiple
path lock and unlock at the FS level and connects it up over ra_local
and ra_svn, and also uses it post-commit to release locks.  A summary
of the branch changes:

* subversion/include/svn_fs.h
  (svn_fs_lock_target_t, svn_fs_lock_result_t,
   svn_fs_lock2, svn_fs_unlock2): new.

* subversion/include/svn_repos.h
  (svn_repos_fs_lock2, svn_repos_fs_unlock2): new.

* subversion/include/svn_error.h
  (SVN_ERR_IS_LOCK_ERROR, SVN_ERR_IS_UNLOCK_ERROR): Add pre- hook errors.

* subversion/libsvn_fs/fs-loader.c
  (svn_fs_lock2, svn_fs_unlock2): New.

* subversion/libsvn_fs/fs-loader.h
  (fs_vtable_t): Change lock and unlock parameters.

* subversion/libsvn_fs_fs/lock.c
* subversion/libsvn_fs_x/lock.c
  (svn_fs_fs__lock, svn_fs_fs__unlock): New multiple path implementation.

* subversion/libsvn_fs_base/lock.c
  (svn_fs_base__lock, svn_fs_base__unlock): Iterate over paths.

* subversion/libsvn_fs_fs/lock.h
  (svn_fs_fs__lock, svn_fs_fs__unlock): Change parameters.

* subversion/libsvn_fs_x/lock.h
  (svn_fs_x__lock, svn_fs_x__unlock): Change parameters.

* subversion/libsvn_fs_base/lock.h
  (svn_fs_base__lock, svn_fs_base__unlock): Change parameters.

* subversion/libsvn_repos/fs-wrap.c
  (svn_repos_fs_lock2, svn_repos_fs_unlock2): New.

* subversion/libsvn_repos/repos.c
  (SVN_REPOS__HOOK_POST_LOCK, SVN_REPOS__HOOK_POST_UNLOCK): Tweak hook
   template text.

* subversion/libsvn_ra_local/ra_plugin.c
  (deltify_etc, svn_ra_local__lock, svn_ra_local__unlock): Use new API.

* subversion/mod_dav_svn/version.c
  (release_locks): Use new API.

* subversion/svnserve/serve.c
  (unlock_paths, lock_many, unlock_many): Use new API.

* subversion/libsvn_subr/log.c
* subversion/libsvn_fs_fs/lock.h
  (svn_fs_fs__lock, svn_fs_fs__unlock,
   svn_log__lock_one_path, svn_log__unlock_one_path): Change parameter.

* subversion/libsvn_client/locking_commands.c
  (store_locks_callback): Tweak error handling.

* subversion/tests/libsvn_fs/locks-test.c
  (lock_multiple_paths): New test.

* subversion/tests/libsvn_ra/ra-test.c
  (lock_test): New test.

* subversion/tests/cmdline/authz_tests.py
  (authz_locking): Tweak expectations.

* subversion/tests/cmdline/lock_tests.py
  (block_unlock_if_pre_unlock_hook_fails, lock_hook_messages): Tweak
   expectations.
  (failing_post_hooks): New.


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