Author: stefan2
Date: Thu Jun 2 12:59:59 2011
New Revision: 1130528
URL: http://svn.apache.org/viewvc?rev=1130528&view=rev
Log:
Replace calls to svn_string_create_from_buf with the much cheaper
svn_string_create_from_buf. This is possible in all places where
source and target objects are expected to reside in the same pool
and the source will not be used after the conversion call.
* subversion/libsvn_client/patch.c
(install_patched_prop_targets): replace here
* subversion/libsvn_repos/hooks.c
(run_hook_cmd, lock_token_content): dito
* subversion/libsvn_subr/mergeinfo.c
(svn_rangelist_to_string, svn_mergeinfo_to_string,
svn_mergeinfo__catalog_to_formatted_string,
svn_mergeinfo__to_formatted_string): dito
* subversion/libsvn_subr/subst.c
(keyword_printf): dito
* subversion/libsvn_subr/utf.c
(svn_utf_string_to_utf8, svn_utf_string_from_utf8): and here
* subversion/libsvn_wc/props.c
(maybe_generate_propconflict, svn_wc_canonicalize_svn_prop): here
* subversion/svn/util.c:
(svn_cl__edit_string_externally): and finally here
Modified:
subversion/trunk/subversion/libsvn_client/patch.c
subversion/trunk/subversion/libsvn_repos/hooks.c
subversion/trunk/subversion/libsvn_subr/mergeinfo.c
subversion/trunk/subversion/libsvn_subr/subst.c
subversion/trunk/subversion/libsvn_subr/utf.c
subversion/trunk/subversion/libsvn_wc/props.c
subversion/trunk/subversion/svn/util.c
Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1130528&r1=1130527&r2=1130528&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Thu Jun 2 12:59:59 2011
@@ -2283,7 +2283,7 @@ install_patched_prop_targets(patch_targe
}
/* Attempt to set the property, and reject all hunks if this fails. */
- prop_val = svn_string_create_from_buf(prop_content, iterpool);
+ prop_val = svn_string_from_stringbuf(prop_content);
if (dry_run)
{
const svn_string_t *canon_propval;
Modified: subversion/trunk/subversion/libsvn_repos/hooks.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/hooks.c?rev=1130528&r1=1130527&r2=1130528&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/hooks.c (original)
+++ subversion/trunk/subversion/libsvn_repos/hooks.c Thu Jun 2 12:59:59 2011
@@ -226,7 +226,7 @@ run_hook_cmd(svn_string_t **result,
return svn_error_wrap_apr
(apr_err, _("Error closing read end of stderr pipe"));
- *result = svn_string_create_from_buf(native_stdout, pool);
+ *result = svn_string_from_stringbuf(native_stdout);
}
else
{
@@ -394,7 +394,7 @@ lock_token_content(apr_file_t **handle,
svn_stringbuf_appendcstr(lock_str, "\n");
return create_temp_file(handle,
- svn_string_create_from_buf(lock_str, pool), pool);
+ svn_string_from_stringbuf(lock_str), pool);
}
Modified: subversion/trunk/subversion/libsvn_subr/mergeinfo.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/mergeinfo.c?rev=1130528&r1=1130527&r2=1130528&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_subr/mergeinfo.c Thu Jun 2 12:59:59 2011
@@ -1506,7 +1506,7 @@ svn_rangelist_to_string(svn_string_t **o
svn_stringbuf_appendcstr(buf, range_to_string(range, pool));
}
- *output = svn_string_create_from_buf(buf, pool);
+ *output = svn_string_from_stringbuf(buf);
return SVN_NO_ERROR;
}
@@ -1560,7 +1560,7 @@ svn_mergeinfo_to_string(svn_string_t **o
{
svn_stringbuf_t *mergeinfo_buf;
SVN_ERR(mergeinfo_to_stringbuf(&mergeinfo_buf, input, NULL, pool));
- *output = svn_string_create_from_buf(mergeinfo_buf, pool);
+ *output = svn_string_from_stringbuf(mergeinfo_buf);
}
else
{
@@ -1930,7 +1930,7 @@ svn_mergeinfo__catalog_to_formatted_stri
otherwise, return a new string containing only a newline
character. */
if (output_buf)
- *output = svn_string_create_from_buf(output_buf, pool);
+ *output = svn_string_from_stringbuf(output_buf);
else
*output = svn_string_create("\n", pool);
@@ -1964,7 +1964,7 @@ svn_mergeinfo__to_formatted_string(svn_s
}
#endif
- *output = output_buf ? svn_string_create_from_buf(output_buf, pool)
+ *output = output_buf ? svn_string_from_stringbuf(output_buf)
: svn_string_create("", pool);
return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/libsvn_subr/subst.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/subst.c?rev=1130528&r1=1130527&r2=1130528&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/subst.c (original)
+++ subversion/trunk/subversion/libsvn_subr/subst.c Thu Jun 2 12:59:59 2011
@@ -229,7 +229,7 @@ keyword_printf(const char *fmt,
fmt = cur + 2;
}
- return svn_string_create_from_buf(value, pool);
+ return svn_string_from_stringbuf(value);
}
svn_error_t *
Modified: subversion/trunk/subversion/libsvn_subr/utf.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/utf.c?rev=1130528&r1=1130527&r2=1130528&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/utf.c (original)
+++ subversion/trunk/subversion/libsvn_subr/utf.c Thu Jun 2 12:59:59 2011
@@ -740,7 +740,7 @@ svn_utf_string_to_utf8(const svn_string_
if (! err)
err = check_utf8(destbuf->data, destbuf->len, pool);
if (! err)
- *dest = svn_string_create_from_buf(destbuf, pool);
+ *dest = svn_string_from_stringbuf(destbuf);
}
else
{
@@ -876,7 +876,7 @@ svn_utf_string_from_utf8(const svn_strin
err = convert_to_stringbuf(node, src->data, src->len,
&dbuf, pool);
if (! err)
- *dest = svn_string_create_from_buf(dbuf, pool);
+ *dest = svn_string_from_stringbuf(dbuf);
}
else
{
Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1130528&r1=1130527&r2=1130528&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Thu Jun 2 12:59:59 2011
@@ -925,8 +925,7 @@ maybe_generate_propconflict(svn_boolean_
result->merged_file :
cdesc->merged_file,
scratch_pool));
- merged_string = svn_string_create_from_buf(merged_stringbuf,
- scratch_pool);
+ merged_string = svn_string_from_stringbuf(merged_stringbuf);
apr_hash_set(working_props, propname,
APR_HASH_KEY_STRING, merged_string);
*conflict_remains = FALSE;
@@ -2483,7 +2482,7 @@ svn_wc_canonicalize_svn_prop(const svn_s
}
if (new_value)
- *propval_p = svn_string_create_from_buf(new_value, pool);
+ *propval_p = svn_string_from_stringbuf(new_value);
else
*propval_p = propval;
Modified: subversion/trunk/subversion/svn/util.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/util.c?rev=1130528&r1=1130527&r2=1130528&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/util.c (original)
+++ subversion/trunk/subversion/svn/util.c Thu Jun 2 12:59:59 2011
@@ -481,7 +481,7 @@ svn_cl__edit_string_externally(svn_strin
if (err)
goto cleanup;
- *edited_contents = svn_string_create_from_buf(edited_contents_s, pool);
+ *edited_contents = svn_string_from_stringbuf(edited_contents_s);
/* Translate back to UTF8/LF if desired. */
if (as_text)