Rework the way svn add --parents creates missing parents directories, fixing a potential problem with leaving the working copy locked upon failure or cancellation.
Rework the way svn add --parents creates missing parents directories,
fixing a potential problem with leaving the working copy locked upon
failure or cancellation.

* subversion/libsvn_client/add.c
  (add_with_write_lock_baton): New member existing_parent_abspath.
  (add): If existing_parent_abspath is set in the baton, create and add
   any missing path components before adding the actual target.
  (add_parent_dirs): Remove.
  (find_existing_parent): New, based on previous. Finds the first
   existing parent of the target to be added.
  (svn_client_add4): Instead of directly creating missing parents with
   questionable use of a working copy write lock, figure out the first
   existing parent. Then lock that parent and call add() while holding
   the lock to do the real work of adding the target and, if necessary,
   its parents.

Suggested by: rhuijben
(in a comment removed by this commit)


git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1058177 13f79535-47bb-0310-9956-ffa450edef68

wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion