Fix compiler warning due to missing function prototype.
[svn.git] / subversion / libsvn_ra / util.c
blob75cd18d03c01e3c16a7c129c0eec0ae7eff9a566
1 /*
2 * util.c: Repository access utility routines.
4 * ====================================================================
5 * Copyright (c) 2007 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
19 /* ==================================================================== */
21 /*** Includes. ***/
22 #include <apr_pools.h>
24 #include "svn_types.h"
25 #include "svn_error.h"
26 #include "svn_error_codes.h"
27 #include "svn_path.h"
28 #include "svn_ra.h"
30 #include "svn_private_config.h"
31 #include "private/svn_ra_private.h"
33 /* Return an error with code SVN_ERR_UNSUPPORTED_FEATURE, and an error
34 message referencing PATH_OR_URL, if the "server" pointed to be
35 RA_SESSION doesn't support Merge Tracking (e.g. is pre-1.5).
36 Perform temporary allocations in POOL. */
37 svn_error_t *
38 svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session,
39 const char *path_or_url,
40 apr_pool_t *pool)
42 svn_boolean_t mergeinfo_capable;
43 SVN_ERR(svn_ra_has_capability(ra_session, &mergeinfo_capable,
44 SVN_RA_CAPABILITY_MERGEINFO, pool));
45 if (! mergeinfo_capable)
47 if (path_or_url == NULL)
49 svn_error_t *err = svn_ra_get_session_url(ra_session, &path_or_url,
50 pool);
51 if (err)
53 /* The SVN_ERR_UNSUPPORTED_FEATURE error is more important,
54 so dummy up the session's URL and chuck this error. */
55 svn_error_clear(err);
56 path_or_url = "<repository>";
59 return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
60 _("Retrieval of mergeinfo unsupported by '%s'"),
61 svn_path_local_style(path_or_url, pool));
63 return SVN_NO_ERROR;