You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/02/15 13:53:26 UTC
svn commit: r1244466 - /subversion/trunk/subversion/libsvn_client/externals.c
Author: stsp
Date: Wed Feb 15 12:53:26 2012
New Revision: 1244466
URL: http://svn.apache.org/viewvc?rev=1244466&view=rev
Log:
Follow-up to r1243694: Optimize UUID lookup by obtaining the UUID from the
working copy, rather than via the repository root URL.
* subversion/libsvn_client/externals.c
(handle_external_item_change): Get the repository UUID from the fil
external's parent directory instead of eb->repos_root_url.
Review by: rhuijben
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=1244466&r1=1244465&r2=1244466&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/externals.c (original)
+++ subversion/trunk/subversion/libsvn_client/externals.c Wed Feb 15 12:53:26 2012
@@ -695,7 +695,8 @@ handle_external_item_change(const struct
case svn_node_file:
if (strcmp(eb->repos_root_url, repos_root_url))
{
- const char *old_repos_uuid;
+ const char *local_repos_root_url;
+ const char *local_repos_uuid;
const char *ext_repos_relpath;
/*
@@ -707,33 +708,35 @@ handle_external_item_change(const struct
* sure both URLs point to the same repository. See issue #4087.
*/
- SVN_ERR(svn_client__ra_session_from_path(&ra_session,
- &ra_revnum,
- &ra_session_url,
- eb->repos_root_url,
- NULL,
- &(new_item->peg_revision),
- &(new_item->revision),
- eb->ctx, scratch_pool));
- SVN_ERR(svn_ra_get_uuid2(ra_session, &old_repos_uuid,
- scratch_pool));
+ SVN_ERR(svn_wc__node_get_origin(NULL, NULL, NULL,
+ &local_repos_root_url,
+ &local_repos_uuid, NULL,
+ eb->ctx->wc_ctx,
+ parent_dir_abspath,
+ FALSE, scratch_pool, scratch_pool));
ext_repos_relpath = svn_uri_skip_ancestor(repos_root_url,
new_url, scratch_pool);
- if (strcmp(old_repos_uuid, repos_uuid) != 0 ||
- ext_repos_relpath == NULL)
+ if (local_repos_uuid == NULL || local_repos_root_url == NULL ||
+ ext_repos_relpath == NULL ||
+ strcmp(local_repos_uuid, repos_uuid) != 0)
return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Unsupported external: url of file external '%s' "
"is not in repository '%s'"),
new_url, eb->repos_root_url);
- SVN_ERR(svn_ra_get_repos_root2(ra_session,
- &repos_root_url,
- scratch_pool));
- new_url = svn_path_url_add_component2(repos_root_url,
+ new_url = svn_path_url_add_component2(local_repos_root_url,
ext_repos_relpath,
scratch_pool);
- SVN_ERR(svn_ra_reparent(ra_session, new_url, scratch_pool));
-
+ SVN_ERR(svn_client__ra_session_from_path(&ra_session,
+ &ra_revnum,
+ &ra_session_url,
+ new_url,
+ NULL,
+ &(new_item->peg_revision),
+ &(new_item->revision),
+ eb->ctx, scratch_pool));
+ SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_url,
+ scratch_pool));
}
SVN_ERR(switch_file_external(local_abspath,
Re: svn commit: r1244466 - /subversion/trunk/subversion/libsvn_client/externals.c
Posted by Greg Stein <gs...@gmail.com>.
Note that you're probably not "optimizing" anything here, unless the
UUID mismatches. Since you still establish a new RA session at the
end, you're not really saving anything. IIRC, we send the UUID in the
initial OPTIONS response, so that later RA session setup is still
fetching the UUID...
On Wed, Feb 15, 2012 at 07:53, <st...@apache.org> wrote:
> Author: stsp
> Date: Wed Feb 15 12:53:26 2012
> New Revision: 1244466
>
> URL: http://svn.apache.org/viewvc?rev=1244466&view=rev
> Log:
> Follow-up to r1243694: Optimize UUID lookup by obtaining the UUID from the
> working copy, rather than via the repository root URL.
>
> * subversion/libsvn_client/externals.c
> (handle_external_item_change): Get the repository UUID from the fil
> external's parent directory instead of eb->repos_root_url.
>
> Review by: rhuijben
>
> 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=1244466&r1=1244465&r2=1244466&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/externals.c (original)
> +++ subversion/trunk/subversion/libsvn_client/externals.c Wed Feb 15 12:53:26 2012
> @@ -695,7 +695,8 @@ handle_external_item_change(const struct
> case svn_node_file:
> if (strcmp(eb->repos_root_url, repos_root_url))
> {
> - const char *old_repos_uuid;
> + const char *local_repos_root_url;
> + const char *local_repos_uuid;
> const char *ext_repos_relpath;
>
> /*
> @@ -707,33 +708,35 @@ handle_external_item_change(const struct
> * sure both URLs point to the same repository. See issue #4087.
> */
>
> - SVN_ERR(svn_client__ra_session_from_path(&ra_session,
> - &ra_revnum,
> - &ra_session_url,
> - eb->repos_root_url,
> - NULL,
> - &(new_item->peg_revision),
> - &(new_item->revision),
> - eb->ctx, scratch_pool));
> - SVN_ERR(svn_ra_get_uuid2(ra_session, &old_repos_uuid,
> - scratch_pool));
> + SVN_ERR(svn_wc__node_get_origin(NULL, NULL, NULL,
> + &local_repos_root_url,
> + &local_repos_uuid, NULL,
> + eb->ctx->wc_ctx,
> + parent_dir_abspath,
> + FALSE, scratch_pool, scratch_pool));
> ext_repos_relpath = svn_uri_skip_ancestor(repos_root_url,
> new_url, scratch_pool);
> - if (strcmp(old_repos_uuid, repos_uuid) != 0 ||
> - ext_repos_relpath == NULL)
> + if (local_repos_uuid == NULL || local_repos_root_url == NULL ||
> + ext_repos_relpath == NULL ||
> + strcmp(local_repos_uuid, repos_uuid) != 0)
> return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
> _("Unsupported external: url of file external '%s' "
> "is not in repository '%s'"),
> new_url, eb->repos_root_url);
>
> - SVN_ERR(svn_ra_get_repos_root2(ra_session,
> - &repos_root_url,
> - scratch_pool));
> - new_url = svn_path_url_add_component2(repos_root_url,
> + new_url = svn_path_url_add_component2(local_repos_root_url,
> ext_repos_relpath,
> scratch_pool);
> - SVN_ERR(svn_ra_reparent(ra_session, new_url, scratch_pool));
> -
> + SVN_ERR(svn_client__ra_session_from_path(&ra_session,
> + &ra_revnum,
> + &ra_session_url,
> + new_url,
> + NULL,
> + &(new_item->peg_revision),
> + &(new_item->revision),
> + eb->ctx, scratch_pool));
> + SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_url,
> + scratch_pool));
> }
>
> SVN_ERR(switch_file_external(local_abspath,
>
>