diff options
author | Jelmer Vernooij <jelmer@jelmer.uk> | 2016-07-10 08:51:38 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@jelmer.uk> | 2016-07-10 08:51:38 +0000 |
commit | 135e75770a5ba6512257cad678cfe21138f1424d (patch) | |
tree | dc2dae93876cdc6a8c72f61c3bc71a0eb515a82d /subvertpy | |
parent | 97125fb1bf02600032361a7256d173ba37a978d5 (diff) |
Support no_autoprops argument to Client.add.
Diffstat (limited to 'subvertpy')
-rw-r--r-- | subvertpy/_ra.c | 2 | ||||
-rw-r--r-- | subvertpy/client.c | 25 |
2 files changed, 21 insertions, 6 deletions
diff --git a/subvertpy/_ra.c b/subvertpy/_ra.c index 894dad45..01ce2ac1 100644 --- a/subvertpy/_ra.c +++ b/subvertpy/_ra.c @@ -2132,7 +2132,7 @@ static PyMethodDef ra_methods[] = { { "get_locations", ra_get_locations, METH_VARARGS, "S.get_locations(path, peg_revision, location_revisions)" }, { "get_locks", ra_get_locks, METH_VARARGS, - "S.get_locks(path)" }, + "S.get_locks(path, depth=DEPTH_INFINITY)" }, { "lock", ra_lock, METH_VARARGS, "S.lock(path_revs, comment, steal_lock, lock_func)\n" }, { "unlock", ra_unlock, METH_VARARGS, diff --git a/subvertpy/client.c b/subvertpy/client.c index a2cffd09..96bb7c5f 100644 --- a/subvertpy/client.c +++ b/subvertpy/client.c @@ -487,12 +487,13 @@ static PyObject *client_add(PyObject *self, PyObject *args, PyObject *kwargs) ClientObject *client = (ClientObject *)self; bool recursive=true, force=false, no_ignore=false; bool add_parents = false; + bool no_autoprops = false; apr_pool_t *temp_pool; char *kwnames[] = { "path", "recursive", "force", "no_ignore", - "add_parents", NULL }; + "add_parents", "no_autoprops", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|bbbb", kwnames, - &path, &recursive, &force, &no_ignore, &add_parents)) + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|bbbbb", kwnames, + &path, &recursive, &force, &no_ignore, &add_parents, &no_autoprops)) return NULL; #if ONLY_BEFORE_SVN(1, 4) @@ -503,11 +504,25 @@ static PyObject *client_add(PyObject *self, PyObject *args, PyObject *kwargs) } #endif +#if ONLY_BEFORE_SVN(1, 8) + if (no_autoprops) { + PyErr_SetString(PyExc_NotImplementedError, + "Subversion < 1.8 does not support no_autoprops"); + return NULL; + } +#endif + temp_pool = Pool(NULL); if (temp_pool == NULL) return NULL; -#if ONLY_SINCE_SVN(1, 5) +#if ONLY_SINCE_SVN(1, 8) + RUN_SVN_WITH_POOL(temp_pool, + svn_client_add5(path, recursive?svn_depth_infinity:svn_depth_empty, + force, no_ignore, no_autoprops, add_parents, + client->client, temp_pool) + ); +#elif ONLY_SINCE_SVN(1, 5) RUN_SVN_WITH_POOL(temp_pool, svn_client_add4(path, recursive?svn_depth_infinity:svn_depth_empty, force, no_ignore, add_parents, @@ -1571,7 +1586,7 @@ static PyObject *client_info(PyObject *self, PyObject *args, PyObject *kwargs) static PyMethodDef client_methods[] = { { "add", (PyCFunction)client_add, METH_VARARGS|METH_KEYWORDS, - "S.add(path, recursive=True, force=False, no_ignore=False)" }, + "S.add(path, recursive=True, force=False, no_ignore=False, no_autoprops=False)" }, { "checkout", (PyCFunction)client_checkout, METH_VARARGS|METH_KEYWORDS, "S.checkout(url, path, rev=None, peg_rev=None, recurse=True, ignore_externals=False, allow_unver_obstructions=False)" }, { "export", (PyCFunction)client_export, METH_VARARGS|METH_KEYWORDS, |