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/07 18:37:53 UTC

svn commit: r1335108 - /subversion/trunk/subversion/libsvn_client/update.c

Author: rhuijben
Date: Mon May  7 16:37:53 2012
New Revision: 1335108

URL: http://svn.apache.org/viewvc?rev=1335108&view=rev
Log:
* subversion/libsvn_client/update.c
  (update_internal): Avoid a now unneeded database call by using new optional
    output values of svn_wc__node_get_base().

Modified:
    subversion/trunk/subversion/libsvn_client/update.c

Modified: subversion/trunk/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/update.c?rev=1335108&r1=1335107&r2=1335108&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/update.c (original)
+++ subversion/trunk/subversion/libsvn_client/update.c Mon May  7 16:37:53 2012
@@ -195,6 +195,7 @@ update_internal(svn_revnum_t *result_rev
   const char *corrected_url;
   const char *target;
   const char *repos_root;
+  const char *repos_relpath;
   svn_error_t *err;
   svn_revnum_t revnum;
   svn_boolean_t use_commit_times;
@@ -221,21 +222,16 @@ update_internal(svn_revnum_t *result_rev
   else
     target = "";
 
-  /* Get full URL from the ANCHOR. */
-  SVN_ERR(svn_wc__node_get_url(&anchor_url, ctx->wc_ctx, anchor_abspath,
-                               pool, pool));
-  if (! anchor_url)
-    return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
+  /* Check if our anchor exists in BASE. If it doesn't we can't update. */
+  SVN_ERR(svn_wc__node_get_base(&revnum, &repos_relpath, &repos_root, NULL,
+                                ctx->wc_ctx, anchor_abspath, pool, pool));
+
+  if (! repos_relpath)
+      return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
                              _("'%s' has no URL"),
                              svn_dirent_local_style(anchor_abspath, pool));
 
-  /* Check if our anchor exists in BASE. If it doesn't we can't update.
-     ### For performance reasons this should be handled with the same query
-     ### as retrieving the anchor url. */
-  SVN_ERR(svn_wc__node_get_base(&revnum, NULL, NULL, NULL, ctx->wc_ctx,
-                                anchor_abspath, pool, pool));
-
-  /* It does not make sense to update tree-conflict victims. */
+  /* It does not make sense to update conflict victims. */
   err = svn_wc_conflicted_p3(NULL, NULL, &tree_conflicted,
                              ctx->wc_ctx, local_abspath, pool);
   if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
@@ -263,6 +259,8 @@ update_internal(svn_revnum_t *result_rev
       return SVN_NO_ERROR;
     }
 
+  anchor_url = svn_path_url_add_component2(repos_root, repos_relpath, pool);
+
   /* We may need to crop the tree if the depth is sticky */
   if (depth_is_sticky && depth < svn_depth_infinity)
     {
@@ -334,8 +332,6 @@ update_internal(svn_revnum_t *result_rev
                                                anchor_abspath, NULL, TRUE,
                                                TRUE, ctx, pool));
 
-  SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root, pool));
-
   /* If we got a corrected URL from the RA subsystem, we'll need to
      relocate our working copy first. */
   if (corrected_url)