Commit 7d80cece authored by Jelmer Vernooij's avatar Jelmer Vernooij

Updated version 0.10.1 from 'upstream/0.10.1'

with Debian dir 5f8797b29068894f13effa3c213bfe586d26c9b8
parents 636bc6c9 6b99d9ba
sudo: required
language: generic
services:
- docker
script:
- wget -O- http://travis.debian.net/script.sh | sh -
branches:
except:
- /^debian\/\d/
......@@ -3,3 +3,7 @@ include subvertpy/*.c
include subvertpy/*.h
include AUTHORS COPYING INSTALL NEWS TODO
include examples/*.py
include README.md
include Makefile
include subvertpy.cfg
include man/*.1
PYTHON = python
FLAKE8 ?= flake8
PYDOCTOR = pydoctor
PYDOCTOR_OPTIONS ?=
SETUP = $(PYTHON) setup.py
TESTRUNNER = unittest
DEBUGGER ?=
RUNTEST = PYTHONPATH=.:$(PYTHONPATH) $(DEBUGGER) $(PYTHON) -m $(TESTRUNNER) -v
all: build build-inplace
build::
$(SETUP) build
build-inplace::
$(SETUP) build_ext --inplace
install::
$(SETUP) install
check:: build-inplace
$(RUNTEST) $(TEST_OPTIONS) subvertpy.tests.test_suite
gdb-check::
$(MAKE) check DEBUGGER="gdb --args"
check-one::
$(MAKE) check TEST_OPTIONS=-f
clean::
$(SETUP) clean
rm -f subvertpy/*.so subvertpy/*.o subvertpy/*.pyc
pydoctor:
$(PYDOCTOR) $(PYDOCTOR_OPTIONS) --introspect-c-modules -c subvertpy.cfg --make-html
style:
$(FLAKE8) --exclude=build,.git,build-pypy,.tox
0.10.0 UNRELEASED
0.10.1 2017-07-19
BUG FIXES
* Bundle Makefile and subvertpy.cfg. (Jelmer Vernooij)
* Fix some endianness issues. (Jelmer Vernooij)
0.10.0 2017-07-17
CHANGES
......
Metadata-Version: 1.1
Name: subvertpy
Version: 0.10.0
Version: 0.10.1
Summary: Alternative Python bindings for Subversion
Home-page: https://jelmer.uk/subvertpy
Author: Jelmer Vernooij
Author-email: jelmer@jelmer.uk
License: LGPLv2.1 or later
Download-URL: https://jelmer.uk/subvertpy/subvertpy-0.10.0.tar.gz
Download-URL: https://jelmer.uk/subvertpy/subvertpy-0.10.1.tar.gz
Description:
Alternative Python bindings for Subversion. The goal is to have
complete, portable and "Pythonic" Python bindings.
......
[![Build Status](https://travis-ci.org/jelmer/subvertpy.png?branch=master)](https://travis-ci.org/jelmer/subvertpy)
Subvertpy
=========
Homepage: https://jelmer.uk/subvertpy/
Python bindings for the Subversion version control system that are aimed to be
complete, fast and feel native to Python programmers.
Bindings are provided for the working copy, client, delta, remote access and
repository APIs. A hookable server side implementation of the custom Subversion
protocol (svn_ra) is also provided.
Differences with similar packages
---------------------------------
subvertpy covers more of the APIs than python-svn. It provides a more
"Pythonic" API than python-subversion, which wraps the Subversion C API pretty
much directly. Neither provide a hookable server-side.
Dependencies
------------
Subvertpy depends on Python 2.7 or 3.5, and Subversion 1.4 or later. It should
work on Windows as well as most POSIX-based platforms (including Linux, BSDs
and Mac OS X).
Installation
------------
Standard distutils are used - use "setup.py build" to build and "setup.install"
to install. On most platforms, setup will find the Python and Subversion
development libraries by itself. On Windows you may have to set various
environment variables, see the next section for details.
Build instructions for Windows
==============================
* Install the SVN dev kit ZIP for Windows from
http://sourceforge.net/projects/win32svn/files/
E.g. svn-win32-1.4.6_dev.zip
* Find the SVN binary ZIP file with the binaries for your dev kit.
E.g. svn-win32-1.4.6.zip
Unzip this in the *same directory* as the dev kit - README.txt will be
overwritten, but that is all. This is the default location the .ZIP file
will suggest (ie, the directory embedded in both .zip files are the same)
* Set SVN_DEV to point at this directory.
* Install BDB.
For Subversion 1.7.0 and later:
http://www.oracle.com/technetwork/database/berkeleydb/downloads/index-082944.html
download Berkeley DB 4.8.30.msi Windows installer and install it.
For Subversion 1.6.17 and earlier:
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=688
download "db-4.4.20-win32.zip" or earlier version of BDB and extract it.
* Set SVN_BDB to the installed directory or extracted directory.
* Install SVN libintl.
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=2627
Download svn-win32-libintl.zip.
extract it to the directory that you want.
* Set SVN_LIBINTL to the extract dir.
Development
-----------
If using GCC it might be useful to disable the deprecation warnings when
compiling to see if there are any more serious warnings:
make CFLAGS="-Wno-deprecated-declarations"
......@@ -10,22 +10,24 @@
#
# Adapted for subvertpy by Jelmer Vernooij <jelmer@samba.org>
trunk_path = '/trunk/'
branches_path = '/branches/'
tags_path = '/tags/'
address = 'localhost'
from io import BytesIO
import sys, os.path
import sys
import os.path
from optparse import OptionParser
import stat
from time import mktime, strptime
from subvertpy.repos import PATH_CHANGE_DELETE, Repository
trunk_path = '/trunk/'
branches_path = '/branches/'
tags_path = '/tags/'
address = 'localhost'
ct_short = ['M', 'A', 'D', 'R', 'X']
stdout = getattr(sys.stdout, 'buffer', sys.stdout)
def dump_file_blob(root, stream, stream_length):
stdout.write(("data %s\n" % stream_length).encode("ascii"))
stdout.flush()
......@@ -189,28 +191,38 @@ if __name__ == '__main__':
dest='final_rev', metavar='FINAL_REV', type='int')
parser.add_option('-r', '--first-rev', help='First revision to import',
dest='first_rev', metavar='FIRST_REV', type='int')
parser.add_option('-t', '--trunk-path', help="Path in repo to /trunk, may be `regex:/cvs/(trunk)/proj1/(.*)`\nFirst group is used as branchname, second to match files",
dest='trunk_path', metavar='TRUNK_PATH')
parser.add_option('-b', '--branches-path', help='Path in repo to /branches',
dest='branches_path', metavar='BRANCHES_PATH')
parser.add_option('-T', '--tags-path', help='Path in repo to /tags',
dest='tags_path', metavar='TAGS_PATH')
parser.add_option('-a', '--address', help='Domain to put on users for their mail address',
dest='address', metavar='hostname', type='string')
parser.add_option("--version", help="Print version and exit", action="store_true")
parser.add_option(
'-t', '--trunk-path',
help=(
"Path in repo to /trunk, may be `regex:/cvs/(trunk)/proj1/(.*)`\n"
"First group is used as branchname, second to match files"),
dest='trunk_path', metavar='TRUNK_PATH')
parser.add_option(
'-b', '--branches-path', help='Path in repo to /branches',
dest='branches_path', metavar='BRANCHES_PATH')
parser.add_option(
'-T', '--tags-path', help='Path in repo to /tags',
dest='tags_path', metavar='TAGS_PATH')
parser.add_option(
'-a', '--address',
help='Domain to put on users for their mail address',
dest='address', metavar='hostname', type='string')
parser.add_option(
"--version", help="Print version and exit",
action="store_true")
(options, args) = parser.parse_args()
if options.version:
import subvertpy
print(".".join(str(x) for x in subvertpy.__version__))
sys.exit(0)
if options.trunk_path != None:
if options.trunk_path is not None:
trunk_path = options.trunk_path
if options.branches_path != None:
if options.branches_path is not None:
branches_path = options.branches_path
if options.tags_path != None:
if options.tags_path is not None:
tags_path = options.tags_path
if options.address != None:
if options.address is not None:
address = options.address
MATCHER = Matcher.getMatcher(trunk_path)
......
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2.
.TH SUBVERTPY-FAST-EXPORT "1" "October 2010" "subvertpy-fast-export" "subvertpy"
.SH NAME
subvertpy-fast-export \- generate fastexport stream from a Subversion repository
.SH DESCRIPTION
Generate fastexport stream from a Subversion repository.
.SH SYNOPSIS
.B subvertpy-fast-export
[\fIoptions\fR] \fIREPOS_PATH\fR
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
show a help message and exit
.TP
\fB\-f\fR FINAL_REV, \fB\-\-final\-rev\fR=\fIFINAL_REV\fR
Final revision to import
.TP
\fB\-r\fR FIRST_REV, \fB\-\-first\-rev\fR=\fIFIRST_REV\fR
First revision to import
.TP
\fB\-t\fR TRUNK_PATH, \fB\-\-trunk\-path\fR=\fITRUNK_PATH\fR
Path in repo to /trunk, may be
`regex:/cvs/(trunk)/proj1/(.*)` First group is used as
branchname, second to match files
.TP
\fB\-b\fR BRANCHES_PATH, \fB\-\-branches\-path\fR=\fIBRANCHES_PATH\fR
Path in repo to /branches
.TP
\fB\-T\fR TAGS_PATH, \fB\-\-tags\-path\fR=\fITAGS_PATH\fR
Path in repo to /tags
.TP
\fB\-a\fR hostname, \fB\-\-address\fR=\fIhostname\fR
Domain to put on users for their mail address
.TP
\fB\-\-version\fR
Print version and exit
.SH "SEE ALSO"
.UR https://jelmer.uk/subvertpy/
.BR https://jelmer.uk/subvertpy/
......@@ -412,7 +412,7 @@ def subvertpy_modules():
]
subvertpy_version = (0, 10, 0)
subvertpy_version = (0, 10, 1)
subvertpy_version_string = ".".join(map(str, subvertpy_version))
......
packages: subvertpy
docformat: restructuredtext
projectname: subvertpy
projecturl: https://jelmer.uk/subvertpy/
htmloutput: apidocs
......@@ -17,7 +17,7 @@
"""Python bindings for Subversion."""
__author__ = "Jelmer Vernooij <jelmer@jelmer.uk>"
__version__ = (0, 10, 0)
__version__ = (0, 10, 1)
NODE_DIR = 2
NODE_FILE = 1
......
......@@ -100,7 +100,7 @@ static svn_error_t *py_lock_func (void *baton, const char *path, int do_lock,
Py_INCREF(py_ra_err);
}
py_lock = pyify_lock(lock);
ret = PyObject_CallFunction((PyObject *)baton, "zbOO", path, do_lock,
ret = PyObject_CallFunction((PyObject *)baton, "zbOO", path, do_lock?true:false,
py_lock, py_ra_err);
Py_DECREF(py_lock);
Py_DECREF(py_ra_err);
......@@ -390,7 +390,7 @@ static svn_error_t *py_file_rev_handler(void *baton, const char *path, svn_revnu
py_rev_props = prop_hash_to_dict(rev_props);
CB_CHECK_PYRETVAL(py_rev_props);
ret = PyObject_CallFunction(fn, "slOb", path, rev, py_rev_props, result_of_merge);
ret = PyObject_CallFunction(fn, "slOi", path, rev, py_rev_props, result_of_merge);
Py_DECREF(py_rev_props);
CB_CHECK_PYRETVAL(ret);
......@@ -940,7 +940,7 @@ static PyObject *ra_do_update(PyObject *self, PyObject *args)
apr_pool_t *temp_pool, *result_pool;
ReporterObject *ret;
RemoteAccessObject *ra = (RemoteAccessObject *)self;
svn_boolean_t send_copyfrom_args = FALSE;
bool send_copyfrom_args = false;
if (!PyArg_ParseTuple(args, "lsbO|bb:do_update", &revision_to_update_to, &update_target, &recurse, &update_editor,
&send_copyfrom_args, &ignore_ancestry))
......@@ -1981,7 +1981,7 @@ fail_busy:
#if ONLY_SINCE_SVN(1, 5)
static PyObject *range_to_tuple(svn_merge_range_t *range)
{
return Py_BuildValue("(llb)", range->start, range->end, range->inheritable);
return Py_BuildValue("(llb)", range->start, range->end, range->inheritable?true:false);
}
static PyObject *merge_rangelist_to_list(apr_array_header_t *rangelist)
......@@ -2059,7 +2059,7 @@ static PyObject *ra_mergeinfo(PyObject *self, PyObject *args)
svn_revnum_t revision = -1;
PyObject *paths;
svn_mergeinfo_inheritance_t inherit = svn_mergeinfo_explicit;
svn_boolean_t include_descendants;
bool include_descendants;
if (!PyArg_ParseTuple(args, "O|lib:mergeinfo", &paths, &revision, &inherit, &include_descendants))
return NULL;
......@@ -2175,7 +2175,7 @@ static PyObject *ra_get_file_revs(PyObject *self, PyObject *args)
PyObject *file_rev_handler;
apr_pool_t *temp_pool;
RemoteAccessObject *ra = (RemoteAccessObject *)self;
svn_boolean_t include_merged_revisions = FALSE;
bool include_merged_revisions = false;
if (!PyArg_ParseTuple(args, "sllO|b:get_file_revs", &path, &start,
&end, &file_rev_handler, &include_merged_revisions))
......@@ -2623,19 +2623,19 @@ static PyObject *credentials_iter_next(CredentialsIterObject *iterator)
if (!strcmp(iterator->cred_kind, SVN_AUTH_CRED_SIMPLE)) {
svn_auth_cred_simple_t *simple = iterator->credentials;
ret = Py_BuildValue("(zzb)", simple->username, simple->password, simple->may_save);
ret = Py_BuildValue("(zzb)", simple->username, simple->password, simple->may_save?true:false);
} else if (!strcmp(iterator->cred_kind, SVN_AUTH_CRED_USERNAME)) {
svn_auth_cred_username_t *uname = iterator->credentials;
ret = Py_BuildValue("(zb)", uname->username, uname->may_save);
ret = Py_BuildValue("(zb)", uname->username, uname->may_save?true:false);
} else if (!strcmp(iterator->cred_kind, SVN_AUTH_CRED_SSL_CLIENT_CERT)) {
svn_auth_cred_ssl_client_cert_t *ccert = iterator->credentials;
ret = Py_BuildValue("(zb)", ccert->cert_file, ccert->may_save);
ret = Py_BuildValue("(zb)", ccert->cert_file, ccert->may_save?true:false);
} else if (!strcmp(iterator->cred_kind, SVN_AUTH_CRED_SSL_CLIENT_CERT_PW)) {
svn_auth_cred_ssl_client_cert_pw_t *ccert = iterator->credentials;
ret = Py_BuildValue("(zb)", ccert->password, ccert->may_save);
ret = Py_BuildValue("(zb)", ccert->password, ccert->may_save?true:false);
} else if (!strcmp(iterator->cred_kind, SVN_AUTH_CRED_SSL_SERVER_TRUST)) {
svn_auth_cred_ssl_server_trust_t *ccert = iterator->credentials;
ret = Py_BuildValue("(ib)", ccert->accepted_failures, ccert->may_save);
ret = Py_BuildValue("(ib)", ccert->accepted_failures, ccert->may_save?true:false);
} else {
PyErr_Format(PyExc_RuntimeError, "Unknown cred kind %s", iterator->cred_kind);
return NULL;
......@@ -2762,7 +2762,7 @@ static svn_error_t *py_username_prompt(svn_auth_cred_username_t **cred, void *ba
PyObject *py_username, *py_may_save;
char *username;
PyGILState_STATE state = PyGILState_Ensure();
ret = PyObject_CallFunction(fn, "sb", realm, may_save);
ret = PyObject_CallFunction(fn, "si", realm, may_save);
CB_CHECK_PYRETVAL(ret);
if (ret == Py_None) {
......@@ -2834,7 +2834,7 @@ static svn_error_t *py_simple_prompt(svn_auth_cred_simple_t **cred, void *baton,
PyObject *py_may_save, *py_username, *py_password;
char *ret_username, *password;
PyGILState_STATE state = PyGILState_Ensure();
ret = PyObject_CallFunction(fn, "ssb", realm, username, may_save);
ret = PyObject_CallFunction(fn, "ssi", realm, username, may_save);
CB_CHECK_PYRETVAL(ret);
if (!PyTuple_Check(ret)) {
PyErr_SetString(PyExc_TypeError, "expected tuple with simple credentials");
......@@ -2919,7 +2919,7 @@ static svn_error_t *py_ssl_server_trust_prompt(svn_auth_cred_ssl_server_trust_t
CB_CHECK_PYRETVAL(py_cert);
ret = PyObject_CallFunction(fn, "slOb", realm, failures, py_cert, may_save);
ret = PyObject_CallFunction(fn, "slOi", realm, failures, py_cert, may_save);
Py_DECREF(py_cert);
CB_CHECK_PYRETVAL(ret);
......@@ -2929,7 +2929,7 @@ static svn_error_t *py_ssl_server_trust_prompt(svn_auth_cred_ssl_server_trust_t
return NULL;
}
if (!PyArg_ParseTuple(ret, "ib", &accepted_failures, &may_save)) {
if (!PyArg_ParseTuple(ret, "ii", &accepted_failures, &may_save)) {
Py_DECREF(ret);
PyGILState_Release(state);
return py_svn_error();
......@@ -2968,9 +2968,9 @@ static svn_error_t *py_ssl_client_cert_pw_prompt(svn_auth_cred_ssl_client_cert_p
{
PyObject *fn = (PyObject *)baton, *ret, *py_password;
PyGILState_STATE state = PyGILState_Ensure();
ret = PyObject_CallFunction(fn, "sb", realm, may_save);
ret = PyObject_CallFunction(fn, "si", realm, may_save);
CB_CHECK_PYRETVAL(ret);
if (!PyArg_ParseTuple(ret, "Ob", &py_password, &may_save)) {
if (!PyArg_ParseTuple(ret, "Oi", &py_password, &may_save)) {
goto fail;
}
......@@ -2995,7 +2995,7 @@ static svn_error_t *py_ssl_client_cert_prompt(svn_auth_cred_ssl_client_cert_t **
PyObject *fn = (PyObject *)baton, *ret, *py_may_save, *py_cert_file;
PyGILState_STATE state = PyGILState_Ensure();
char *cert_file;
ret = PyObject_CallFunction(fn, "sb", realm, may_save);
ret = PyObject_CallFunction(fn, "si", realm, may_save);
CB_CHECK_PYRETVAL(ret);
if (!PyTuple_Check(ret)) {
......@@ -3108,7 +3108,7 @@ static svn_error_t *py_cb_get_simple_provider_prompt(svn_boolean_t *may_save_pla
PyGILState_Release(state);
return py_svn_error();
}
*may_save_plaintext = PyObject_IsTrue(ret);
*may_save_plaintext = PyObject_IsTrue(ret)?TRUE:FALSE;
Py_DECREF(ret);
PyGILState_Release(state);
}
......
This diff is collapsed.
......@@ -29,7 +29,11 @@ extern PyTypeObject FileEditor_Type;
extern PyTypeObject Editor_Type;
extern PyTypeObject TxDeltaWindowHandler_Type;
struct EditorObject;
PyObject *new_editor_object(struct EditorObject *parent, const svn_delta_editor_t *editor, void *baton, apr_pool_t *pool, PyTypeObject *type, void (*done_cb) (void *baton), void *done_baton, PyObject *commit_callback);
PyObject *new_editor_object(
struct EditorObject *parent, const
svn_delta_editor_t *editor, void *baton, apr_pool_t
*pool, PyTypeObject *type, void (*done_cb) (void *baton),
void *done_baton, PyObject *commit_callback);
#define DirectoryEditor_Check(op) PyObject_TypeCheck(op, &DirectoryEditor_Type)
#define FileEditor_Check(op) PyObject_TypeCheck(op, &FileEditor_Type)
......@@ -37,9 +41,9 @@ PyObject *new_editor_object(struct EditorObject *parent, const svn_delta_editor_
#define TxDeltaWindowHandler_Check(op) PyObject_TypeCheck(op, &TxDeltaWindowHandler_Type)
typedef struct {
PyObject_HEAD
svn_txdelta_window_handler_t txdelta_handler;
void *txdelta_baton;
PyObject_HEAD
svn_txdelta_window_handler_t txdelta_handler;
void *txdelta_baton;
} TxDeltaWindowHandlerObject;
svn_error_t *py_txdelta_window_handler(svn_txdelta_window_t *window, void *baton);
......
......@@ -21,7 +21,7 @@
#define _BZR_SVN_RA_H_
typedef struct {
PyObject_HEAD
PyObject_HEAD
svn_auth_baton_t *auth_baton;
apr_pool_t *pool;
PyObject *providers;
......
......@@ -386,7 +386,7 @@ static PyObject *repos_delete(PyObject *self, PyObject *args)
static PyObject *repos_hotcopy(RepositoryObject *self, PyObject *args)
{
char *src_path, *dest_path;
svn_boolean_t clean_logs = FALSE;
bool clean_logs = false;
apr_pool_t *temp_pool;
if (!PyArg_ParseTuple(args, "ss|b", &src_path, &dest_path, &clean_logs))
......@@ -397,7 +397,7 @@ static PyObject *repos_hotcopy(RepositoryObject *self, PyObject *args)
return NULL;
RUN_SVN_WITH_POOL(temp_pool,
svn_repos_hotcopy(src_path, dest_path, clean_logs, temp_pool));
svn_repos_hotcopy(src_path, dest_path, clean_logs?TRUE:FALSE, temp_pool));
apr_pool_destroy(temp_pool);
......@@ -807,7 +807,7 @@ static PyObject *fs_node_file_proplist(FileSystemRootObject *self, PyObject *arg
static PyObject *fs_root_file_checksum(FileSystemRootObject *self, PyObject *args)
{
apr_pool_t *temp_pool;
svn_boolean_t force = FALSE;
bool force = false;
char *path;
#if ONLY_SINCE_SVN(1, 6)
svn_checksum_kind_t kind;
......@@ -826,9 +826,8 @@ static PyObject *fs_root_file_checksum(FileSystemRootObject *self, PyObject *arg
if (temp_pool == NULL)
return NULL;
#if ONLY_SINCE_SVN(1, 6)
RUN_SVN_WITH_POOL(temp_pool, svn_fs_file_checksum(&checksum, kind,
self->root,
path, force, temp_pool));
RUN_SVN_WITH_POOL(temp_pool, svn_fs_file_checksum(
&checksum, kind, self->root, path, force?TRUE:FALSE, temp_pool));
cstr = svn_checksum_to_cstring(checksum, temp_pool);
if (cstr == NULL) {
ret = Py_None;
......
......@@ -958,7 +958,7 @@ static PyObject *stream_init(PyTypeObject *type, PyObject *args, PyObject *kwarg
if (ret->pool == NULL)
return NULL;
ret->stream = svn_stream_empty(ret->pool);
ret->closed = FALSE;
ret->closed = false;
return (PyObject *)ret;
}
......@@ -967,7 +967,7 @@ static PyObject *stream_close(StreamObject *self)
{
if (!self->closed) {
svn_stream_close(self->stream);
self->closed = TRUE;
self->closed = true;
}
Py_RETURN_NONE;
}
......@@ -1032,7 +1032,7 @@ static PyObject *stream_read_full(StreamObject *self, PyObject *args)
self->stream,
temp_pool,
temp_pool));
self->closed = TRUE;
self->closed = true;
ret = PyBytes_FromStringAndSize(result->data, result->len);
apr_pool_destroy(temp_pool);
return ret;
......
......@@ -45,39 +45,38 @@ bool string_list_to_apr_array(apr_pool_t *pool, PyObject *l, apr_array_header_t
bool relpath_list_to_apr_array(apr_pool_t *pool, PyObject *l, apr_array_header_t **);
PyObject *prop_hash_to_dict(apr_hash_t *props);
apr_hash_t *prop_dict_to_hash(apr_pool_t *pool, PyObject *py_props);
svn_error_t *py_svn_log_wrapper(void *baton, apr_hash_t *changed_paths,
long revision, const char *author,
const char *date, const char *message,
apr_pool_t *pool);
svn_error_t *py_svn_log_wrapper(
void *baton, apr_hash_t *changed_paths, long revision, const char *author,
const char *date, const char *message, apr_pool_t *pool);
svn_error_t *py_svn_error(void);
void PyErr_SetSubversionException(svn_error_t *error);
PyTypeObject *PyErr_GetSubversionExceptionTypeObject(void);
#define RUN_SVN(cmd) { \
svn_error_t *err; \
PyThreadState *_save; \
_save = PyEval_SaveThread(); \
err = (cmd); \
PyEval_RestoreThread(_save); \
if (err != NULL) { \
handle_svn_error(err); \
svn_error_clear(err); \
return NULL; \
} \
svn_error_t *err; \
PyThreadState *_save; \
_save = PyEval_SaveThread(); \
err = (cmd); \
PyEval_RestoreThread(_save); \
if (err != NULL) { \
handle_svn_error(err); \
svn_error_clear(err); \
return NULL; \
} \
}
#define RUN_SVN_WITH_POOL(pool, cmd) { \
svn_error_t *err; \
PyThreadState *_save; \
_save = PyEval_SaveThread(); \
err = (cmd); \
PyEval_RestoreThread(_save); \
if (err != NULL) { \
handle_svn_error(err); \
svn_error_clear(err); \
apr_pool_destroy(pool); \
return NULL; \
} \
svn_error_t *err; \
PyThreadState *_save; \
_save = PyEval_SaveThread(); \
err = (cmd); \
PyEval_RestoreThread(_save); \
if (err != NULL) { \
handle_svn_error(err); \
svn_error_clear(err); \
apr_pool_destroy(pool); \
return NULL; \
} \
}
PyObject *wrap_lock(svn_lock_t *lock);
......@@ -89,9 +88,10 @@ void PyErr_SetAprStatus(apr_status_t status);
PyObject *py_dirent(const svn_dirent_t *dirent, int dirent_fields);
PyObject *PyOS_tmpfile(void);
PyObject *pyify_changed_paths(apr_hash_t *changed_paths, bool node_kind, apr_pool_t *pool);
bool pyify_log_message(apr_hash_t *changed_paths, const char *author,
const char *date, const char *message, bool node_kind,
apr_pool_t *pool, PyObject **py_changed_paths, PyObject **revprops);
bool pyify_log_message(
apr_hash_t *changed_paths, const char *author,
const char *date, const char *message, bool node_kind,
apr_pool_t *pool, PyObject **py_changed_paths, PyObject **revprops);
#if ONLY_SINCE_SVN(1, 6)
PyObject *pyify_changed_paths2(apr_hash_t *changed_paths2, apr_pool_t *pool);
#endif
......@@ -106,19 +106,19 @@ svn_error_t *py_svn_log_entry_receiver(void *baton, svn_log_entry_t *log_entry,
#endif
#define CB_CHECK_PYRETVAL(ret) \
if (ret == NULL) { \
PyGILState_Release(state); \
return py_svn_error(); \
}
if (ret == NULL) { \
PyGILState_Release(state); \
return py_svn_error(); \
}
#if SVN_VER_MINOR < 5
typedef enum svn_depth_t {
svn_depth_unknown = -2,
svn_depth_exclude = -1,
svn_depth_empty = 0,
svn_depth_files = 1,
svn_depth_immediates = 2,
svn_depth_infinity = 3
svn_depth_unknown = -2,
svn_depth_exclude = -1,
svn_depth_empty = 0,
svn_depth_files = 1,
svn_depth_immediates = 2,
svn_depth_infinity = 3
} svn_depth_t;
#endif
......@@ -129,10 +129,10 @@ typedef struct {
} ConfigObject;
typedef struct {
PyObject_HEAD
svn_stream_t *stream;
apr_pool_t *pool;
svn_boolean_t closed;
PyObject_HEAD
svn_stream_t *stream;
apr_pool_t *pool;
bool closed;
} StreamObject;
extern PyTypeObject Stream_Type;
......
......@@ -1074,8 +1074,8 @@ static PyObject *adm_crawl_revisions(PyObject *self, PyObject *args, PyObject *k
apr_pool_t *temp_pool;
AdmObject *admobj = (AdmObject *)self;
svn_wc_traversal_info_t *traversal_info;
svn_boolean_t depth_compatibility_trick = FALSE;
svn_boolean_t honor_depth_exclude = FALSE;
bool depth_compatibility_trick = false;
bool honor_depth_exclude = false;
char *kwnames[] = { "path", "reporter", "restore_files", "recurse", "use_commit_times", "notify_func", "depth_compatibility_trick", "honor_depth_exclude,", NULL };
PyObject *py_path;
......@@ -1101,8 +1101,8 @@ static PyObject *adm_crawl_revisions(PyObject *self, PyObject *args, PyObject *k
RUN_SVN_WITH_POOL(temp_pool, svn_wc_crawl_revisions4(path, admobj->adm,
&py_ra_reporter, (void *)reporter,
restore_files, recurse?svn_depth_infinity:svn_depth_files,
honor_depth_exclude,
depth_compatibility_trick, use_commit_times,
honor_depth_exclude?TRUE:FALSE,
depth_compatibility_trick?TRUE:FALSE, use_commit_times,
py_wc_notify_func, (void *)notify_func,
traversal_info, temp_pool));
#elif ONLY_SINCE_SVN(1, 5)
......@@ -1143,8 +1143,8 @@ static PyObject *adm_get_update_editor(PyObject *self, PyObject *args)
apr_pool_t *pool;
svn_revnum_t *latest_revnum;
svn_error_t *err;
svn_boolean_t allow_unver_obstructions = FALSE;
svn_boolean_t depth_is_sticky = FALSE;
bool allow_unver_obstructions = false;
bool depth_is_sticky = false;
if (!PyArg_ParseTuple(args, "s|bbOzbb", &target, &use_commit_times,
&recurse, &notify_func, &diff3_cmd, &depth_is_sticky,
......@@ -1164,7 +1164,7 @@ static PyObject *adm_get_update_editor(PyObject *self, PyObject *args)
/* FIXME: Support conflict func */
err = svn_wc_get_update_editor3(latest_revnum, admobj->adm, target,
use_commit_times, recurse?svn_depth_infinity:svn_depth_files,
depth_is_sticky, allow_unver_obstructions,
depth_is_sticky?TRUE:FALSE, allow_unver_obstructions?TRUE:FALSE,
py_wc_notify_func, (void *)notify_func,
py_cancel_check, NULL,
NULL, NULL, NULL, NULL,
......@@ -1283,7 +1283,7 @@ static PyObject *adm_process_committed(PyObject *self, PyObject *args, PyObject
AdmObject *admobj = (AdmObject *)self;
apr_pool_t *temp_pool;
int digest_len;
svn_boolean_t remove_changelist = FALSE;
bool remove_changelist = false;
char *kwnames[] = { "path", "recurse", "new_revnum", "rev_date", "rev_author",
"wcprop_changes", "remove_lock", "digest", "remove_changelist", NULL };
......@@ -1317,7 +1317,7 @@ static PyObject *adm_process_committed(PyObject *self, PyObject *args, PyObject
RUN_SVN_WITH_POOL(temp_pool, svn_wc_process_committed4(
path, admobj->adm, recurse, new_revnum,
rev_date, rev_author, wcprop_changes,
remove_lock, remove_changelist, digest, temp_pool));
remove_lock, remove_changelist?TRUE:FALSE, digest, temp_pool));
#else
if (remove_changelist) {
PyErr_SetString(PyExc_NotImplementedError, "remove_changelist only supported in svn < 1.6");
......@@ -1540,7 +1540,7 @@ static PyObject *mark_missing_deleted(PyObject *self, PyObject *args)
static PyObject *remove_from_revision_control(PyObject *self, PyObject *args)
{
char *name;
svn_boolean_t destroy_wf = FALSE, instant_error = FALSE;
bool destroy_wf = false, instant_error = false;
AdmObject *admobj = (AdmObject *)self;
apr_pool_t *temp_pool;
......@@ -1555,7 +1555,7 @@ static PyObject *remove_from_revision_control(PyObject *self, PyObject *args)
RUN_SVN_WITH_POOL(temp_pool,
svn_wc_remove_from_revision_control(admobj->adm, name,