You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2011/01/18 20:00:38 UTC

svn commit: r1060539 - in /subversion/branches/uris-as-urls/subversion: include/svn_dirent_uri.h libsvn_subr/dirent_uri.c

Author: cmpilato
Date: Tue Jan 18 19:00:38 2011
New Revision: 1060539

URL: http://svn.apache.org/viewvc?rev=1060539&view=rev
Log:
On the 'uris-as-urls' branch, remove some soon-to-be-pointless functions.

* trunk/subversion/include/svn_dirent_uri.h
  (svn_url_is_absolute, svn_url_join): Remove.

* trunk/subversion/libsvn_subr/dirent_uri.c
  (svn_url_is_absolute, svn_url_join): Remove.

Modified:
    subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h
    subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c

Modified: subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h?rev=1060539&r1=1060538&r2=1060539&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h (original)
+++ subversion/branches/uris-as-urls/subversion/include/svn_dirent_uri.h Tue Jan 18 19:00:38 2011
@@ -197,27 +197,6 @@ svn_relpath_join(const char *base,
                  const char *component,
                  apr_pool_t *pool);
 
-/** Join a valid base uri (@a base) with a relative path or uri
- * (@a component), allocating the result in @a pool. @a component need
- * not be a single component: it can be a relative path or a '/'
- * prefixed relative path to join component to the root path of @a base.
- *
- * If @a component is the empty path, then @a base will be copied and
- * returned.
- *
- * If the @a component is an absolute uri, then it is copied and returned.
- *
- * If @a component starts with a '/' and @a base contains a scheme, the
- * scheme defined joining rules are applied.
- *
- * @since New in 1.7.
- */
-char *
-svn_url_join(const char *base,
-             const char *component,
-             apr_pool_t *pool);
-
-
 /** Gets the name of the specified canonicalized @a dirent as it is known
  * within its parent directory. If the @a dirent is root, return "". The
  * returned value will not have slashes in it.
@@ -403,13 +382,6 @@ svn_url_dirname(const char *uri,
 svn_boolean_t
 svn_dirent_is_absolute(const char *dirent);
 
-/** Return TRUE if @a uri is considered absolute or is a URL.
- *
- * @since New in 1.7.
- */
-svn_boolean_t
-svn_url_is_absolute(const char *uri);
-
 /** Return TRUE if @a dirent is considered a root directory on the platform
  * at hand.
  * E.g.:

Modified: subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c?rev=1060539&r1=1060538&r2=1060539&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/uris-as-urls/subversion/libsvn_subr/dirent_uri.c Tue Jan 18 19:00:38 2011
@@ -1213,55 +1213,6 @@ svn_relpath_join(const char *base,
 }
 
 char *
-svn_url_join(const char *base, const char *component, apr_pool_t *pool)
-{
-  apr_size_t blen = strlen(base);
-  apr_size_t clen = strlen(component);
-  char *path;
-
-  assert(svn_uri_is_canonical(base, pool));
-  assert(svn_uri_is_canonical(component, pool));
-
-  /* If either is empty return the other */
-  if (SVN_PATH_IS_EMPTY(base))
-    return apr_pmemdup(pool, component, clen + 1);
-  if (SVN_PATH_IS_EMPTY(component))
-    return apr_pmemdup(pool, base, blen + 1);
-
-  /* If the component is absolute, then return it.  */
-  if (svn_uri_is_absolute(component))
-    {
-      if (*component != '/')
-        return apr_pmemdup(pool, component, clen + 1);
-      else
-        {
-          /* The uri is not absolute enough; use only the root from base */
-          apr_size_t n = uri_schema_root_length(base, blen);
-
-          path = apr_palloc(pool, n + clen + 1);
-
-          if (n > 0)
-            memcpy(path, base, n);
-
-          memcpy(path + n, component, clen + 1); /* Include '\0' */
-
-          return path;
-        }
-    }
-
-  if (blen == 1 && base[0] == '/')
-    blen = 0; /* Ignore base, just return separator + component */
-
-  /* Construct the new, combined path. */
-  path = apr_palloc(pool, blen + 1 + clen + 1);
-  memcpy(path, base, blen);
-  path[blen] = '/';
-  memcpy(path + blen + 1, component, clen + 1);
-
-  return path;
-}
-
-char *
 svn_dirent_dirname(const char *dirent, apr_pool_t *pool)
 {
   apr_size_t len = strlen(dirent);
@@ -1641,17 +1592,6 @@ svn_dirent_is_absolute(const char *diren
   return FALSE;
 }
 
-svn_boolean_t
-svn_url_is_absolute(const char *uri)
-{
-  /* uri is absolute if it starts with '/' */
-  if (uri && uri[0] == '/')
-    return TRUE;
-
-  /* URLs are absolute. */
-  return svn_path_is_url(uri);
-}
-
 svn_error_t *
 svn_dirent_get_absolute(const char **pabsolute,
                         const char *relative,