Author: hwright
Date: Tue Mar 16 14:48:28 2010
New Revision: 923779
URL: http://svn.apache.org/viewvc?rev=923779&view=rev
Log:
Reintegrate the 1.6.x-issue-3242-partial branch:
* ^/subversion/branches/1.6.x-issue-3242-partial
Merge a portion of the issue 3242 work, specifically the bit that
makes mergeinfo queries in the client layer happen against the
current RA session URL instead of forcibly against the repository
root URL (which might not be readable by the user per authz
policy). While this is not a full solution to issue #3242, it
should get us back to Subversion 1.4-level behavior which has
pretty consistently been deemed acceptable (enough) by our user
base.
Justification:
Issue #3242 is a hot issue. Hot topic, hot tempers, etc.
Votes:
+1: cmpilato, ivan, rhuijben
Modified:
subversion/branches/1.6.x/ (props changed)
subversion/branches/1.6.x/CHANGES (props changed)
subversion/branches/1.6.x/STATUS
subversion/branches/1.6.x/subversion/libsvn_client/copy.c
subversion/branches/1.6.x/subversion/libsvn_client/delete.c
subversion/branches/1.6.x/subversion/libsvn_client/merge.c
subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.c
subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.h
Propchange: subversion/branches/1.6.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 14:48:28 2010
@@ -3,6 +3,7 @@
/subversion/branches/1.6.x-UNC-paths:872816-872890
/subversion/branches/1.6.x-dirent-basename:872475-872607
/subversion/branches/1.6.x-future-proof:880259-884209
+/subversion/branches/1.6.x-issue-3242-partial:916088-923778
/subversion/branches/1.6.x-issue3443:874942-875825
/subversion/branches/1.6.x-issue3519:880376-889934
/subversion/branches/1.6.x-issue3573:906488-923765
@@ -45,6 +46,7 @@
/subversion/branches/issue-3067-deleted-subtrees:869720-870429
/subversion/branches/issue-3148-dev:871538-871549
/subversion/branches/issue-3220-dev:868555-868571
+/subversion/branches/issue-3242-dev:879762,880472,880579
/subversion/branches/issue-3334-dirs:871501-872212
/subversion/branches/kwallet:867130-867659
/subversion/branches/log-g-performance:867286-867377
Propchange: subversion/branches/1.6.x/CHANGES
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 14:48:28 2010
@@ -3,6 +3,7 @@
/subversion/branches/1.6.x-UNC-paths/CHANGES:872816-872890
/subversion/branches/1.6.x-dirent-basename/CHANGES:872475-872607
/subversion/branches/1.6.x-future-proof/CHANGES:880259-884209
+/subversion/branches/1.6.x-issue-3242-partial/CHANGES:916088-923778
/subversion/branches/1.6.x-issue3443/CHANGES:874942-875825
/subversion/branches/1.6.x-issue3519/CHANGES:880376-889934
/subversion/branches/1.6.x-issue3573/CHANGES:906488-923765
@@ -44,6 +45,7 @@
/subversion/branches/issue-3067-deleted-subtrees/CHANGES:869720-870429
/subversion/branches/issue-3148-dev/CHANGES:871538-871549
/subversion/branches/issue-3220-dev/CHANGES:868555-868571
+/subversion/branches/issue-3242-dev/CHANGES:879762,880472,880579
/subversion/branches/issue-3334-dirs/CHANGES:871501-872212
/subversion/branches/kwallet/CHANGES:867130-867659
/subversion/branches/log-g-performance/CHANGES:867286-867377
Modified: subversion/branches/1.6.x/STATUS
URL:
http://svn.apache.org/viewvc/subversion/branches/1.6.x/STATUS?rev=923779&r1=923778&r2=923779&view=diff
==============================================================================
--- subversion/branches/1.6.x/STATUS (original)
+++ subversion/branches/1.6.x/STATUS Tue Mar 16 14:48:28 2010
@@ -237,17 +237,3 @@ Approved changes:
resolve, I recommend a backport branch because of the volume.
Votes:
+1: neels, cmpilato, rhuijben
-
- * ^/subversion/branches/1.6.x-issue-3242-partial
- Merge a portion of the issue 3242 work, specifically the bit that
- makes mergeinfo queries in the client layer happen against the
- current RA session URL instead of forcibly against the repository
- root URL (which might not be readable by the user per authz
- policy). While this is not a full solution to issue #3242, it
- should get us back to Subversion 1.4-level behavior which has
- pretty consistently been deemed acceptable (enough) by our user
- base.
- Justification:
- Issue #3242 is a hot issue. Hot topic, hot tempers, etc.
- Votes:
- +1: cmpilato, ivan, rhuijben
Modified: subversion/branches/1.6.x/subversion/libsvn_client/copy.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_client/copy.c?rev=923779&r1=923778&r2=923779&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/1.6.x/subversion/libsvn_client/copy.c Tue Mar 16
14:48:28 2010
@@ -67,7 +67,7 @@
*TARGET_MERGEINFO. ADM_ACCESS may be NULL, if SRC_PATH_OR_URL is an
URL. If NO_REPOS_ACCESS is set, this function is disallowed from
consulting the repository about anything. RA_SESSION may be NULL but
- only if NO_REPOS_ACCESS is true. */
+ only if NO_REPOS_ACCESS is true. */
static svn_error_t *
calculate_target_mergeinfo(svn_ra_session_t *ra_session,
apr_hash_t **target_mergeinfo,
@@ -109,19 +109,22 @@ calculate_target_mergeinfo(svn_ra_sessio
if (! locally_added)
{
- const char *mergeinfo_path;
-
if (! no_repos_access)
{
- /* Fetch any existing (explicit) mergeinfo. */
- SVN_ERR(svn_client__path_relative_to_root(&mergeinfo_path, src_url,
- entry ? entry->repos :
NULL,
- FALSE, ra_session,
- adm_access, pool));
+ /* Fetch any existing (explicit) mergeinfo. We'll temporarily
+ reparent to the target URL here, just to keep the code simple.
+ We could, as an alternative, first see if the target URL was a
+ child of the session URL and use the relative "remainder",
+ falling back to this reparenting as necessary. */
+ const char *old_session_url = NULL;
+ SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url,
+ ra_session, src_url,
pool));
SVN_ERR(svn_client__get_repos_mergeinfo(ra_session, &src_mergeinfo,
- mergeinfo_path, src_revnum,
+ "", src_revnum,
svn_mergeinfo_inherited,
TRUE, pool));
+ if (old_session_url)
+ SVN_ERR(svn_ra_reparent(ra_session, old_session_url, pool));
}
else
{
Modified: subversion/branches/1.6.x/subversion/libsvn_client/delete.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_client/delete.c?rev=923779&r1=923778&r2=923779&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_client/delete.c (original)
+++ subversion/branches/1.6.x/subversion/libsvn_client/delete.c Tue Mar 16
14:48:28 2010
@@ -109,7 +109,7 @@ delete_urls(svn_commit_info_t **commit_i
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
- svn_ra_session_t *ra_session;
+ svn_ra_session_t *ra_session = NULL;
const svn_delta_editor_t *editor;
void *edit_baton;
void *commit_baton;
@@ -162,30 +162,47 @@ delete_urls(svn_commit_info_t **commit_i
SVN_ERR(svn_client__ensure_revprop_table(&commit_revprops, revprop_table,
log_msg, ctx, pool));
- /* Open an RA session for the URL. Note that we don't have a local
- directory, nor a place to put temp files. */
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, common, NULL,
- NULL, NULL, FALSE, TRUE,
- ctx, pool));
-
/* Verify that each thing to be deleted actually exists (to prevent
the creation of a revision that has no changes, since the
- filesystem allows for no-op deletes). */
+ filesystem allows for no-op deletes). While here, we'll
+ URI-decode our targets. */
for (i = 0; i < targets->nelts; i++)
{
const char *path = APR_ARRAY_IDX(targets, i, const char *);
+ const char *item_url;
+
svn_pool_clear(subpool);
+ item_url = svn_path_url_add_component2(common, path, subpool);
path = svn_path_uri_decode(path, pool);
APR_ARRAY_IDX(targets, i, const char *) = path;
- SVN_ERR(svn_ra_check_path(ra_session, path, SVN_INVALID_REVNUM,
+
+ /* If we've not yet done so, open an RA session for the
+ URL. Note that we don't have a local directory, nor a place
+ to put temp files. Otherwise, reparent our existing
+ session. */
+ if (! ra_session)
+ {
+ SVN_ERR(svn_client__open_ra_session_internal(&ra_session, item_url,
+ NULL, NULL, NULL, FALSE,
+ TRUE, ctx, pool));
+ }
+ else
+ {
+ SVN_ERR(svn_ra_reparent(ra_session, item_url, subpool));
+ }
+
+ SVN_ERR(svn_ra_check_path(ra_session, "", SVN_INVALID_REVNUM,
&kind, subpool));
if (kind == svn_node_none)
return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
"URL '%s' does not exist",
- svn_path_local_style(path, pool));
+ svn_path_local_style(item_url, pool));
}
svn_pool_destroy(subpool);
+ /* Reparent the RA_session to the common parent of our deletees. */
+ SVN_ERR(svn_ra_reparent(ra_session, common, pool));
+
/* Fetch RA commit editor */
SVN_ERR(svn_client__commit_get_baton(&commit_baton, commit_info_p, pool));
SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton,
Modified: subversion/branches/1.6.x/subversion/libsvn_client/merge.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_client/merge.c?rev=923779&r1=923778&r2=923779&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/1.6.x/subversion/libsvn_client/merge.c Tue Mar 16
14:48:28 2010
@@ -2838,7 +2838,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
svn_boolean_t inherited;
SVN_ERR(svn_client__get_wc_or_repos_mergeinfo(recorded_mergeinfo, entry,
&inherited, FALSE,
- inherit, ra_session,
+ inherit, NULL,
target_wcpath,
adm_access, ctx, pool));
if (indirect)
Modified: subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.c
URL:
http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.c?rev=923779&r1=923778&r2=923779&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.c Tue Mar 16
14:48:28 2010
@@ -304,15 +304,10 @@ svn_client__get_repos_mergeinfo(svn_ra_s
{
svn_error_t *err;
svn_mergeinfo_t repos_mergeinfo;
- const char *old_session_url;
apr_array_header_t *rel_paths = apr_array_make(pool, 1, sizeof(rel_path));
APR_ARRAY_PUSH(rel_paths, const char *) = rel_path;
- /* Temporarily point the session at the root of the repository. */
- SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url, ra_session,
- NULL, pool));
-
/* Fetch the mergeinfo. */
err = svn_ra_get_mergeinfo(ra_session, &repos_mergeinfo, rel_paths, rev,
inherit, FALSE, pool);
@@ -327,10 +322,6 @@ svn_client__get_repos_mergeinfo(svn_ra_s
return err;
}
- /* If we reparented the session, put it back where our caller had it. */
- if (old_session_url)
- SVN_ERR(svn_ra_reparent(ra_session, old_session_url, pool));
-
/* Grab only the mergeinfo provided for REL_PATH. */
if (repos_mergeinfo)
*target_mergeinfo = apr_hash_get(repos_mergeinfo, rel_path,
@@ -392,21 +383,28 @@ svn_client__get_wc_or_repos_mergeinfo(sv
NULL, ctx, pool));
if (apr_hash_get(props, target_wcpath, APR_HASH_KEY_STRING) == NULL)
{
- const char *repos_rel_path;
+ const char *session_url = NULL;
+ apr_pool_t *sesspool = NULL;
- if (ra_session == NULL)
- SVN_ERR(svn_client__open_ra_session_internal(&ra_session, url,
- NULL, NULL, NULL,
- FALSE, TRUE, ctx,
- pool));
-
- SVN_ERR(svn_client__path_relative_to_root(&repos_rel_path, url,
- entry->repos, FALSE,
- ra_session, NULL,
- pool));
+ if (ra_session)
+ {
+ SVN_ERR(svn_client__ensure_ra_session_url(&session_url,
+ ra_session,
+ url, pool));
+ }
+ else
+ {
+ sesspool = svn_pool_create(pool);
+ SVN_ERR(svn_client__open_ra_session_internal(&ra_session,
url,
+ NULL, NULL,
NULL,
+ FALSE, TRUE,
+ ctx,
+ sesspool));
+ }
+
SVN_ERR(svn_client__get_repos_mergeinfo(ra_session,
&repos_mergeinfo,
- repos_rel_path,
+ "",
target_rev,
inherit,
TRUE,
@@ -416,6 +414,18 @@ svn_client__get_wc_or_repos_mergeinfo(sv
*target_mergeinfo = repos_mergeinfo;
*indirect = TRUE;
}
+
+ /* If we created an RA_SESSION above, destroy it.
+ Otherwise, if reparented an existing session, point
+ it back where it was when we were called. */
+ if (sesspool)
+ {
+ svn_pool_destroy(sesspool);
+ }
+ else if (session_url)
+ {
+ SVN_ERR(svn_ra_reparent(ra_session, session_url, pool));
+ }
}
}
}
Modified: subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.h
URL:
http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.h?rev=923779&r1=923778&r2=923779&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/1.6.x/subversion/libsvn_client/mergeinfo.h Tue Mar 16
14:48:28 2010
@@ -103,11 +103,9 @@ svn_client__get_wc_mergeinfo(svn_mergein
svn_client_ctx_t *ctx,
apr_pool_t *pool);
-/* Obtain any mergeinfo for the root-relative repository filesystem path
- REL_PATH from the repository, and set it in *TARGET_MERGEINFO.
- RA_SESSION should be an open RA session pointing at the URL that REL_PATH
- is relative to, or NULL, in which case this function will open its own
- temporary session.
+/* Obtain any mergeinfo for repository filesystem path REL_PATH
+ (relative to RA_SESSION's session URL) from the repository, and set
+ it in *TARGET_MERGEINFO.
INHERIT indicates whether explicit, explicit or inherited, or only
inherited mergeinfo for REL_PATH is obtained.
@@ -133,18 +131,18 @@ svn_client__get_repos_mergeinfo(svn_ra_s
target has no info of its own.
If no mergeinfo can be obtained from the WC or REPOS_ONLY is TRUE,
- get it from the repository. RA_SESSION should be an open RA session
- pointing at ENTRY->URL, or NULL, in which case this function will open
- its own temporary session.
+ get it from the repository. RA_SESSION should be an open RA
+ session pointing at ENTRY->URL, or NULL, in which case this
+ function will open its own temporary session.
(opening a new RA session if RA_SESSION
is NULL). Store any mergeinfo obtained for TARGET_WCPATH -- which
is reflected by ENTRY -- in *TARGET_MERGEINFO, if no mergeinfo is
found *TARGET_MERGEINFO is NULL.
- Like svn_client__get_wc_mergeinfo, this function considers no inherited
- mergeinfo to be found in the WC when trying to crawl into a parent path
- with a different working revision.
+ Like svn_client__get_wc_mergeinfo(), this function considers no
+ inherited mergeinfo to be found in the WC when trying to crawl into
+ a parent path with a different working revision.
INHERIT indicates whether explicit, explicit or inherited, or only
inherited mergeinfo for TARGET_WCPATH is retrieved.