Author: rhuijben
Date: Thu Jan 29 18:48:03 2015
New Revision: 1655796
URL: http://svn.apache.org/r1655796
Log:
* subversion/libsvn_client/copy.c
(wc_to_repos_copy): Don't allocate list when we are not going to add
anything.
Modified:
subversion/trunk/subversion/libsvn_client/copy.c
Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1655796&r1=1655795&r2=1655796&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Thu Jan 29 18:48:03 2015
@@ -1408,8 +1408,6 @@ wc_to_repos_copy(const apr_array_header_
/* Set the mergeinfo for the destination to the combined merge
info known to the WC and the repository. */
- item->outgoing_prop_changes = apr_array_make(scratch_pool, 1,
- sizeof(svn_prop_t *));
/* Repository mergeinfo (or NULL if it's locally added)... */
if (src_origin)
SVN_ERR(svn_client__get_repos_mergeinfo(
@@ -1426,19 +1424,25 @@ wc_to_repos_copy(const apr_array_header_
iterpool));
else if (! mergeinfo)
mergeinfo = wc_mergeinfo;
+
if (mergeinfo)
{
/* Push a mergeinfo prop representing MERGEINFO onto the
* OUTGOING_PROP_CHANGES array. */
svn_prop_t *mergeinfo_prop
- = apr_palloc(item->outgoing_prop_changes->pool,
- sizeof(svn_prop_t));
+ = apr_palloc(scratch_pool,
sizeof(*mergeinfo_prop));
svn_string_t *prop_value;
SVN_ERR(svn_mergeinfo_to_string(&prop_value, mergeinfo,
item->outgoing_prop_changes->pool));
+ if (!item->outgoing_prop_changes)
+ {
+ item->outgoing_prop_changes = apr_array_make(scratch_pool, 1,
+ sizeof(svn_prop_t
*));
+ }
+
mergeinfo_prop->name = SVN_PROP_MERGEINFO;
mergeinfo_prop->value = prop_value;
APR_ARRAY_PUSH(item->outgoing_prop_changes, svn_prop_t *)