You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2011/07/12 18:19:49 UTC
svn commit: r1145653 - in /subversion/trunk/subversion/libsvn_client:
merge.c mergeinfo.c mergeinfo.h
Author: pburba
Date: Tue Jul 12 16:19:48 2011
New Revision: 1145653
URL: http://svn.apache.org/viewvc?rev=1145653&view=rev
Log:
Some issue #3668 and #3669 follow-up: Default to asking the server to
validate inherited mergeinfo in most cases. Also clarify some comments
and doc strings.
* subversion/libsvn_client/merge.c
(get_invalid_inherited_mergeinfo): Doc string clarifications.
(get_full_mergeinfo): Add some more commentary about the use of
get_invalid_inherited_mergeinfo and only call that function if
necessary.
(process_children_with_new_mergeinfo): Update call to
svn_client__get_wc_or_repos_mergeinfo().
* subversion/libsvn_client/mergeinfo.h
(svn_client__get_wc_or_repos_mergeinfo,
svn_client__get_wc_or_repos_mergeinfo_catalog): Add a new output parameter
to signal to the caller if we had to contact the repository to find
inherited mergeinfo.
* subversion/libsvn_client/mergeinfo.c
(svn_client__get_wc_or_repos_mergeinfo): Add new parameter, pass it along
to svn_client__get_wc_or_repos_mergeinfo_catalog().
(svn_client__get_wc_or_repos_mergeinfo_catalog): Add new parameter. If
the repository must be contacted to find inherited mergeinfo then request
that inherited mergeinfo be validated.
(svn_client__elide_mergeinfo): Update call to
svn_client__get_wc_or_repos_mergeinfo
(get_mergeinfo): Remove an unnecessary local variable. If we are asking
the repository for inherited mergeinfo request validation by default since
very few callers actually *want* inherited mergeinfo with non-existent
merge sources.
Modified:
subversion/trunk/subversion/libsvn_client/merge.c
subversion/trunk/subversion/libsvn_client/mergeinfo.c
subversion/trunk/subversion/libsvn_client/mergeinfo.h
Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1145653&r1=1145652&r2=1145653&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Tue Jul 12 16:19:48 2011
@@ -3161,26 +3161,27 @@ fix_deleted_subtree_ranges(const char *u
/*** Determining What Remains To Be Merged ***/
-/* Attempt to determine if a working copy path inherits any invalid
- mergeinfo.
+/* Contact the repository to get the portion of a working copy path's
+ inherited mergeinfo (if any) which contains non-existent mergeinfo
+ sources -- see http://subversion.tigris.org/issues/show_bug.cgi?id=3669
+
+ Note: This function should only be called if the server supports the
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability.
Query the repository for the mergeinfo TARGET_ABSPATH inherits at its
- base revision and set *VALIDATED to indicate to the caller if we can
- determine what portions of that inherited mergeinfo are invalid.
+ base revision.
If no mergeinfo is inherited set *INVALID_INHERITED_MERGEINFO to NULL.
If only empty mergeinfo is inherited set *INVALID_INHERITED_MERGEINFO to
an empty hash.
- If non-empty inherited mergeinfo is inherited then, if the server
- supports the SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability,
- remove all valid path-revisions from the raw inherited mergeinfo, and set
- *INVALID_INHERITED_MERGEINFO to the remainder.
-
- Note that if validation occurs, but all inherited mergeinfo describes
- non-existent paths, then *INVALID_INHERITED_MERGEINFO is set to an empty
- hash.
+ If non-empty mergeinfo is inherited then, if the server supports the
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability, remove all
+ existing path-revisions from the inherited mergeinfo, and set
+ *INVALID_INHERITED_MERGEINFO to the remainder. If all of the inherited
+ inherited mergeinfo describes non-existent paths, then set
+ *INVALID_INHERITED_MERGEINFO to an empty hash.
RA_SESSION is an open session that points to TARGET_ABSPATH's repository
location or to the location of one of TARGET_ABSPATH's parents. It may
@@ -3307,8 +3308,11 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
removing any self-referential mergeinfo. */
if (recorded_mergeinfo)
{
+ svn_boolean_t inherited_from_repos;
+
SVN_ERR(svn_client__get_wc_or_repos_mergeinfo(recorded_mergeinfo,
&inherited_mergeinfo,
+ &inherited_from_repos,
FALSE,
inherit, ra_session,
target_abspath,
@@ -3316,9 +3320,20 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
if (inherited)
*inherited = inherited_mergeinfo;
- /* Issue #3669: Remove any non-existent mergeinfo sources
- from TARGET_ABSPATH's inherited mergeinfo. */
- if (inherited_mergeinfo && validate_inherited)
+ /* Issue #3669: If TARGET_ABSPATH inherited its mergeinfo from a
+ working copy parent, then contact the repository to discover what
+ portion (if any) of that inherited mergeinfo describes non-existent
+ mergeinfo sources and remove it.
+
+ If we already contacted the repository for inherited mergeinfo then
+ we've done all we can since svn_client__get_wc_or_repos_mergeinfo
+ will request validation by default when asking the repository.
+
+ ### [PTB] Issue #3756 is still a problem here, i.e. TARGET_ABSPATH
+ ### inherits working mergeinfo from a working copy parent. */
+ if (inherited_mergeinfo
+ && validate_inherited
+ && !inherited_from_repos)
{
svn_mergeinfo_t invalid_inherited_mergeinfo;
@@ -7137,7 +7152,7 @@ process_children_with_new_mergeinfo(merg
the merge. */
SVN_ERR(svn_client__get_wc_or_repos_mergeinfo(
&path_inherited_mergeinfo,
- &inherited,
+ &inherited, NULL,
FALSE,
svn_mergeinfo_nearest_ancestor, /* We only want inherited MI */
merge_b->ra_session2,
Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1145653&r1=1145652&r2=1145653&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Tue Jul 12 16:19:48 2011
@@ -505,6 +505,7 @@ svn_client__get_repos_mergeinfo_catalog(
svn_error_t *
svn_client__get_wc_or_repos_mergeinfo(svn_mergeinfo_t *target_mergeinfo,
svn_boolean_t *inherited,
+ svn_boolean_t *from_repos,
svn_boolean_t repos_only,
svn_mergeinfo_inheritance_t inherit,
svn_ra_session_t *ra_session,
@@ -517,7 +518,8 @@ svn_client__get_wc_or_repos_mergeinfo(sv
*target_mergeinfo = NULL;
SVN_ERR(svn_client__get_wc_or_repos_mergeinfo_catalog(&tgt_mergeinfo_cat,
- inherited, FALSE,
+ inherited, from_repos,
+ FALSE,
repos_only,
FALSE, inherit,
ra_session,
@@ -542,6 +544,7 @@ svn_error_t *
svn_client__get_wc_or_repos_mergeinfo_catalog(
svn_mergeinfo_catalog_t *target_mergeinfo_catalog,
svn_boolean_t *inherited,
+ svn_boolean_t *from_repos,
svn_boolean_t include_descendants,
svn_boolean_t repos_only,
svn_boolean_t ignore_invalid_mergeinfo,
@@ -561,6 +564,9 @@ svn_client__get_wc_or_repos_mergeinfo_ca
SVN_ERR(svn_dirent_get_absolute(&local_abspath, target_wcpath,
scratch_pool));
+ if (from_repos)
+ *from_repos = FALSE;
+
/* We may get an entry with abbreviated information from TARGET_WCPATH's
parent if TARGET_WCPATH is missing. These limited entries do not have
a URL and without that we cannot get accurate mergeinfo for
@@ -609,7 +615,6 @@ svn_client__get_wc_or_repos_mergeinfo_ca
{
const char *session_url = NULL;
apr_pool_t *sesspool = NULL;
- svn_boolean_t validate_inherited_mergeinfo = FALSE;
if (ra_session)
{
@@ -628,13 +633,17 @@ svn_client__get_wc_or_repos_mergeinfo_ca
SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
target_mergeinfo_catalog, ra_session,
"", target_rev, inherit,
- TRUE, FALSE, validate_inherited_mergeinfo,
+ TRUE, FALSE, TRUE,
result_pool, scratch_pool));
if (*target_mergeinfo_catalog
&& apr_hash_get(*target_mergeinfo_catalog, "",
APR_HASH_KEY_STRING))
- *inherited = TRUE;
+ {
+ *inherited = TRUE;
+ if (from_repos)
+ *from_repos = TRUE;
+ }
/* If we created an RA_SESSION above, destroy it.
Otherwise, if reparented an existing session, point
@@ -959,7 +968,7 @@ svn_client__elide_mergeinfo(const char *
if (!mergeinfo && !wc_elision_limit_path)
{
err = svn_client__get_wc_or_repos_mergeinfo(
- &mergeinfo, &inherited, TRUE,
+ &mergeinfo, &inherited, NULL, TRUE,
svn_mergeinfo_nearest_ancestor,
NULL, target_wcpath, ctx, pool);
if (err)
@@ -1066,12 +1075,11 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
if (use_url)
{
svn_mergeinfo_catalog_t tmp_catalog;
- svn_boolean_t validate_inherited_mergeinfo = FALSE;
rev = peg_rev;
SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
&tmp_catalog, ra_session, "", rev, svn_mergeinfo_inherited,
- FALSE, include_descendants, validate_inherited_mergeinfo,
+ FALSE, include_descendants, TRUE,
result_pool, scratch_pool));
/* If we're not querying the root of the repository, the catalog
@@ -1108,7 +1116,7 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
/* Acquire return values. */
SVN_ERR(svn_client__get_wc_or_repos_mergeinfo_catalog(
- mergeinfo_catalog, &inherited, include_descendants, FALSE,
+ mergeinfo_catalog, &inherited, NULL, include_descendants, FALSE,
ignore_invalid_mergeinfo, svn_mergeinfo_inherited,
ra_session, path_or_url, ctx,
result_pool, scratch_pool));
Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.h?rev=1145653&r1=1145652&r2=1145653&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.h Tue Jul 12 16:19:48 2011
@@ -227,12 +227,24 @@ svn_client__get_repos_mergeinfo_catalog(
INHERIT indicates whether explicit, explicit or inherited, or only
inherited mergeinfo for TARGET_WCPATH is retrieved.
+ If FROM_REPOS is not NULL, then set *FROM_REPOS to true if
+ *TARGET_MERGEINFO is inherted and the repository was contacted to
+ obtain it. Set *FROM_REPOS to false otherwise.
+
If TARGET_WCPATH inherited its mergeinfo from a working copy ancestor
or if it was obtained from the repository, set *INHERITED to TRUE, set it
- to FALSE otherwise. */
+ to FALSE otherwise.
+
+ Note: If the repository is contacted to find inherited mergeinfo, then
+ inherited mergeinfo validation is requested by defaul (see the
+ VALIDATE_INHERITED_MERGEINFO parameter to svn_client__get_repos_mergeinfo).
+ If the caller needs to know if validation actually occurred then it should
+ check if the server supports the
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability. */
svn_error_t *
svn_client__get_wc_or_repos_mergeinfo(svn_mergeinfo_t *target_mergeinfo,
svn_boolean_t *inherited,
+ svn_boolean_t *from_repos,
svn_boolean_t repos_only,
svn_mergeinfo_inheritance_t inherit,
svn_ra_session_t *ra_session,
@@ -259,6 +271,7 @@ svn_error_t *
svn_client__get_wc_or_repos_mergeinfo_catalog(
svn_mergeinfo_catalog_t *target_mergeinfo_catalog,
svn_boolean_t *inherited,
+ svn_boolean_t *from_repos,
svn_boolean_t include_descendants,
svn_boolean_t repos_only,
svn_boolean_t ignore_invalid_mergeinfo,