Author: rhuijben
Date: Thu Oct 11 16:42:44 2012
New Revision: 1397157
URL: http://svn.apache.org/viewvc?rev=1397157&view=rev
Log:
Minor cleanup to mergeinfo apis. No functional changes.
* subversion/include/private/svn_mergeinfo_private.h
(svn_mergeinfo__relpaths_to_urls): Remove private api.
(svn_mergeinfo__to_formatted_string): Remove private api.
* subversion/libsvn_client/mergeinfo.c
(mergeinfo_relpaths_to_urls): Add svn_mergeinfo__relpaths_to_urls as static
function. No longer needed as api, as new apis will use repos_relpaths.
(svn_client_mergeinfo_get_merged): Update caller.
* subversion/libsvn_subr/mergeinfo.c
(svn_mergeinfo__relpaths_to_urls): Remove here, move to libsvn_client.
(svn_mergeinfo__to_formatted_string): Remove unused function.
Modified:
subversion/trunk/subversion/include/private/svn_mergeinfo_private.h
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=1397157&r1=1397156&r2=1397157&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_mergeinfo_private.h
(original)
+++ subversion/trunk/subversion/include/private/svn_mergeinfo_private.h Thu Oct
11 16:42:44 2012
@@ -125,20 +125,6 @@ svn_mergeinfo__add_prefix_to_catalog(svn
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Set *OUT_MERGEINFO to a shallow copy of MERGEINFO with each source path
- converted to a (URI-encoded) URL based on REPOS_ROOT_URL. *OUT_MERGEINFO
- is declared as 'apr_hash_t *' because its key do not obey the rules of
- 'svn_mergeinfo_t'.
-
- Allocate *OUT_MERGEINFO and the new keys in RESULT_POOL. Use
- SCRATCH_POOL for any temporary allocations. */
-svn_error_t *
-svn_mergeinfo__relpaths_to_urls(apr_hash_t **out_mergeinfo,
- svn_mergeinfo_t mergeinfo,
- const char *repos_root_url,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* Set *OUT_MERGEINFO to a shallow copy of MERGEINFO with the relpath
SUFFIX_RELPATH added to the end of each key path.
@@ -170,20 +156,6 @@ svn_mergeinfo__catalog_to_formatted_stri
const char *val_prefix,
apr_pool_t *pool);
-/* Create a string representation of MERGEINFO in *OUTPUT, allocated in POOL.
- Unlike svn_mergeinfo_to_string(), NULL MERGEINFO is tolerated and results
- in *OUTPUT set to "\n". If SVN_DEBUG is true, then NULL or empty MERGEINFO
- causes *OUTPUT to be set to an appropriate newline terminated string. If
- PREFIX is not NULL then prepend PREFIX to each line in *OUTPUT.
-
- Any relative merge source paths in MERGEINFO are converted to absolute
- paths in *OUTPUT.*/
-svn_error_t *
-svn_mergeinfo__to_formatted_string(svn_string_t **output,
- svn_mergeinfo_t mergeinfo,
- const char *prefix,
- apr_pool_t *pool);
-
/* Set *YOUNGEST_REV and *OLDEST_REV to the youngest and oldest revisions
found in the rangelists within MERGEINFO. Note that *OLDEST_REV is
exclusive and *YOUNGEST_REV is inclusive. If MERGEINFO is NULL or empty
Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1397157&r1=1397156&r2=1397157&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Thu Oct 11 16:42:44
2012
@@ -1572,6 +1572,44 @@ logs_for_mergeinfo_rangelist(const char
return SVN_NO_ERROR;
}
+
+/* Set *OUT_MERGEINFO to a shallow copy of MERGEINFO with each source path
+ converted to a (URI-encoded) URL based on REPOS_ROOT_URL. *OUT_MERGEINFO
+ is declared as 'apr_hash_t *' because its key do not obey the rules of
+ 'svn_mergeinfo_t'.
+
+ Allocate *OUT_MERGEINFO and the new keys in RESULT_POOL. Use
+ SCRATCH_POOL for any temporary allocations. */
+static svn_error_t *
+mergeinfo_relpaths_to_urls(apr_hash_t **out_mergeinfo,
+ svn_mergeinfo_t mergeinfo,
+ const char *repos_root_url,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ *out_mergeinfo = NULL;
+ if (mergeinfo)
+ {
+ apr_hash_index_t *hi;
+ apr_hash_t *full_path_mergeinfo = apr_hash_make(result_pool);
+
+ for (hi = apr_hash_first(scratch_pool, mergeinfo);
+ hi; hi = apr_hash_next(hi))
+ {
+ const char *key = svn__apr_hash_index_key(hi);
+ void *val = svn__apr_hash_index_val(hi);
+
+ apr_hash_set(full_path_mergeinfo,
+ svn_path_url_add_component2(repos_root_url, key + 1,
+ result_pool),
+ APR_HASH_KEY_STRING, val);
+ }
+ *out_mergeinfo = full_path_mergeinfo;
+ }
+
+ return SVN_NO_ERROR;
+}
+
/*** Public APIs ***/
@@ -1614,8 +1652,8 @@ svn_client_mergeinfo_get_merged(apr_hash
mergeinfo = NULL;
}
- SVN_ERR(svn_mergeinfo__relpaths_to_urls(mergeinfo_p, mergeinfo,
- repos_root, pool, pool));
+ SVN_ERR(mergeinfo_relpaths_to_urls(mergeinfo_p, mergeinfo,
+ repos_root, pool, pool));
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=1397157&r1=1397156&r2=1397157&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_subr/mergeinfo.c Thu Oct 11 16:42:44 2012
@@ -2197,36 +2197,6 @@ svn_mergeinfo__add_prefix_to_catalog(svn
}
svn_error_t *
-svn_mergeinfo__relpaths_to_urls(apr_hash_t **out_mergeinfo,
- svn_mergeinfo_t mergeinfo,
- const char *repos_root_url,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- *out_mergeinfo = NULL;
- if (mergeinfo)
- {
- apr_hash_index_t *hi;
- apr_hash_t *full_path_mergeinfo = apr_hash_make(result_pool);
-
- for (hi = apr_hash_first(scratch_pool, mergeinfo);
- hi; hi = apr_hash_next(hi))
- {
- const char *key = svn__apr_hash_index_key(hi);
- void *val = svn__apr_hash_index_val(hi);
-
- apr_hash_set(full_path_mergeinfo,
- svn_path_url_add_component2(repos_root_url, key + 1,
- result_pool),
- APR_HASH_KEY_STRING, val);
- }
- *out_mergeinfo = full_path_mergeinfo;
- }
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
svn_mergeinfo__add_suffix_to_mergeinfo(svn_mergeinfo_t *out_mergeinfo,
svn_mergeinfo_t mergeinfo,
const char *suffix_relpath,
@@ -2359,38 +2329,6 @@ svn_mergeinfo__catalog_to_formatted_stri
}
svn_error_t *
-svn_mergeinfo__to_formatted_string(svn_string_t **output,
- svn_mergeinfo_t mergeinfo,
- const char *prefix,
- apr_pool_t *pool)
-{
- svn_stringbuf_t *output_buf = NULL;
-
- if (mergeinfo && apr_hash_count(mergeinfo))
- {
- SVN_ERR(mergeinfo_to_stringbuf(&output_buf, mergeinfo,
- prefix ? prefix : "", pool));
- svn_stringbuf_appendcstr(output_buf, "\n");
- }
-#if SVN_DEBUG
- else if (!mergeinfo)
- {
- output_buf = svn_stringbuf_create(prefix ? prefix : "", pool);
- svn_stringbuf_appendcstr(output_buf, _("NULL mergeinfo\n"));
- }
- else if (apr_hash_count(mergeinfo) == 0)
- {
- output_buf = svn_stringbuf_create(prefix ? prefix : "", pool);
- svn_stringbuf_appendcstr(output_buf, _("empty mergeinfo\n"));
- }
-#endif
-
- *output = output_buf ? svn_stringbuf__morph_into_string(output_buf)
- : svn_string_create_empty(pool);
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
svn_mergeinfo__get_range_endpoints(svn_revnum_t *youngest_rev,
svn_revnum_t *oldest_rev,
svn_mergeinfo_t mergeinfo,