
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
168
|
Chapter 8: Developer Information
In the previous code segment, calls were made to both the repository and filesystem
interfaces. We could just as easily have committed the transaction using
svn_fs_
commit_txn
. But the filesystem API knows nothing about the repository library’s hook
mechanism. If you want your Subversion repository to automatically perform some
set of non-Subversion tasks every time you commit a transaction (such as sending an
email that describes all the changes made in that transaction to your developer mail-
ing list), you need to use the libsvn_repos-wrapped version of that function—
svn_
repos_fs_commit_txn
. This function actually first run the pre-commit hook script if
one exists, then commit the transaction, and finally runs a
post-commit hook script.
The hooks provide a special kind of reporting mechanism that does not really belong
in the core filesystem library itself. (For more information regarding Subversion’s
repository hooks, see “Hook Scripts” in Chapter 5).
object that represents that transaction. */
SVN_ERR (svn_fs_txn_root (&txn_root, txn, pool));
/* Create our new directory under the transaction root, at the path
NEW_DIRECTORY. */
SVN_ERR (svn_fs_make_dir (txn_root, new_directory, pool));
/* Commit the transaction, creating a new revision of the ...