You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/08/11 21:29:25 UTC

svn commit: r1156756 - /subversion/trunk/subversion/libsvn_client/patch.c

Author: stsp
Date: Thu Aug 11 19:29:25 2011
New Revision: 1156756

URL: http://svn.apache.org/viewvc?rev=1156756&view=rev
Log:
* subversion/libsvn_client/patch.c
  (resolve_target_path): Rename LOCAL_ABSPATH parameter to the more obvious
   WCROOT_ABSPATH. It is the absolute path of the working copy root.
  (choose_target_filename): Rename BASE_DIR parameter to WCROOT_ABSPATH for
   the same reason.

Modified:
    subversion/trunk/subversion/libsvn_client/patch.c

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1156756&r1=1156755&r2=1156756&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Thu Aug 11 19:29:25 2011
@@ -365,7 +365,7 @@ obtain_eol_and_keywords_for_file(apr_has
 static svn_error_t *
 resolve_target_path(patch_target_t *target,
                     const char *path_from_patchfile,
-                    const char *local_abspath,
+                    const char *wcroot_abspath,
                     int strip_count,
                     svn_boolean_t prop_changes_only,
                     svn_wc_context_t *wc_ctx,
@@ -398,7 +398,8 @@ resolve_target_path(patch_target_t *targ
 
   if (svn_dirent_is_absolute(stripped_path))
     {
-      target->local_relpath = svn_dirent_is_child(local_abspath, stripped_path,
+      target->local_relpath = svn_dirent_is_child(wcroot_abspath,
+                                                  stripped_path,
                                                   result_pool);
 
       if (! target->local_relpath)
@@ -419,7 +420,7 @@ resolve_target_path(patch_target_t *targ
   /* Make sure the path is secure to use. We want the target to be inside
    * of the working copy and not be fooled by symlinks it might contain. */
   SVN_ERR(svn_dirent_is_under_root(&under_root,
-                                   &target->local_abspath, local_abspath,
+                                   &target->local_abspath, wcroot_abspath,
                                    target->local_relpath, result_pool));
 
   if (! under_root)
@@ -828,7 +829,7 @@ choose_target_filename(const svn_patch_t
 static svn_error_t *
 init_patch_target(patch_target_t **patch_target,
                   const svn_patch_t *patch,
-                  const char *base_dir,
+                  const char *wcroot_abspath,
                   svn_wc_context_t *wc_ctx, int strip_count,
                   svn_boolean_t remove_tempfiles,
                   apr_pool_t *result_pool, apr_pool_t *scratch_pool)
@@ -873,7 +874,7 @@ init_patch_target(patch_target_t **patch
   target->prop_targets = apr_hash_make(result_pool);
 
   SVN_ERR(resolve_target_path(target, choose_target_filename(patch),
-                              base_dir, strip_count, prop_changes_only,
+                              wcroot_abspath, strip_count, prop_changes_only,
                               wc_ctx, result_pool, scratch_pool));
   if (! target->skipped)
     {



RE: svn commit: r1156756 - /subversion/trunk/subversion/libsvn_client/patch.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: stsp@apache.org [mailto:stsp@apache.org]
> Sent: donderdag 11 augustus 2011 21:29
> To: commits@subversion.apache.org
> Subject: svn commit: r1156756 -
> /subversion/trunk/subversion/libsvn_client/patch.c
> 
> Author: stsp
> Date: Thu Aug 11 19:29:25 2011
> New Revision: 1156756
> 
> URL: http://svn.apache.org/viewvc?rev=1156756&view=rev
> Log:
> * subversion/libsvn_client/patch.c
>   (resolve_target_path): Rename LOCAL_ABSPATH parameter to the more
> obvious
>    WCROOT_ABSPATH. It is the absolute path of the working copy root.
>   (choose_target_filename): Rename BASE_DIR parameter to
> WCROOT_ABSPATH for
>    the same reason.

Looking at the callers this argument is not necessary the real wcroot, but just the directory where the path is applied to. 
(svn_client_patch performs baton.abs_wc_path = wc_dir_abspath which is then used for wcroot_abspath for this function).

As I don't think the working copy root is the only valid patch target, I think this argument should have a different name.

	Bert


RE: svn commit: r1156756 - /subversion/trunk/subversion/libsvn_client/patch.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: stsp@apache.org [mailto:stsp@apache.org]
> Sent: donderdag 11 augustus 2011 21:29
> To: commits@subversion.apache.org
> Subject: svn commit: r1156756 -
> /subversion/trunk/subversion/libsvn_client/patch.c
> 
> Author: stsp
> Date: Thu Aug 11 19:29:25 2011
> New Revision: 1156756
> 
> URL: http://svn.apache.org/viewvc?rev=1156756&view=rev
> Log:
> * subversion/libsvn_client/patch.c
>   (resolve_target_path): Rename LOCAL_ABSPATH parameter to the more
> obvious
>    WCROOT_ABSPATH. It is the absolute path of the working copy root.
>   (choose_target_filename): Rename BASE_DIR parameter to
> WCROOT_ABSPATH for
>    the same reason.

Looking at the callers this argument is not necessary the real wcroot, but just the directory where the path is applied to. 
(svn_client_patch performs baton.abs_wc_path = wc_dir_abspath which is then used for wcroot_abspath for this function).

As I don't think the working copy root is the only valid patch target, I think this argument should have a different name.

	Bert