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

Re: [RFC] API for reading trees from repo or WC

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 7 Oct 2011 17:29:59 +0200

No comments on the general idea as I'm not sufficiently familiar with
the internals of the client library. That said, ...

Julian Foad wrote on Fri, Oct 07, 2011 at 14:56:42 +0100:
> This is a Request For Comments on the creation of an API for reading a
> tree of dirs and files from an arbitrary source via a common API.
>

Would it be a public API?

> /* V-table for #svn_client_tree_t.
> *
> * Paths are relpaths, relative to the tree root.
> * Revision numbers and repository ids are #SVN_INVALID_REVNUM and NULL
> * for an unversioned node (including a node that is a local add/copy/move
> * in a WC working tree).
> */
> typedef struct svn_client_tree__vtable_t
> {
> /* Fetch the node kind of the node at @a relpath.
> * (### and other metadata? revnum? props?)
> *
> * Set @a *kind to the node kind.
> */
> svn_error_t *(*get_kind)(svn_client_tree_t *tree,
> svn_node_kind_t *kind,
> const char *relpath,
> apr_pool_t *scratch_pool);

Return an svn_client_info2_t ?

>
> /* Fetch the contents and properties of the file at @a relpath.
> svn_error_t *(*get_file)(svn_client_tree_t *tree,
> svn_stream_t **stream,
> apr_hash_t **props,
> const char *relpath,
> apr_pool_t *result_pool,
> apr_pool_t *scratch_pool);
>
> /* Fetch the entries and properties of the directory at @a relpath.
> svn_error_t *(*get_dir)(svn_client_tree_t *tree,
> apr_hash_t **dirents,
> apr_hash_t **props,
> const char *relpath,
> apr_pool_t *result_pool,
> apr_pool_t *scratch_pool);
>
> /* Push a sub-tree into an editor, as a delta against an empty tree.
> * This is useful for efficiency when streaming a (sub-)tree from a
> * remote source. */
> svn_error_t *(*push_as_delta_edit)(svn_client_tree_t *tree,
> const char *relpath,
> svn_delta_editor_t *editor,
> void *edit_baton,
> apr_pool_t *result_pool,
> apr_pool_t *scratch_pool)

Add a "describe this tree" member? e.g., it could return the
PATH_OR_URL_at_PEG being described.

> } svn_client_tree__vtable_t;
Received on 2011-10-07 17:30:46 CEST

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.