You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2011/04/11 18:39:57 UTC
svn commit: r1091117 - /subversion/trunk/subversion/libsvn_wc/translate.c
Author: julianfoad
Date: Mon Apr 11 16:39:56 2011
New Revision: 1091117
URL: http://svn.apache.org/viewvc?rev=1091117&view=rev
Log:
Remove useless code from svn_wc__maybe_set_read_only(). A follow-up to
r1084897.
* subversion/libsvn_wc/translate.c
(svn_wc__maybe_set_read_only): It doesn't make sense to operate on an
unversioned path so just return the error if that is the case. The
comment here said "we still want to set it to read-only" which didn't
make sense (because we can't query the svn:needs-lock property of an
unversioned file) and didn't match the code. I also checked and found
that this condition never occurs in a test suite run.
Modified:
subversion/trunk/subversion/libsvn_wc/translate.c
Modified: subversion/trunk/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/translate.c?rev=1091117&r1=1091116&r2=1091117&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/translate.c (original)
+++ subversion/trunk/subversion/libsvn_wc/translate.c Mon Apr 11 16:39:56 2011
@@ -383,29 +383,20 @@ svn_wc__maybe_set_read_only(svn_boolean_
svn_wc__db_status_t status;
svn_wc__db_kind_t kind;
svn_wc__db_lock_t *lock;
- svn_error_t *err;
if (did_set)
*did_set = FALSE;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
- err = svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- &lock,
- db, local_abspath, scratch_pool, scratch_pool);
+ SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ &lock,
+ db, local_abspath, scratch_pool, scratch_pool));
- if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
- {
- /* If the path wasn't versioned, we still want to set it to read-only. */
- svn_error_clear(err);
- status = svn_wc__db_status_not_present;
- }
- else if (err)
- return svn_error_return(err);
- else if (lock)
+ if (lock)
return SVN_NO_ERROR; /* We have a lock */
else if (kind != svn_wc__db_kind_file)
return SVN_NO_ERROR;