|
svn commit: r13158 - in trunk/subversion: libsvn_repos mod_dav_svn tests/cl: msg#00338version-control.subversion.svn
Author: kfogel Date: Fri Feb 25 15:49:44 2005 New Revision: 13158 Modified: trunk/subversion/libsvn_repos/rev_hunt.c trunk/subversion/mod_dav_svn/file_revs.c trunk/subversion/tests/clients/cmdline/blame_tests.py Log: Resolve issue #2154: 'svn blame' on a directory over DAV would get a messy "invalid XML" complaint instead of a clean error. Patch by VK Sameer <sameer-r6XmE1ReyPisTnJN9+BGXg@xxxxxxxxxxxxxxxx>. * subversion/tests/clients/cmdline/blame_tests.py (blame_directory): Add new test to blame a directory. test_list: Added blame_directory test. * subversion/mod_dav_svn/file_revs.c (dav_svn__file_revs_report): Change to return immediately without cleanup if svn_repos_get_file_revs() returns an error. * subversion/libsvn_repos/rev_hunt.c (svn_repos_get_file_revs): Add path when generating error message. Modified: trunk/subversion/libsvn_repos/rev_hunt.c Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_repos/rev_hunt.c?view=diff&rev=13158&p1=trunk/subversion/libsvn_repos/rev_hunt.c&r1=13157&p2=trunk/subversion/libsvn_repos/rev_hunt.c&r2=13158 ============================================================================== --- trunk/subversion/libsvn_repos/rev_hunt.c (original) +++ trunk/subversion/libsvn_repos/rev_hunt.c Fri Feb 25 15:49:44 2005 @@ -536,7 +536,8 @@ 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"), path); /* Open a history object. */ SVN_ERR (svn_fs_node_history (&history, root, path, last_pool)); Modified: trunk/subversion/mod_dav_svn/file_revs.c Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/mod_dav_svn/file_revs.c?view=diff&rev=13158&p1=trunk/subversion/mod_dav_svn/file_revs.c&r1=13157&p2=trunk/subversion/mod_dav_svn/file_revs.c&r2=13158 ============================================================================== --- trunk/subversion/mod_dav_svn/file_revs.c (original) +++ trunk/subversion/mod_dav_svn/file_revs.c Fri Feb 25 15:49:44 2005 @@ -273,9 +273,14 @@ if (serr) { - derr = dav_svn_convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, serr->message, - resource->pool); - goto cleanup; + /* We don't 'goto cleanup' because ap_fflush() tells httpd + to write the HTTP headers out, and that includes whatever + r->status is at that particular time. When we call + dav_svn_convert_err(), we don't immediately set r->status + right then, so r->status remains 0, hence HTTP status 200 + would be misleadingly returned. */ + return (dav_svn_convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, + serr->message, resource->pool)); } if ((serr = maybe_send_header(&frb))) Modified: trunk/subversion/tests/clients/cmdline/blame_tests.py Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/tests/clients/cmdline/blame_tests.py?view=diff&rev=13158&p1=trunk/subversion/tests/clients/cmdline/blame_tests.py&r1=13157&p2=trunk/subversion/tests/clients/cmdline/blame_tests.py&r2=13158 ============================================================================== --- trunk/subversion/tests/clients/cmdline/blame_tests.py (original) +++ trunk/subversion/tests/clients/cmdline/blame_tests.py Fri Feb 25 15:49:44 2005 @@ -89,6 +89,37 @@ +# 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'. The repository error will + # probably include a leading slash on the path, but we'll tolerate + # it either way, since either way it would still be a clean error. + expected_error = ".*'[/]{0,1}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 +128,7 @@ test_list = [ None, blame_space_in_name, blame_binary, + blame_directory, ] if __name__ == '__main__': |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | svn commit: r13157 - trunk: 00338, maxb-jqHnx1hy4Dsdnm+yROfE0A |
|---|---|
| Next by Date: | svn commit: r13159 - trunk/subversion/libsvn_fs_base: 00338, kfogel-jqHnx1hy4Dsdnm+yROfE0A |
| Previous by Thread: | svn commit: r13157 - trunki: 00338, maxb-jqHnx1hy4Dsdnm+yROfE0A |
| Next by Thread: | svn commit: r13159 - trunk/subversion/libsvn_fs_base: 00338, kfogel-jqHnx1hy4Dsdnm+yROfE0A |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |