2
* url.c: converting paths to urls
4
* ====================================================================
5
* Copyright (c) 2000-2004 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
* ====================================================================
21
#include <apr_pools.h>
23
#include "svn_error.h"
25
#include "svn_client.h"
33
svn_client_url_from_path (const char **url,
34
const char *path_or_url,
37
svn_wc_adm_access_t *adm_access;
38
const svn_wc_entry_t *entry;
39
svn_boolean_t is_url = svn_path_is_url (path_or_url);
47
SVN_ERR (svn_wc_adm_probe_open3 (&adm_access, NULL, path_or_url,
48
FALSE, 0, NULL, NULL, pool));
49
SVN_ERR (svn_wc_entry (&entry, path_or_url, adm_access, FALSE, pool));
50
SVN_ERR (svn_wc_adm_close (adm_access));
52
*url = entry ? entry->url : NULL;