You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2013/07/01 15:47:15 UTC
svn commit: r1498449 - /subversion/trunk/subversion/libsvn_ra/util.c
Author: danielsh
Date: Mon Jul 1 13:47:14 2013
New Revision: 1498449
URL: http://svn.apache.org/r1498449
Log:
Break out a helper function.
* subversion/libsvn_ra/util.c
(svn_ra__assert_mergeinfo_capable_server): Break out some code into..
(get_path): .. this new function. While here, mark a string for translation.
Modified:
subversion/trunk/subversion/libsvn_ra/util.c
Modified: subversion/trunk/subversion/libsvn_ra/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/util.c?rev=1498449&r1=1498448&r2=1498449&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra/util.c Mon Jul 1 13:47:14 2013
@@ -38,6 +38,26 @@
#include "svn_private_config.h"
#include "private/svn_ra_private.h"
+static const char *
+get_path(const char *path_or_url,
+ svn_ra_session_t *ra_session,
+ apr_pool_t *pool)
+{
+ if (path_or_url == NULL)
+ {
+ svn_error_t *err = svn_ra_get_session_url(ra_session, &path_or_url,
+ pool);
+ if (err)
+ {
+ /* The SVN_ERR_UNSUPPORTED_FEATURE error in the caller is more
+ important, so dummy up the session's URL and chuck this error. */
+ svn_error_clear(err);
+ return _("<repository>");
+ }
+ }
+ return path_or_url;
+}
+
svn_error_t *
svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session,
const char *path_or_url,
@@ -48,18 +68,7 @@ svn_ra__assert_mergeinfo_capable_server(
SVN_RA_CAPABILITY_MERGEINFO, pool));
if (! mergeinfo_capable)
{
- if (path_or_url == NULL)
- {
- svn_error_t *err = svn_ra_get_session_url(ra_session, &path_or_url,
- pool);
- if (err)
- {
- /* The SVN_ERR_UNSUPPORTED_FEATURE error is more important,
- so dummy up the session's URL and chuck this error. */
- svn_error_clear(err);
- path_or_url = "<repository>";
- }
- }
+ path_or_url = get_path(path_or_url, ra_session, pool);
return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Retrieval of mergeinfo unsupported by '%s'"),
svn_path_is_url(path_or_url)