Various target-file-related improvements to svn patch.
Various target-file-related improvements to svn patch.

* subversion/libsvn_client/patch.c
  (patch_target_t): Make abs_path non-const so we can pass it to
   svn_dirent_is_under_root(). Allow for the 'file' member to be
   NULL in case the target file is absent.
  (resolve_target_path): Add 'exists' output argument which upon
   indicates whether the target file already exists.
   Sanitize target path validation by using svn_dirent_is_under_root().
   Try to create non-existent parent directories of the target path.
  (init_patch_target): Only try to open the target file if it exists.
   When checking for local mods, consider that directories of the target
   path may be unversioned, e.g. if resolve_target_path() created them.
  (apply_one_patch): Only read from target file if it exists.
  (apply_one_hunk): As previous, and if it does not exist, use an empty
   string as latest text. This always creates a conflict in the created
   file, we might want to make this a bit smarter later.


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

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