subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Neyman <sti...@att.net>
Subject [PATCH] Allow "cease invocation" return from Python callback for repos.svn_repos_history2()
Date Tue, 16 Mar 2010 21:05:01 GMT
Hi all,

The svn_repos_history2() function allows the history_func() to return a 
special error, SVN_ERR_CEASE_INVOCATION, to stop the search. This is not 
supported in Python bindings, though: attempt to return 
core.SVN_ERR_CEASE_INVOCATION from the history receiver results in an 
exception:

  def history_lookup(path, rev, pool):
    return core.SVN_ERR_CEASE_INVOCATION

  repos.svn_repos_history2(..., history_lookup, ...)

svn.core.SubversionException: ('Python callback returned an invalid 
object', 20014)

Indeed, svn_swig_py_repos_history_func() only expects a return of None. 
This patch allows the callback to return core.SVN_ERR_CEASE_INVOCATION. 
Currently, this is only used in svn_repos_history2() - apparently, it's 
the only function that supports SVN_ERR_CEASE_INVOCATION. However, there 
is a FIXME at least in copyfrom_info_receiver() in libsvn_client/log.c, 
stating that other callbacks may eventually be able to return 
SVN_ERR_CEASE_INVOCATION as well.

Regards,
Alexey.

Mime
View raw message