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.
typedef void(*) svn_wc_notify_func2_t(void *baton, const svn_wc_notify_t *notify, apr_pool_t *pool) |
Notify the world that notify->action has happened to notify->path.
Recommendation: callers of svn_wc_notify_func2_t
should avoid invoking it multiple times on the same 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 svn_delta_editor_t's
close_file(), for example), passing the appropriate notify->content_state and notify->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) |
Similar to svn_wc_notify_func2_t
, but takes the information as arguments instead of struct fields.
The type of action occurring.
What happened to a lock during an operation.
The type of notification that is occurring.
svn_wc_notify_t* svn_wc_create_notify | ( | const char * | path, | |
svn_wc_notify_action_t | action, | |||
apr_pool_t * | pool | |||
) |
Allocate an svn_wc_notify_t
structure in pool, initialize and return it.
Set the path
field of the created struct to path, and action
to action. Set all other fields to their _unknown
, NULL
or invalid value, respectively.
svn_wc_notify_t* svn_wc_dup_notify | ( | const svn_wc_notify_t * | notify, | |
apr_pool_t * | pool | |||
) |
Return a deep copy of notify, allocated in pool.