diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2013-09-04 07:31:08 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@jelmer.uk> | 2016-07-07 23:35:00 +0000 |
commit | db585348265f3a78fcb167247eb20e6ed9d0eb78 (patch) | |
tree | 7bf1ee7fc74f13ee1c564a38e62d031d1d958f68 /subvertpy/_ra_iter_log.c | |
parent | a646b83e4f850e4954dee8542cf3fd47adf7c777 (diff) |
Factor out ra_get_log_prepare() to share with get_log() and iter_log()
Patch by Martin Panter.
Diffstat (limited to 'subvertpy/_ra_iter_log.c')
-rw-r--r-- | subvertpy/_ra_iter_log.c | 53 |
1 files changed, 2 insertions, 51 deletions
diff --git a/subvertpy/_ra_iter_log.c b/subvertpy/_ra_iter_log.c index 27ead012..b2fcf41e 100644 --- a/subvertpy/_ra_iter_log.c +++ b/subvertpy/_ra_iter_log.c @@ -316,57 +316,8 @@ PyObject *ra_iter_log(PyObject *self, PyObject *args, PyObject *kwargs) &include_merged_revisions, &revprops)) return NULL; - if (ra_check_busy(ra)) - return NULL; - - pool = Pool(ra->pool); - if (pool == NULL) - return NULL; - if (paths == Py_None) { - /* The subversion libraries don't behave as expected, - * so tweak our own parameters a bit. */ - apr_paths = apr_array_make(pool, 1, sizeof(char *)); - APR_ARRAY_PUSH(apr_paths, char *) = apr_pstrdup(pool, ""); - } else if (!path_list_to_apr_array(pool, paths, &apr_paths)) { - apr_pool_destroy(pool); - return NULL; - } - -#if ONLY_BEFORE_SVN(1, 5) - if (revprops == Py_None) { - PyErr_SetString(PyExc_NotImplementedError, - "fetching all revision properties not supported"); - apr_pool_destroy(pool); - return NULL; - } else if (!PySequence_Check(revprops)) { - PyErr_SetString(PyExc_TypeError, "revprops should be a sequence"); - apr_pool_destroy(pool); - return NULL; - } else { - int i; - for (i = 0; i < PySequence_Size(revprops); i++) { - const char *n = PyString_AsString(PySequence_GetItem(revprops, i)); - if (strcmp(SVN_PROP_REVISION_LOG, n) && - strcmp(SVN_PROP_REVISION_AUTHOR, n) && - strcmp(SVN_PROP_REVISION_DATE, n)) { - PyErr_SetString(PyExc_NotImplementedError, - "fetching custom revision properties not supported"); - apr_pool_destroy(pool); - return NULL; - } - } - } - - if (include_merged_revisions) { - PyErr_SetString(PyExc_NotImplementedError, - "include_merged_revisions not supported in Subversion 1.4"); - apr_pool_destroy(pool); - return NULL; - } -#endif - - if (!string_list_to_apr_array(pool, revprops, &apr_revprops)) { - apr_pool_destroy(pool); + if (!ra_get_log_prepare(ra, paths, include_merged_revisions, + revprops, &pool, &apr_paths, &apr_revprops)) { return NULL; } |