Index: subversion/libsvn_fs_base/tree.c =================================================================== --- subversion/libsvn_fs_base/tree.c (revision 25371) +++ subversion/libsvn_fs_base/tree.c (working copy) @@ -382,46 +382,6 @@ -/* Constructing nice error messages for roots. */ - -/* Build an SVN_ERR_FS_NOT_FOUND error, with a detailed error text, - for PATH in ROOT. */ -#define NOT_FOUND(r, p) ( \ - r->is_txn_root ? \ - svn_error_createf \ - (SVN_ERR_FS_NOT_FOUND, 0, \ - _("File not found: transaction '%s', path '%s'"), \ - r->txn, p) \ - : \ - svn_error_createf \ - (SVN_ERR_FS_NOT_FOUND, 0, \ - _("File not found: revision %ld, path '%s'"), \ - r->rev, p) \ - ) - - -/* Build a detailed `file already exists' message for PATH in ROOT. */ -#define ALREADY_EXISTS(r, p) ( \ - r->is_txn_root ? \ - svn_error_createf \ - (SVN_ERR_FS_ALREADY_EXISTS, 0, \ - _("File already exists: filesystem '%s', transaction '%s', path '%s'"), \ - r->fs->path, r->txn, p) \ - : \ - svn_error_createf \ - (SVN_ERR_FS_ALREADY_EXISTS, 0, \ - _("File already exists: filesystem '%s', revision %ld, path '%s'"), \ - r->fs->path, r->rev, p) \ - ) - - -#define NOT_TXN(r) \ - svn_error_create \ - (SVN_ERR_FS_NOT_TXN_ROOT, NULL, \ - _("Root object must be a transaction root")) - - - /* Getting dag nodes for roots. */ Index: subversion/include/private/svn_fs_util.h =================================================================== --- subversion/include/private/svn_fs_util.h (revision 25371) +++ subversion/include/private/svn_fs_util.h (working copy) @@ -40,6 +40,44 @@ error if this is not the case. */ svn_error_t *svn_fs__check_fs(svn_fs_t *fs); +/* Constructing nice error messages for roots. */ + +/* Build an SVN_ERR_FS_NOT_FOUND error, with a detailed error text, + for PATH in ROOT. */ +#define NOT_FOUND(r, p) ( \ + r->is_txn_root ? \ + svn_error_createf \ + (SVN_ERR_FS_NOT_FOUND, 0, \ + _("File not found: transaction '%s', path '%s'"), \ + r->txn, p) \ + : \ + svn_error_createf \ + (SVN_ERR_FS_NOT_FOUND, 0, \ + _("File not found: revision %ld, path '%s'"), \ + r->rev, p) \ + ) + + +/* Build a detailed `file already exists' message for PATH in ROOT. */ +#define ALREADY_EXISTS(r, p) ( \ + r->is_txn_root ? \ + svn_error_createf \ + (SVN_ERR_FS_ALREADY_EXISTS, 0, \ + _("File already exists: filesystem '%s', transaction '%s', path '%s'"), \ + r->fs->path, r->txn, p) \ + : \ + svn_error_createf \ + (SVN_ERR_FS_ALREADY_EXISTS, 0, \ + _("File already exists: filesystem '%s', revision %ld, path '%s'"), \ + r->fs->path, r->rev, p) \ + ) + + +#define NOT_TXN(r) \ + svn_error_create \ + (SVN_ERR_FS_NOT_TXN_ROOT, NULL, \ + _("Root object must be a transaction root")) + /* SVN_FS__ERR_NOT_MUTABLE: the caller attempted to change a node outside of a transaction. FS is of type "svn_fs_t *". */ #define SVN_FS__ERR_NOT_MUTABLE(fs, rev, path_in_repo) \ Index: subversion/libsvn_fs_fs/tree.c =================================================================== --- subversion/libsvn_fs_fs/tree.c (revision 25371) +++ subversion/libsvn_fs_fs/tree.c (working copy) @@ -301,55 +301,6 @@ -/* Constructing nice error messages for roots. */ - -/* Return the error SVN_ERR_FS_NOT_FOUND, with a detailed error text, - for PATH in ROOT. */ -#define NOT_FOUND(root, path) ( \ - root->is_txn_root ? \ - svn_error_createf \ - (SVN_ERR_FS_NOT_FOUND, 0, \ - _("File not found: transaction '%s', path '%s'"), \ - root->txn, path) \ - : \ - svn_error_createf \ - (SVN_ERR_FS_NOT_FOUND, 0, \ - _("File not found: revision %ld, path '%s'"), \ - root->rev, path) \ - ) - - -/* Return a detailed `file already exists' message for PATH in ROOT. */ -static svn_error_t * -already_exists(svn_fs_root_t *root, const char *path) -{ - svn_fs_t *fs = root->fs; - - if (root->is_txn_root) - return - svn_error_createf - (SVN_ERR_FS_ALREADY_EXISTS, 0, - _("File already exists: filesystem '%s', transaction '%s', path '%s'"), - fs->path, root->txn, path); - else - return - svn_error_createf - (SVN_ERR_FS_ALREADY_EXISTS, 0, - _("File already exists: filesystem '%s', revision %ld, path '%s'"), - fs->path, root->rev, path); -} - - -static svn_error_t * -not_txn(svn_fs_root_t *root) -{ - return svn_error_create - (SVN_ERR_FS_NOT_TXN_ROOT, NULL, - _("Root object must be a transaction root")); -} - - - /* Getting dag nodes for roots. */ @@ -1044,7 +995,7 @@ svn_fs_txn_t *txn; if (! root->is_txn_root) - return not_txn(root); + return NOT_TXN(root); txn_id = root->txn; SVN_ERR(root->fs->vtable->open_txn(&txn, root->fs, txn_id, pool)); SVN_ERR(svn_mergeinfo__to_string(&mergeinfo_str, mergeinfo, pool)); @@ -1074,7 +1025,7 @@ const char *txn_id; if (! root->is_txn_root) - return not_txn(root); + return NOT_TXN(root); txn_id = root->txn; SVN_ERR(open_path(&parent_path, root, path, 0, txn_id, pool)); @@ -1748,7 +1699,7 @@ svn_stringbuf_t *conflict = svn_stringbuf_create("", pool); if (! target_root->is_txn_root) - return not_txn(target_root); + return NOT_TXN(target_root); /* Paranoia. */ if ((source_root->fs != ancestor_root->fs) @@ -1853,7 +1804,7 @@ /* If there's already a sub-directory by that name, complain. This also catches the case of trying to make a subdirectory named `/'. */ if (parent_path->node) - return already_exists(root, path); + return ALREADY_EXISTS(root, path); /* Create the subdirectory. */ SVN_ERR(make_path_mutable(root, parent_path->parent, path, pool)); @@ -1888,7 +1839,7 @@ const char *txn_id = root->txn; if (! root->is_txn_root) - return not_txn(root); + return NOT_TXN(root); SVN_ERR(open_path(&parent_path, root, path, 0, txn_id, pool)); @@ -2082,7 +2033,7 @@ apr_pool_t *pool) { if (! to_root->is_txn_root) - return not_txn(to_root); + return NOT_TXN(to_root); return copy_helper(from_root, path, to_root, path, FALSE, pool); } @@ -2161,7 +2112,7 @@ /* If there's already a file by that name, complain. This also catches the case of trying to make a file named `/'. */ if (parent_path->node) - return already_exists(root, path); + return ALREADY_EXISTS(root, path); /* Check (non-recursively) to see if path is locked; if so, check that we can use it. */