Index: subversion/tests/cmdline/stat_tests.py =================================================================== --- subversion/tests/cmdline/stat_tests.py (revision 18810) +++ subversion/tests/cmdline/stat_tests.py (working copy) @@ -653,7 +653,7 @@ def status_on_unversioned_dotdot(sbox): "status on '..' where '..' is not versioned" - # See issue #1617. + # See issue #1617 (and #2030). sbox.build() wc_dir = sbox.wc_dir @@ -667,7 +667,7 @@ try: out, err = svntest.main.run_svn(1, 'st', '..') for line in err: - if line.find('svn: \'..\' is not a working copy') != -1: + if line.find('svn: warning: \'..\' is not a working copy') != -1: break else: raise svntest.Failure @@ -832,6 +832,15 @@ 'Status against revision: 2\n'], [], "status", "-u", wc_dir) +#---------------------------------------------------------------------- + +def status_unversioned_dir(sbox): + "status on unversioned dir (issue 2030)" + sbox.build() + dir = sbox.repo_dir + expected_err = ["svn: warning: '" + dir + "' is not a working copy\n"] + svntest.actions.run_and_verify_svn(None, [], expected_err, "status", dir) + #---------------------------------------------------------------------- @@ -859,6 +868,7 @@ missing_dir_in_anchor, status_in_xml, status_ignored_dir, + status_unversioned_dir, ] if __name__ == '__main__': Index: subversion/svn/status-cmd.c =================================================================== --- subversion/svn/status-cmd.c (revision 18810) +++ subversion/svn/status-cmd.c (working copy) @@ -143,7 +143,35 @@ } } +/* Simpler helper to allow use of svn_cl__try. */ +static svn_error_t * +do_status(svn_cl__opt_state_t *opt_state, + const char *target, + const svn_opt_revision_t *rev, + void *status_baton, + svn_client_ctx_t *ctx, + apr_pool_t *pool) +{ + svn_revnum_t repos_rev = SVN_INVALID_REVNUM; + if (opt_state->xml) + SVN_ERR(print_start_target_xml(svn_path_local_style(target, pool), pool)); + + SVN_ERR(svn_client_status2(&repos_rev, target, rev, + print_status, status_baton, + opt_state->nonrecursive ? FALSE : TRUE, + opt_state->verbose, + opt_state->update, + opt_state->no_ignore, + opt_state->ignore_externals, + ctx, pool)); + + if (opt_state->xml) + SVN_ERR(print_finish_target_xml(repos_rev, pool)); + + return SVN_NO_ERROR; +} + /* This implements the `svn_opt_subcommand_t' interface. */ svn_error_t * svn_cl__status(apr_getopt_t *os, @@ -157,7 +185,6 @@ int i; svn_opt_revision_t rev; struct status_baton sb; - svn_revnum_t repos_rev = SVN_INVALID_REVNUM; SVN_ERR(svn_opt_args_to_target_array2(&targets, os, opt_state->targets, pool)); @@ -211,19 +238,11 @@ sb.xml_mode = opt_state->xml; sb.pool = subpool; - if (opt_state->xml) - SVN_ERR(print_start_target_xml(svn_path_local_style(target, pool), - pool)); - - SVN_ERR(svn_client_status2(&repos_rev, target, &rev, print_status, &sb, - opt_state->nonrecursive ? FALSE : TRUE, - opt_state->verbose, - opt_state->update, - opt_state->no_ignore, - opt_state->ignore_externals, - ctx, subpool)); - if (opt_state->xml) - SVN_ERR(print_finish_target_xml(repos_rev, pool)); + SVN_ERR(svn_cl__try(do_status(opt_state, target, &rev, &sb, ctx, + subpool), + NULL, opt_state->quiet, + SVN_ERR_WC_NOT_DIRECTORY, /* not versioned */ + SVN_NO_ERROR)); } svn_pool_destroy(subpool);