Subversion
Functions
Merge changes between branches.
Client working copy management

Functions

svn_error_tsvn_client_merge4 (const char *source1, const svn_opt_revision_t *revision1, const char *source2, const svn_opt_revision_t *revision2, const char *target_wcpath, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t record_only, svn_boolean_t dry_run, svn_boolean_t allow_mixed_rev, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Merge changes from source1/revision1 to source2/revision2 into the working-copy path target_wcpath.
svn_error_tsvn_client_merge3 (const char *source1, const svn_opt_revision_t *revision1, const char *source2, const svn_opt_revision_t *revision2, const char *target_wcpath, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t record_only, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Similar to svn_client_merge4(), but with allow_mixed_rev set to TRUE.
svn_error_tsvn_client_merge2 (const char *source1, const svn_opt_revision_t *revision1, const char *source2, const svn_opt_revision_t *revision2, const char *target_wcpath, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Similar to svn_client_merge3(), but with record_only set to FALSE, and depth set according to recurse: if recurse is TRUE, set depth to svn_depth_infinity, if recurse is FALSE, set depth to svn_depth_files.
svn_error_tsvn_client_merge (const char *source1, const svn_opt_revision_t *revision1, const char *source2, const svn_opt_revision_t *revision2, const char *target_wcpath, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t dry_run, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Similar to svn_client_merge2(), but with merge_options set to NULL.
svn_error_tsvn_client_merge_reintegrate (const char *source, const svn_opt_revision_t *peg_revision, const char *target_wcpath, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Perform a reintegration merge of source at peg_revision into target_wcpath.
svn_error_tsvn_client_merge_peg4 (const char *source, const apr_array_header_t *ranges_to_merge, const svn_opt_revision_t *peg_revision, const char *target_wcpath, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t record_only, svn_boolean_t dry_run, svn_boolean_t allow_mixed_rev, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Merge the changes between the filesystem object source in peg revision peg_revision, as it changed between the ranges described in ranges_to_merge.
svn_error_tsvn_client_merge_peg3 (const char *source, const apr_array_header_t *ranges_to_merge, const svn_opt_revision_t *peg_revision, const char *target_wcpath, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t record_only, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Similar to svn_client_merge_peg4(), but with allow_mixed_rev set to TRUE.
svn_error_tsvn_client_merge_peg2 (const char *source, const svn_opt_revision_t *revision1, const svn_opt_revision_t *revision2, const svn_opt_revision_t *peg_revision, const char *target_wcpath, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t dry_run, const apr_array_header_t *merge_options, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Similar to svn_client_merge_peg3(), but with record_only set to FALSE, and depth set according to recurse: if recurse is TRUE, set depth to svn_depth_infinity, if recurse is FALSE, set depth to svn_depth_files.
svn_error_tsvn_client_merge_peg (const char *source, const svn_opt_revision_t *revision1, const svn_opt_revision_t *revision2, const svn_opt_revision_t *peg_revision, const char *target_wcpath, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, svn_boolean_t force, svn_boolean_t dry_run, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Similar to svn_client_merge_peg2(), but with merge_options set to NULL.
svn_error_tsvn_client_suggest_merge_sources (apr_array_header_t **suggestions, const char *path_or_url, const svn_opt_revision_t *peg_revision, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Set suggestions to an ordered array of const char * potential merge sources (expressed as full repository URLs) for path_or_url at peg_revision.
svn_error_tsvn_client_mergeinfo_get_merged (apr_hash_t **mergeinfo, const char *path_or_url, const svn_opt_revision_t *peg_revision, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Set *mergeinfo to a hash mapping const char * merge source URLs to apr_array_header_t * rangelists (arrays of svn_merge_range_t * ranges) describing the ranges which have been merged into path_or_url as of peg_revision, per path_or_url's explicit mergeinfo or inherited mergeinfo if no explicit mergeinfo if found.
svn_error_tsvn_client_mergeinfo_log (svn_boolean_t finding_merged, const char *path_or_url, const svn_opt_revision_t *peg_revision, const char *merge_source_path_or_url, const svn_opt_revision_t *src_peg_revision, svn_log_entry_receiver_t receiver, void *receiver_baton, svn_boolean_t discover_changed_paths, svn_depth_t depth, const apr_array_header_t *revprops, svn_client_ctx_t *ctx, apr_pool_t *scratch_pool)
 If finding_merged is TRUE, then drive log entry callbacks receiver / receiver_baton with the revisions merged from merge_source_path_or_url (as of src_peg_revision) into path_or_url (as of peg_revision).
svn_error_tsvn_client_mergeinfo_log_merged (const char *path_or_url, const svn_opt_revision_t *peg_revision, const char *merge_source_path_or_url, const svn_opt_revision_t *src_peg_revision, svn_log_entry_receiver_t receiver, void *receiver_baton, svn_boolean_t discover_changed_paths, const apr_array_header_t *revprops, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Similar to svn_client_mergeinfo_log(), but finds only merged revisions and always operates at depth svn_depth_empty.
svn_error_tsvn_client_mergeinfo_log_eligible (const char *path_or_url, const svn_opt_revision_t *peg_revision, const char *merge_source_path_or_url, const svn_opt_revision_t *src_peg_revision, svn_log_entry_receiver_t receiver, void *receiver_baton, svn_boolean_t discover_changed_paths, const apr_array_header_t *revprops, svn_client_ctx_t *ctx, apr_pool_t *pool)
 Similar to svn_client_mergeinfo_log(), but finds only eligible revisions and always operates at depth svn_depth_empty.

Function Documentation

svn_error_t* svn_client_merge ( const char *  source1,
const svn_opt_revision_t revision1,
const char *  source2,
const svn_opt_revision_t revision2,
const char *  target_wcpath,
svn_boolean_t  recurse,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  force,
svn_boolean_t  dry_run,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Similar to svn_client_merge2(), but with merge_options set to NULL.

Deprecated:
Provided for backwards compatibility with the 1.3 API.
svn_error_t* svn_client_merge2 ( const char *  source1,
const svn_opt_revision_t revision1,
const char *  source2,
const svn_opt_revision_t revision2,
const char *  target_wcpath,
svn_boolean_t  recurse,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  force,
svn_boolean_t  dry_run,
const apr_array_header_t *  merge_options,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Similar to svn_client_merge3(), but with record_only set to FALSE, and depth set according to recurse: if recurse is TRUE, set depth to svn_depth_infinity, if recurse is FALSE, set depth to svn_depth_files.

Deprecated:
Provided for backward compatibility with the 1.4 API.
Since:
New in 1.4.
svn_error_t* svn_client_merge3 ( const char *  source1,
const svn_opt_revision_t revision1,
const char *  source2,
const svn_opt_revision_t revision2,
const char *  target_wcpath,
svn_depth_t  depth,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  force,
svn_boolean_t  record_only,
svn_boolean_t  dry_run,
const apr_array_header_t *  merge_options,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Similar to svn_client_merge4(), but with allow_mixed_rev set to TRUE.

Deprecated:
Provided for backward compatibility with the 1.6 API.
Since:
New in 1.5.
svn_error_t* svn_client_merge4 ( const char *  source1,
const svn_opt_revision_t revision1,
const char *  source2,
const svn_opt_revision_t revision2,
const char *  target_wcpath,
svn_depth_t  depth,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  force,
svn_boolean_t  record_only,
svn_boolean_t  dry_run,
svn_boolean_t  allow_mixed_rev,
const apr_array_header_t *  merge_options,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Merge changes from source1/revision1 to source2/revision2 into the working-copy path target_wcpath.

source1 and source2 are either URLs that refer to entries in the repository, or paths to entries in the working copy.

By "merging", we mean: apply file differences using svn_wc_merge(), and schedule additions & deletions when appropriate.

source1 and source2 must both represent the same node kind -- that is, if source1 is a directory, source2 must also be, and if source1 is a file, source2 must also be.

If either revision1 or revision2 has an `unspecified' or unrecognized `kind', return SVN_ERR_CLIENT_BAD_REVISION.

If depth is svn_depth_infinity, merge fully recursively. Else if svn_depth_immediates, merge changes at most to files that are immediate children of target_wcpath and to directory properties of target_wcpath and its immediate subdirectory children. Else if svn_depth_files, merge at most to immediate file children of target_wcpath and to target_wcpath itself. Else if svn_depth_empty, apply changes only to target_wcpath (i.e., directory property changes only)

If depth is svn_depth_unknown, use the depth of target_wcpath.

Use ignore_ancestry to control whether or not items being diffed will be checked for relatedness first. Unrelated items are typically transmitted to the editor as a deletion of one thing and the addition of another, but if this flag is TRUE, unrelated items will be diffed as if they were related.

If force is false and the merge involves deleting a file whose content differs from the source-left version, or a locally modified directory, or an unversioned item, then the operation will fail. If force is true then all such items will be deleted.

merge_options (an array of const char *), if non-NULL, is used to pass additional command line arguments to the merge processes (internal or external).

See also:
svn_diff_file_options_parse().

If ctx->notify_func2 is non-NULL, then call ctx->notify_func2 with ctx->notify_baton2 once for each merged target, passing the target's local path.

If record_only is TRUE, the merge is performed, but is limited only to mergeinfo property changes on existing paths in target_wcpath.

If dry_run is TRUE, the merge is carried out, and full notification feedback is provided, but the working copy is not modified.

If allow_mixed_rev is FALSE, and merge_target is a mixed-revision working copy, raise SVN_ERR_CLIENT_MERGE_UPDATE_REQUIRED. Because users rarely intend to merge into mixed-revision working copies, it is recommended to set this parameter to FALSE by default unless the user has explicitly requested a merge into a mixed-revision working copy.

The authentication baton cached in ctx is used to communicate with the repository.

Since:
New in 1.7.
svn_error_t* svn_client_merge_peg ( const char *  source,
const svn_opt_revision_t revision1,
const svn_opt_revision_t revision2,
const svn_opt_revision_t peg_revision,
const char *  target_wcpath,
svn_boolean_t  recurse,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  force,
svn_boolean_t  dry_run,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Similar to svn_client_merge_peg2(), but with merge_options set to NULL.

Deprecated:
Provided for backwards compatibility with the 1.3 API.
Since:
New in 1.1.
svn_error_t* svn_client_merge_peg2 ( const char *  source,
const svn_opt_revision_t revision1,
const svn_opt_revision_t revision2,
const svn_opt_revision_t peg_revision,
const char *  target_wcpath,
svn_boolean_t  recurse,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  force,
svn_boolean_t  dry_run,
const apr_array_header_t *  merge_options,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Similar to svn_client_merge_peg3(), but with record_only set to FALSE, and depth set according to recurse: if recurse is TRUE, set depth to svn_depth_infinity, if recurse is FALSE, set depth to svn_depth_files.

Deprecated:
Provided for backwards compatibility with the 1.4 API.
Since:
New in 1.4.
svn_error_t* svn_client_merge_peg3 ( const char *  source,
const apr_array_header_t *  ranges_to_merge,
const svn_opt_revision_t peg_revision,
const char *  target_wcpath,
svn_depth_t  depth,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  force,
svn_boolean_t  record_only,
svn_boolean_t  dry_run,
const apr_array_header_t *  merge_options,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Similar to svn_client_merge_peg4(), but with allow_mixed_rev set to TRUE.

Deprecated:
Provided for backward compatibility with the 1.6 API.
Since:
New in 1.5.
svn_error_t* svn_client_merge_peg4 ( const char *  source,
const apr_array_header_t *  ranges_to_merge,
const svn_opt_revision_t peg_revision,
const char *  target_wcpath,
svn_depth_t  depth,
svn_boolean_t  ignore_ancestry,
svn_boolean_t  force,
svn_boolean_t  record_only,
svn_boolean_t  dry_run,
svn_boolean_t  allow_mixed_rev,
const apr_array_header_t *  merge_options,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Merge the changes between the filesystem object source in peg revision peg_revision, as it changed between the ranges described in ranges_to_merge.

ranges_to_merge is an array of svn_opt_revision_range_t * ranges. These ranges may describe additive and/or subtractive merge ranges, they may overlap fully or partially, and/or they may partially or fully negate each other. This rangelist is not required to be sorted. If any revision in the list of provided ranges has an `unspecified' or unrecognized `kind', return SVN_ERR_CLIENT_BAD_REVISION.

All other options are handled identically to svn_client_merge4().

Since:
New in 1.7.
svn_error_t* svn_client_merge_reintegrate ( const char *  source,
const svn_opt_revision_t peg_revision,
const char *  target_wcpath,
svn_boolean_t  dry_run,
const apr_array_header_t *  merge_options,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Perform a reintegration merge of source at peg_revision into target_wcpath.

target_wcpath must be a single-revision, svn_depth_infinity, pristine, unswitched working copy -- in other words, it must reflect a single revision tree, the "target". The mergeinfo on source must reflect that all of the target has been merged into it. Then this behaves like a merge with svn_client_merge3() from the target's URL to the source.

All other options are handled identically to svn_client_merge3(). The depth of the merge is always svn_depth_infinity.

Since:
New in 1.5.
svn_error_t* svn_client_mergeinfo_get_merged ( apr_hash_t **  mergeinfo,
const char *  path_or_url,
const svn_opt_revision_t peg_revision,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Set *mergeinfo to a hash mapping const char * merge source URLs to apr_array_header_t * rangelists (arrays of svn_merge_range_t * ranges) describing the ranges which have been merged into path_or_url as of peg_revision, per path_or_url's explicit mergeinfo or inherited mergeinfo if no explicit mergeinfo if found.

If no explicit or inherited mergeinfo is found, then set *mergeinfo to NULL.

Use pool for all necessary allocations.

If the server doesn't support retrieval of mergeinfo (which will never happen for file:// URLs), return an SVN_ERR_UNSUPPORTED_FEATURE error.

Note:
Unlike most APIs which deal with mergeinfo, this one returns data where the keys of the hash are absolute repository URLs rather than repository filesystem paths.
Since:
New in 1.5.
svn_error_t* svn_client_mergeinfo_log ( svn_boolean_t  finding_merged,
const char *  path_or_url,
const svn_opt_revision_t peg_revision,
const char *  merge_source_path_or_url,
const svn_opt_revision_t src_peg_revision,
svn_log_entry_receiver_t  receiver,
void *  receiver_baton,
svn_boolean_t  discover_changed_paths,
svn_depth_t  depth,
const apr_array_header_t *  revprops,
svn_client_ctx_t ctx,
apr_pool_t *  scratch_pool 
)

If finding_merged is TRUE, then drive log entry callbacks receiver / receiver_baton with the revisions merged from merge_source_path_or_url (as of src_peg_revision) into path_or_url (as of peg_revision).

If finding_merged is FALSE then find the revisions eligible for merging.

If depth is svn_depth_empty consider only the explicit or inherited mergeinfo on path_or_url when calculating merged revisions from merge_source_path_or_url. If depth is svn_depth_infinity then also consider the explicit subtree mergeinfo under path_or_url. If a depth other than svn_depth_empty or svn_depth_infinity is requested then return a SVN_ERR_UNSUPPORTED_FEATURE error.

discover_changed_paths and revprops are the same as for svn_client_log5(). Use scratch_pool for all temporary allocations.

ctx is a context used for authentication.

If the server doesn't support retrieval of mergeinfo, return an SVN_ERR_UNSUPPORTED_FEATURE error.

Since:
New in 1.7.
svn_error_t* svn_client_mergeinfo_log_eligible ( const char *  path_or_url,
const svn_opt_revision_t peg_revision,
const char *  merge_source_path_or_url,
const svn_opt_revision_t src_peg_revision,
svn_log_entry_receiver_t  receiver,
void *  receiver_baton,
svn_boolean_t  discover_changed_paths,
const apr_array_header_t *  revprops,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Similar to svn_client_mergeinfo_log(), but finds only eligible revisions and always operates at depth svn_depth_empty.

Deprecated:
Provided for backwards compatibility with the 1.6 API. Use svn_client_mergeinfo_log() instead.
Since:
New in 1.5.
svn_error_t* svn_client_mergeinfo_log_merged ( const char *  path_or_url,
const svn_opt_revision_t peg_revision,
const char *  merge_source_path_or_url,
const svn_opt_revision_t src_peg_revision,
svn_log_entry_receiver_t  receiver,
void *  receiver_baton,
svn_boolean_t  discover_changed_paths,
const apr_array_header_t *  revprops,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Similar to svn_client_mergeinfo_log(), but finds only merged revisions and always operates at depth svn_depth_empty.

Deprecated:
Provided for backwards compatibility with the 1.6 API. Use svn_client_mergeinfo_log() instead.
Since:
New in 1.5.
svn_error_t* svn_client_suggest_merge_sources ( apr_array_header_t **  suggestions,
const char *  path_or_url,
const svn_opt_revision_t peg_revision,
svn_client_ctx_t ctx,
apr_pool_t *  pool 
)

Set suggestions to an ordered array of const char * potential merge sources (expressed as full repository URLs) for path_or_url at peg_revision.

path_or_url is a working copy path or repository URL. ctx is a context used for authentication in the repository case. Use pool for all allocations.

Since:
New in 1.5.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines