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

notification callback handling


Data Structures

struct  svn_wc_notify_t
 
Since:
New in 1.2.
More...

Typedefs

typedef enum svn_wc_notify_action_t svn_wc_notify_action_t
 The type of action occurring.
typedef enum svn_wc_notify_state_t svn_wc_notify_state_t
 The type of notification that is occurring.
typedef enum svn_wc_notify_lock_state_t svn_wc_notify_lock_state_t
 
Since:
New in 1.2.

typedef svn_wc_notify_t svn_wc_notify_t
 
Since:
New in 1.2.

typedef void(* svn_wc_notify_func2_t )(void *baton, const svn_wc_notify_t *notify, apr_pool_t *pool)
 
Since:
New in 1.2.

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)

Enumerations

enum  svn_wc_notify_action_t {
  svn_wc_notify_add = 0,
  svn_wc_notify_copy,
  svn_wc_notify_delete,
  svn_wc_notify_restore,
  svn_wc_notify_revert,
  svn_wc_notify_failed_revert,
  svn_wc_notify_resolved,
  svn_wc_notify_skip,
  svn_wc_notify_update_delete,
  svn_wc_notify_update_add,
  svn_wc_notify_update_update,
  svn_wc_notify_update_completed,
  svn_wc_notify_update_external,
  svn_wc_notify_status_completed,
  svn_wc_notify_status_external,
  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,
  svn_wc_notify_blame_revision,
  svn_wc_notify_locked,
  svn_wc_notify_unlocked,
  svn_wc_notify_failed_lock,
  svn_wc_notify_failed_unlock
}
 The type of action occurring. More...
enum  svn_wc_notify_state_t {
  svn_wc_notify_state_inapplicable = 0,
  svn_wc_notify_state_unknown,
  svn_wc_notify_state_unchanged,
  svn_wc_notify_state_missing,
  svn_wc_notify_state_obstructed,
  svn_wc_notify_state_changed,
  svn_wc_notify_state_merged,
  svn_wc_notify_state_conflicted
}
 The type of notification that is occurring. More...
enum  svn_wc_notify_lock_state_t {
  svn_wc_notify_lock_state_inapplicable = 0,
  svn_wc_notify_lock_state_unknown,
  svn_wc_notify_lock_state_unchanged,
  svn_wc_notify_lock_state_locked,
  svn_wc_notify_lock_state_unlocked
}
 
Since:
New in 1.2.
More...

Functions

svn_wc_notify_tsvn_wc_create_notify (const char *path, svn_wc_notify_action_t action, apr_pool_t *pool)
 
Since:
New in 1.2.

svn_wc_notify_tsvn_wc_dup_notify (const svn_wc_notify_t *notify, apr_pool_t *pool)
 
Since:
New in 1.2.


Detailed Description

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.


Typedef Documentation

typedef void(* svn_wc_notify_func2_t)(void *baton, const svn_wc_notify_t *notify, apr_pool_t *pool)
 

Since:
New in 1.2.

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.

Definition at line 688 of file svn_wc.h.

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)
 

Deprecated:
Provided for backward compatibility with the 1.1 API.
Similar to svn_wc_notify_func2_t, but takes the information as arguments instead of struct fields.

Definition at line 696 of file svn_wc.h.

typedef enum svn_wc_notify_lock_state_t svn_wc_notify_lock_state_t
 

Since:
New in 1.2.

What happened to a lock during an operation.

typedef struct svn_wc_notify_t svn_wc_notify_t
 

Since:
New in 1.2.

Structure used in the svn_wc_notify_func2_t function.

path is either absolute or relative to the current working directory (i.e., not relative to an anchor). action describes what happened to path.

kind, content_state, prop_state and lock_state are from after action, not before. lock_state reflects the addition or removal of a lock token in the working copy.

If mime_type is non-null, it indicates the mime-type of path. It is always NULL for directories.

If action is svn_wc_notify_update_completed, revision is the target revision of the update, or SVN_INVALID_REVNUM if not available. If action is svn_wc_notify_blame_revision, revision is the processed revision. In all other cases, revision is SVN_INVALID_REVNUM.

For an action of svn_wc_notify_locked, lock is the lock structure received from the repository. For other actions, it is NULL.

err is NULL, except when action is svn_wc_notify_failed_lock or svn_wc_notify_failed_unlock, in which case it points to an error describing the reason for the failure.

Note that if action is svn_wc_notify_update, then path has already been installed, so it is legitimate for an implementation of svn_wc_notify_func2_t to examine path in the working copy.

Note:
The purpose of the kind, mime_type, content_state, and prop_state fields is to provide "for free" information that an implementation 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 to attempt deduction, or just to punt and give a less informative notification).

Callers of notification functions should use svn_wc_create_notify to create structures of this type to allow for extensibility.


Enumeration Type Documentation

enum svn_wc_notify_action_t
 

The type of action occurring.

Enumeration values:
svn_wc_notify_add  Adding a path to revision control.
svn_wc_notify_copy  Copying a versioned path.
svn_wc_notify_delete  Deleting a versioned path.
svn_wc_notify_restore  Restoring a missing path from the pristine text-base.
svn_wc_notify_revert  Reverting a modified path.
svn_wc_notify_failed_revert  A revert operation has failed.
svn_wc_notify_resolved  Resolving a conflict.
svn_wc_notify_skip  Skipping a path.
svn_wc_notify_update_delete  Got a delete in an update.
svn_wc_notify_update_add  Got an add in an update.
svn_wc_notify_update_update  Got any other action in an update.
svn_wc_notify_update_completed  The last notification in an update (including updates of externals).
svn_wc_notify_update_external  Updating an external module.
svn_wc_notify_status_completed  The last notification in a status (including status on externals).
svn_wc_notify_status_external  Running status on an external module.
svn_wc_notify_commit_modified  Committing a modification.
svn_wc_notify_commit_added  Committing an addition.
svn_wc_notify_commit_deleted  Committing a deletion.
svn_wc_notify_commit_replaced  Committing a replacement.
svn_wc_notify_commit_postfix_txdelta  Transmitting post-fix text-delta data for a file.
svn_wc_notify_blame_revision  Processed a single revision's blame.
svn_wc_notify_locked 
Since:
New in 1.2.

Locking a path.

svn_wc_notify_unlocked 
Since:
New in 1.2.

Unlocking a path.

svn_wc_notify_failed_lock 
Since:
New in 1.2.

Failed to lock a path.

svn_wc_notify_failed_unlock 
Since:
New in 1.2.

Failed to unlock a path.

Definition at line 470 of file svn_wc.h.

enum svn_wc_notify_lock_state_t
 

Since:
New in 1.2.

What happened to a lock during an operation.

Enumeration values:
svn_wc_notify_lock_state_unchanged  The lock wasn't changed.
svn_wc_notify_lock_state_locked  The item was locked.
svn_wc_notify_lock_state_unlocked  The item was unlocked.

Definition at line 582 of file svn_wc.h.

enum svn_wc_notify_state_t
 

The type of notification that is occurring.

Enumeration values:
svn_wc_notify_state_unknown  Notifier doesn't know or isn't saying.
svn_wc_notify_state_unchanged  The state did not change.
svn_wc_notify_state_missing  The item wasn't present.
svn_wc_notify_state_obstructed  An unversioned item obstructed work.
svn_wc_notify_state_changed  Pristine state was modified.
svn_wc_notify_state_merged  Modified state had mods merged in.
svn_wc_notify_state_conflicted  Modified state got conflicting mods.

Definition at line 550 of file svn_wc.h.


Function Documentation

svn_wc_notify_t* svn_wc_create_notify const char *  path,
svn_wc_notify_action_t  action,
apr_pool_t *  pool
 

Since:
New in 1.2.

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
 

Since:
New in 1.2.

Return a deep copy of notify, allocated in pool.


Generated on Thu Aug 25 00:11:42 2005 for Subversion by  doxygen 1.3.9.1