Conflict callback functionality
[Working copy management]

Interactive conflict handling. More...

Data Structures

struct  svn_wc_conflict_description_t
 A struct that describes a conflict that has occurred in the working copy. More...
struct  svn_wc_conflict_result_t
 The final result returned by svn_wc_conflict_resolver_func_t. More...

Typedefs

typedef enum svn_wc_conflict_action_t svn_wc_conflict_action_t
 The type of action being attempted on an object.
typedef enum svn_wc_conflict_reason_t svn_wc_conflict_reason_t
 The pre-existing condition which is causing a state of conflict.
typedef enum svn_wc_conflict_kind_t svn_wc_conflict_kind_t
 The type of conflict being described by an svn_wc_conflict_description_t (see below).
typedef enum svn_wc_operation_t svn_wc_operation_t
 The user operation that exposed a conflict.
typedef svn_wc_conflict_description_t svn_wc_conflict_description_t
 A struct that describes a conflict that has occurred in the working copy.
typedef enum svn_wc_conflict_choice_t svn_wc_conflict_choice_t
 The way in which the conflict callback chooses a course of action.
typedef svn_wc_conflict_result_t svn_wc_conflict_result_t
 The final result returned by svn_wc_conflict_resolver_func_t.
typedef svn_error_t *(* svn_wc_conflict_resolver_func_t )(svn_wc_conflict_result_t **result, const svn_wc_conflict_description_t *description, void *baton, apr_pool_t *pool)
 A callback used in svn_client_merge3(), svn_client_update3(), and svn_client_switch2() for resolving conflicts during the application of a tree delta to a working copy.

Enumerations

enum  svn_wc_conflict_action_t {
  svn_wc_conflict_action_edit,
  svn_wc_conflict_action_add,
  svn_wc_conflict_action_delete
}
 The type of action being attempted on an object. More...
enum  svn_wc_conflict_reason_t {
  svn_wc_conflict_reason_edited,
  svn_wc_conflict_reason_obstructed,
  svn_wc_conflict_reason_deleted,
  svn_wc_conflict_reason_added,
  svn_wc_conflict_reason_missing,
  svn_wc_conflict_reason_unversioned
}
 The pre-existing condition which is causing a state of conflict. More...
enum  svn_wc_conflict_kind_t {
  svn_wc_conflict_kind_text,
  svn_wc_conflict_kind_property,
  svn_wc_conflict_kind_tree
}
 The type of conflict being described by an svn_wc_conflict_description_t (see below). More...
enum  svn_wc_operation_t {
  svn_wc_operation_update,
  svn_wc_operation_switch,
  svn_wc_operation_merge
}
 The user operation that exposed a conflict. More...
enum  svn_wc_conflict_choice_t {
  svn_wc_conflict_choose_postpone,
  svn_wc_conflict_choose_base,
  svn_wc_conflict_choose_theirs_full,
  svn_wc_conflict_choose_mine_full,
  svn_wc_conflict_choose_theirs_conflict,
  svn_wc_conflict_choose_mine_conflict,
  svn_wc_conflict_choose_merged
}
 The way in which the conflict callback chooses a course of action. More...

Functions

svn_wc_conflict_description_tsvn_wc_conflict_description_create_text (const char *path, svn_wc_adm_access_t *adm_access, apr_pool_t *pool)
 Allocate an svn_wc_conflict_description_t structure in pool, initialize to represent a text conflict, and return it.
svn_wc_conflict_description_tsvn_wc_conflict_description_create_prop (const char *path, svn_wc_adm_access_t *adm_access, svn_node_kind_t node_kind, const char *property_name, apr_pool_t *pool)
 Allocate an svn_wc_conflict_description_t structure in pool, initialize to represent a property conflict, and return it.
svn_wc_conflict_description_tsvn_wc_conflict_description_create_tree (const char *path, svn_wc_adm_access_t *adm_access, svn_node_kind_t node_kind, svn_wc_operation_t operation, apr_pool_t *pool)
 Allocate an svn_wc_conflict_description_t structure in pool, initialize to represent a tree conflict, and return it.
svn_wc_conflict_result_tsvn_wc_create_conflict_result (svn_wc_conflict_choice_t choice, const char *merged_file, apr_pool_t *pool)
 Allocate an svn_wc_conflict_result_t structure in pool, initialize and return it.

Detailed Description

Interactive conflict handling.

This API gives a Subversion client application the opportunity to define a callback that allows the user to resolve conflicts interactively during updates and merges.

If a conflict is discovered, libsvn_wc invokes the callback with an svn_wc_conflict_description_t. This structure describes the path in conflict, whether it's a text or property conflict, and may also present up to three files that can be used to resolve the conflict (perhaps by launching an editor or 3rd-party merging tool). The structure also provides a possible fourth file (merged_file) which, if not NULL, represents libsvn_wc's attempt to contextually merge the first three files. (Note that libsvn_wc will not attempt to merge a file that it believes is binary, and it will only attempt to merge property values it believes to be a series of multi-line text.)

When the callback is finished interacting with the user, it responds by returning a svn_wc_conflict_result_t. This structure indicates whether the user wants to postpone the conflict for later (allowing libsvn_wc to mark the path "conflicted" as usual), or whether the user wants libsvn_wc to use one of the four files as the "final" state for resolving the conflict immediately.

Note that the callback is at liberty (and encouraged) to merge the three files itself. If it does so, it signals this to libsvn_wc by returning a choice of svn_wc_conflict_choose_merged. To return the 'final' merged file to libsvn_wc, the callback has the option of either:

or, if libsvn_wc never supplied a merged_file in the description structure (i.e. passed NULL for that field),


Typedef Documentation

typedef enum svn_wc_conflict_action_t svn_wc_conflict_action_t
 

The type of action being attempted on an object.

Since:
New in 1.5.

typedef enum svn_wc_conflict_choice_t svn_wc_conflict_choice_t
 

The way in which the conflict callback chooses a course of action.

Since:
New in 1.5.

typedef struct svn_wc_conflict_description_t svn_wc_conflict_description_t
 

A struct that describes a conflict that has occurred in the working copy.

Passed to svn_wc_conflict_resolver_func_t.

The conflict described by this structure is one of:

  • a conflict on the content of the file node path
  • a conflict on the property property_name of path

Note:
Fields may be added to the end of this structure in future versions. Therefore, to preserve binary compatibility, users should not directly allocate structures of this type but should use svn_wc_create_conflict_description_text() or svn_wc_create_conflict_description_prop() or svn_wc_create_conflict_description_tree() instead.
Since:
New in 1.5.

typedef enum svn_wc_conflict_kind_t svn_wc_conflict_kind_t
 

The type of conflict being described by an svn_wc_conflict_description_t (see below).

Since:
New in 1.5.

typedef enum svn_wc_conflict_reason_t svn_wc_conflict_reason_t
 

The pre-existing condition which is causing a state of conflict.

Since:
New in 1.5.

typedef svn_error_t*(* svn_wc_conflict_resolver_func_t)(svn_wc_conflict_result_t **result, const svn_wc_conflict_description_t *description, void *baton, apr_pool_t *pool)
 

A callback used in svn_client_merge3(), svn_client_update3(), and svn_client_switch2() for resolving conflicts during the application of a tree delta to a working copy.

description describes the exact nature of the conflict, and provides information to help resolve it. baton is a closure object; it should be provided by the implementation, and passed by the caller. All allocations should be performed in pool. When finished, the callback signals its resolution by returning a structure in *result. (See svn_wc_conflict_result_t.)

The values svn_wc_conflict_choose_mine_conflict and svn_wc_conflict_choose_theirs_conflict are not legal for conflicts in binary files or properties.

Implementations of this callback are free to present the conflict using any user interface. This may include simple contextual conflicts in a file's text or properties, or more complex 'tree'-based conflcts related to obstructed additions, deletions, and edits. The callback implementation is free to decide which sorts of conflicts to handle; it's also free to decide which types of conflicts are automatically resolvable and which require user interaction.

Since:
New in 1.5.

Definition at line 1376 of file svn_wc.h.

typedef struct svn_wc_conflict_result_t svn_wc_conflict_result_t
 

The final result returned by svn_wc_conflict_resolver_func_t.

Note:
Fields may be added to the end of this structure in future versions. Therefore, to preserve binary compatibility, users should not directly allocate structures of this type. Instead, construct this structure using svn_wc_create_conflict_result() below.
Since:
New in 1.5.

typedef enum svn_wc_operation_t svn_wc_operation_t
 

The user operation that exposed a conflict.

Since:
New in 1.6.


Enumeration Type Documentation

enum svn_wc_conflict_action_t
 

The type of action being attempted on an object.

Since:
New in 1.5.

Definition at line 1071 of file svn_wc.h.

enum svn_wc_conflict_choice_t
 

The way in which the conflict callback chooses a course of action.

Since:
New in 1.5.

Definition at line 1282 of file svn_wc.h.

enum svn_wc_conflict_kind_t
 

The type of conflict being described by an svn_wc_conflict_description_t (see below).

Since:
New in 1.5.

Definition at line 1101 of file svn_wc.h.

enum svn_wc_conflict_reason_t
 

The pre-existing condition which is causing a state of conflict.

Since:
New in 1.5.

Definition at line 1084 of file svn_wc.h.

enum svn_wc_operation_t
 

The user operation that exposed a conflict.

Since:
New in 1.6.

Definition at line 1114 of file svn_wc.h.


Function Documentation

svn_wc_conflict_description_t* svn_wc_conflict_description_create_prop const char *  path,
svn_wc_adm_access_t adm_access,
svn_node_kind_t  node_kind,
const char *  property_name,
apr_pool_t *  pool
 

Allocate an svn_wc_conflict_description_t structure in pool, initialize to represent a property conflict, and return it.

Set the path field of the created struct to path, the access field to adm_access, the kind field to svn_wc_conflict_kind_prop, the node_kind to node_kind, and the property_name to property_name. Make only shallow copies of the pointer arguments.

Note:
: It is the caller's responsibility to set the other required fields (such as the four file names and action and reason).
Since:
New in 1.6.

svn_wc_conflict_description_t* svn_wc_conflict_description_create_text const char *  path,
svn_wc_adm_access_t adm_access,
apr_pool_t *  pool
 

Allocate an svn_wc_conflict_description_t structure in pool, initialize to represent a text conflict, and return it.

Set the path field of the created struct to path, the access field to adm_access, the kind field to svn_wc_conflict_kind_text, the node_kind to svn_node_file, the action to svn_wc_conflict_action_edit, and the reason to svn_wc_conflict_reason_edited. Make only shallow copies of the pointer arguments.

Note:
: It is the caller's responsibility to set the other required fields (such as the four file names and mime_type and is_binary).
Since:
New in 1.6.

svn_wc_conflict_description_t* svn_wc_conflict_description_create_tree const char *  path,
svn_wc_adm_access_t adm_access,
svn_node_kind_t  node_kind,
svn_wc_operation_t  operation,
apr_pool_t *  pool
 

Allocate an svn_wc_conflict_description_t structure in pool, initialize to represent a tree conflict, and return it.

Set the path field of the created struct to path, the access field to adm_access, the kind field to svn_wc_conflict_kind_tree, the node_kind to node_kind, and the operation to operation. Make only shallow copies of the pointer arguments.

Note:
: It is the caller's responsibility to set the other required fields (such as the four file names and action and reason).
Since:
New in 1.6.

svn_wc_conflict_result_t* svn_wc_create_conflict_result svn_wc_conflict_choice_t  choice,
const char *  merged_file,
apr_pool_t *  pool
 

Allocate an svn_wc_conflict_result_t structure in pool, initialize and return it.

Set the choice field of the structure to choice, and merged_file to merged_file. Set all other fields to their _unknown, NULL or invalid value, respectively. Make only a shallow copy of the pointer argument merged_file.

Since:
New in 1.5.


Generated on Tue Oct 7 04:09:59 2008 for Subversion by  doxygen 1.3.9.1