# Bring a working copy up-to-date with a repository
[Client working copy management]

## Functions
svn_error_t * | svn_client_update4 (apr_array_header_t **result_revs, const apr_array_header_t *paths, const svn_opt_revision_t *revision, svn_depth_t depth, svn_boolean_t depth_is_sticky, svn_boolean_t ignore_externals, svn_boolean_t allow_unver_obstructions, svn_boolean_t adds_as_modification, svn_boolean_t make_parents, svn_client_ctx_t *ctx, apr_pool_t *pool)
| Update working trees paths to revision, authenticating with the authentication baton cached in ctx.
svn_error_t * | svn_client_update3 (apr_array_header_t **result_revs, const apr_array_header_t *paths, const svn_opt_revision_t *revision, svn_depth_t depth, svn_boolean_t depth_is_sticky, svn_boolean_t ignore_externals, svn_boolean_t allow_unver_obstructions, svn_client_ctx_t *ctx, apr_pool_t *pool)
| Similar to svn_client_update4() but with make_parents always set to FALSE and adds_as_modification set to TRUE.
svn_error_t * | svn_client_update2 (apr_array_header_t **result_revs, const apr_array_header_t *paths, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_boolean_t ignore_externals, svn_client_ctx_t *ctx, apr_pool_t *pool)
| Similar to svn_client_update3() but with allow_unver_obstructions always set to FALSE, depth_is_sticky 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_t * | svn_client_update (svn_revnum_t *result_rev, const char *path, const svn_opt_revision_t *revision, svn_boolean_t recurse, svn_client_ctx_t *ctx, apr_pool_t *pool)
| Similar to svn_client_update2() except that it accepts only a single target in path, returns a single revision if result_rev is not NULL, and ignore_externals is always set to FALSE.

## Function Documentation

svn_error_t* svn_client_update | ( | svn_revnum_t * | result_rev,
|  | const char * | path,
|  | const svn_opt_revision_t * | revision,
|  | svn_boolean_t | recurse,
|  | svn_client_ctx_t * | ctx,
|  | apr_pool_t * | pool |
| ) |  |  |

Similar to svn_client_update2() except that it accepts only a single target in path, returns a single revision if result_rev is not NULL, and ignore_externals is always set to FALSE.

Deprecated:
  Provided for backward compatibility with the 1.1 API.

svn_error_t* svn_client_update2 | ( | apr_array_header_t ** | result_revs,
|  | const apr_array_header_t * | paths,
|  | const svn_opt_revision_t * | revision,
|  | svn_boolean_t | recurse,
|  | svn_boolean_t | ignore_externals,
|  | svn_client_ctx_t * | ctx,
|  | apr_pool_t * | pool |
| ) |  |  |

Similar to svn_client_update3() but with allow_unver_obstructions always set to FALSE, depth_is_sticky 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.

svn_error_t* svn_client_update3 | ( | apr_array_header_t ** | result_revs,
|  | const apr_array_header_t * | paths,
|  | const svn_opt_revision_t * | revision,
|  | svn_depth_t | depth,
|  | svn_boolean_t | depth_is_sticky,
|  | svn_boolean_t | ignore_externals,
|  | svn_boolean_t | allow_unver_obstructions,
|  | svn_client_ctx_t * | ctx,
|  | apr_pool_t * | pool |
| ) |  |  |

Similar to svn_client_update4() but with make_parents always set to FALSE and adds_as_modification set to TRUE.

Deprecated:
  Provided for backward compatibility with the 1.6 API.

Since:
  New in 1.5.

svn_error_t* svn_client_update4 | ( | apr_array_header_t ** | result_revs,
|  | const apr_array_header_t * | paths,
|  | const svn_opt_revision_t * | revision,
|  | svn_depth_t | depth,
|  | svn_boolean_t | depth_is_sticky,
|  | svn_boolean_t | ignore_externals,
|  | svn_boolean_t | allow_unver_obstructions,
|  | svn_boolean_t | adds_as_modification,
|  | svn_boolean_t | make_parents,
|  | svn_client_ctx_t * | ctx,
|  | apr_pool_t * | pool |
| ) |  |  |

Update working trees paths to revision, authenticating with the authentication baton cached in ctx.

paths is an array of const char * paths to be updated. Unversioned paths that are direct children of a versioned path will cause an update that attempts to add that path; other unversioned paths are skipped. If result_revs is not NULL, *result_revs will be set to an array of svn_revnum_t with each element set to the revision to which revision was resolved for the corresponding element of paths.

revision must be of kind svn_opt_revision_number, svn_opt_revision_head, or svn_opt_revision_date. If revision does not meet these requirements, return the error SVN_ERR_CLIENT_BAD_REVISION.

The paths in paths can be from multiple working copies from multiple repositories, but even if they all come from the same repository there is no guarantee that revision represented by svn_opt_revision_head will remain the same as each path is updated.

If ignore_externals is set, don't process externals definitions as part of this operation.

If depth is svn_depth_infinity, update fully recursively. Else if it is svn_depth_immediates or svn_depth_files, update each target and its file entries, but not its subdirectories. Else if svn_depth_empty, update exactly each target, nonrecursively (essentially, update the target's properties).

If depth is svn_depth_unknown, take the working depth from paths and then behave as described above.

If depth_is_sticky is set and depth is not svn_depth_unknown, then in addition to updating PATHS, also set their sticky ambient depth value to depth.

If allow_unver_obstructions is TRUE then the update tolerates existing unversioned items that obstruct added paths. Only obstructions of the same type (file or dir) as the added item are tolerated. The text of obstructing files is left as-is, effectively treating it as a user modification after the update. Working properties of obstructing items are set equal to the base properties. If allow_unver_obstructions is FALSE then the update will abort if there are any unversioned obstructing items.

If adds_as_modification is TRUE, a local addition at the same path as an incoming addition of the same node kind results in a normal node with a possible local modification, instead of a tree conflict.

If make_parents is TRUE, create any non-existent parent directories also by checking them out at depth=empty.

If ctx->notify_func2 is non-NULL, invoke ctx->notify_func2 with ctx->notify_baton2 for each item handled by the update, and also for files restored from text-base. If ctx->cancel_func is non-NULL, invoke it passing ctx->cancel_baton at various places during the update.

Use pool for any temporary allocation.

Todo:
  Multiple Targets
  - Up for debate: an update on multiple targets is *not* atomic. Right now, svn_client_update only takes one path. What's debatable is whether this should ever change. On the one hand, it's kind of losing to have the client application loop over targets and call svn_client_update() on each one; each call to update initializes a whole new repository session (network overhead, etc.) On the other hand, it's a very simple implementation, and allows for the possibility that different targets may come from different repositories.

Since:
  New in 1.7.

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines