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/10/25 16:26:54 UTC

svn commit: r1188665 - in /subversion/trunk/subversion: include/svn_dirent_uri.h libsvn_ra_serf/merge.c libsvn_subr/dirent_uri.c libsvn_wc/adm_files.c libsvn_wc/wc_db.c tests/libsvn_subr/dirent_uri-test.c

Author: julianfoad
Date: Tue Oct 25 14:26:53 2011
New Revision: 1188665

URL: http://svn.apache.org/viewvc?rev=1188665&view=rev
Log:
Eliminate svn_relpath__is_ancestor(); use svn_relpath_skip_ancestor()
instead.

* subversion/include/svn_dirent_uri.h
  (svn_relpath__is_ancestor): Remove.

* subversion/libsvn_subr/dirent_uri.c
  (svn_relpath__is_ancestor): Remove.
  (svn_fspath__is_ancestor): Use svn_fspath_skip_ancestor() instead.

* subversion/libsvn_ra_serf/merge.c
  (svn_ra_serf__merge_lock_token_list): Use svn_relpath_skip_ancestor()
    instead.

* subversion/libsvn_wc/adm_files.c
  (svn_wc__internal_ensure_adm): Same.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_wclock_obtain, is_wclocked, wclock_owns_lock): Same.

* subversion/tests/libsvn_subr/dirent_uri-test.c
  (test_relpath_is_ancestor): Remove.
  (test_funcs): Remove test_relpath_is_ancestor from the list.

Modified:
    subversion/trunk/subversion/include/svn_dirent_uri.h
    subversion/trunk/subversion/libsvn_ra_serf/merge.c
    subversion/trunk/subversion/libsvn_subr/dirent_uri.c
    subversion/trunk/subversion/libsvn_wc/adm_files.c
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c

Modified: subversion/trunk/subversion/include/svn_dirent_uri.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_dirent_uri.h?rev=1188665&r1=1188664&r2=1188665&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_dirent_uri.h (original)
+++ subversion/trunk/subversion/include/svn_dirent_uri.h Tue Oct 25 14:26:53 2011
@@ -597,13 +597,6 @@ svn_boolean_t
 svn_dirent_is_ancestor(const char *parent_dirent,
                        const char *child_dirent);
 
-/** Return TRUE if @a parent_relpath is an ancestor of @a child_relpath or
- * the relpaths are equal, and FALSE otherwise.
- */
-svn_boolean_t
-svn_relpath__is_ancestor(const char *parent_relpath,
-                         const char *child_relpath);
-
 /** Return TRUE if @a parent_uri is an ancestor of @a child_uri or
  * the uris are equal, and FALSE otherwise.
  */

Modified: subversion/trunk/subversion/libsvn_ra_serf/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/merge.c?rev=1188665&r1=1188664&r2=1188665&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/merge.c Tue Oct 25 14:26:53 2011
@@ -447,7 +447,7 @@ svn_ra_serf__merge_lock_token_list(apr_h
       path.data = key;
       path.len = klen;
 
-      if (parent && !svn_relpath__is_ancestor(parent, key))
+      if (parent && !svn_relpath_skip_ancestor(parent, key))
         continue;
 
       svn_ra_serf__add_open_tag_buckets(body, alloc, "S:lock", NULL);

Modified: subversion/trunk/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/dirent_uri.c?rev=1188665&r1=1188664&r2=1188665&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Tue Oct 25 14:26:53 2011
@@ -1536,12 +1536,6 @@ svn_dirent_is_ancestor(const char *paren
 }
 
 svn_boolean_t
-svn_relpath__is_ancestor(const char *parent_relpath, const char *child_relpath)
-{
-  return svn_relpath_skip_ancestor(parent_relpath, child_relpath) != NULL;
-}
-
-svn_boolean_t
 svn_uri__is_ancestor(const char *parent_uri, const char *child_uri)
 {
   return uri_skip_ancestor(parent_uri, child_uri) != NULL;

Modified: subversion/trunk/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_files.c?rev=1188665&r1=1188664&r2=1188665&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.c Tue Oct 25 14:26:53 2011
@@ -503,7 +503,7 @@ svn_wc__internal_ensure_adm(svn_wc__db_t
       /* ### comparing URLs, should they be canonicalized first? */
       if (strcmp(db_repos_uuid, repos_uuid)
           || strcmp(db_repos_root_url, repos_root_url)
-          || !svn_relpath__is_ancestor(db_repos_relpath, repos_relpath))
+          || !svn_relpath_skip_ancestor(db_repos_relpath, repos_relpath))
         {
           const char *copyfrom_root_url, *copyfrom_repos_relpath;
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1188665&r1=1188664&r2=1188665&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Oct 25 14:26:53 2011
@@ -11368,7 +11368,7 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
           svn_wc__db_wclock_t* lock = &APR_ARRAY_IDX(wcroot->owned_locks,
                                                      i, svn_wc__db_wclock_t);
 
-          if (svn_relpath__is_ancestor(lock->local_relpath, local_relpath)
+          if (svn_relpath_skip_ancestor(lock->local_relpath, local_relpath)
               && (lock->levels == -1
                   || (lock->levels + relpath_depth(lock->local_relpath))
                             >= depth))
@@ -11433,7 +11433,7 @@ is_wclocked(void *baton,
     {
       const char *relpath = svn_sqlite__column_text(stmt, 0, NULL);
 
-      if (svn_relpath__is_ancestor(relpath, dir_relpath))
+      if (svn_relpath_skip_ancestor(relpath, dir_relpath))
         {
           /* Any row here means there can be no locks closer to root
              that extend past here. */
@@ -11568,7 +11568,7 @@ wclock_owns_lock(svn_boolean_t *own_lock
           svn_wc__db_wclock_t *lock = &APR_ARRAY_IDX(owned_locks, i,
                                                      svn_wc__db_wclock_t);
 
-          if (svn_relpath__is_ancestor(lock->local_relpath, local_relpath)
+          if (svn_relpath_skip_ancestor(lock->local_relpath, local_relpath)
               && (lock->levels == -1
                   || ((relpath_depth(lock->local_relpath) + lock->levels)
                       >= lock_level)))

Modified: subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1188665&r1=1188664&r2=1188665&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/dirent_uri-test.c Tue Oct 25 14:26:53 2011
@@ -1441,28 +1441,6 @@ static const testcase_ancestor_t relpath
     { "X:foo",          "X:bar",            NULL },
   };
 
-static svn_error_t *
-test_relpath_is_ancestor(apr_pool_t *pool)
-{
-  const testcase_ancestor_t *t;
-
-  for (t = relpath_ancestor_tests;
-       t < relpath_ancestor_tests + COUNT_OF(relpath_ancestor_tests);
-       t++)
-    {
-      svn_boolean_t retval;
-
-      retval = svn_relpath__is_ancestor(t->path1, t->path2);
-      if (!!t->result != retval)
-        return svn_error_createf
-          (SVN_ERR_TEST_FAILED, NULL,
-           "svn_relpath_is_ancestor (%s, %s) returned %s instead of %s",
-           t->path1, t->path2, retval ? "TRUE" : "FALSE",
-           t->result ? "TRUE" : "FALSE");
-    }
-  return SVN_NO_ERROR;
-}
-
 static const testcase_ancestor_t uri_ancestor_tests[] =
   {
     { "http://test",    "http://test",      "" },
@@ -2788,8 +2766,6 @@ struct svn_test_descriptor_t test_funcs[
                    "test svn_uri_is_child"),
     SVN_TEST_PASS2(test_dirent_is_ancestor,
                    "test svn_dirent_is_ancestor"),
-    SVN_TEST_PASS2(test_relpath_is_ancestor,
-                   "test svn_relpath_is_ancestor"),
     SVN_TEST_PASS2(test_uri_is_ancestor,
                    "test svn_uri_is_ancestor"),
     SVN_TEST_PASS2(test_dirent_skip_ancestor,