📄 svn_wc.h
字号:
/** What revision to check out. The only valid kinds for this are
svn_opt_revision_number, svn_opt_revision_date, and
svn_opt_revision_head. */
svn_opt_revision_t revision;
} svn_wc_external_item_t;
/**
* @since New in 1.1.
*
* If @a externals_p is non-null, set @a *externals_p to an array of
* @a svn_wc_external_item_t * objects based on @a desc.
*
* If the format of @a desc is invalid, don't touch @a *externals_p and
* return @c SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION. Thus, if
* you just want to check the validity of an externals description,
* and don't care about the parsed result, pass null for @a externals_p.
*
* The format of @a desc is the same as for values of the directory
* property @c SVN_PROP_EXTERNALS, which see.
*
* Allocate the table, keys, and values in @a pool.
*
* Use @a parent_directory only in constructing error strings.
*/
svn_error_t *
svn_wc_parse_externals_description2 (apr_array_header_t **externals_p,
const char *parent_directory,
const char *desc,
apr_pool_t *pool);
/**
* @deprecated Provided for backward compatability with the 1.0.0 API.
*
* Similar to svn_wc_parse_externals_description2, but returns the
* parsed externals in a hash instead of an array. This function
* should not be used, as storing the externals in a hash causes their
* order of evaluation to be not easily identifiable.
*/
svn_error_t *
svn_wc_parse_externals_description (apr_hash_t **externals_p,
const char *parent_directory,
const char *desc,
apr_pool_t *pool);
/* Notification/callback handling. */
/**
* @defgroup svn_wc_notifications notification callback handling
* @{
*
* In many cases, the WC library will scan a working copy and make
* changes. The caller usually wants to know when each of these changes
* has been made, so that it can display some kind of notification to
* the user.
*
* These notifications have a standard callback function type, which
* takes the path of the file that was affected, and a caller-
* supplied baton.
*
* Note that the callback is a 'void' return -- this is a simple
* reporting mechanism, rather than an opportunity for the caller to
* alter the operation of the WC library.
*
* Note also that some of the actions are used across several
* different Subversion commands. For example, the update actions are
* also used for checkouts, switches, and merges.
*/
/** The type of action occurring. */
typedef enum svn_wc_notify_action_t
{
/** Adding a path to revision control. */
svn_wc_notify_add = 0,
/** Copying a versioned path. */
svn_wc_notify_copy,
/** Deleting a versioned path. */
svn_wc_notify_delete,
/** Restoring a missing path from the pristine text-base. */
svn_wc_notify_restore,
/** Reverting a modified path. */
svn_wc_notify_revert,
/** A revert operation has failed. */
svn_wc_notify_failed_revert,
/** Resolving a conflict. */
svn_wc_notify_resolved,
/** Skipping a path. */
svn_wc_notify_skip,
/** Got a delete in an update. */
svn_wc_notify_update_delete,
/** Got an add in an update. */
svn_wc_notify_update_add,
/** Got any other action in an update. */
svn_wc_notify_update_update,
/** The last notification in an update (including updates of externals). */
svn_wc_notify_update_completed,
/** Updating an external module. */
svn_wc_notify_update_external,
/** The last notification in a status (including status on externals). */
svn_wc_notify_status_completed,
/** Running status on an external module. */
svn_wc_notify_status_external,
/** Committing a modification. */
svn_wc_notify_commit_modified,
/** Committing an addition. */
svn_wc_notify_commit_added,
/** Committing a deletion. */
svn_wc_notify_commit_deleted,
/** Committing a replacement. */
svn_wc_notify_commit_replaced,
/** Transmitting post-fix text-delta data for a file. */
svn_wc_notify_commit_postfix_txdelta,
/** Processed a single revision's blame. */
svn_wc_notify_blame_revision
} svn_wc_notify_action_t;
/** The type of notification that is occurring. */
typedef enum svn_wc_notify_state_t
{
svn_wc_notify_state_inapplicable = 0,
/** Notifier doesn't know or isn't saying. */
svn_wc_notify_state_unknown,
/** The state did not change. */
svn_wc_notify_state_unchanged,
/** The item wasn't present. */
svn_wc_notify_state_missing,
/** An unversioned item obstructed work. */
svn_wc_notify_state_obstructed,
/** Pristine state was modified. */
svn_wc_notify_state_changed,
/** Modified state had mods merged in. */
svn_wc_notify_state_merged,
/** Modified state got conflicting mods. */
svn_wc_notify_state_conflicted
} svn_wc_notify_state_t;
/** Notify the world that @a action has happened to @a path. @a path is
* either absolute or relative to cwd (i.e., not relative to an anchor).
*
* @a kind, @a content_state and @a prop_state are from after @a action,
* not before.
*
* If @a mime_type is non-null, it indicates the mime-type of @a path. It
* is always @c NULL for directories.
*
* @a revision is @c SVN_INVALID_REVNUM, except when @a action is
* @c svn_wc_notify_update_completed, in which case @a revision is
* the target revision of the update if available, else it is still
* @c SVN_INVALID_REVNUM.
*
* Note that if @a action is @c svn_wc_notify_update, then @a path has
* already been installed, so it is legitimate for an implementation of
* @c svn_wc_notify_func_t to examine @a path in the working copy.
*
* ### Design Notes:
*
* The purpose of the @a kind, @a mime_type, @a content_state, and
* @a prop_state fields is to provide "for free" information that this
* function is likely to want, and which it would otherwise be forced
* to deduce via expensive operations such as reading entries and
* properties. However, if the caller does not have this information,
* it will simply pass the corresponding `*_unknown' values, and it is
* up to the implementation how to handle that (i.e., whether or not to
* attempt deduction, or just to punt and give a less informative
* notification).
*
* Recommendation: callers of @c svn_wc_notify_func_t should avoid
* invoking it multiple times on the same @a path within a given
* operation, and implementations should not bother checking for such
* duplicate calls. For example, in an update, the caller should not
* invoke the notify func on receiving a prop change and then again
* on receiving a text change. Instead, wait until all changes have
* been received, and then invoke the notify func once (from within
* an @c svn_delta_editor_t's @c close_file(), for example), passing
* the appropriate @a content_state and @a prop_state flags.
*/
typedef void (*svn_wc_notify_func_t) (void *baton,
const char *path,
svn_wc_notify_action_t action,
svn_node_kind_t kind,
const char *mime_type,
svn_wc_notify_state_t content_state,
svn_wc_notify_state_t prop_state,
svn_revnum_t revision);
/** @} */
/** A callback vtable invoked by our diff-editors, as they receive
* diffs from the server. 'svn diff' and 'svn merge' both implement
* their own versions of this table.
*/
typedef struct svn_wc_diff_callbacks_t
{
/** A file @a path has changed. The changes can be seen by comparing
* @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of
* the file, respectively.
*
* If known, the @c svn:mime-type value of each file is passed into
* @a mimetype1 and @a mimetype2; either or both of the values can
* be NULL. The implementor can use this information to decide if
* (or how) to generate differences.
*
* @a adm_access will be an access baton for the directory containing
* @a path, or @c NULL if the diff editor is not using access batons.
*
* If @a state is non-null, set @a *state to the state of the file
* contents after the operation has been performed. (In practice,
* this is only useful with merge, not diff; diff callbacks will
* probably set @a *state to @c svn_wc_notify_state_unknown, since
* they do not change the state and therefore do not bother to know
* the state after the operation.)
*/
svn_error_t *(*file_changed) (svn_wc_adm_access_t *adm_access,
svn_wc_notify_state_t *state,
const char *path,
const char *tmpfile1,
const char *tmpfile2,
svn_revnum_t rev1,
svn_revnum_t rev2,
const char *mimetype1,
const char *mimetype2,
void *diff_baton);
/** A file @a path was added. The contents can be seen by comparing
* @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2
* of the file, respectively. (If either file is empty, the rev
* will be 0.)
*
* If known, the @c svn:mime-type value of each file is passed into
* @a mimetype1 and @a mimetype2; either or both of the values can
* be NULL. The implementor can use this information to decide if
* (or how) to generate differences.
*
* @a adm_access will be an access baton for the directory containing
* @a path, or @c NULL if the diff editor is not using access batons.
*
* If @a state is non-null, set @a *state to the state of the file
* contents after the operation has been performed. (In practice,
* this is only useful with merge, not diff; diff callbacks will
* probably set @a *state to @c svn_wc_notify_state_unknown, since
* they do not change the state and therefore do not bother to know
* the state after the operation.)
*
*/
svn_error_t *(*file_added) (svn_wc_adm_access_t *adm_access,
svn_wc_notify_state_t *state,
const char *path,
const char *tmpfile1,
const char *tmpfile2,
svn_revnum_t rev1,
svn_revnum_t rev2,
const char *mimetype1,
const char *mimetype2,
void *diff_baton);
/** A file @a path was deleted. The [loss of] contents can be seen by
* comparing @a tmpfile1 and @a tmpfile2.
*
* If known, the @c svn:mime-type value of each file is passed into
* @a mimetype1 and @a mimetype2; either or both of the values can
* be NULL. The implementor can use this information to decide if
* (or how) to generate differences.
*
* @a adm_access will be an access baton for the directory containing
* @a path, or @c NULL if the diff editor is not using access batons.
*
* If @a state is non-null, set @a *state to the state of the item
* after the delete operation has been performed. (In practice,
* this is only useful with merge, not diff; diff callbacks will
* probably set @a *state to @c svn_wc_notify_state_unknown, since
* they do not change the state and therefore do not bother to know
* the state after the operation.)
*/
svn_error_t *(*file_deleted) (svn_wc_adm_access_t *adm_access,
svn_wc_notify_state_t *state,
const char *path,
const char *tmpfile1,
const char *tmpfile2,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -