Main Page | Modules | Data Structures | File List | Data Fields | Globals

svn_client.h File Reference

Public interface for libsvn_client. More...

#include <apr_tables.h>
#include "svn_types.h"
#include "svn_wc.h"
#include "svn_string.h"
#include "svn_error.h"
#include "svn_opt.h"

Go to the source code of this file.

Data Structures

struct  svn_client_commit_info_t
 Information about commits passed back to client from this module. More...

struct  svn_client_commit_item_t
 The commit candidate structure. More...

struct  svn_client_ctx_t
 A client context structure, which holds client specific callbacks, batons, serves as a cache for configuration options, and other various and sundry things. More...

struct  svn_client_proplist_item_t
 This is a structure which stores a filename and a hash of property names and values. More...


Defines

#define SVN_CLIENT_COMMIT_ITEM_ADD   0x01
#define SVN_CLIENT_COMMIT_ITEM_DELETE   0x02
#define SVN_CLIENT_COMMIT_ITEM_TEXT_MODS   0x04
#define SVN_CLIENT_COMMIT_ITEM_PROP_MODS   0x08
#define SVN_CLIENT_COMMIT_ITEM_IS_COPY   0x10
#define SVN_CLIENT_AUTH_USERNAME   "username"
#define SVN_CLIENT_AUTH_PASSWORD   "password"

Typedefs

typedef svn_client_proplist_item_t svn_client_proplist_item_t
 This is a structure which stores a filename and a hash of property names and values.

typedef svn_client_commit_info_t svn_client_commit_info_t
 Information about commits passed back to client from this module.

typedef svn_client_commit_item_t svn_client_commit_item_t
 The commit candidate structure.

typedef svn_error_t *(* svn_client_get_commit_log_t )(const char **log_msg, const char **tmp_file, apr_array_header_t *commit_items, void *baton, apr_pool_t *pool)
 Callback type used by commit-y operations to get a commit log message from the caller.

typedef svn_error_t *(* svn_client_blame_receiver_t )(void *baton, apr_int64_t line_no, svn_revnum_t revision, const char *author, const char *date, const char *line, apr_pool_t *pool)
 Callback type used by svn_client_blame() to notify the caller that line line_no of the blamed file was last changed in revision by author on date, and that the contents were line.

typedef svn_client_ctx_t svn_client_ctx_t
 A client context structure, which holds client specific callbacks, batons, serves as a cache for configuration options, and other various and sundry things.


Functions

void svn_client_get_simple_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_simple_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_simple_t that gets information by prompting the user with prompt_func and prompt_baton.

void svn_client_get_username_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_username_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_username_t that gets information by prompting the user with prompt_func and prompt_baton.

void svn_client_get_simple_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_simple_t that gets/sets information from the user's ~/.subversion configuration directory.

void svn_client_get_username_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_username_t that gets/sets information from a user's ~/.subversion configuration directory.

void svn_client_get_ssl_server_trust_file_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_ssl_server_trust_t, allocated in pool.

void svn_client_get_ssl_client_cert_file_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_ssl_client_cert_t, allocated in pool.

void svn_client_get_ssl_client_cert_pw_file_provider (svn_auth_provider_object_t **provider, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t, allocated in pool.

void svn_client_get_ssl_server_trust_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_ssl_server_trust_prompt_func_t prompt_func, void *prompt_baton, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_ssl_server_trust_t, allocated in pool.

void svn_client_get_ssl_client_cert_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_ssl_client_cert_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_ssl_client_cert_t, allocated in pool.

void svn_client_get_ssl_client_cert_pw_prompt_provider (svn_auth_provider_object_t **provider, svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func, void *prompt_baton, int retry_limit, apr_pool_t *pool)
 Create and return *provider, an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t, allocated in pool.

svn_error_tsvn_client_create_context (svn_client_ctx_t **ctx, apr_pool_t *pool)
 Initialize a client context.

svn_error_tsvn_client_checkout (svn_revnum_t *result_rev, const char *URL, const char *path, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Checkout a working copy of URL at revision, using path as the root directory of the newly checked out working copy, and authenticating with the authentication baton cached in ctx.

svn_error_tsvn_client_update (svn_revnum_t *result_rev, const char *path, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Update working tree path to revision, authenticating with the authentication baton cached in ctx.

svn_error_tsvn_client_switch (svn_revnum_t *result_rev, const char *path, const char *url, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Switch working tree path to url at revision, authenticating with the authentication baton cached in ctx.

svn_error_tsvn_client_add (const char *path, svn_boolean_t recursive, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Schedule a working copy path for addition to the repository.

svn_error_tsvn_client_mkdir (svn_client_commit_info_t **commit_info, const apr_array_header_t *paths, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Create a directory, either in a repository or a working copy.

svn_error_tsvn_client_delete (svn_client_commit_info_t **commit_info, const apr_array_header_t *paths, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Delete items from a repository or working copy.

svn_error_tsvn_client_import (svn_client_commit_info_t **commit_info, const char *path, const char *url, svn_boolean_t nonrecursive, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Import file or directory path into repository directory url at head, authenticating with the authentication baton cached in ctx, and using ctx->log_msg_func/ctx->log_msg_baton to get a log message for the (implied) commit.

svn_error_tsvn_client_commit (svn_client_commit_info_t **commit_info, const apr_array_header_t *targets, svn_boolean_t nonrecursive, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Commit file or directory path into repository, authenticating with the authentication baton cached in ctx, and using ctx->log_msg_func/ctx->log_msg_baton to obtain the log message.

svn_error_tsvn_client_status (svn_revnum_t *result_rev, const char *path, svn_opt_revision_t *revision, svn_wc_status_func_t status_func, void *status_baton, svn_boolean_t descend, svn_boolean_t get_all, svn_boolean_t update, svn_boolean_t no_ignore, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Given path to a working copy directory (or single file), call status_func/status_baton with a set of svn_wc_status_t * structures which describe the status of path and its children.

svn_error_tsvn_client_log (const apr_array_header_t *targets, const svn_opt_revision_t *start, const svn_opt_revision_t *end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Invoke receiver with receiver_baton on each log message from start to end in turn, inclusive (but never invoke receiver on a given log message more than once).

svn_error_tsvn_client_blame (const char *path_or_url, const svn_opt_revision_t *start, const svn_opt_revision_t *end, svn_client_blame_receiver_t receiver, void *receiver_baton, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Invoke receiver with receiver_baton on each line-blame item associated with revision end of path_or_url, using start as the default source of all blame.

svn_error_tsvn_client_diff (const apr_array_header_t *diff_options, const char *path1, const svn_opt_revision_t *revision1, const char *path2, const svn_opt_revision_t *revision2, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t no_diff_deleted, apr_file_t *outfile, apr_file_t *errfile, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Produce diff output which describes the delta between path1/revision1 and path2/revision2.

svn_error_tsvn_client_merge (const char *source1, const svn_opt_revision_t *revision1, const char *source2, const svn_opt_revision_t *revision2, const char *target_wcpath, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t dry_run, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Merge changes from source1/revision1 to source2/revision2 into the working-copy path target_wcpath.

svn_error_tsvn_client_cleanup (const char *dir, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Recursively cleanup a working copy directory dir, finishing any incomplete operations, removing lockfiles, etc.

svn_error_tsvn_client_relocate (const char *dir, const char *from, const char *to, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Modify a working copy directory dir, changing any repository URLs that begin with from to begin with to instead, recursing into subdirectories if recurse is true.

svn_error_tsvn_client_revert (const apr_array_header_t *paths, svn_boolean_t recursive, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Restore the pristine version of a working copy paths, effectively undoing any local mods.

svn_error_tsvn_client_resolved (const char *path, svn_boolean_t recursive, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Remove the 'conflicted' state on a working copy path.

svn_error_tsvn_client_copy (svn_client_commit_info_t **commit_info, const char *src_path, const svn_opt_revision_t *src_revision, const char *dst_path, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Copy src_path to dst_path.

svn_error_tsvn_client_move (svn_client_commit_info_t **commit_info, const char *src_path, const svn_opt_revision_t *src_revision, const char *dst_path, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Move src_path to dst_path.

svn_error_tsvn_client_propset (const char *propname, const svn_string_t *propval, const char *target, svn_boolean_t recurse, apr_pool_t *pool)
 Set propname to propval on target.

svn_error_tsvn_client_revprop_set (const char *propname, const svn_string_t *propval, const char *URL, const svn_opt_revision_t *revision, svn_revnum_t *set_rev, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Set propname to propval on revision revision in the repository represented by URL.

svn_error_tsvn_client_propget (apr_hash_t **props, const char *propname, const char *target, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Set *props to a hash table whose keys are `char *' paths, prefixed by target (a working copy path or a URL), of items on which property propname is set, and whose values are `svn_string_t *' representing the property value for propname at that path.

svn_error_tsvn_client_revprop_get (const char *propname, svn_string_t **propval, const char *URL, const svn_opt_revision_t *revision, svn_revnum_t *set_rev, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Set *propval to the value of propname on revision revision in the repository represented by URL.

svn_error_tsvn_client_proplist (apr_array_header_t **props, const char *target, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Set *props to the regular properties of target, a URL or working copy path.

svn_error_tsvn_client_revprop_list (apr_hash_t **props, const char *URL, const svn_opt_revision_t *revision, svn_revnum_t *set_rev, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Set *props to a hash of the revision props attached to revision in the repository represented by URL.

svn_error_tsvn_client_export (svn_revnum_t *result_rev, const char *from, const char *to, svn_opt_revision_t *revision, svn_boolean_t force, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Export the contents of either a subversion repository or a subversion working copy into a 'clean' directory (meaning a directory with no administrative directories).

svn_error_tsvn_client_ls (apr_hash_t **dirents, const char *path_or_url, svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Set *dirents to a newly allocated hash of entries for path_or_url at revision.

svn_error_tsvn_client_cat (svn_stream_t *out, const char *path_or_url, const svn_opt_revision_t *revision, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Output the content of file identified by path_or_url and revision to the stream out.

svn_error_tsvn_client_url_from_path (const char **url, const char *path_or_url, apr_pool_t *pool)
 Set *url to the URL for path_or_url.

svn_error_tsvn_client_uuid_from_url (const char **uuid, const char *url, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Get repository uuid for url.

svn_error_tsvn_client_uuid_from_path (const char **uuid, const char *path, svn_wc_adm_access_t *adm_access, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Return the repository uuid for working-copy path, allocated in pool.


Detailed Description

Public interface for libsvn_client.

Definition in file svn_client.h.


Typedef Documentation

typedef svn_error_t*(* svn_client_blame_receiver_t)(void *baton, apr_int64_t line_no, svn_revnum_t revision, const char *author, const char *date, const char *line, apr_pool_t *pool)
 

Callback type used by svn_client_blame() to notify the caller that line line_no of the blamed file was last changed in revision by author on date, and that the contents were line.

All allocations should be performed in pool.

Definition at line 329 of file svn_client.h.

typedef struct svn_client_ctx_t svn_client_ctx_t
 

A client context structure, which holds client specific callbacks, batons, serves as a cache for configuration options, and other various and sundry things.

In order to avoid backwards compatability problems clients should use svn_client_create_context() to allocate and intialize this structure instead of doing so themselves.

typedef svn_error_t*(* svn_client_get_commit_log_t)(const char **log_msg, const char **tmp_file, apr_array_header_t *commit_items, void *baton, apr_pool_t *pool)
 

Callback type used by commit-y operations to get a commit log message from the caller.

Set *log_msg to the log message for the commit, allocated in pool, or NULL if wish to abort the commit process. Set *tmpfile to the path of any temporary file which might be holding that log message, or NULL if no such file exists (though, if *log_msg is NULL, this value is undefined). The log message MUST be a UTF8 string with LF line separators.

commit_items is an array of svn_client_commit_item_t structures, which may be fully or only partially filled-in, depending on the type of commit operation.

baton is provided along with the callback for use by the handler.

All allocations should be performed in pool.

Definition at line 315 of file svn_client.h.


Function Documentation

svn_error_t* svn_client_add const char *  path,
svn_boolean_t  recursive,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Schedule a working copy path for addition to the repository.

path's parent must be under revision control already, but path is not. If recursive is set, then assuming path is a directory, all of its contents will be scheduled for addition as well.

If ctx->notify_func is non-null, then for each added item, call ctx->notify_func with ctx->notify_baton and the path of the added item.

Important: this is a *scheduling* operation. No changes will happen to the repository until a commit occurs. This scheduling can be removed with svn_client_revert.

svn_error_t* svn_client_blame const char *  path_or_url,
const svn_opt_revision_t start,
const svn_opt_revision_t end,
svn_client_blame_receiver_t  receiver,
void *  receiver_baton,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Invoke receiver with receiver_baton on each line-blame item associated with revision end of path_or_url, using start as the default source of all blame.

If start->kind or end->kind is svn_opt_revision_unspecified, return the error SVN_ERR_CLIENT_BAD_REVISION. If any of the revisions of path_or_url have a binary mime-type, return the error SVN_ERR_UNSUPPORTED_FEATURE.

Use pool for any temporary allocation.

svn_error_t* svn_client_cat svn_stream_t out,
const char *  path_or_url,
const svn_opt_revision_t revision,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Output the content of file identified by path_or_url and revision to the stream out.

If path_or_url is not a local path, then if revision is of kind svn_opt_revision_previous (or some other kind that requires a local path), an error will be returned, because the desired revision cannot be determined.

Use the authentication baton cached in ctx to authenticate against the repository.

Perform all allocations from pool.

### TODO: Add an expansion/translation flag?

svn_error_t* svn_client_checkout svn_revnum_t result_rev,
const char *  URL,
const char *  path,
const svn_opt_revision_t revision,
svn_boolean_t  recurse,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Checkout a working copy of URL at revision, using path as the root directory of the newly checked out working copy, and authenticating with the authentication baton cached in ctx.

If result_rev is not NULL, set *result_rev to the value of the revision actually checked out from the repository.

revision must be of kind svn_opt_revision_number, svn_opt_revision_head, or svn_opt_revision_date. If revision does not meet these requirements, return the error SVN_ERR_CLIENT_BAD_REVISION.

If ctx->notify_func is non-null, invoke ctx->notify_func with ctx->notify_baton as the checkout progresses.

Use pool for any temporary allocation.

svn_error_t* svn_client_cleanup const char *  dir,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Recursively cleanup a working copy directory dir, finishing any incomplete operations, removing lockfiles, etc.

If ctx->cancel_func is non-null, invoke it with ctx->cancel_baton at various points during the operation. If it returns an error (typically SVN_ERR_CANCELLED), return that error immediately.

svn_error_t* svn_client_commit svn_client_commit_info_t **  commit_info,
const apr_array_header_t *  targets,
svn_boolean_t  nonrecursive,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Commit file or directory path into repository, authenticating with the authentication baton cached in ctx, and using ctx->log_msg_func/ctx->log_msg_baton to obtain the log message.

Set *commit_info to the results of the commit, allocated in pool.

targets is an array of const char * paths to commit. They need not be canonicalized nor condensed; this function will take care of that. If targets has zero elements, then do nothing and return immediately without error.

If notify_func is non-null, then call ctx->notify_func with ctx->notify_baton as the commit progresses, with any of the following actions: svn_wc_notify_commit_modified, svn_wc_notify_commit_added, svn_wc_notify_commit_deleted, svn_wc_notify_commit_replaced, svn_wc_notify_commit_postfix_txdelta.

Use nonrecursive to indicate that subdirectories of directory targets should be ignored.

Use pool for any temporary allocation.

If no error is returned and (*commit_info)->revision is set to SVN_INVALID_REVNUM, then the commit was a no-op; nothing needed to be committed.

svn_error_t* svn_client_copy svn_client_commit_info_t **  commit_info,
const char *  src_path,
const svn_opt_revision_t src_revision,
const char *  dst_path,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Copy src_path to dst_path.

src_path must be a file or directory under version control, or the URL of a versioned item in the repository. If src_path is a URL, src_revision is used to choose the revision from which to copy the src_path. dst_path must be a file or directory under version control, or a repository URL, existent or not.

If dst_path is a URL, use the authentication baton in ctx and ctx->log_msg_func/ctx->log_msg_baton to immediately attempt to commit the copy action in the repository. If the commit succeeds, allocate (in pool) and populate *commit_info.

If dst_path is not a URL, then this is just a variant of svn_client_add, where the dst_path items are scheduled for addition as copies. No changes will happen to the repository until a commit occurs. This scheduling can be removed with svn_client_revert.

ctx->log_msg_func/ctx->log_msg_baton are a callback/baton combo that this function can use to query for a commit log message when one is needed.

If ctx->notify_func is non-null, invoke it with ctx->notify_baton for each item added at the new location, passing the new, relative path of the added item.

svn_error_t* svn_client_create_context svn_client_ctx_t **  ctx,
apr_pool_t *  pool
 

Initialize a client context.

Return a client context in *ctx (allocated in pool) that represents a particular instance of the svn client.

In order to avoid backwards compatability problems, clients must use this function to intialize and allocate the svn_client_ctx_t structure rather than doing so themselves, as the size of this structure may change in the future.

svn_error_t* svn_client_delete svn_client_commit_info_t **  commit_info,
const apr_array_header_t *  paths,
svn_boolean_t  force,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Delete items from a repository or working copy.

If the paths in paths are URLs, use the authentication baton in ctx and ctx->log_msg_func/ctx->log_msg_baton to immediately attempt to commit a deletion of the URLs from the repository. If the commit succeeds, allocate (in pool) and populate *commit_info. Every path must belong to the same repository.

Else, schedule the working copy paths in paths for removal from the repository. Each path's parent must be under revision control. This is just a *scheduling* operation. No changes will happen to the repository until a commit occurs. This scheduling can be removed with svn_client_revert. If a path is a file it is immediately removed from the working copy. If the path is a directory it will remain in the working copy but all the files, and all unversioned items, it contains will be removed. If force is not set then this operation will fail if any path contains locally modified and/or unversioned items. If force is set such items will be deleted.

ctx->log_msg_func/ctx->log_msg_baton are a callback/baton combo that this function can use to query for a commit log message when one is needed.

If ctx->notify_func is non-null, then for each item deleted, call ctx->notify_func with ctx->notify_baton and the path of the deleted item.

svn_error_t* svn_client_diff const apr_array_header_t *  diff_options,
const char *  path1,
const svn_opt_revision_t revision1,
const char *  path2,
const svn_opt_revision_t revision2,
svn_boolean_t  recurse,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  no_diff_deleted,
apr_file_t *  outfile,
apr_file_t *  errfile,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Produce diff output which describes the delta between path1/revision1 and path2/revision2.

Print the output of the diff to outfile, and any errors to errfile. path1 and path2 can be either working-copy paths or URLs.

If either revision1 or revision2 has an `unspecified' or unrecognized `kind', return SVN_ERR_CLIENT_BAD_REVISION.

path1 and path2 must both represent the same node kind -- that is, if path1 is a directory, path2 must also be, and if path1 is a file, path2 must also be. (Currently, path1 and path2 must be the exact same path)

If recurse is true (and the paths are directories) this will be a recursive operation.

Use ignore_ancestry to control whether or not items being diffed will be checked for relatedness first. Unrelated items are typically transmitted to the editor as a deletion of one thing and the addition of another, but if this flag is TRUE, unrelated items will be diffed as if they were related.

If no_diff_deleted is true, then no diff output will be generated on deleted files.

diff_options (an array of const char *) is used to pass additional command line options to the diff processes invoked to compare files.

the authentication baton cached in ctx is used to communicate with the repository.

svn_error_t* svn_client_export svn_revnum_t result_rev,
const char *  from,
const char *  to,
svn_opt_revision_t revision,
svn_boolean_t  force,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Export the contents of either a subversion repository or a subversion working copy into a 'clean' directory (meaning a directory with no administrative directories).

If result_rev is not NULL and the path being exported is a repository URL, set *result_rev to the value of the revision actually exported (set it to SVN_INVALID_REVNUM for local exports).

from is either the path the working copy on disk, or a URL to the repository you wish to export.

to is the path to the directory where you wish to create the exported tree.

revision is the revision that should be exported, which is only used when exporting from a repository.

ctx->notify_func and ctx->notify_baton are the notification functions and baton which are passed to svn_client_checkout when exporting from a repository.

ctx is a context used for authentication in the repository case.

All allocations are done in pool.

void svn_client_get_simple_prompt_provider svn_auth_provider_object_t **  provider,
svn_auth_simple_prompt_func_t  prompt_func,
void *  prompt_baton,
int  retry_limit,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_simple_t that gets information by prompting the user with prompt_func and prompt_baton.

Allocate *provider in pool.

If either SVN_AUTH_PARAM_DEFAULT_USERNAME or SVN_AUTH_PARAM_DEFAULT_PASSWORD is defined as a runtime parameter in the auth_baton, then *provider will return the default argument(s) when svn_auth_first_credentials is called. If svn_auth_first_credentials fails, then *provider will re-prompt retry_limit times (via svn_auth_next_credentials).

void svn_client_get_simple_provider svn_auth_provider_object_t **  provider,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_simple_t that gets/sets information from the user's ~/.subversion configuration directory.

Allocate *provider in pool.

If a default username or password is available, *provider will honor them as well, and return them when svn_auth_first_credentials is called. (see SVN_AUTH_PARAM_DEFAULT_USERNAME and SVN_AUTH_PARAM_DEFAULT_PASSWORD).

void svn_client_get_ssl_client_cert_file_provider svn_auth_provider_object_t **  provider,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_ssl_client_cert_t, allocated in pool.

*provider retrieves its credentials from the configuration mechanism. The returned credential is used to load the appropriate client certificate for authentication when requested by a server.

void svn_client_get_ssl_client_cert_prompt_provider svn_auth_provider_object_t **  provider,
svn_auth_ssl_client_cert_prompt_func_t  prompt_func,
void *  prompt_baton,
int  retry_limit,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_ssl_client_cert_t, allocated in pool.

*provider retrieves its credentials by using the prompt_func and prompt_baton. The returned credential is used to load the appropriate client certificate for authentication when requested by a server. The prompt will be retried retry_limit times.

void svn_client_get_ssl_client_cert_pw_file_provider svn_auth_provider_object_t **  provider,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t, allocated in pool.

*provider retrieves its credentials from the configuration mechanism. The returned credential is used when a loaded client certificate is protected by a passphrase.

void svn_client_get_ssl_client_cert_pw_prompt_provider svn_auth_provider_object_t **  provider,
svn_auth_ssl_client_cert_pw_prompt_func_t  prompt_func,
void *  prompt_baton,
int  retry_limit,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_ssl_client_cert_pw_t, allocated in pool.

*provider retrieves its credentials by using the prompt_func and prompt_baton. The returned credential is used when a loaded client certificate is protected by a passphrase. The prompt will be retried retry_limit times.

void svn_client_get_ssl_server_trust_file_provider svn_auth_provider_object_t **  provider,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_ssl_server_trust_t, allocated in pool.

*provider retrieves its credentials from the configuration mechanism. The returned credential is used to override SSL security on an error.

void svn_client_get_ssl_server_trust_prompt_provider svn_auth_provider_object_t **  provider,
svn_auth_ssl_server_trust_prompt_func_t  prompt_func,
void *  prompt_baton,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_ssl_server_trust_t, allocated in pool.

*provider retrieves its credentials by using the prompt_func and prompt_baton. The returned credential is used to override SSL security on an error.

void svn_client_get_username_prompt_provider svn_auth_provider_object_t **  provider,
svn_auth_username_prompt_func_t  prompt_func,
void *  prompt_baton,
int  retry_limit,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_username_t that gets information by prompting the user with prompt_func and prompt_baton.

Allocate *provider in pool.

If SVN_AUTH_PARAM_DEFAULT_USERNAME is defined as a runtime parameter in the auth_baton, then *provider will return the default argument when svn_auth_first_credentials is called. If svn_auth_first_credentials fails, then *provider will re-prompt retry_limit times (via svn_auth_next_credentials).

void svn_client_get_username_provider svn_auth_provider_object_t **  provider,
apr_pool_t *  pool
 

Create and return *provider, an authentication provider of type svn_auth_cred_username_t that gets/sets information from a user's ~/.subversion configuration directory.

Allocate *provider in pool.

If a default username is available, *provider will honor it, and return it when svn_auth_first_credentials is called. (see SVN_AUTH_PARAM_DEFAULT_USERNAME).

svn_error_t* svn_client_import svn_client_commit_info_t **  commit_info,
const char *  path,
const char *  url,
svn_boolean_t  nonrecursive,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Import file or directory path into repository directory url at head, authenticating with the authentication baton cached in ctx, and using ctx->log_msg_func/ctx->log_msg_baton to get a log message for the (implied) commit.

Set *commit_info to the results of the commit, allocated in pool. If some components of url do not exist then create parent directories as necessary.

If path is a directory, the contents of that directory are imported directly into the directory identified by url. Note that the directory path itself is not imported -- that is, the basename of path is not part of the import.

If path is a file, then the dirname of url is the directory receiving the import. The basename of url is the filename in the repository. In this case if url already exists, return error.

If ctx->notify_func is non-null, then call ctx->notify_func with ctx->notify_baton as the import progresses, with any of the following actions: svn_wc_notify_commit_added, svn_wc_notify_commit_postfix_txdelta.

Use pool for any temporary allocation.

ctx->log_msg_func/ctx->log_msg_baton are a callback/baton combo that this function can use to query for a commit log message when one is needed.

Use nonrecursive to indicate that imported directories should not recurse into any subdirectories they may have.

### kff todo: This import is similar to cvs import, in that it does not change the source tree into a working copy. However, this behavior confuses most people, and I think eventually svn _should_ turn the tree into a working copy, or at least should offer the option. However, doing so is a bit involved, and we don't need it right now.

svn_error_t* svn_client_log const apr_array_header_t *  targets,
const svn_opt_revision_t start,
const svn_opt_revision_t end,
svn_boolean_t  discover_changed_paths,
svn_boolean_t  strict_node_history,
svn_log_message_receiver_t  receiver,
void *  receiver_baton,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Invoke receiver with receiver_baton on each log message from start to end in turn, inclusive (but never invoke receiver on a given log message more than once).

targets contains all the working copy paths (as const char *'s) for which log messages are desired. The repository info is determined by taking the common prefix of the target entries' URLs. receiver is invoked only on messages whose revisions involved a change to some path in targets.

### todo: the above paragraph is not fully implemented yet.

If discover_changed_paths is set, then the `changed_paths' argument to receiver will be passed on each invocation.

If strict_node_history is set, copy history (if any exists) will not be traversed while harvesting revision logs for each target.

If start->kind or end->kind is svn_opt_revision_unspecified, return the error SVN_ERR_CLIENT_BAD_REVISION.

Use pool for any temporary allocation.

Special case for repositories at revision 0:

If start->kind is svn_opt_revision_head, and end->kind is svn_opt_revision_number && end->number is 1, then handle an empty (no revisions) repository specially: instead of erroring because requested revision 1 when the highest revision is 0, just invoke receiver on revision 0, passing NULL for changed paths and empty strings for the author and date. This is because that particular combination of start and end usually indicates the common case of log invocation -- the user wants to see all log messages from youngest to oldest, where the oldest commit is revision 1. That works fine, except when there are no commits in the repository, hence this special case.

If ctx->notify_func is non-null, then call ctx->notify_func/baton with a 'skip' signal on any unversioned targets.

svn_error_t* svn_client_ls apr_hash_t **  dirents,
const char *  path_or_url,
svn_opt_revision_t revision,
svn_boolean_t  recurse,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Set *dirents to a newly allocated hash of entries for path_or_url at revision.

If path_or_url is a directory, return all dirents in the hash. If path_or_url is a file, return only the dirent for the file. If path_or_url is non-existent, return SVN_ERR_FS_NOT_FOUND.

The hash maps entrynames (const char *) to svn_dirent_t *'s. Do all allocation in pool.

Use authentication baton cached in ctx to authenticate against the repository.

If recurse is true (and path_or_url is a directory) this will be a recursive operation.

svn_error_t* svn_client_merge const char *  source1,
const svn_opt_revision_t revision1,
const char *  source2,
const svn_opt_revision_t revision2,
const char *  target_wcpath,
svn_boolean_t  recurse,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  force,
svn_boolean_t  dry_run,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Merge changes from source1/revision1 to source2/revision2 into the working-copy path target_wcpath.

source1 and source2 are either URLs that refer to entries in the repository, or paths to entries in the working copy.

By "merging", we mean: apply file differences using svn_wc_merge, and schedule additions & deletions when appropriate.

source1 and source2 must both represent the same node kind -- that is, if source1 is a directory, source2 must also be, and if source1 is a file, source2 must also be.

If either revision1 or revision2 has an `unspecified' or unrecognized `kind', return SVN_ERR_CLIENT_BAD_REVISION.

If recurse is true (and the URLs are directories), apply changes recursively; otherwise, only apply changes in the current directory.

Use ignore_ancestry to control whether or not items being diffed will be checked for relatedness first. Unrelated items are typically transmitted to the editor as a deletion of one thing and the addition of another, but if this flag is TRUE, unrelated items will be diffed as if they were related.

If force is not set and the merge involves deleting locally modified or unversioned items the operation will fail. If force is set such items will be deleted.

If ctx->notify_func is non-null, then call ctx->notify_func with ctx->notify_baton once for each merged target, passing the target's local path.

If dry_run is true the merge is carried out, and full notification feedback is provided, but the working copy is not modified.

the authentication baton cached in ctx is used to communicate with the repository.

svn_error_t* svn_client_mkdir svn_client_commit_info_t **  commit_info,
const apr_array_header_t *  paths,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Create a directory, either in a repository or a working copy.

If paths contains URLs, use the authentication baton in ctx and message to immediately attempt to commit the creation of the directories in paths in the repository. If the commit succeeds, allocate (in pool) and populate *commit_info.

Else, create the directories on disk, and attempt to schedule them for addition (using svn_client_add, whose docstring you should read).

ctx->log_msg_func/ctx->log_msg_baton are a callback/baton combo that this function can use to query for a commit log message when one is needed.

If ctx->notify_func is non-null, when the directory has been created (successfully) in the working copy, call ctx->notify_func with ctx->notify_baton and the path of the new directory. Note that this is only called for items added to the working copy.

svn_error_t* svn_client_move svn_client_commit_info_t **  commit_info,
const char *  src_path,
const svn_opt_revision_t src_revision,
const char *  dst_path,
svn_boolean_t  force,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Move src_path to dst_path.

src_path must be a file or directory under version control, or the URL of a versioned item in the repository.

If src_path is a repository URL:

  • dst_path must also be a repository URL (existent or not).

  • src_revision is used to choose the revision from which to copy the src_path.

  • the authentication baton in ctx and ctx->log_msg_func/ctx->log_msg_baton are used to commit the move.

  • The move operation will be immediately committed. If the commit succeeds, allocate (in pool) and populate *commit_info.

If src_path is a working copy path

  • dst_path must also be a working copy path (existent or not).

  • src_revision, and ctx->log_msg_func/ctx->log_msg_baton are ignored.

  • This is a scheduling operation. No changes will happen to the repository until a commit occurs. This scheduling can be removed with svn_client_revert. If src_path is a file it is removed from the working copy immediately. If src_path is a directory it will remain n the working copy but all the files, and unversioned items, it contains will be removed.

  • If src_path contains locally modified and/or unversioned items and force is not set, the copy will fail. If force is set such items will be removed.

ctx->log_msg_func/ctx->log_msg_baton are a callback/baton combo that this function can use to query for a commit log message when one is needed.

If ctx->notify_func is non-null, then for each item moved, call ctx->notify_func with the ctx->notify_baton twice, once to indicate the deletion of the moved thing, and once to indicate the addition of the new location of the thing.

### Is this really true? What about svn_wc_notify_commit_replaced? ###

svn_error_t* svn_client_relocate const char *  dir,
const char *  from,
const char *  to,
svn_boolean_t  recurse,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Modify a working copy directory dir, changing any repository URLs that begin with from to begin with to instead, recursing into subdirectories if recurse is true.

Parameters:
dir Working copy directory
from Original URL
to New URL
recurse Whether to recurse
pool The pool from which to perform memory allocations

svn_error_t* svn_client_resolved const char *  path,
svn_boolean_t  recursive,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Remove the 'conflicted' state on a working copy path.

This will not semantically resolve conflicts; it just allows path to be committed in the future. The implementation details are opaque. If recursive is set, recurse below path, looking for conflicts to resolve.

If path is not in a state of conflict to begin with, do nothing. If path's conflict state is removed and ctx->notify_func is non-null, call ctx->notify_func with ctx->notify_baton and path.

svn_error_t* svn_client_revert const apr_array_header_t *  paths,
svn_boolean_t  recursive,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Restore the pristine version of a working copy paths, effectively undoing any local mods.

For each path in paths, if it is a directory, and recursive is true, this will be a recursive operation.

If ctx->notify_func is non-null, then for each item reverted, call ctx->notify_func with ctx->notify_baton and the path of the reverted item.

svn_error_t* svn_client_status svn_revnum_t result_rev,
const char *  path,
svn_opt_revision_t revision,
svn_wc_status_func_t  status_func,
void *  status_baton,
svn_boolean_t  descend,
svn_boolean_t  get_all,
svn_boolean_t  update,
svn_boolean_t  no_ignore,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Given path to a working copy directory (or single file), call status_func/status_baton with a set of svn_wc_status_t * structures which describe the status of path and its children.

  • If descend is non-zero, recurse fully, else do only immediate children.

  • If get_all is set, retrieve all entries; otherwise, retrieve only "interesting" entries (local mods and/or out-of-date).

  • If update is set, contact the repository and augment the status structures with information about out-of-dateness (with respect to revision). Also, if result_rev is not NULL, set *result_rev to the actual revision against which the working copy was compared (*result_rev is not meaningful unless update is set).

This function recurses into externals definitions ('svn:externals') after handling the main target, if any exist. The function calls the client notification function (in ctx) with the svn_wc_notify_status_external action before handling each externals definition, and with svn_wc_notify_status_completed after each.

svn_error_t* svn_client_switch svn_revnum_t result_rev,
const char *  path,
const char *  url,
const svn_opt_revision_t revision,
svn_boolean_t  recurse,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Switch working tree path to url at revision, authenticating with the authentication baton cached in ctx.

If result_rev is not NULL, set *result_rev to the value of the revision to which the working copy was actually switched.

Summary of purpose: this is normally used to switch a working directory over to another line of development, such as a branch or a tag. Switching an existing working directory is more efficient than checking out url from scratch.

revision must be of kind svn_opt_revision_number, svn_opt_revision_head, or svn_opt_revision_date; otherwise, return SVN_ERR_CLIENT_BAD_REVISION.

If ctx->notify_func is non-null, invoke it with ctx->notify_baton on paths affected by the switch. Also invoke it for files may be restored from the text-base because they were removed from the working copy.

Use pool for any temporary allocation.

svn_error_t* svn_client_update svn_revnum_t result_rev,
const char *  path,
const svn_opt_revision_t revision,
svn_boolean_t  recurse,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Update working tree path to revision, authenticating with the authentication baton cached in ctx.

If result_rev is not NULL, set *result_rev to the value of the revision to which the working copy was actually updated.

revision must be of kind svn_opt_revision_number, svn_opt_revision_head, or svn_opt_revision_date. If revision does not meet these requirements, return the error SVN_ERR_CLIENT_BAD_REVISION.

If ctx->notify_func is non-null, invoke ctx->notify_func with ctx->notify_baton for each item handled by the update, and also for files restored from text-base.

If path is not found, return the error SVN_ERR_ENTRY_NOT_FOUND.

Use pool for any temporary allocation.

svn_error_t* svn_client_url_from_path const char **  url,
const char *  path_or_url,
apr_pool_t *  pool
 

Set *url to the URL for path_or_url.

If path_or_url is already a URL, set *url to path_or_url.

If path_or_url is a versioned item, set *url to path_or_url's entry URL. If path_or_url is unversioned (has no entry), set *url to null.

svn_error_t* svn_client_uuid_from_path const char **  uuid,
const char *  path,
svn_wc_adm_access_t adm_access,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Return the repository uuid for working-copy path, allocated in pool.

Use adm_access to retrieve the uuid from path's entry; if not present in the entry, then call svn_client_uuid_from_url() to retrieve, using the entry's URL. ctx is required for possible repository authentication.

NOTE: the only reason this function falls back on svn_client_uuid_from_url is for compatibility purposes. Old working copies may not have uuids in the entries file.

svn_error_t* svn_client_uuid_from_url const char **  uuid,
const char *  url,
svn_client_ctx_t ctx,
apr_pool_t *  pool
 

Get repository uuid for url.

Use a pool to open a temporary RA session to url, discover the repository uuid, and free the session. Return the uuid in uuid, allocated in pool. ctx is required for possible repository authentication.


Generated on Wed Oct 13 23:55:35 2004 for Subversion by doxygen 1.3.4