📄 svn_client.h
字号:
* @a ctx->log_msg_func/@a 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 @a ctx->notify_func is non-null, then for each item moved, call
* @a ctx->notify_func with the @a 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 @c svn_wc_notify_commit_replaced? ###
*/
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);
/** Properties
*
* Note that certain svn-controlled properties must always have their
* values set and stored in UTF8 with LF line endings. When
* retrieving these properties, callers must convert the values back
* to native locale and native line-endings before displaying them to
* the user. For help with this task, see
* @c svn_prop_needs_translation, @c svn_subst_translate_string, and @c
* svn_subst_detranslate_string.
*
* @defgroup svn_client_prop_funcs property functions
* @{
*/
/** Set @a propname to @a propval on @a target. If @a recurse is true,
* then @a propname will be set on recursively on @a target and all
* children. If @a recurse is false, and @a target is a directory, @a
* propname will be set on _only_ @a target.
*
* A @a propval of @c NULL will delete the property.
*
* If @a propname is an svn-controlled property (i.e. prefixed with
* @c SVN_PROP_PREFIX), then the caller is responsible for ensuring that
* the value is UTF8-encoded and uses LF line-endings.
*
* Use @a pool for all memory allocation.
*/
svn_error_t *
svn_client_propset (const char *propname,
const svn_string_t *propval,
const char *target,
svn_boolean_t recurse,
apr_pool_t *pool);
/** Set @a propname to @a propval on revision @a revision in the repository
* represented by @a URL. Use the authentication baton in @a ctx for
* authentication, and @a pool for all memory allocation. Return the actual
* rev affected in @a *set_rev. A @a propval of @c NULL will delete the
* property.
*
* If @a force is true, allow newlines in the author property.
*
* If @a propname is an svn-controlled property (i.e. prefixed with
* @c SVN_PROP_PREFIX), then the caller is responsible for ensuring that
* the value UTF8-encoded and uses LF line-endings.
*
* Note that unlike its cousin @c svn_client_propset, this routine
* doesn't affect the working copy at all; it's a pure network
* operation that changes an *unversioned* property attached to a
* revision. This can be used to tweak log messages, dates, authors,
* and the like. Be careful: it's a lossy operation.
*
* Also note that unless the administrator creates a
* pre-revprop-change hook in the repository, this feature will fail.
*/
svn_error_t *
svn_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 @a *props to a hash table whose keys are `<tt>char *</tt>' paths,
* prefixed by @a target (a working copy path or a URL), of items on
* which property @a propname is set, and whose values are `@c svn_string_t
* *' representing the property value for @a propname at that path.
*
* Allocate @a *props, its keys, and its values in @a pool.
*
* Don't store any path, not even @a target, if it does not have a
* property named @a propname.
*
* If @a revision->kind is @c svn_opt_revision_unspecified, then: get
* properties from the working copy if @a target is a working copy path,
* or from the repository head if @a target is a URL. Else get the
* properties as of @a revision. Use the authentication baton in @a ctx
* for authentication if contacting the repository.
*
* If @a target is a file or @a recurse is false, @a *props will have
* at most one element.
*
* If error, don't touch @a *props, otherwise @a *props is a hash table
* even if empty.
*/
svn_error_t *
svn_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 @a *propval to the value of @a propname on revision @a revision
* in the repository represented by @a URL. Use the authentication baton
* in @a ctx for authentication, and @a pool for all memory allocation.
* Return the actual rev queried in @a *set_rev.
*
* Note that unlike its cousin @c svn_client_propget, this routine
* doesn't affect the working copy at all; it's a pure network
* operation that queries an *unversioned* property attached to a
* revision. This can query log messages, dates, authors, and the
* like.
*/
svn_error_t *
svn_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 @a *props to the regular properties of @a target, a URL or working
* copy path.
*
* Each element of the returned array is (@c svn_client_proplist_item_t *).
* For each item, item->node_name contains the name relative to the
* same base as @a target, and @a item->prop_hash maps (<tt>const char *</tt>)
* property names to (@c svn_string_t *) values.
*
* Allocate @a *props and its contents in @a pool.
*
* If @a revision->kind is @c svn_opt_revision_unspecified, then get
* properties from the working copy, if @a target is a working copy path,
* or from the repository head if @a target is a URL. Else get the
* properties as of @a revision. Use the authentication baton cached in @a ctx
* for authentication if contacting the repository.
*
* If @a recurse is false, or @a target is a file, @a *props will contain
* only a single element. Otherwise, it will contain one element for each
* versioned entry below (and including) @a target.
*
* If @a target is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND.
*/
svn_error_t *
svn_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 @a *props to a hash of the revision props attached to @a revision in
* the repository represented by @a URL. Use the authentication baton cached
* in @a ctx for authentication, and @a pool for all memory allocation.
* Return the actual rev queried in @a *set_rev.
*
* The allocated hash maps (<tt>const char *</tt>) property names to
* (@c svn_string_t *) property values.
*
* Note that unlike its cousin @c svn_client_proplist, this routine
* doesn't read a working copy at all; it's a pure network operation
* that reads *unversioned* properties attached to a revision.
*/
svn_error_t *
svn_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);
/** @} */
/**
* @since New in 1.1.
*
* 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 @a result_rev
* is not @c NULL and the path being exported is a repository URL, set
* @a *result_rev to the value of the revision actually exported (set
* it to @c SVN_INVALID_REVNUM for local exports).
*
* @a from is either the path the working copy on disk, or a URL to the
* repository you wish to export.
*
* @a to is the path to the directory where you wish to create the exported
* tree.
*
* @a revision is the revision that should be exported, which is only used
* when exporting from a repository.
*
* @a ctx->notify_func and @a ctx->notify_baton are the notification functions
* and baton which are passed to @c svn_client_checkout when exporting from a
* repository.
*
* @a ctx is a context used for authentication in the repository case.
*
* @a force if true will cause the export to overwrite files or directories.
*
* @a native_eol allows you to override the standard eol marker on the platform
* you are running on. Can be either "LF", "CR" or "CRLF" or NULL. If NULL
* will use the standard eol marker. Any other value will cause the
* SVN_ERR_IO_UNKNOWN_EOL error to be returned.
*
* All allocations are done in @a pool.
*/
svn_error_t *
svn_client_export2 (svn_revnum_t *result_rev,
const char *from,
const char *to,
svn_opt_revision_t *revision,
svn_boolean_t force,
const char *native_eol,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
/**
* @deprecated Provided for backward compatibility with the 1.0.0 API.
*
* Similar to svn_client_export2(), but with the @a native_eol parameter
* always set to @c NULL.
*/
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);
/** Set @a *dirents to a newly allocated hash of entries for @a path_or_url
* at @a revision.
*
* If @a path_or_url is a directory, return all dirents in the hash. If
* @a path_or_url is a file, return only the dirent for the file. If @a
* path_or_url is non-existent, return @c SVN_ERR_FS_NOT_FOUND.
*
* The hash maps entrynames (<tt>const char *</tt>) to @c svn_dirent_t *'s.
* Do all allocation in @a pool.
*
* Use authentication baton cached in @a ctx to authenticate against the
* repository.
*
* If @a recurse is true (and @a path_or_url is a directory) this will
* be a recursive operation.
*/
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);
/** Output the content of file identified by @a path_or_url and @a
* revision to the stream @a out.
*
* If @a path_or_url is not a local path, then if @a revision is of
* kind @c 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 @a ctx to authenticate against the
* repository.
*
* Perform all allocations from @a pool.
*
* ### TODO: Add an expansion/translation flag?
*/
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);
/* Converting paths to URLs. */
/** Set @a *url to the URL for @a path_or_url.
*
* If @a path_or_url is already a URL, set @a *url to @a path_or_url.
*
* If @a path_or_url is a versioned item, set @a *url to @a
* path_or_url's entry URL. If @a path_or_url is unversioned (has
* no entry), set @a *url to null.
*/
svn_error_t *
svn_client_url_from_path (const char **url,
const char *path_or_url,
apr_pool_t *pool);
/* Fetching repository UUIDs. */
/** Get repository @a uuid for @a url.
*
* Use a @a pool to open a temporary RA session to @a url, discover the
* repository uuid, and free the session. Return the uuid in @a uuid,
* allocated in @a pool. @a ctx is required for possible repository
* authentication.
*/
svn_error_t *
svn_client_uuid_from_url (const char **uuid,
const char *url,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
/** Return the repository @a uuid for working-copy @a path, allocated
* in @a pool. Use @a adm_access to retrieve the uuid from @a path's
* entry; if not present in the entry, then call
* svn_client_uuid_from_url() to retrieve, using the entry's URL. @a
* ctx is required for possible repository authentication.
*
* NOTE: the only reason this function falls back on
* @c 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_path (const char **uuid,
const char *path,
svn_wc_adm_access_t *adm_access,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SVN_CLIENT_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -