[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Allow "cease invocation" return from Python callback for repos.svn_repos_history2()

From: Alexey Neyman <stilor_at_att.net>
Date: Tue, 16 Mar 2010 14:05:01 -0700

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.

Received on 2010-03-16 22:05:33 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.