subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1186267 - in /subversion/trunk/subversion: include/svn_client.h libsvn_client/cmdline.c libsvn_client/copy.c libsvn_client/deprecated.c libsvn_client/merge.c libsvn_client/ra.c libsvn_client/relocate.c libsvn_client/url.c
Date Wed, 19 Oct 2011 15:26:35 GMT
Author: julianfoad
Date: Wed Oct 19 15:26:34 2011
New Revision: 1186267

URL: http://svn.apache.org/viewvc?rev=1186267&view=rev
Log:
Update calls to three deprecated APIs to use svn_client_get_repos_root()
instead, mark the deprecated APIs as such and move their implementations to
'deprecated.c'. A follow-up to r1186244.

* subversion/include/svn_client.h
  (svn_client_get_repos_root): Mention that it may open a temporary RA
    session.
  (svn_client_root_url_from_path, svn_client_uuid_from_url,
   svn_client_uuid_from_path2): Mark as deprecated.

* subversion/libsvn_client/ra.c
  (svn_client_uuid_from_url, svn_client_uuid_from_path2): Move these ...

* subversion/libsvn_client/url.c
  (svn_client_root_url_from_path): ... and this ...

* subversion/libsvn_client/deprecated.c
  (svn_client_uuid_from_url, svn_client_uuid_from_path2,
   svn_client_root_url_from_path): ... to here.

* subversion/libsvn_client/cmdline.c
  (svn_client_args_to_target_array2): Update calls.

* subversion/libsvn_client/copy.c
  (repos_to_wc_copy_locked): Update calls.

* subversion/libsvn_client/merge.c
  (merge_cousins_and_supplement_mergeinfo): Update calls.

* subversion/libsvn_client/relocate.c
  (relocate_externals, svn_client_relocate2): Update calls.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/cmdline.c
    subversion/trunk/subversion/libsvn_client/copy.c
    subversion/trunk/subversion/libsvn_client/deprecated.c
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_client/ra.c
    subversion/trunk/subversion/libsvn_client/relocate.c
    subversion/trunk/subversion/libsvn_client/url.c

Modified: subversion/trunk/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1186267&r1=1186266&r2=1186267&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Wed Oct 19 15:26:34 2011
@@ -5807,6 +5807,9 @@ svn_client_url_from_path(const char **ur
  * necessary. @a repos_root_url and/or @a repos_uuid may be NULL if not
  * wanted.
  *
+ * This function will open a temporary RA session to the repository if
+ * necessary to get the information.
+ *
  * Allocate @a *repos_root_url and @a *repos_uuid in @a result_pool.
  * Use @a scratch_pool for temporary allocations.
  *
@@ -5827,8 +5830,9 @@ svn_client_get_repos_root(const char **r
  *
  * @since New in 1.5.
  * @deprecated Provided for backward compatibility with the 1.7 API. Use
- * svn_client_get_repos_root().
+ * svn_client_get_repos_root() instead, with an absolute path.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_client_root_url_from_path(const char **url,
                               const char *path_or_url,
@@ -5843,8 +5847,9 @@ svn_client_root_url_from_path(const char
  * authentication.
  *
  * @deprecated Provided for backward compatibility with the 1.7 API. Use
- * svn_client_get_repos_root().
+ * svn_client_get_repos_root() instead.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_client_uuid_from_url(const char **uuid,
                          const char *url,
@@ -5860,8 +5865,9 @@ svn_client_uuid_from_url(const char **uu
  *
  * @since New in 1.7.
  * @deprecated Provided for backward compatibility with the 1.7 API. Use
- * svn_client_get_repos_root().
+ * svn_client_get_repos_root() instead.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_client_uuid_from_path2(const char **uuid,
                            const char *local_abspath,

Modified: subversion/trunk/subversion/libsvn_client/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/cmdline.c?rev=1186267&r1=1186266&r2=1186267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/cmdline.c (original)
+++ subversion/trunk/subversion/libsvn_client/cmdline.c Wed Oct 19 15:26:34 2011
@@ -347,7 +347,11 @@ svn_client_args_to_target_array2(apr_arr
        */
       if (root_url == NULL)
         {
-          err = svn_client_root_url_from_path(&root_url, "", ctx, pool);
+          const char *current_abspath;
+
+          SVN_ERR(svn_dirent_get_absolute(&current_abspath, "", pool));
+          err = svn_client_get_repos_root(&root_url, NULL /* uuid */,
+                                          current_abspath, ctx, pool, pool);
           if (err || root_url == NULL)
             return svn_error_create(SVN_ERR_WC_NOT_WORKING_COPY, err,
                                     _("Resolving '^/': no repository root "

Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1186267&r1=1186266&r2=1186267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Wed Oct 19 15:26:34 2011
@@ -1746,8 +1746,9 @@ repos_to_wc_copy_locked(const apr_array_
       parent = top_dst_path;
 
     SVN_ERR(svn_dirent_get_absolute(&parent_abspath, parent, scratch_pool));
-    dst_err = svn_client_uuid_from_path2(&dst_uuid, parent_abspath, ctx,
-                                         scratch_pool, scratch_pool);
+    dst_err = svn_client_get_repos_root(NULL /* root_url */, &dst_uuid,
+                                        parent_abspath, ctx,
+                                        scratch_pool, scratch_pool);
     if (dst_err && dst_err->apr_err != SVN_ERR_RA_NO_REPOS_UUID)
       return dst_err;
 

Modified: subversion/trunk/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/deprecated.c?rev=1186267&r1=1186266&r2=1186267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_client/deprecated.c Wed Oct 19 15:26:34 2011
@@ -39,6 +39,7 @@
 #include "svn_props.h"
 #include "svn_utf.h"
 #include "svn_string.h"
+#include "svn_pools.h"
 
 #include "client.h"
 #include "mergeinfo.h"
@@ -2464,6 +2465,41 @@ svn_client_revert(const apr_array_header
 
 /*** From ra.c ***/
 svn_error_t *
+svn_client_uuid_from_url(const char **uuid,
+                         const char *url,
+                         svn_client_ctx_t *ctx,
+                         apr_pool_t *pool)
+{
+  svn_ra_session_t *ra_session;
+  apr_pool_t *subpool = svn_pool_create(pool);
+
+  /* use subpool to create a temporary RA session */
+  SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, url,
+                                               NULL, /* no base dir */
+                                               NULL, FALSE, TRUE,
+                                               ctx, subpool));
+
+  SVN_ERR(svn_ra_get_uuid2(ra_session, uuid, pool));
+
+  /* destroy the RA session */
+  svn_pool_destroy(subpool);
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_client_uuid_from_path2(const char **uuid,
+                           const char *local_abspath,
+                           svn_client_ctx_t *ctx,
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(
+    svn_wc__node_get_repos_info(NULL, uuid, ctx->wc_ctx, local_abspath,
+                                result_pool, scratch_pool));
+}
+
+svn_error_t *
 svn_client_uuid_from_path(const char **uuid,
                           const char *path,
                           svn_wc_adm_access_t *adm_access,
@@ -2479,6 +2515,20 @@ svn_client_uuid_from_path(const char **u
 
 /*** From url.c ***/
 svn_error_t *
+svn_client_root_url_from_path(const char **url,
+                              const char *path_or_url,
+                              svn_client_ctx_t *ctx,
+                              apr_pool_t *pool)
+{
+  if (!svn_path_is_url(path_or_url))
+    SVN_ERR(svn_dirent_get_absolute(&path_or_url, path_or_url, pool));
+
+  return svn_error_trace(
+           svn_client_get_repos_root(url, NULL, path_or_url,
+                                     ctx, pool, pool));
+}
+
+svn_error_t *
 svn_client_url_from_path(const char **url,
                          const char *path_or_url,
                          apr_pool_t *pool)

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1186267&r1=1186266&r2=1186267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed Oct 19 15:26:34 2011
@@ -9116,8 +9116,9 @@ merge_cousins_and_supplement_mergeinfo(c
 
       SVN_ERR(svn_ra_get_uuid2(URL1_ra_session, &source_repos_uuid,
                                subpool));
-      SVN_ERR(svn_client_uuid_from_path2(&wc_repos_uuid, target_abspath,
-                                         ctx, subpool, subpool));
+      SVN_ERR(svn_client_get_repos_root(NULL /* root_url */, &wc_repos_uuid,
+                                        target_abspath,
+                                        ctx, subpool, subpool));
       same_repos = (strcmp(wc_repos_uuid, source_repos_uuid) == 0);
     }
   else

Modified: subversion/trunk/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/ra.c?rev=1186267&r1=1186266&r2=1186267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/ra.c (original)
+++ subversion/trunk/subversion/libsvn_client/ra.c Wed Oct 19 15:26:34 2011
@@ -385,43 +385,6 @@ svn_client_open_ra_session(svn_ra_sessio
 }
 
 
-svn_error_t *
-svn_client_uuid_from_url(const char **uuid,
-                         const char *url,
-                         svn_client_ctx_t *ctx,
-                         apr_pool_t *pool)
-{
-  svn_ra_session_t *ra_session;
-  apr_pool_t *subpool = svn_pool_create(pool);
-
-  /* use subpool to create a temporary RA session */
-  SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, url,
-                                               NULL, /* no base dir */
-                                               NULL, FALSE, TRUE,
-                                               ctx, subpool));
-
-  SVN_ERR(svn_ra_get_uuid2(ra_session, uuid, pool));
-
-  /* destroy the RA session */
-  svn_pool_destroy(subpool);
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_client_uuid_from_path2(const char **uuid,
-                           const char *local_abspath,
-                           svn_client_ctx_t *ctx,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool)
-{
-  return svn_error_trace(
-    svn_wc__node_get_repos_info(NULL, uuid, ctx->wc_ctx, local_abspath,
-                                result_pool, scratch_pool));
-}
-
-
 
 
 /* Convert a path or URL for display: if it is a local path, convert it to

Modified: subversion/trunk/subversion/libsvn_client/relocate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/relocate.c?rev=1186267&r1=1186266&r2=1186267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/relocate.c (original)
+++ subversion/trunk/subversion/libsvn_client/relocate.c Wed Oct 19 15:26:34 2011
@@ -185,8 +185,8 @@ relocate_externals(const char *local_abs
                                                       ext_item->target_dir,
                                                       iterpool),
                                       iterpool));
-      err = svn_client_root_url_from_path(&target_repos_root_url,
-                                          target_abspath, ctx, iterpool);
+      err = svn_client_get_repos_root(&target_repos_root_url, NULL /* uuid */,
+                                      target_abspath, ctx, iterpool, iterpool);
 
       /* Ignore externals that aren't present in the working copy.
        * This can happen if an external is deleted from disk accidentally,
@@ -248,16 +248,16 @@ svn_client_relocate2(const char *wcroot_
     }
 
   /* Fetch our current root URL. */
-  SVN_ERR(svn_client_root_url_from_path(&old_repos_root_url, local_abspath,
-                                        ctx, pool));
+  SVN_ERR(svn_client_get_repos_root(&old_repos_root_url, NULL /* uuid */,
+                                    local_abspath, ctx, pool, pool));
 
   /* Perform the relocation. */
   SVN_ERR(svn_wc_relocate4(ctx->wc_ctx, local_abspath, from_prefix, to_prefix,
                            validator_func, &vb, pool));
 
   /* Now fetch new current root URL. */
-  SVN_ERR(svn_client_root_url_from_path(&new_repos_root_url, local_abspath,
-                                        ctx, pool));
+  SVN_ERR(svn_client_get_repos_root(&new_repos_root_url, NULL /* uuid */,
+                                    local_abspath, ctx, pool, pool));
 
 
   /* Relocate externals, too (if any). */

Modified: subversion/trunk/subversion/libsvn_client/url.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/url.c?rev=1186267&r1=1186266&r2=1186267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/url.c (original)
+++ subversion/trunk/subversion/libsvn_client/url.c Wed Oct 19 15:26:34 2011
@@ -61,18 +61,3 @@ svn_client_url_from_path2(const char **u
 
   return SVN_NO_ERROR;
 }
-
-
-svn_error_t *
-svn_client_root_url_from_path(const char **url,
-                              const char *path_or_url,
-                              svn_client_ctx_t *ctx,
-                              apr_pool_t *pool)
-{
-  if (!svn_path_is_url(path_or_url))
-    SVN_ERR(svn_dirent_get_absolute(&path_or_url, path_or_url, pool));
-
-  return svn_error_trace(
-           svn_client_get_repos_root(url, NULL, path_or_url,
-                                     ctx, pool, pool));
-}



Mime
View raw message