Author: rhuijben
Date: Thu Jun 16 16:40:48 2011
New Revision: 1136538

URL: http://svn.apache.org/viewvc?rev=1136538&view=rev
Log:
* subversion/libsvn_client/externals.c
  (switch_dir_external): Avoid two database calls on updating a directory
    external and store the defined url instead of the actual url.

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

Modified: subversion/trunk/subversion/libsvn_client/externals.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/externals.c?rev=1136538&r1=1136537&r2=1136538&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/externals.c (original)
+++ subversion/trunk/subversion/libsvn_client/externals.c Thu Jun 16 16:40:48 
2011
@@ -161,6 +161,7 @@ switch_dir_external(const char *local_ab
       if (node_url)
         {
           const char *repos_root_url;
+          const char *repos_uuid;
 
           /* If we have what appears to be a version controlled
              subdir, and its top-level URL matches that of our
@@ -177,7 +178,7 @@ switch_dir_external(const char *local_ab
               return SVN_NO_ERROR;
             }
 
-          SVN_ERR(svn_wc__node_get_repos_info(&repos_root_url, NULL,
+          SVN_ERR(svn_wc__node_get_repos_info(&repos_root_url, &repos_uuid,
                                               ctx->wc_ctx, local_abspath,
                                               pool, subpool));
           if (repos_root_url)
@@ -222,29 +223,16 @@ switch_dir_external(const char *local_ab
                                                   timestamp_sleep,
                                                   ctx, subpool));
 
-              {
-                const char *repos_uuid;
-                const char *repos_relpath;
-
-                SVN_ERR(svn_wc__node_get_repos_info(NULL,
-                                                    &repos_uuid,
-                                                    ctx->wc_ctx, local_abspath,
-                                                    subpool, subpool));
-
-                SVN_ERR(svn_wc__node_get_repos_relpath(&repos_relpath,
-                                                       ctx->wc_ctx,
-                                                       local_abspath,
-                                                       subpool, subpool));
-
-                SVN_ERR(svn_wc__external_register(ctx->wc_ctx,
-                                                  defining_abspath,
-                                                  local_abspath, svn_node_dir,
-                                                  repos_root_url, repos_uuid,
-                                                  repos_relpath,
-                                                  SVN_INVALID_REVNUM,
-                                                  SVN_INVALID_REVNUM,
-                                                  subpool));
-              }
+              SVN_ERR(svn_wc__external_register(ctx->wc_ctx,
+                                                defining_abspath,
+                                                local_abspath, svn_node_dir,
+                                                repos_root_url, repos_uuid,
+                                                svn_uri_skip_ancestor(
+                                                            repos_root_url,
+                                                            url, subpool),
+                                                SVN_INVALID_REVNUM,
+                                                SVN_INVALID_REVNUM,
+                                                subpool));
 
               svn_pool_destroy(subpool);
               return SVN_NO_ERROR;


Reply via email to