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 2010/10/26 18:50:07 UTC

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

Author: julianfoad
Date: Tue Oct 26 16:50:07 2010
New Revision: 1027643

URL: http://svn.apache.org/viewvc?rev=1027643&view=rev
Log:
Fix an inconsistency in the WC DB's searches for children. Doesn't seem to
have any effect on the test suite.

* subversion/libsvn_wc/wc_db.c
  (construct_like_arg): Be consistent in only matching children, and never
    matching the specified relpath itself.
  (wclock_obtain_cb): Use construct_like_arg() instead of in-line code, to
    help maintain consistency.

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=1027643&r1=1027642&r2=1027643&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Oct 26 16:50:07 2010
@@ -396,16 +396,14 @@ escape_sqlite_like(const char * const st
  * operator, in order to match any path that is a child of LOCAL_RELPATH
  * (at any depth below LOCAL_RELPATH), *excluding* LOCAL_RELPATH itself.
  * LOCAL_RELPATH may be the empty string, in which case the result will
- * match any path *including* the empty path.
- *
- * ### Inconsistent on whether the match includes LOCAL_RELPATH itself.
+ * match any path except the empty path.
  *
  * Allocate the result either statically or in RESULT_POOL.  */
 static const char *construct_like_arg(const char *local_relpath,
                                       apr_pool_t *result_pool)
 {
   if (local_relpath[0] == '\0')
-    return "%";
+    return "_%";
 
   return apr_pstrcat(result_pool,
                      escape_sqlite_like(local_relpath, result_pool),
@@ -7692,13 +7690,7 @@ wclock_obtain_cb(void *baton,
                                                         scratch_pool));
     }
 
-  if (*bt->local_relpath == '\0')
-    filter = "%";
-  else
-    filter = apr_pstrcat(scratch_pool,
-                         escape_sqlite_like(bt->local_relpath, scratch_pool),
-                         "/%",
-                         (char *)NULL);
+  filter = construct_like_arg(bt->local_relpath, scratch_pool);
 
   /* Check if there are nodes locked below the new lock root */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_FIND_WC_LOCK));