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

Re: Bindings use is *painful*

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Wed, 16 Feb 2011 16:28:06 +0000

Ramkumar Ramachandra wrote:
> Stefan Sperling writes:
> > On Wed, Feb 16, 2011 at 03:08:39PM +0000, Hyrum K Wright wrote:
> > This is because the bindings are generated with SWIG.
> > We cannot really fix this without using a different approach.
> >
> > We could improve the documentation. An introductory document that
> > explains how to apply the C API docs to the python bindings would
> > be helpful. Maybe someone with some experience in using the python
> > bindings could write something like this?
> >
> > Also, there's an API built on top of the bindings that is easier to use
> > and has better documentation: http://pysvn.tigris.org/
>
> Does it make sense to write bindings ground up by hand and hand-craft
> a nice API? Since the C API is guaranteed to be relatively stable and
> backward compatible, maintainability shouldn't be much of an
> issue. Plus, it'll probably make a good GSoC project.

Isn't that the nature of our Python-Ctypes bindings? I though that was
hand-crated and more idiomatic to Python and thus "cleaner" to use.

class RemoteRepository(object):

    def log(self, start_rev, end_rev, paths=None, limit=0,
            discover_changed_paths=FALSE, stop_on_copy=FALSE):
        """A generator function which returns information about the revisions
           between START_REV and END_REV. Each return value is a
           csvn.types.LogEntry object which describes a revision.

           For details on what fields are contained in a LogEntry object,
           please see the documentation from csvn.types.LogEntry.

           You can iterate through the log information for several revisions
           using a regular for loop. For example:
             for entry in session.log(start_rev, end_rev):
               print("Revision %d" % entry.revision)
               ...

           ARGUMENTS:

             If PATHS is not None and has one or more elements, then only
             show revisions in which at least one of PATHS was changed (i.e.,
             if file, text or props changed; if dir, props changed or an entry
             was added or deleted). Each PATH should be relative to the current
             session's root.

             If LIMIT is non-zero, only the first LIMIT logs are returned.

             If DISCOVER_CHANGED_PATHS is True, then changed_paths will contain
             a list of paths affected by this revision.

             If STOP_ON_COPY is True, then this function will not cross
             copies while traversing history.

             If START_REV or END_REV is a non-existent revision, we throw
             a SVN_ERR_FS_NO_SUCH_REVISION SubversionException, without
             returning any logs.

        """

- Julian
Received on 2011-02-16 17:28:51 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.