Index: subversion/libsvn_fs_base/tree.c =================================================================== --- subversion/libsvn_fs_base/tree.c (revision 25405) +++ 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. */ @@ -757,7 +717,7 @@ { /* Build a better error message than svn_fs_base__dag_open can provide, giving the root and full path name. */ - return NOT_FOUND(root, path); + return SVN_FS__NOT_FOUND(root, path); } } @@ -1272,7 +1232,7 @@ struct change_merge_info_args args; if (! root->is_txn_root) - return NOT_TXN(root); + return SVN_FS__NOT_TXN(root); args.root = root; args.path = path; SVN_ERR(svn_mergeinfo__to_string((svn_string_t **) &args.value, merge_info, @@ -1367,7 +1327,7 @@ struct change_node_prop_args args; if (! root->is_txn_root) - return NOT_TXN(root); + return SVN_FS__NOT_TXN(root); args.root = root; args.path = path; @@ -2582,7 +2542,7 @@ svn_fs_t *fs; if (! target_root->is_txn_root) - return NOT_TXN(target_root); + return SVN_FS__NOT_TXN(target_root); /* Paranoia. */ fs = ancestor_root->fs; @@ -2697,7 +2657,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 SVN_FS__ALREADY_EXISTS(root, path); /* Check to see if some lock is 'reserving' a file-path or dir-path at that location, or even some child-path; if so, check that we @@ -2736,7 +2696,7 @@ struct make_dir_args args; if (! root->is_txn_root) - return NOT_TXN(root); + return SVN_FS__NOT_TXN(root); args.root = root; args.path = path; @@ -2765,7 +2725,7 @@ const char *txn_id = root->txn; if (! root->is_txn_root) - return NOT_TXN(root); + return SVN_FS__NOT_TXN(root); SVN_ERR(open_path(&parent_path, root, path, 0, txn_id, trail, trail->pool)); @@ -2957,7 +2917,7 @@ from_root->fs->path, to_root->fs->path); if (! to_root->is_txn_root) - return NOT_TXN(to_root); + return SVN_FS__NOT_TXN(to_root); if (from_root->is_txn_root) return svn_error_create @@ -3104,7 +3064,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 SVN_FS__ALREADY_EXISTS(root, path); /* Check to see if some lock is 'reserving' a file-path or dir-path at that location, or even some child-path; if so, check that we @@ -3864,7 +3824,7 @@ /* And we require that the path exist in the root. */ SVN_ERR(base_check_path(&kind, root, path, pool)); if (kind == svn_node_none) - return NOT_FOUND(root, path); + return SVN_FS__NOT_FOUND(root, path); /* Okay, all seems well. Build our history object and return it. */ *history_p = assemble_history(root->fs, Index: subversion/include/private/svn_fs_util.h =================================================================== --- subversion/include/private/svn_fs_util.h (revision 25405) +++ subversion/include/private/svn_fs_util.h (working copy) @@ -40,6 +40,45 @@ 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. ROOT is of type svn_fs_root_t *. */ +#define SVN_FS__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) \ + ) + + +/* Build a detailed `file already exists' message for PATH in ROOT. + ROOT is of type svn_fs_root_t *. */ +#define SVN_FS__ALREADY_EXISTS(root, path) ( \ + root->is_txn_root ? \ + svn_error_createf \ + (SVN_ERR_FS_ALREADY_EXISTS, 0, \ + _("File already exists: filesystem '%s', transaction '%s', path '%s'"), \ + root->fs->path, root->txn, path) \ + : \ + svn_error_createf \ + (SVN_ERR_FS_ALREADY_EXISTS, 0, \ + _("File already exists: filesystem '%s', revision %ld, path '%s'"), \ + root->fs->path, root->rev, path) \ + ) + +/* ROOT is of type svn_fs_root_t *. */ +#define SVN_FS__NOT_TXN(root) \ + 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 25405) +++ 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. */ @@ -679,7 +630,7 @@ { /* Build a better error message than svn_fs_fs__dag_open can provide, giving the root and full path name. */ - return NOT_FOUND(root, path); + return SVN_FS__NOT_FOUND(root, path); } } @@ -1044,7 +995,7 @@ svn_fs_txn_t *txn; if (! root->is_txn_root) - return not_txn(root); + return SVN_FS__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 SVN_FS__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 SVN_FS__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 SVN_FS__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 SVN_FS__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 SVN_FS__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 SVN_FS__ALREADY_EXISTS(root, path); /* Check (non-recursively) to see if path is locked; if so, check that we can use it. */ @@ -2755,7 +2706,7 @@ /* And we require that the path exist in the root. */ SVN_ERR(svn_fs_fs__check_path(&kind, root, path, pool)); if (kind == svn_node_none) - return NOT_FOUND(root, path); + return SVN_FS__NOT_FOUND(root, path); /* Okay, all seems well. Build our history object and return it. */ *history_p = assemble_history(root->fs,