Index: subversion/libsvn_client/info.c =================================================================== --- subversion/libsvn_client/info.c (revision 16117) +++ subversion/libsvn_client/info.c (working copy) @@ -358,21 +358,18 @@ /* Possibly discover a lock attached to the remote URL. */ lock = NULL; - if (peg_revision->kind == svn_opt_revision_head) - { - err = svn_ra_get_lock (ra_session, &lock, "", pool); + err = svn_ra_get_lock (ra_session, &lock, "", pool); - /* An old mod_dav_svn will always work; there's nothing wrong with - doing a PROPFIND for a property named "DAV:supportedlock". But - an old svnserve will error. */ - if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED) - { - svn_error_clear(err); - lock = NULL; - } - else if (err) - return err; + /* An old mod_dav_svn will always work; there's nothing wrong with + doing a PROPFIND for a property named "DAV:supportedlock". But + an old svnserve will error. */ + if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED) + { + svn_error_clear(err); + lock = NULL; } + else if (err) + return err; /* Push the URL's dirent (and lock) at the callback.*/ SVN_ERR (build_info_from_dirent (&info, the_ent, lock, url, rev, Index: subversion/tests/clients/cmdline/lock_tests.py =================================================================== --- subversion/tests/clients/cmdline/lock_tests.py (revision 16117) +++ subversion/tests/clients/cmdline/lock_tests.py (working copy) @@ -1225,7 +1225,51 @@ # Make sure the file is unlocked svntest.actions.run_and_verify_status(wc_dir, expected_status) +#---------------------------------------------------------------------- +def repos_lock_with_info(sbox): + "verify info path@X or path -rY return repos lock" + sbox.build() + wc_dir = sbox.wc_dir + + fname = 'iota' + comment = 'This is a lock test.' + file_path = os.path.join(sbox.wc_dir, fname) + file_url = svntest.main.current_repo_url + '/' + fname + + # lock wc file + svntest.actions.run_and_verify_svn(None, None, [], 'lock', + '--username', svntest.main.wc_author2, + '--password', svntest.main.wc_passwd, + '--no-auth-cache', + '-m', comment, file_path) + + # stealing lock on wc file + svntest.actions.run_and_verify_svn(None, None, [], 'lock', + '--username', svntest.main.wc_author2, + '--password', svntest.main.wc_passwd, + '--no-auth-cache', + '--force', + '-m', comment, file_url) + # Getting repository lock token + output, err = svntest.actions.run_and_verify_svn(None, None, [], 'info', + file_url) + lock_token = output[-6][28:] + + # info with revision + output, err = svntest.actions.run_and_verify_svn(None, None, [], 'info', + file_path, '-r1') + if (output[-6][28:] != lock_token): + print "Error: expected repository lock information not found." + raise svntest.Failure + + # info with peg revision + output, err = svntest.actions.run_and_verify_svn(None, None, [], 'info', + file_path + '@1') + if (output[-6][28:] != lock_token): + print "Error: expected repository lock information not found." + raise svntest.Failure + ######################################################################## # Run the tests @@ -1258,6 +1302,7 @@ Skip(lock_and_exebit1, (os.name != 'posix')), Skip(lock_and_exebit2, (os.name != 'posix')), commit_xml_unsafe_file_unlock, + repos_lock_with_info, ] if __name__ == '__main__':