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

[RFC] libsvn_ra->get_revisions()

From: Sir Woody Hackswell <sir.woody_at_hackswell.com>
Date: 2003-10-25 18:14:44 CEST

I'd like to request an addition to the libsvn_ra API.

I'd like to add a function similar to get_log, but instead of returning
logs, return revision numbers and paths. These routines follow
the get_log() interface very closely, but return just the revision numbers
and paths. (revision node). These routines will always traverse path
changes.

These routines could be used to help diff and log out when traversing back
among renames. These routines are also required to implement the -r PREVn
interface I'm working on. But one thing at a time, no? :)

<svn_types.h>
/** A revision number. */
typedef long int svn_revnum_t;

/** A revision type */
typedef struct svn_revnode_t
{
  svn_revnum_t rev;
  char *path;
} svn_revnode_t;

<svn_ra.h> (and ra_* plugins)
  /** Get at most "maxrevisions" from each path in "paths", starting at
   * "start" and ending at "end", following path changes.
   *
   * Results are returned in the APR array "revisions". Elements are of
   * type svn_revnode_t.
   */
  svn_error_t *(*get_revisions) (void *session_baton,
                                const apr_array_header_t *paths,
                                svn_revnum_t start,
                                svn_revnum_t end,
                                int maxrevisions,
                                apr_array_header_t *revisions,
                                apr_pool_t *pool);

Each ra->get_revisions() call will end up calling a new function in
libsvn_repos, which has very similar parameters.

**Question: Should "revisions" be allocated by caller, get_revisions, or
the following svn_repos_get_revisions?

<libsvn_repos/revisions.c>
svn_error_t *
svn_repos_get_revisions (svn_repos_t *repos,
                    const apr_array_header_t *paths,
                    svn_revnum_t start,
                    svn_revnum_t end,
                    int maxrevisions,
                    apr_array_header_t *revisions,
                    apr_pool_t *pool);

svn_repos_get_revisions goes to the fs interface, starts with "start", and
goes to "end" or back "maxrevisions" count, whichever comes first.

Again, "revisions" sends back the revnums and paths that
svn_fs_history_location returned.

Thoughts? Questions? Flames? Constructive criticism? Revisions?

-Richard Balint

-----
Sir.Woody_at_Hackswell.com http://sir.woody.hackswell.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 25 18:17:20 2003

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.