Index: subversion/mod_dav_svn/file_revs.c =================================================================== --- subversion/mod_dav_svn/file_revs.c (revision 13145) +++ subversion/mod_dav_svn/file_revs.c (working copy) @@ -273,9 +273,9 @@ if (serr) { - derr = dav_svn_convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, serr->message, - resource->pool); - goto cleanup; + /* going to cleanup: causes status to change */ + return (dav_svn_convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, serr->message, + resource->pool)); } if ((serr = maybe_send_header(&frb))) Index: subversion/tests/clients/cmdline/blame_tests.py =================================================================== --- subversion/tests/clients/cmdline/blame_tests.py (revision 13145) +++ subversion/tests/clients/cmdline/blame_tests.py (working copy) @@ -89,6 +89,35 @@ +# Issue #2154 - annotating a directory should fail +# (change needed if the desired behavior is to +# run blame recursively on all the files in it) +# +def blame_directory(sbox): + "annotating a directory not allowed" + + # Issue 2154 - blame on directory fails without error message + + import re + + # Setup + sbox.build() + wc_dir = sbox.wc_dir + dir = os.path.join(wc_dir, 'A') + + # Run blame against directory 'A' + expected_error = ".*/A is not a file" + outlines, errlines = svntest.main.run_svn(1, 'blame', dir) + + # Verify expected error message is output + for line in errlines: + if re.match (expected_error, line): + break + else: + raise svntest.Failure ('Failed to find %s in %s' % + (expected_error, str(errlines))) + + ######################################################################## # Run the tests @@ -97,6 +126,7 @@ test_list = [ None, blame_space_in_name, blame_binary, + blame_directory, ] if __name__ == '__main__': Index: subversion/libsvn_repos/rev_hunt.c =================================================================== --- subversion/libsvn_repos/rev_hunt.c (revision 13145) +++ subversion/libsvn_repos/rev_hunt.c (working copy) @@ -536,7 +536,9 @@ the callback before reporting an uglier error below. */ SVN_ERR (svn_fs_check_path (&kind, root, path, pool)); if (kind != svn_node_file) - return svn_error_create (SVN_ERR_FS_NOT_FILE, NULL, NULL); + return svn_error_createf + (SVN_ERR_FS_NOT_FILE, NULL, _("%s is not a file"), + svn_path_local_style (path, pool)); /* Open a history object. */ SVN_ERR (svn_fs_node_history (&history, root, path, last_pool));