You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/05/24 14:26:30 UTC

svn commit: r1342225 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Author: rhuijben
Date: Thu May 24 12:26:30 2012
New Revision: 1342225

URL: http://svn.apache.org/viewvc?rev=1342225&view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (is_wclocked): Following up on r1342217, remove the assumption that the
    first match will be the only match as this is no longer true.
    But it is cheaper to check all matches, then to make Sqlite copy all
    data for sorting and then check the result. Especially when you have
    not that many locks in your working copy.

Found by the entries_compat tests (but missed by me until after I clicked
commit)

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1342225&r1=1342224&r2=1342225&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu May 24 12:26:30 2012
@@ -12035,15 +12035,16 @@ is_wclocked(void *baton,
 
       if (svn_relpath_skip_ancestor(relpath, dir_relpath))
         {
-          /* Any row here means there can be no locks closer to root
-             that extend past here. */
           int locked_levels = svn_sqlite__column_int(stmt, 1);
           int row_depth = relpath_depth(relpath);
 
-          *locked = (locked_levels == -1
-                     || locked_levels + row_depth >= dir_depth);
-          SVN_ERR(svn_sqlite__reset(stmt));
-          return SVN_NO_ERROR;
+          if (locked_levels == -1
+              || locked_levels + row_depth >= dir_depth)
+            {
+              *locked = TRUE;
+              SVN_ERR(svn_sqlite__reset(stmt));
+              return SVN_NO_ERROR;
+            }
         }
 
       SVN_ERR(svn_sqlite__step(&have_row, stmt));