Loading...
Searching...
No Matches
Remove local changes in a repository.
Client working copy management

## Functions

svn_error_t * | svn_client_revert4 (const apr_array_header_t *paths, svn_depth_t depth, const apr_array_header_t *changelists, svn_boolean_t clear_changelists, svn_boolean_t metadata_only, svn_boolean_t added_keep_local, svn_client_ctx_t *ctx, apr_pool_t *scratch_pool)
| Restore the pristine version of working copy paths, effectively undoing any local mods.
svn_error_t * | svn_client_revert3 (const apr_array_header_t *paths, svn_depth_t depth, const apr_array_header_t *changelists, svn_boolean_t clear_changelists, svn_boolean_t metadata_only, svn_client_ctx_t *ctx, apr_pool_t *pool)
| Similar to svn_client_revert4(), but with added_keep_local set to TRUE.
svn_error_t * | svn_client_revert2 (const apr_array_header_t *paths, svn_depth_t depth, const apr_array_header_t *changelists, svn_client_ctx_t *ctx, apr_pool_t *pool)
| Similar to svn_client_revert2, but with clear_changelists set to FALSE and metadata_only set to FALSE.
svn_error_t * | svn_client_revert (const apr_array_header_t *paths, svn_boolean_t recursive, svn_client_ctx_t *ctx, apr_pool_t *pool)
| Similar to svn_client_revert2(), but with changelists passed as `NULL`, and depth set according to recurse: if recurse is TRUE, depth is svn_depth_infinity, else if recurse is FALSE, depth is svn_depth_empty.

## Detailed Description

## Function Documentation

## svn_client_revert()

svn_error_t * svn_client_revert | ( | const apr_array_header_t * | paths,
|  | svn_boolean_t | recursive,
|  | svn_client_ctx_t * | ctx,
|  | apr_pool_t * | pool )

Similar to svn_client_revert2(), but with changelists passed as `NULL`, and depth set according to recurse: if recurse is TRUE, depth is svn_depth_infinity, else if recurse is FALSE, depth is svn_depth_empty.

Note
  Most APIs map recurse==FALSE to depth==svn_depth_files; revert is deliberately different.

Deprecated
  Provided for backwards compatibility with the 1.4 API.

## svn_client_revert2()

svn_error_t * svn_client_revert2 | ( | const apr_array_header_t * | paths,
|  | svn_depth_t | depth,
|  | const apr_array_header_t * | changelists,
|  | svn_client_ctx_t * | ctx,
|  | apr_pool_t * | pool )

Similar to svn_client_revert2, but with clear_changelists set to FALSE and metadata_only set to FALSE.

Since
  New in 1.5.

Deprecated
  Provided for backwards compatibility with the 1.8 API.

References SVN_DEPRECATED.

## svn_client_revert3()

svn_error_t * svn_client_revert3 | ( | const apr_array_header_t * | paths,
|  | svn_depth_t | depth,
|  | const apr_array_header_t * | changelists,
|  | svn_boolean_t | clear_changelists,
|  | svn_boolean_t | metadata_only,
|  | svn_client_ctx_t * | ctx,
|  | apr_pool_t * | pool )

Similar to svn_client_revert4(), but with added_keep_local set to TRUE.

Since
  New in 1.9.

Deprecated
  Provided for backwards compatibility with the 1.10 API.

References SVN_DEPRECATED.

## svn_client_revert4()

svn_error_t * svn_client_revert4 | ( | const apr_array_header_t * | paths,
|  | svn_depth_t | depth,
|  | const apr_array_header_t * | changelists,
|  | svn_boolean_t | clear_changelists,
|  | svn_boolean_t | metadata_only,
|  | svn_boolean_t | added_keep_local,
|  | svn_client_ctx_t * | ctx,
|  | apr_pool_t * | scratch_pool )

Restore the pristine version of working copy paths, effectively undoing any local mods.

This means returning each path's versioned status to 'unmodified' and changing its on-disk state to match that.

If an item was in a state of conflict, reverting also marks the conflict as resolved. If there are conflict marker files attached to the item, these are removed.

paths is an array of (const char *) local WC paths.

For each path in paths, revert it if it is a file. Else if it is a directory, revert according to depth: If depth is svn_depth_empty, revert just the directory; else if svn_depth_files, revert the directory and any files immediately under the directory; else if svn_depth_immediates, revert all of the preceding plus immediate subdirectories; else if svn_depth_infinity, revert path and everything under it fully recursively.

changelists is an array of const char * changelist names, used as a restrictive filter on items reverted; that is, don't revert any item unless it's a member of one of those changelists. If changelists is empty (or altogether `NULL`), no changelist filtering occurs.

If clear_changelists is TRUE, then changelist information for the paths is cleared while reverting.

The metadata_only and added_keep_local options control the extent of reverting. If metadata_only is TRUE, the working copy files are untouched, but if there are conflict marker files attached to these files these markers are removed. Otherwise, if added_keep_local is TRUE, then all items are reverted except an item that was scheduled as plain 'add' (not a copy) will not be removed from the working copy. Otherwise, all items are reverted and their on-disk state changed to match.

Consult the `SVN_CONFIG_OPTION_USE_COMMIT_TIMES` option in ctx to determine whether or not to revert timestamp to the time of last commit ('use-commit-times = yes').

If ctx->notify_func2 is non-NULL, then for each item reverted, call ctx->notify_func2 with ctx->notify_baton2 and the path of the reverted item.

If an item specified for reversion is not under version control, then do not error, just invoke ctx->notify_func2 with ctx->notify_baton2, using notification code svn_wc_notify_skip.

Warning
  The 'revert' command intentionally and permanently loses local modifications.

Since
  New in 1.11.

References SVN_DEPRECATED.