Locking branch:  port new notification system from trunk to branch.

(Patch 99% by lundblad;  tested, tweaked, committed by sussman.)

Also:

  - Have 'svn update' use new system when it removes defunct locks.
  - Have 'svn (un)lock' use new  system, instead of private callback.
  - API and other small cleanups.


* subversion/include/svn_types.h (svn_lock_callback_t): Move and rename to...
* subversion/include/svn_ra.h (svn_ra_lock_callback_t): ... this.  Add pool
  argument.
  (svn_ra_lock): Tweak docstring.  Remove locks argument.  Change type
  of callback.
  (svn_ra_unlock): Tweak docstring.  Change type of callback.
* subversion/include/svn_wc.h (svn_wc_notify_action_t): Add
  svn_wc_notify_locked, svn_wc_notify_unlocked, svn_wc_notify_failed_lock,
  svn_wc_failed_unlock.
  (svn_wc_notify_lock_state_t): Remove ### from docstring.  Add
  svn_wc_notify_lock_state_unknown and svn_wc_notify_lock_state_locked.
  (svn_wc_notify_t): Add lock, err and lock_state fields.

* subversion/include/svn_client.h (svn_client_lock): Rewrite docstring.
  Remove locks_p argument and callback/baton.  Make targets const.
  (svn_client_unlock): Rewrite docstring.  Make targets const.  Remove
  callback/baton.

* subversion/include/svn_error.h (svn_error_dup): New function.

* subversion/libsvn_ra/ra_loader.c (svn_ra_lock): New signature.
  Remove trailing dot from error message.
  (svn_ra_unlock): New signature.

* subversion/libsvn_ra/ra_loader.h (svn_ra__vtable_t): Change signatures
  for lock and unlock fuctions.

* subversion/libsvn_wc/util.c (svn_wc_create_notify): Initialize new fields of
  struct.
  (err_cleanup): New function.
  (svn_wc_dup_notify): Duplicate new fields in structure.

* subversion/libsvn_wc/update_editor.c (close_file): Add lock_state to
  notification struct.

* subversion/libsvn_subr/error.c (svn_error_dup): New function.

* subversion/libsvn_client/repos_diff.c (delete_entry, close_directory),
* subversion/libsvn_client/blame.c (file_rev_handler, old_blame),
* subversion/libsvn_client/update.c (svn_client__update_internal),
* subversion/libsvn_client/commit.c (import_file, import_dir),
* subversion/libsvn_client/switch.c (svn_client_switch): Set lock state to
  inapplicable where content_state and prop_state are so set.

* subversion/libsvn_client/locking_commands.c
  (check_out_of_date): Remove.  (Already #ifdef'd out.)
  (struct lock_baton): Remove nested callback/baton.  Add ctx.
  (store_locks_callback): Add pool argument.  Call notify function instead
  of nested callback.
  (organize_lock_targets): Make targets argument const.
  (svn_client_lock, svn_client_unlock): Adjust to new signature.  Don't set
  nested callback, but instead ctx in baton.

* subversion/clients/cmdline/notify.c (notify): Add new column in update output
  for B)roken locks.  (And an extra column for some extensibility without
  breaking scripts.)  Add support for the four new notify actions related to
  locking.  Don't leak an error.

* subversion/clients/cmdline/lock-cmd.c 
  (lock_baton, print_lock_info): Remove.
  (svn_cl__lock): Use new variant of svn_client_lock.  Initialize a
  notify function in the client context.

* subversion/clients/cmdline/unlock-cmd.c
  (lock_baton, print_unlock_info): Remove.
  (svn_cl__unlock): Use new variant of svn_client_unlock.  Initialize a
  notification function in the client context.

* subversion/libsvn_ra_local/ra_plugin.c (svn_ra_local__lock,
  svn_ra_local__unlock): Adjust signature
  to new API.  Use an iterpool.  Minor cleanups.

* subversion/libsvn_repos/hooks.c (array_join): Fix compiler warning by
  making new_str const.

* subversion/libsvn_ra_svn/client.c (ra_svn_lock, ra_svn_unlock): Adjust
  for new API.  Use an iteration pool.  Minor cleanups.

* subversion/libsvn_ra_dav/session.c (svn_ra_dav__lock, svn_ra_dav__lock): 
  Adjust for new API.  Use an iteration pool.  Minor cleanups.

* subversion/tests/clients/cmdline/svntest/tree.py
  (build_tree_from_checkout): tweak regexp to parse the 'B' column in update.

Meta-Note: THESE ARE POORLY WRITTEN TESTS!  They should be using the
           -parser-, not grepping for literals:

* subversion/tests/clients/cmdline/merge_tests.py
  (simple_property_merges, merge_with_implicit_target,
   merge_with_prev, merge_binary_with_common_ancestry,
   merge_dir_branches):  tweak merge tests to adjust for new output spacing.
 
* subversion/tests/clients/cmdline/update_tests.py 
  (another_hudson_problem): adjust for new output spacing.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/locking@853643 13f79535-47bb-0310-9956-ffa450edef68
26 files changed