subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1188155 - in /subversion/trunk/subversion: include/private/svn_mergeinfo_private.h libsvn_client/merge.c libsvn_client/mergeinfo.c libsvn_subr/mergeinfo.c
Date Mon, 24 Oct 2011 14:36:47 GMT
Author: julianfoad
Date: Mon Oct 24 14:36:46 2011
New Revision: 1188155

URL: http://svn.apache.org/viewvc?rev=1188155&view=rev
Log:
Do shallow copies instead of deep copies in a couple of mergeinfo functions.

* subversion/include/private/svn_mergeinfo_private.h,
  subversion/libsvn_subr/mergeinfo.c
  (svn_mergeinfo__add_suffix_to_mergeinfo): Change to do shallow copying;
    its current callers only need shallow copies.

* subversion/libsvn_client/mergeinfo.c
  (svn_client__adjust_mergeinfo_source_paths): Change to do shallow copying;
    two of its three current callers only need shallow copies.

* subversion/libsvn_client/merge.c
  (inherit_implicit_mergeinfo_from_parent): Dup the mergeinfo into the
    result pool after calling svn_client__adjust_mergeinfo_source_paths().

Modified:
    subversion/trunk/subversion/include/private/svn_mergeinfo_private.h
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_client/mergeinfo.c
    subversion/trunk/subversion/libsvn_subr/mergeinfo.c

Modified: subversion/trunk/subversion/include/private/svn_mergeinfo_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_mergeinfo_private.h?rev=1188155&r1=1188154&r2=1188155&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_mergeinfo_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_mergeinfo_private.h Mon Oct 24 14:36:46
2011
@@ -138,11 +138,11 @@ svn_mergeinfo__relpaths_to_urls(apr_hash
                                 apr_pool_t *result_pool,
                                 apr_pool_t *scratch_pool);
 
-/* Set *OUT_MERGEINFO to a deep copy of MERGEINFO with the relpath
+/* Set *OUT_MERGEINFO to a shallow copy of MERGEINFO with the relpath
    SUFFIX_RELPATH added to the end of each key path.
 
-   Allocate *OUT_MERGEINFO in RESULT_POOL.  Use SCRATCH_POOL for any
-   temporary allocations. */
+   Allocate *OUT_MERGEINFO and the new keys in RESULT_POOL.  Use
+   SCRATCH_POOL for any temporary allocations. */
 svn_error_t *
 svn_mergeinfo__add_suffix_to_mergeinfo(svn_mergeinfo_t *out_mergeinfo,
                                        svn_mergeinfo_t mergeinfo,

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1188155&r1=1188154&r2=1188155&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Mon Oct 24 14:36:46 2011
@@ -3520,7 +3520,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
 
    Set CHILD->IMPLICIT_MERGEINFO to the mergeinfo inherited from
    PARENT->IMPLICIT_MERGEINFO.  CHILD->IMPLICIT_MERGEINFO is allocated
-   in POOL.
+   in RESULT_POOL.
    */
 static svn_error_t *
 inherit_implicit_mergeinfo_from_parent(svn_client__merge_path_t *parent,
@@ -3560,6 +3560,8 @@ inherit_implicit_mergeinfo_from_parent(s
   SVN_ERR(svn_client__adjust_mergeinfo_source_paths(
     child->implicit_mergeinfo, path_diff,
     parent->implicit_mergeinfo, result_pool));
+  child->implicit_mergeinfo = svn_mergeinfo_dup(child->implicit_mergeinfo,
+                                                result_pool);
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1188155&r1=1188154&r2=1188155&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Mon Oct 24 14:36:46 2011
@@ -148,7 +148,6 @@ svn_client__adjust_mergeinfo_source_path
 {
   apr_hash_index_t *hi;
   const char *path;
-  apr_array_header_t *copied_rangelist;
 
   SVN_ERR_ASSERT(adjusted_mergeinfo);
   SVN_ERR_ASSERT(mergeinfo);
@@ -161,9 +160,8 @@ svn_client__adjust_mergeinfo_source_path
       /* Copy inherited mergeinfo into our output hash, adjusting the
          merge source as appropriate. */
       path = svn_fspath__join(merge_source, rel_path, pool);
-      copied_rangelist = svn_rangelist_dup(rangelist, pool);
       apr_hash_set(adjusted_mergeinfo, path, APR_HASH_KEY_STRING,
-                   copied_rangelist);
+                   rangelist);
     }
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/mergeinfo.c?rev=1188155&r1=1188154&r2=1188155&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_subr/mergeinfo.c Mon Oct 24 14:36:46 2011
@@ -2230,7 +2230,7 @@ svn_mergeinfo__add_suffix_to_mergeinfo(s
       apr_hash_set(*out_mergeinfo,
                    svn_dirent_join(path, suffix_relpath, result_pool),
                    APR_HASH_KEY_STRING,
-                   svn_rangelist_dup(rangelist, result_pool));
+                   rangelist);
     }
 
   return SVN_NO_ERROR;



Mime
View raw message