# Hook-sensitive wrappers for libsvn_fs routines.

## Modules
| Repository lock wrappers
## Functions
svn_error_t * | svn_repos_fs_commit_txn (const char **conflict_p, svn_repos_t *repos, svn_revnum_t *new_rev, svn_fs_txn_t *txn, apr_pool_t *pool)
| Like svn_fs_commit_txn(), but invoke the repos' pre- and post-commit hooks around the commit.
svn_error_t * | svn_repos_fs_begin_txn_for_commit2 (svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, apr_hash_t *revprop_table, apr_pool_t *pool)
| Like svn_fs_begin_txn(), but use revprop_table, a hash mapping `const char *` property names to svn_string_t values, to set the properties on transaction *txn_p.
SVN_DEPRECATED svn_error_t * | svn_repos_fs_begin_txn_for_commit (svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *log_msg, apr_pool_t *pool)
| Same as svn_repos_fs_begin_txn_for_commit2(), but with revprop_table set to a hash containing author and log_msg as the SVN_PROP_REVISION_AUTHOR and SVN_PROP_REVISION_LOG properties, respectively.
svn_error_t * | svn_repos_fs_begin_txn_for_update (svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, const char *author, apr_pool_t *pool)
| Like svn_fs_begin_txn(), but use author to set the corresponding property on transaction *txn_p.
svn_error_t * | svn_repos_fs_change_rev_prop4 (svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *const *old_value_p, const svn_string_t *new_value, svn_boolean_t use_pre_revprop_change_hook, svn_boolean_t use_post_revprop_change_hook, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
| Like svn_fs_change_rev_prop2(), but validate the name and value of the property and invoke the repos's pre- and post-revprop-change hooks around the change as specified by use_pre_revprop_change_hook and use_post_revprop_change_hook (respectively).
SVN_DEPRECATED svn_error_t * | svn_repos_fs_change_rev_prop3 (svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, svn_boolean_t use_pre_revprop_change_hook, svn_boolean_t use_post_revprop_change_hook, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
| Similar to svn_repos_fs_change_rev_prop4(), but with old_value_p always set to `NULL`.
SVN_DEPRECATED svn_error_t * | svn_repos_fs_change_rev_prop2 (svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
| Similar to svn_repos_fs_change_rev_prop3(), but with the use_pre_revprop_change_hook and use_post_revprop_change_hook always set to `TRUE`.
SVN_DEPRECATED svn_error_t * | svn_repos_fs_change_rev_prop (svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, apr_pool_t *pool)
| Similar to svn_repos_fs_change_rev_prop2(), but with the authz_read_func parameter always NULL.
svn_error_t * | svn_repos_fs_revision_prop (svn_string_t **value_p, svn_repos_t *repos, svn_revnum_t rev, const char *propname, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
| Set *value_p to the value of the property named propname on revision rev in the filesystem opened in repos.
svn_error_t * | svn_repos_fs_revision_proplist (apr_hash_t **table_p, svn_repos_t *repos, svn_revnum_t rev, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
| Set *table_p to the entire property list of revision rev in filesystem opened in repos, as a hash table allocated in pool.
svn_error_t * | svn_repos_fs_change_node_prop (svn_fs_root_t *root, const char *path, const char *name, const svn_string_t *value, apr_pool_t *pool)
| Validating wrapper for svn_fs_change_node_prop() (which see for argument descriptions).
svn_error_t * | svn_repos_fs_change_txn_prop (svn_fs_txn_t *txn, const char *name, const svn_string_t *value, apr_pool_t *pool)
| Validating wrapper for svn_fs_change_txn_prop() (which see for argument descriptions).
svn_error_t * | svn_repos_fs_change_txn_props (svn_fs_txn_t *txn, const apr_array_header_t *props, apr_pool_t *pool)
| Validating wrapper for svn_fs_change_txn_props() (which see for argument descriptions).

## Function Documentation

SVN_DEPRECATED svn_error_t* svn_repos_fs_begin_txn_for_commit | ( | svn_fs_txn_t ** | txn_p,
|  | svn_repos_t * | repos,
|  | svn_revnum_t | rev,
|  | const char * | author,
|  | const char * | log_msg,
|  | apr_pool_t * | pool |
| ) |  |  |

Same as svn_repos_fs_begin_txn_for_commit2(), but with revprop_table set to a hash containing author and log_msg as the SVN_PROP_REVISION_AUTHOR and SVN_PROP_REVISION_LOG properties, respectively.

author and log_msg may both be `NULL`.

Deprecated:
  Provided for backward compatibility with the 1.4 API.

svn_error_t* svn_repos_fs_begin_txn_for_commit2 | ( | svn_fs_txn_t ** | txn_p,
|  | svn_repos_t * | repos,
|  | svn_revnum_t | rev,
|  | apr_hash_t * | revprop_table,
|  | apr_pool_t * | pool |
| ) |  |  |

Like svn_fs_begin_txn(), but use revprop_table, a hash mapping `const char *` property names to svn_string_t values, to set the properties on transaction *txn_p.

repos is the repository object which contains the filesystem. rev, *txn_p, and pool are as in svn_fs_begin_txn().

Before a txn is created, the repository's start-commit hooks are run; if any of them fail, no txn is created, *txn_p is unaffected, and SVN_ERR_REPOS_HOOK_FAILURE is returned.

Note:
  revprop_table may contain an SVN_PROP_REVISION_DATE property, which will be set on the transaction, but that will be overwritten when the transaction is committed.

Since:
  New in 1.5.

svn_error_t* svn_repos_fs_begin_txn_for_update | ( | svn_fs_txn_t ** | txn_p,
|  | svn_repos_t * | repos,
|  | svn_revnum_t | rev,
|  | const char * | author,
|  | apr_pool_t * | pool |
| ) |  |  |

Like svn_fs_begin_txn(), but use author to set the corresponding property on transaction *txn_p.

repos is the repository object which contains the filesystem. rev, *txn_p, and pool are as in svn_fs_begin_txn().

### Someday: before a txn is created, some kind of read-hook could be called here.

svn_error_t* svn_repos_fs_change_node_prop | ( | svn_fs_root_t * | root,
|  | const char * | path,
|  | const char * | name,
|  | const svn_string_t * | value,
|  | apr_pool_t * | pool |
| ) |  |  |

Validating wrapper for svn_fs_change_node_prop() (which see for argument descriptions).

If name's kind is not svn_prop_regular_kind, return SVN_ERR_REPOS_BAD_ARGS. If name is an "svn:" property, validate its value and return SVN_ERR_BAD_PROPERTY_VALUE if it is invalid for the property.

Note:
  Currently, the only properties validated are the "svn:" properties SVN_PROP_REVISION_LOG and SVN_PROP_REVISION_DATE. This may change in future releases.

SVN_DEPRECATED svn_error_t* svn_repos_fs_change_rev_prop | ( | svn_repos_t * | repos,
|  | svn_revnum_t | rev,
|  | const char * | author,
|  | const char * | name,
|  | const svn_string_t * | new_value,
|  | apr_pool_t * | pool |
| ) |  |  |

Similar to svn_repos_fs_change_rev_prop2(), but with the authz_read_func parameter always NULL.

Deprecated:
  Provided for backward compatibility with the 1.0 API.

SVN_DEPRECATED svn_error_t* svn_repos_fs_change_rev_prop2 | ( | svn_repos_t * | repos,
|  | svn_revnum_t | rev,
|  | const char * | author,
|  | const char * | name,
|  | const svn_string_t * | new_value,
|  | svn_repos_authz_func_t | authz_read_func,
|  | void * | authz_read_baton,
|  | apr_pool_t * | pool |
| ) |  |  |

Similar to svn_repos_fs_change_rev_prop3(), but with the use_pre_revprop_change_hook and use_post_revprop_change_hook always set to `TRUE`.

Deprecated:
  Provided for backward compatibility with the 1.4 API.

SVN_DEPRECATED svn_error_t* svn_repos_fs_change_rev_prop3 | ( | svn_repos_t * | repos,
|  | svn_revnum_t | rev,
|  | const char * | author,
|  | const char * | name,
|  | const svn_string_t * | new_value,
|  | svn_boolean_t | use_pre_revprop_change_hook,
|  | svn_boolean_t | use_post_revprop_change_hook,
|  | svn_repos_authz_func_t | authz_read_func,
|  | void * | authz_read_baton,
|  | apr_pool_t * | pool |
| ) |  |  |

Similar to svn_repos_fs_change_rev_prop4(), but with old_value_p always set to `NULL`.

(In other words, it is similar to svn_fs_change_rev_prop().)

Deprecated:
  Provided for backward compatibility with the 1.6 API.

Since:
  New in 1.5.

svn_error_t* svn_repos_fs_change_rev_prop4 | ( | svn_repos_t * | repos,
|  | svn_revnum_t | rev,
|  | const char * | author,
|  | const char * | name,
|  | const svn_string_t *const * | old_value_p,
|  | const svn_string_t * | new_value,
|  | svn_boolean_t | use_pre_revprop_change_hook,
|  | svn_boolean_t | use_post_revprop_change_hook,
|  | svn_repos_authz_func_t | authz_read_func,
|  | void * | authz_read_baton,
|  | apr_pool_t * | pool |
| ) |  |  |

Like svn_fs_change_rev_prop2(), but validate the name and value of the property and invoke the repos's pre- and post-revprop-change hooks around the change as specified by use_pre_revprop_change_hook and use_post_revprop_change_hook (respectively).

rev is the revision whose property to change, name is the name of the property, and new_value is the new value of the property. If old_value_p is not `NULL`, then *old_value_p is the expected current (preexisting) value of the property (or `NULL` for "unset"). author is the authenticated username of the person changing the property value, or NULL if not available.

If authz_read_func is non-NULL, then use it (with authz_read_baton) to validate the changed-paths associated with rev. If the revision contains any unreadable changed paths, then return SVN_ERR_AUTHZ_UNREADABLE.

Validate name and new_value like the same way svn_repos_fs_change_node_prop() does.

Use pool for temporary allocations.

Since:
  New in 1.7.

svn_error_t* svn_repos_fs_change_txn_prop | ( | svn_fs_txn_t * | txn,
|  | const char * | name,
|  | const svn_string_t * | value,
|  | apr_pool_t * | pool |
| ) |  |  |

Validating wrapper for svn_fs_change_txn_prop() (which see for argument descriptions).

See svn_repos_fs_change_txn_props() for more information.

svn_error_t* svn_repos_fs_change_txn_props | ( | svn_fs_txn_t * | txn,
|  | const apr_array_header_t * | props,
|  | apr_pool_t * | pool |
| ) |  |  |

Validating wrapper for svn_fs_change_txn_props() (which see for argument descriptions).

Validate properties and their values the same way svn_repos_fs_change_node_prop() does.

Since:
  New in 1.5.

svn_error_t* svn_repos_fs_commit_txn | ( | const char ** | conflict_p,
|  | svn_repos_t * | repos,
|  | svn_revnum_t * | new_rev,
|  | svn_fs_txn_t * | txn,
|  | apr_pool_t * | pool |
| ) |  |  |

Like svn_fs_commit_txn(), but invoke the repos' pre- and post-commit hooks around the commit.

Use pool for any necessary allocations.

If the pre-commit hook fails, do not attempt to commit the transaction and throw the original error to the caller.

A successful commit is indicated by a valid revision value in *new_rev, not if svn_fs_commit_txn() returns an error, which can occur during its post commit FS processing. If the transaction was not committed, then return the associated error and do not execute the post-commit hook.

If the commit succeeds the post-commit hook is executed. If the post-commit hook returns an error, always wrap it with SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED; this allows the caller to find the post-commit hook error in the returned error chain. If both svn_fs_commit_txn() and the post-commit hook return errors, then svn_fs_commit_txn()'s error is the parent error and the SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped error is the child error.

conflict_p, new_rev, and txn are as in svn_fs_commit_txn().

svn_error_t* svn_repos_fs_revision_prop | ( | svn_string_t ** | value_p,
|  | svn_repos_t * | repos,
|  | svn_revnum_t | rev,
|  | const char * | propname,
|  | svn_repos_authz_func_t | authz_read_func,
|  | void * | authz_read_baton,
|  | apr_pool_t * | pool |
| ) |  |  |

Set *value_p to the value of the property named propname on revision rev in the filesystem opened in repos.

If rev has no property by that name, set *value_p to zero. Allocate the result in pool.

If authz_read_func is non-NULL, then use it (with authz_read_baton) to validate the changed-paths associated with rev. If the changed-paths are all unreadable, then set *value_p to zero unconditionally. If only some of the changed-paths are unreadable, then allow 'svn:author' and 'svn:date' propvalues to be fetched, but return 0 for any other property.

Since:
  New in 1.1.

svn_error_t* svn_repos_fs_revision_proplist | ( | apr_hash_t ** | table_p,
|  | svn_repos_t * | repos,
|  | svn_revnum_t | rev,
|  | svn_repos_authz_func_t | authz_read_func,
|  | void * | authz_read_baton,
|  | apr_pool_t * | pool |
| ) |  |  |

Set *table_p to the entire property list of revision rev in filesystem opened in repos, as a hash table allocated in pool.

The table maps `char *` property names to svn_string_t * values; the names and values are allocated in pool.

If authz_read_func is non-NULL, then use it (with authz_read_baton) to validate the changed-paths associated with rev. If the changed-paths are all unreadable, then return an empty hash. If only some of the changed-paths are unreadable, then return an empty hash, except for 'svn:author' and 'svn:date' properties (assuming those properties exist).

Since:
  New in 1.1.

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines