=== subversion/svnversion/main.c ================================================================== --- subversion/svnversion/main.c (revision 47327) +++ subversion/svnversion/main.c (local) @@ -108,9 +108,10 @@ int main(int argc, const char *argv[]) { - const char *wc_path, *trail_url; + const char *wc_path, *wc_check_path, *trail_url; apr_allocator_t *allocator; apr_pool_t *pool; + svn_node_kind_t kind; int wc_format; svn_wc_revision_status_t *res; svn_boolean_t no_newline = FALSE, committed = FALSE; @@ -219,11 +220,23 @@ else trail_url = NULL; - SVN_INT_ERR(svn_wc_check_wc(wc_path, &wc_format, pool)); + /* As we can only call svn_wc_check_wc on directories, if we were + passed a file on the command-line, use its parent directory there + instead. (We still find the original file's revision later.) */ + SVN_INT_ERR(svn_io_check_path(wc_path, &kind, pool)); + if (kind == svn_node_file) + { + wc_check_path = svn_path_dirname(wc_path, pool); + } + else + { + wc_check_path = wc_path; + } + + SVN_INT_ERR(svn_wc_check_wc(wc_check_path, &wc_format, pool)); if (! wc_format) { - svn_node_kind_t kind; - SVN_INT_ERR(svn_io_check_path(wc_path, &kind, pool)); + SVN_INT_ERR(svn_io_check_path(wc_check_path, &kind, pool)); if (kind == svn_node_dir) { SVN_INT_ERR(svn_cmdline_printf(pool, _("exported%s"), === subversion/tests/cmdline/svnversion_tests.py ================================================================== --- subversion/tests/cmdline/svnversion_tests.py (revision 47327) +++ subversion/tests/cmdline/svnversion_tests.py (local) @@ -70,6 +70,14 @@ wc_dir, repo_url, [ "1:2\n" ], []) + svntest.actions.run_and_verify_svnversion("Unmodified higher file in mixed working copy", + os.path.join(wc_dir, 'A', 'mu'), repo_url + "/A/mu", + [ "2\n" ], []) + + svntest.actions.run_and_verify_svnversion("Unmodified lower file in mixed working copy", + os.path.join(wc_dir, 'iota'), repo_url + "/iota", + [ "1\n" ], []) + svntest.actions.run_and_verify_svn(None, None, [], 'propset', 'blue', 'azul', os.path.join(wc_dir, 'A', 'mu')) @@ -79,6 +87,10 @@ wc_dir, repo_url, [ "1:2M\n" ], []) + svntest.actions.run_and_verify_svnversion("Property modified file in mixed working copy", + os.path.join(wc_dir, 'A', 'mu'), repo_url + "/A/mu", + [ "2M\n" ], []) + iota_path = os.path.join(wc_dir, 'iota') gamma_url = svntest.main.current_repo_url + '/A/D/gamma' expected_output = wc.State(wc_dir, {'iota' : Item(status='U ')})