diff options
author | Jelmer Vernooij <jelmer@jelmer.uk> | 2016-07-09 19:54:27 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@jelmer.uk> | 2016-07-09 19:54:27 +0000 |
commit | 324a3063e1ac776f3e699d33010e48c8e5b9b8c4 (patch) | |
tree | 8914e8f1195cef0cd31a3e295f837d57a7b61781 /subvertpy | |
parent | 519ebeac5c3e2a4d1266d5b4ed65f8e22bf576d2 (diff) |
Use svn_uri_canonicalize when possible.
Diffstat (limited to 'subvertpy')
-rw-r--r-- | subvertpy/_ra.c | 4 | ||||
-rw-r--r-- | subvertpy/repos.c | 6 | ||||
-rw-r--r-- | subvertpy/util.c | 9 | ||||
-rw-r--r-- | subvertpy/util.h | 6 |
4 files changed, 20 insertions, 5 deletions
diff --git a/subvertpy/_ra.c b/subvertpy/_ra.c index da5d0b26..a2c4a70e 100644 --- a/subvertpy/_ra.c +++ b/subvertpy/_ra.c @@ -595,7 +595,7 @@ static PyObject *ra_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) return NULL; } - ret->url = svn_path_canonicalize(url, ret->pool); + ret->url = svn_uri_canonicalize(url, ret->pool); if (ret->url == NULL) { Py_DECREF(ret); return NULL; @@ -707,7 +707,7 @@ static PyObject *ra_reparent(PyObject *self, PyObject *args) temp_pool = Pool(NULL); if (temp_pool == NULL) return NULL; - ra->url = svn_path_canonicalize(url, ra->pool); + ra->url = svn_uri_canonicalize(url, ra->pool); RUN_RA_WITH_POOL(temp_pool, ra, svn_ra_reparent(ra->ra, ra->url, temp_pool)); apr_pool_destroy(temp_pool); Py_RETURN_NONE; diff --git a/subvertpy/repos.c b/subvertpy/repos.c index cf2c065b..5e0c30cc 100644 --- a/subvertpy/repos.c +++ b/subvertpy/repos.c @@ -62,9 +62,9 @@ static PyObject *repos_create(PyObject *self, PyObject *args) PyErr_SetString(PyExc_RuntimeError, "Unable to create fs config hash"); return NULL; } - RUN_SVN_WITH_POOL(pool, svn_repos_create(&repos, - svn_path_canonicalize(path, pool), NULL, NULL, - hash_config, hash_fs_config, pool)); + RUN_SVN_WITH_POOL(pool, svn_repos_create(&repos, + svn_path_canonicalize(path, pool), NULL, NULL, + hash_config, hash_fs_config, pool)); ret = PyObject_New(RepositoryObject, &Repository_Type); if (ret == NULL) diff --git a/subvertpy/util.c b/subvertpy/util.c index ae9d1feb..46228a2e 100644 --- a/subvertpy/util.c +++ b/subvertpy/util.c @@ -42,6 +42,15 @@ void PyErr_SetAprStatus(apr_status_t status) apr_strerror(status, errmsg, sizeof(errmsg))); } +#if ONLY_BEFORE_SVN(1, 7) +const char * +svn_uri_canonicalize(const char *uri, + apr_pool_t *result_pool) +{ + return svn_path_canonicalize(uri, result_pool); +} +#endif + apr_pool_t *Pool(apr_pool_t *parent) { apr_status_t status; diff --git a/subvertpy/util.h b/subvertpy/util.h index bebc3f16..6b52ae92 100644 --- a/subvertpy/util.h +++ b/subvertpy/util.h @@ -137,4 +137,10 @@ typedef struct { extern PyTypeObject Stream_Type; +#if ONLY_BEFORE_SVN(1, 7) +const char * +svn_uri_canonicalize(const char *uri, + apr_pool_t *result_pool); +#endif + #endif /* _SUBVERTPY_UTIL_H_ */ |