Pass things in the canonicalized form.
authorJelmer Vernooij <jelmer@jelmer.uk>
Fri, 11 Aug 2017 02:20:57 +0000 (02:20 +0000)
committerJelmer Vernooij <jelmer@jelmer.uk>
Fri, 11 Aug 2017 02:20:57 +0000 (02:20 +0000)
subvertpy/_ra.c
subvertpy/client.c
subvertpy/repos.c
subvertpy/wc_adm.c

index ae9f75e7fd0611361ad146e686a4ed4d40e5b15f..1aecc762e101d24e0e3d0eb4aa8e0592e2387b87 100644 (file)
@@ -1044,10 +1044,11 @@ static PyObject *ra_do_switch(PyObject *self, PyObject *args)
        void *report_baton;
        apr_pool_t *temp_pool, *result_pool;
        ReporterObject *ret;
+    PyObject *py_switch_url;
        svn_error_t *err;
 
-       if (!PyArg_ParseTuple(args, "lsbsO|bb:do_switch", &revision_to_update_to, &update_target,
-                                                 &recurse, &switch_url, &update_editor, &send_copyfrom_args, &ignore_ancestry))
+       if (!PyArg_ParseTuple(args, "lsbOO|bb:do_switch", &revision_to_update_to, &update_target,
+                                                 &recurse, &py_switch_url, &update_editor, &send_copyfrom_args, &ignore_ancestry))
                return NULL;
        if (ra_check_busy(ra))
                return NULL;
@@ -1058,6 +1059,13 @@ static PyObject *ra_do_switch(PyObject *self, PyObject *args)
                return NULL;
        }
 
+    switch_url = py_object_to_svn_uri(py_switch_url, temp_pool);
+    if (switch_url == NULL) {
+        apr_pool_destroy(temp_pool);
+        ra->busy = false;
+        return NULL;
+    }
+
        result_pool = Pool(NULL);
        if (result_pool == NULL) {
                apr_pool_destroy(temp_pool);
index a19e407fedb942184edaa7d4441b3c41ab85c69d..a86614f551991817d163515a8cd3861c49cd1901 100644 (file)
@@ -1016,7 +1016,7 @@ static PyObject *client_delete(PyObject *self, PyObject *args)
 #if ONLY_BEFORE_SVN(1, 7)
     svn_commit_info_t *commit_info = NULL;
 #endif
-    PyObject *py_revprops;
+    PyObject *py_revprops = Py_None;
     apr_array_header_t *apr_paths;
     ClientObject *client = (ClientObject *)self;
     apr_hash_t *hash_revprops;
@@ -1366,9 +1366,9 @@ static PyObject *client_propget(PyObject *self, PyObject *args)
     PyObject *peg_revision = Py_None;
     PyObject *revision;
     ClientObject *client = (ClientObject *)self;
-    PyObject *ret;
+    PyObject *ret, *py_target;
 
-    if (!PyArg_ParseTuple(args, "ssO|Ob", &propname, &target, &peg_revision,
+    if (!PyArg_ParseTuple(args, "sOO|Ob", &propname, &py_target, &peg_revision,
                           &revision, &recurse))
         return NULL;
     if (!to_opt_revision(peg_revision, &c_peg_rev))
@@ -1378,6 +1378,11 @@ static PyObject *client_propget(PyObject *self, PyObject *args)
     temp_pool = Pool(NULL);
     if (temp_pool == NULL)
         return NULL;
+    target = py_object_to_svn_abspath(py_target, temp_pool);
+    if (target == NULL) {
+        apr_pool_destroy(temp_pool);
+        return NULL;
+    }
 #if ONLY_SINCE_SVN(1, 8)
     /* FIXME: Support changelists */
     /* FIXME: Support actual_revnum */
index e6a41c15855d852e90afa23de64b651d32e37cac..44c48416e914e82870deea3e27063e7ec3e071cc 100644 (file)
@@ -64,7 +64,7 @@ static PyObject *repos_create(PyObject *self, PyObject *args)
                return NULL;
        }
 
-       path = py_object_to_svn_string(py_path, pool);
+       path = py_object_to_svn_dirent(py_path, pool);
        if (path == NULL) {
                apr_pool_destroy(pool);
                return NULL;
index 023c23a0e98057a2f0c29c7b6413360b61468596..a5e5a5c097ba47ccce474f546762ab1408eb7a59 100644 (file)
@@ -652,13 +652,13 @@ static PyObject *adm_get_switch_editor(PyObject *self, PyObject *args, PyObject
     bool depth_is_sticky = false;
     int depth = svn_depth_infinity;
     char *switch_url;
-    PyObject *py_target;
+    PyObject *py_target, *py_switch_url;
     char *kwnames[] = {
         "target", "switch_url", "use_commit_times", "depth", "notify_func",
         "diff3_cmd", "depth_is_sticky", "allow_unver_obstructions", NULL };
 
-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Os|biOzbb", kwnames,
-                                     &py_target, &switch_url, &use_commit_times,
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|biOzbb", kwnames,
+                                     &py_target, &py_switch_url, &use_commit_times,
                                      &depth, &notify_func, &diff3_cmd,
                                      &depth_is_sticky,
                                      &allow_unver_obstructions))
@@ -675,6 +675,13 @@ static PyObject *adm_get_switch_editor(PyObject *self, PyObject *args, PyObject
         apr_pool_destroy(pool);
         return NULL;
     }
+
+    switch_url = py_object_to_svn_uri(py_switch_url, pool);
+    if (switch_url == NULL) {
+        apr_pool_destroy(pool);
+        return NULL;
+    }
+
     latest_revnum = (svn_revnum_t *)apr_palloc(pool, sizeof(svn_revnum_t));
     Py_BEGIN_ALLOW_THREADS
 #if ONLY_SINCE_SVN(1, 5)