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 2010/11/15 19:31:42 UTC

svn commit: r1035389 - in /subversion/branches/issue-3668-3669/subversion: include/ libsvn_client/ libsvn_ra/ libsvn_ra_local/ libsvn_ra_neon/ libsvn_ra_serf/ libsvn_ra_svn/ mod_dav_svn/reports/ svnserve/

Author: pburba
Date: Mon Nov 15 18:31:41 2010
New Revision: 1035389

URL: http://svn.apache.org/viewvc?rev=1035389&view=rev
Log:
On the issue-3668-3669 branch: If the server is asked to validate inherited
mergeinfo, enable it to communicate back to the client that it was actually
able to do this.

* subversion/include/svn_ra.h
  (svn_ra_get_mergeinfo2):
* subversion/libsvn_client/mergeinfo.h
  (svn_client__get_repos_mergeinfo,
   svn_client__get_repos_mergeinfo_catalog):
* subversion/libsvn_ra/ra_loader.h
  (svn_ra__vtable_t):
* subversion/libsvn_ra/ra_loader.c
  (svn_ra_get_mergeinfo2):
* subversion/libsvn_ra_local/ra_plugin.c
  (svn_ra_local__get_mergeinfo):

   Change the validation boolean flags on all of these functions to an
   input-output argument so the server can communicate back to the caller
   if it was able to validate inherited mergeinfo.

* subversion/libsvn_client/copy.c

  (calculate_target_mergeinfo): Update call to
   svn_client__get_repos_mergeinfo().

* subversion/libsvn_client/merge.c

  (get_invalid_inherited_mergeinfo): Add a new output argument to communicate
   to the caller if inherited mergeinfo validation occurred.

  (get_full_mergeinfo): Update call to get_invalid_inherited_mergeinfo().
 
* subversion/libsvn_client/mergeinfo.c

  (svn_client__get_repos_mergeinfo,
   svn_client__get_repos_mergeinfo_catalog):
   Implement new argument.

  (svn_client__get_wc_or_repos_mergeinfo_catalog,
   get_mergeinfo):
   Update calls to svn_client__get_repos_mergeinfo_catalog()

* subversion/libsvn_ra/deprecated.c

  (svn_ra_get_mergeinfo): Update call to svn_ra_get_mergeinfo2().

* subversion/libsvn_ra_neon/ra_neon.h

  (svn_ra_neon__get_mergeinfo): Change the validation argument as per
   svn_ra_get_mergeinfo2().

  (ELEM_validate_inherited_mergeinfo): New.

* subversion/libsvn_ra_neon/mergeinfo.c

  (mergeinfo_baton): Add a flag for the server to signal if it validated
   inherited mergeinfo.

  (mergeinfo_report_elements): Add SVN_DAV__VALIDATE_INHERITED, the server
   might send it to us now, not just the inverse.

  (start_element): Handle new ELEM_validate_inherited_mergeinfo.

  (svn_ra_neon__get_mergeinfo): Implement change to validation argument.

* subversion/libsvn_ra_neon/options.c

  (svn_ra_neon__has_capability): Update call to svn_ra_neon__get_mergeinfo().

* subversion/libsvn_ra_serf/ra_serf.h

  (svn_ra_serf__get_mergeinfo): Change the validation argument as per
   svn_ra_get_mergeinfo2().

* subversion/libsvn_ra_serf/mergeinfo.c

  (mergeinfo_state_e.MERGEINFO_VALIDATED): New.

  (mergeinfo_context_t.validated_inherited_mergeinfo): New.

  (start_element): Handle SVN_DAV__VALIDATE_INHERITED, the server might send
   it to us now.

  (cdata_handler): Handle new mergeinfo_state_e.MERGEINFO_VALIDATED.

  (svn_ra_serf__get_mergeinfo): Change the validation argument as per
   svn_ra_get_mergeinfo2().

* subversion/libsvn_ra_serf/options.c

  (svn_ra_serf__has_capability): Update call to svn_ra_serf__get_mergeinfo().

* subversion/libsvn_ra_svn/client.c

  (optbool_to_tristate): Move definition ahead of first reference.

  (ra_svn_get_mergeinfo): Change the validation argument as per
   svn_ra_get_mergeinfo2().

* subversion/mod_dav_svn/reports/mergeinfo.c
  (dav_svn__get_mergeinfo_report):
* subversion/svnserve/serve.c
  (get_mergeinfo):

   If asked, let the client know we were able to validate inherited
   mergeinfo.

Modified:
    subversion/branches/issue-3668-3669/subversion/include/svn_ra.h
    subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c
    subversion/branches/issue-3668-3669/subversion/libsvn_client/merge.c
    subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.c
    subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.h
    subversion/branches/issue-3668-3669/subversion/libsvn_ra/deprecated.c
    subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.c
    subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.h
    subversion/branches/issue-3668-3669/subversion/libsvn_ra_local/ra_plugin.c
    subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/mergeinfo.c
    subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/options.c
    subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/ra_neon.h
    subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/mergeinfo.c
    subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/options.c
    subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/issue-3668-3669/subversion/libsvn_ra_svn/client.c
    subversion/branches/issue-3668-3669/subversion/mod_dav_svn/reports/mergeinfo.c
    subversion/branches/issue-3668-3669/subversion/svnserve/serve.c

Modified: subversion/branches/issue-3668-3669/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/include/svn_ra.h?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/include/svn_ra.h (original)
+++ subversion/branches/issue-3668-3669/subversion/include/svn_ra.h Mon Nov 15 18:31:41 2010
@@ -1012,9 +1012,12 @@ svn_ra_get_dir(svn_ra_session_t *session
  * only inherited mergeinfo for @a paths is retrieved.
  *
  * If the mergeinfo for any path is inherited and
- * @a validate_inherited_mergeinfo is TRUE, then the mergeinfo for
- * that path in @a *catalog will only contain merge source
- * path-revisions that actually exist in repository.
+ * @a *validate_inherited_mergeinfo is TRUE, then request that the server
+ * validate the mergeinfo in @a *catalog, so it contains only merge source
+ * path-revisions that actually exist in repository.  If validation is
+ * requested and the server supports it, then set
+ * @a *validate_inherited_mergeinfo to TRUE on return.  Set it to FALSE
+ * in all other cases.
  *
  * If @a include_descendants is TRUE, then additionally return the
  * mergeinfo for any descendant of any element of @a paths which has
@@ -1040,7 +1043,7 @@ svn_ra_get_mergeinfo2(svn_ra_session_t *
                       const apr_array_header_t *paths,
                       svn_revnum_t revision,
                       svn_mergeinfo_inheritance_t inherit,
-                      svn_boolean_t validate_inherited_mergeinfo,
+                      svn_boolean_t *validate_inherited_mergeinfo,
                       svn_boolean_t include_descendants,
                       apr_pool_t *pool);
 

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_client/copy.c Mon Nov 15 18:31:41 2010
@@ -118,6 +118,8 @@ calculate_target_mergeinfo(svn_ra_sessio
 
   if (! locally_added)
     {
+      svn_boolean_t validate_inherited_mergeinfo = FALSE;
+
       /* 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
@@ -128,8 +130,9 @@ calculate_target_mergeinfo(svn_ra_sessio
                                                 ra_session, src_url, pool));
       SVN_ERR(svn_client__get_repos_mergeinfo(ra_session, &src_mergeinfo,
                                               "", src_revnum,
-                                              svn_mergeinfo_inherited,
-                                              TRUE, FALSE, pool));
+                                              svn_mergeinfo_inherited, TRUE,
+                                              &validate_inherited_mergeinfo,
+                                              pool));
       if (old_session_url)
         SVN_ERR(svn_ra_reparent(ra_session, old_session_url, pool));
     }

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_client/merge.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_client/merge.c Mon Nov 15 18:31:41 2010
@@ -3291,12 +3291,29 @@ fix_deleted_subtree_ranges(const char *u
 /*** Determining What Remains To Be Merged ***/
 
 
-/* Set *INVALID_INHERITED_MERGEINFO to the mergeinfo that working copy path
-   TARGET_ABSPATH inherits, less any merge source path-revisions that don't
-   actually exist in the repository.  If all inherited mergeinfo describes
+/* Attempt to determine if a working copy path inherits any invalid
+   mergeinfo.
+
+   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.
+
+   If no mergeinfo is inherited set *INVALID_INHERITED_MERGEINFO to NULL and
+   *VALIDATED to true.
+
+   If only empty mergeinfo is inherited set *INVALID_INHERITED_MERGEINFO to
+   and empty hash and *VALIDATED to true.
+
+   If non-empty inherited mergeinfo is inherited then, if the server (1.7+)
+   supports inherited mergeinfo validation, remove all valid path-revisions
+   from the raw inherited mergeinfo, set *INVALID_INHERITED_MERGEINFO to the
+   remainder, and set *VALIDATED to true.  If the server doesn't support
+   inherited mergeinfo validation then set *INVALID_INHERITED_MERGEINFO to
+   NULL and set *VALIDATED to false.
+
+   Note that if validation occurs, but all inherited mergeinfo describes
    non-existent paths, then *INVALID_INHERITED_MERGEINFO is set to an empty
-   hash.  If TARGET_ABSPATH inherits no mergeinfo whatsoever (pre-validation),
-   then *INVALID_INHERITED_MERGEINFO is set to NULL.
+   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
@@ -3306,6 +3323,7 @@ fix_deleted_subtree_ranges(const char *u
    is used for any temporary allocations. */
 static svn_error_t *
 get_invalid_inherited_mergeinfo(svn_mergeinfo_t *invalid_inherited_mergeinfo,
+                                svn_boolean_t *validated,
                                 svn_ra_session_t *ra_session,
                                 const char *target_abspath,
                                 svn_client_ctx_t *ctx,
@@ -3315,9 +3333,11 @@ get_invalid_inherited_mergeinfo(svn_merg
   svn_mergeinfo_t repos_raw_inherited;
   svn_mergeinfo_t repos_validated_inherited;
   svn_revnum_t base_revision;
+  svn_boolean_t validate_inherited_mergeinfo;
 
-  /* Our starting assumption. */ 
+  /* Our starting assumptions. */ 
   *invalid_inherited_mergeinfo = NULL;
+  *validated = TRUE;
 
   SVN_ERR(svn_wc__node_get_base_rev(&base_revision, ctx->wc_ctx,
                                     target_abspath, scratch_pool));
@@ -3338,10 +3358,11 @@ get_invalid_inherited_mergeinfo(svn_merg
       /* Contact the repository to derive the portion of
          TARGET_ABSPATH's inherited mergeinfo which is non-existent
          and remove it from */
+      validate_inherited_mergeinfo = FALSE;
       SVN_ERR(svn_client__get_repos_mergeinfo(
         ra_session, &repos_raw_inherited, "", base_revision,
         svn_mergeinfo_inherited, TRUE,
-        FALSE, /* validate_inherited_mergeinfo */
+        &validate_inherited_mergeinfo,
         scratch_pool));
 
       if (repos_raw_inherited == NULL)
@@ -3357,12 +3378,15 @@ get_invalid_inherited_mergeinfo(svn_merg
           SVN_ERR(svn_client__get_repos_mergeinfo(
             ra_session, &repos_validated_inherited, "", base_revision,
             svn_mergeinfo_inherited, TRUE,
-            TRUE, /* validate_inherited_mergeinfo */
+            validated,
             scratch_pool));
-          SVN_ERR(svn_mergeinfo_remove2(invalid_inherited_mergeinfo,
-                                        repos_validated_inherited,
-                                        repos_raw_inherited, FALSE,
-                                        result_pool, scratch_pool));
+          if (*validated)
+            SVN_ERR(svn_mergeinfo_remove2(invalid_inherited_mergeinfo,
+                                          repos_validated_inherited,
+                                          repos_raw_inherited, FALSE,
+                                          result_pool, scratch_pool));
+          else
+            *invalid_inherited_mergeinfo = NULL;
         }
       SVN_ERR(svn_client__ensure_ra_session_url(&session_url, ra_session,
                                                 session_url, scratch_pool));
@@ -3413,11 +3437,12 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
                    apr_pool_t *scratch_pool)
 {
   svn_boolean_t inherited = FALSE;
+  svn_boolean_t inherited_validated = FALSE;
 
   /* First, we get the real mergeinfo.  We use SCRATCH_POOL throughout this
      block because we'll make a final copy of *RECORDED_MERGEINFO only after
      removing any self-referential mergeinfo. */
-if (recorded_mergeinfo)
+  if (recorded_mergeinfo)
     {
       /* ### FIXME: There's probably an RA session we could/should be
          ### using here instead of having this function possibly spawn
@@ -3436,12 +3461,13 @@ if (recorded_mergeinfo)
         {
           svn_mergeinfo_t invalid_inherited_mergeinfo;
 
-          SVN_ERR(get_invalid_inherited_mergeinfo(&invalid_inherited_mergeinfo,
-                                                  ra_session, target_abspath,
-                                                  ctx, scratch_pool,
-                                                  scratch_pool));
+          SVN_ERR(get_invalid_inherited_mergeinfo(
+            &invalid_inherited_mergeinfo, &inherited_validated,
+            ra_session, target_abspath, ctx,
+            scratch_pool, scratch_pool));
 
-          if (invalid_inherited_mergeinfo
+          if (inherited_validated
+              && invalid_inherited_mergeinfo
               && apr_hash_count(invalid_inherited_mergeinfo))
             SVN_ERR(svn_mergeinfo_remove2(recorded_mergeinfo,
                                           invalid_inherited_mergeinfo,

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.c Mon Nov 15 18:31:41 2010
@@ -442,19 +442,16 @@ svn_client__get_repos_mergeinfo(svn_ra_s
                                 svn_revnum_t rev,
                                 svn_mergeinfo_inheritance_t inherit,
                                 svn_boolean_t squelch_incapable,
-                                svn_boolean_t validate_inherited_mergeinfo,
+                                svn_boolean_t *validate_inherited_mergeinfo,
                                 apr_pool_t *pool)
 {
   svn_mergeinfo_catalog_t tgt_mergeinfo_cat;
 
   *target_mergeinfo = NULL;
 
-  SVN_ERR(svn_client__get_repos_mergeinfo_catalog(&tgt_mergeinfo_cat,
-                                                  ra_session,
-                                                  rel_path, rev, inherit,
-                                                  squelch_incapable, FALSE,
-                                                  validate_inherited_mergeinfo,
-                                                  pool, pool));
+  SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
+    &tgt_mergeinfo_cat, ra_session, rel_path, rev, inherit,
+    squelch_incapable, FALSE, validate_inherited_mergeinfo, pool, pool));
 
   if (tgt_mergeinfo_cat && apr_hash_count(tgt_mergeinfo_cat))
     {
@@ -478,7 +475,7 @@ svn_client__get_repos_mergeinfo_catalog(
   svn_mergeinfo_inheritance_t inherit,
   svn_boolean_t squelch_incapable,
   svn_boolean_t include_descendants,
-  svn_boolean_t validate_inherited_mergeinfo,
+  svn_boolean_t *validate_inherited_mergeinfo,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool)
 {
@@ -611,6 +608,7 @@ 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)
                 {
@@ -629,7 +627,8 @@ 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, FALSE, result_pool, scratch_pool));
+                        TRUE, FALSE, &validate_inherited_mergeinfo,
+                        result_pool, scratch_pool));
 
               if (*target_mergeinfo_catalog
                   && apr_hash_get(*target_mergeinfo_catalog, "",
@@ -1032,6 +1031,7 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
   if (is_url)
     {
       svn_mergeinfo_catalog_t tmp_catalog;
+      svn_boolean_t validate_inherited_mergeinfo = FALSE;
 
       SVN_ERR(svn_dirent_get_absolute(&local_abspath, "", scratch_pool));
       SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL,
@@ -1042,14 +1042,10 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
                                               local_abspath, ra_session,
                                               &peg_rev, scratch_pool));
       SVN_ERR(svn_ra_get_repos_root2(ra_session, repos_root, scratch_pool));
-      SVN_ERR(svn_client__get_repos_mergeinfo_catalog(&tmp_catalog,
-                                                      ra_session,
-                                                      "", rev,
-                                                      svn_mergeinfo_inherited,
-                                                      FALSE,
-                                                      include_descendants,
-                                                      FALSE, result_pool,
-                                                      scratch_pool));
+      SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
+        &tmp_catalog, ra_session, "", rev, svn_mergeinfo_inherited,
+        FALSE, include_descendants, &validate_inherited_mergeinfo,
+        result_pool, scratch_pool));
 
       /* If we're not querying the root of the repository, the catalog
          we fetched will be keyed on paths relative to the session

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.h?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_client/mergeinfo.h Mon Nov 15 18:31:41 2010
@@ -158,9 +158,17 @@ svn_client__get_wc_mergeinfo_catalog(svn
    TRUE, set *TARGET_MERGEINFO to NULL.
 
    If the *TARGET_MERGEINFO for REL_PATH path is inherited and
-   VALIDATE_INHERITED_MERGEINFO is TRUE, then *TARGET_MERGEINFO
+   *VALIDATE_INHERITED_MERGEINFO is TRUE, then *TARGET_MERGEINFO
    will only contain merge source path-revisions that actually
-   exist in repository. */
+   exist in repository.
+
+   If the *TARGET_MERGEINFO for REL_PATH path is inherited and
+   *VALIDATE_INHERITED_MERGEINFO is TRUE, then request that the server
+   validate the mergeinfo in *TARGET_MERGEINFO, so it contains only merge
+   source path-revisions that actually exist in repository.  If validation
+   is requested and the server supports it, then set
+   *VALIDATE_INHERITED_MERGEINFO to TRUE on return.  Set it to FALSE in
+   all other cases. */
 svn_error_t *
 svn_client__get_repos_mergeinfo(svn_ra_session_t *ra_session,
                                 svn_mergeinfo_t *target_mergeinfo,
@@ -168,7 +176,7 @@ svn_client__get_repos_mergeinfo(svn_ra_s
                                 svn_revnum_t rev,
                                 svn_mergeinfo_inheritance_t inherit,
                                 svn_boolean_t squelch_incapable,
-                                svn_boolean_t validate_inherited_mergeinfo,
+                                svn_boolean_t *validate_inherited_mergeinfo,
                                 apr_pool_t *pool);
 
 /* If INCLUDE_DESCENDANTS is FALSE, behave exactly like
@@ -190,7 +198,7 @@ svn_client__get_repos_mergeinfo_catalog(
   svn_mergeinfo_inheritance_t inherit,
   svn_boolean_t squelch_incapable,
   svn_boolean_t include_descendants,
-  svn_boolean_t validate_inherited_mergeinfo,
+  svn_boolean_t *validate_inherited_mergeinfo,
   apr_pool_t *result_pool,
   apr_pool_t *scratch_pool);
 

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra/deprecated.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra/deprecated.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra/deprecated.c Mon Nov 15 18:31:41 2010
@@ -426,7 +426,10 @@ svn_error_t *svn_ra_get_mergeinfo(svn_ra
                                   svn_boolean_t include_descendants,
                                   apr_pool_t *pool)
 {
-  return svn_error_return(svn_ra_get_mergeinfo2(session, catalog, paths, revision,
-                          inherit, FALSE, include_descendants, pool));
+  svn_boolean_t validate_inherited_mergeinfo = FALSE;
+
+  return svn_error_return(svn_ra_get_mergeinfo2(session, catalog, paths,
+                          revision, inherit, &validate_inherited_mergeinfo,
+                          include_descendants, pool));
 }
 

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.c Mon Nov 15 18:31:41 2010
@@ -758,7 +758,7 @@ svn_error_t *svn_ra_get_mergeinfo2(svn_r
                                    const apr_array_header_t *paths,
                                    svn_revnum_t revision,
                                    svn_mergeinfo_inheritance_t inherit,
-                                   svn_boolean_t validate_inherited_mergeinfo,
+                                   svn_boolean_t *validate_inherited_mergeinfo,
                                    svn_boolean_t include_descendants,
                                    apr_pool_t *pool)
 {

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.h?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra/ra_loader.h Mon Nov 15 18:31:41 2010
@@ -119,7 +119,7 @@ typedef struct svn_ra__vtable_t {
                                 const apr_array_header_t *paths,
                                 svn_revnum_t revision,
                                 svn_mergeinfo_inheritance_t inherit,
-                                svn_boolean_t validate_inherited_mergeinfo,
+                                svn_boolean_t *validate_inherited_mergeinfo,
                                 svn_boolean_t include_merged_revisions,
                                 apr_pool_t *pool);
   svn_error_t *(*do_update)(svn_ra_session_t *session,

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra_local/ra_plugin.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra_local/ra_plugin.c Mon Nov 15 18:31:41 2010
@@ -693,7 +693,7 @@ svn_ra_local__get_mergeinfo(svn_ra_sessi
                             const apr_array_header_t *paths,
                             svn_revnum_t revision,
                             svn_mergeinfo_inheritance_t inherit,
-                            svn_boolean_t validate_inherited_mergeinfo,
+                            svn_boolean_t *validate_inherited_mergeinfo,
                             svn_boolean_t include_descendants,
                             apr_pool_t *pool)
 {
@@ -712,7 +712,7 @@ svn_ra_local__get_mergeinfo(svn_ra_sessi
 
   SVN_ERR(svn_repos_fs_get_mergeinfo2(&tmp_catalog, sess->repos, abs_paths,
                                       revision, inherit,
-                                      validate_inherited_mergeinfo,
+                                      *validate_inherited_mergeinfo,
                                       include_descendants,
                                       NULL, NULL, pool));
   if (apr_hash_count(tmp_catalog) > 0)

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/mergeinfo.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/mergeinfo.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/mergeinfo.c Mon Nov 15 18:31:41 2010
@@ -51,6 +51,7 @@ struct mergeinfo_baton
   svn_stringbuf_t *curr_path;
   svn_stringbuf_t *curr_info;
   svn_mergeinfo_catalog_t catalog;
+  svn_boolean_t validated_inherited_mergeinfo;
   svn_error_t *err;
 };
 
@@ -62,6 +63,8 @@ static const svn_ra_neon__xml_elm_t merg
       SVN_RA_NEON__XML_CDATA },
     { SVN_XML_NAMESPACE, SVN_DAV__MERGEINFO_INFO, ELEM_mergeinfo_info,
       SVN_RA_NEON__XML_CDATA },
+    { SVN_XML_NAMESPACE, SVN_DAV__VALIDATE_INHERITED,
+      ELEM_validate_inherited_mergeinfo, SVN_RA_NEON__XML_CDATA },
     { NULL }
   };
 
@@ -93,6 +96,10 @@ start_element(int *elem, void *baton, in
       svn_stringbuf_setempty(mb->curr_info);
       svn_stringbuf_setempty(mb->curr_path);
     }
+  else if (elm->id == ELEM_validate_inherited_mergeinfo)
+    {
+      mb->validated_inherited_mergeinfo = TRUE;
+    }
 
   SVN_ERR(mb->err);
 
@@ -163,7 +170,7 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
                            const apr_array_header_t *paths,
                            svn_revnum_t revision,
                            svn_mergeinfo_inheritance_t inherit,
-                           svn_boolean_t validate_inherited_mergeinfo,
+                           svn_boolean_t *validate_inherited_mergeinfo,
                            svn_boolean_t include_descendants,
                            apr_pool_t *pool)
 {
@@ -195,7 +202,7 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
                                         "</S:inherit>",
                                         svn_inheritance_to_word(inherit)));
 
-  if (validate_inherited_mergeinfo)
+  if (*validate_inherited_mergeinfo)
     {
       /* Send it only if true; server will default to "no". */
       svn_stringbuf_appendcstr(request_body,
@@ -233,6 +240,7 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
   mb.curr_path = svn_stringbuf_create("", pool);
   mb.curr_info = svn_stringbuf_create("", pool);
   mb.catalog = apr_hash_make(pool);
+  mb.validated_inherited_mergeinfo = FALSE;
   mb.err = SVN_NO_ERROR;
 
   /* ras's URL may not exist in HEAD, and thus it's not safe to send
@@ -262,5 +270,7 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
   if (mb.err == SVN_NO_ERROR && apr_hash_count(mb.catalog))
     *catalog = mb.catalog;
 
+  *validate_inherited_mergeinfo = mb.validated_inherited_mergeinfo;
+
   return mb.err;
 }

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/options.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/options.c Mon Nov 15 18:31:41 2010
@@ -395,12 +395,15 @@ svn_ra_neon__has_capability(svn_ra_sessi
              support mergeinfo. */
           svn_mergeinfo_catalog_t ignored;
           svn_error_t *err;
+          svn_boolean_t validate_inherited_mergeinfo = FALSE;
           apr_array_header_t *paths = apr_array_make(pool, 1,
                                                      sizeof(char *));
           APR_ARRAY_PUSH(paths, const char *) = "";
 
           err = svn_ra_neon__get_mergeinfo(session, &ignored, paths, 0,
-                                           FALSE, FALSE, FALSE, pool);
+                                           FALSE,
+                                           &validate_inherited_mergeinfo,
+                                           FALSE, pool);
 
           if (err)
             {

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/ra_neon.h?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra_neon/ra_neon.h Mon Nov 15 18:31:41 2010
@@ -305,7 +305,7 @@ svn_error_t * svn_ra_neon__get_mergeinfo
   const apr_array_header_t *paths,
   svn_revnum_t revision,
   svn_mergeinfo_inheritance_t inherit,
-  svn_boolean_t validate_inherited_mergeinfo,
+  svn_boolean_t *validate_inherited_mergeinfo,
   svn_boolean_t include_descendants,
   apr_pool_t *pool);
 
@@ -861,7 +861,8 @@ enum {
   ELEM_mergeinfo_info,
   ELEM_has_children,
   ELEM_merged_revision,
-  ELEM_deleted_rev_report
+  ELEM_deleted_rev_report,
+  ELEM_validate_inherited_mergeinfo
 };
 
 /* ### docco */

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/mergeinfo.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/mergeinfo.c Mon Nov 15 18:31:41 2010
@@ -45,7 +45,8 @@ typedef enum {
   MERGEINFO_REPORT,
   MERGEINFO_ITEM,
   MERGEINFO_PATH,
-  MERGEINFO_INFO
+  MERGEINFO_INFO,
+  MERGEINFO_VALIDATED
 } mergeinfo_state_e;
 
 /* Baton for accumulating mergeinfo.  RESULT_CATALOG stores the final
@@ -63,6 +64,7 @@ typedef struct {
   svn_revnum_t revision;
   svn_mergeinfo_inheritance_t inherit;
   svn_boolean_t validate_inherited_mergeinfo;
+  svn_boolean_t validated_inherited_mergeinfo;
   svn_boolean_t include_descendants;
 } mergeinfo_context_t;
 
@@ -81,6 +83,11 @@ start_element(svn_ra_serf__xml_parser_t 
       svn_ra_serf__xml_push_state(parser, MERGEINFO_REPORT);
     }
   else if (state == MERGEINFO_REPORT &&
+           strcmp(name.name, SVN_DAV__VALIDATE_INHERITED) == 0)
+    {
+      svn_ra_serf__xml_push_state(parser, MERGEINFO_VALIDATED);
+    }
+  else if (state == MERGEINFO_REPORT &&
            strcmp(name.name, SVN_DAV__MERGEINFO_ITEM) == 0)
     {
       svn_ra_serf__xml_push_state(parser, MERGEINFO_ITEM);
@@ -170,6 +177,11 @@ cdata_handler(svn_ra_serf__xml_parser_t 
         svn_stringbuf_appendbytes(mergeinfo_ctx->curr_info, data, len);
       break;
 
+    case MERGEINFO_VALIDATED:
+      if (strncmp(data, "yes", 3) == 0)
+        mergeinfo_ctx->validated_inherited_mergeinfo = TRUE;
+      break;
+
     default:
       break;
     }
@@ -243,7 +255,7 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
                            const apr_array_header_t *paths,
                            svn_revnum_t revision,
                            svn_mergeinfo_inheritance_t inherit,
-                           svn_boolean_t validate_inherited_mergeinfo,
+                           svn_boolean_t *validate_inherited_mergeinfo,
                            svn_boolean_t include_descendants,
                            apr_pool_t *pool)
 {
@@ -273,7 +285,8 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
   mergeinfo_ctx->paths = paths;
   mergeinfo_ctx->revision = revision;
   mergeinfo_ctx->inherit = inherit;
-  mergeinfo_ctx->validate_inherited_mergeinfo = validate_inherited_mergeinfo;
+  mergeinfo_ctx->validate_inherited_mergeinfo = *validate_inherited_mergeinfo;
+  mergeinfo_ctx->validated_inherited_mergeinfo = FALSE;
   mergeinfo_ctx->include_descendants = include_descendants;
 
   handler = apr_pcalloc(pool, sizeof(*handler));
@@ -313,6 +326,9 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
 
   SVN_ERR(err);
 
+  *validate_inherited_mergeinfo =
+    mergeinfo_ctx->validated_inherited_mergeinfo;
+
   if (mergeinfo_ctx->done && apr_hash_count(mergeinfo_ctx->result_catalog))
     *catalog = mergeinfo_ctx->result_catalog;
 

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/options.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/options.c Mon Nov 15 18:31:41 2010
@@ -566,12 +566,15 @@ svn_ra_serf__has_capability(svn_ra_sessi
              support mergeinfo. */
           svn_mergeinfo_catalog_t ignored;
           svn_error_t *err;
+          svn_boolean_t validate_inherited_mergeinfo = FALSE;
           apr_array_header_t *paths = apr_array_make(pool, 1,
                                                      sizeof(char *));
           APR_ARRAY_PUSH(paths, const char *) = "";
 
           err = svn_ra_serf__get_mergeinfo(ra_session, &ignored, paths, 0,
-                                           FALSE, FALSE, FALSE, pool);
+                                           FALSE,
+                                           &validate_inherited_mergeinfo,
+                                           FALSE, pool);
 
           if (err)
             {

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/ra_serf.h?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra_serf/ra_serf.h Mon Nov 15 18:31:41 2010
@@ -1385,7 +1385,7 @@ svn_error_t * svn_ra_serf__get_mergeinfo
   const apr_array_header_t *paths,
   svn_revnum_t revision,
   svn_mergeinfo_inheritance_t inherit,
-  svn_boolean_t validate_inherited_mergeinfo,
+  svn_boolean_t *validate_inherited_mergeinfo,
   svn_boolean_t include_descendants,
   apr_pool_t *pool);
 

Modified: subversion/branches/issue-3668-3669/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/libsvn_ra_svn/client.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/issue-3668-3669/subversion/libsvn_ra_svn/client.c Mon Nov 15 18:31:41 2010
@@ -1153,16 +1153,34 @@ static svn_error_t *ra_svn_get_dir(svn_r
   return SVN_NO_ERROR;
 }
 
+/* Converts a apr_uint64_t with values TRUE, FALSE or
+   SVN_RA_SVN_UNSPECIFIED_NUMBER as provided by svn_ra_svn_parse_tuple
+   to a svn_tristate_t */
+static svn_tristate_t
+optbool_to_tristate(apr_uint64_t v)
+{
+  switch (v)
+  {
+    case TRUE:
+      return svn_tristate_true;
+    case FALSE:
+      return svn_tristate_false;
+    default: /* Contains SVN_RA_SVN_UNSPECIFIED_NUMBER */
+      return svn_tristate_unknown;
+  }
+}
+
 /* If REVISION is SVN_INVALID_REVNUM, no value is sent to the
    server, which defaults to youngest. */
-static svn_error_t *ra_svn_get_mergeinfo(svn_ra_session_t *session,
-                                         svn_mergeinfo_catalog_t *catalog,
-                                         const apr_array_header_t *paths,
-                                         svn_revnum_t revision,
-                                         svn_mergeinfo_inheritance_t inherit,
-                                         svn_boolean_t validate_inherited_mergeinfo,
-                                         svn_boolean_t include_descendants,
-                                         apr_pool_t *pool)
+static svn_error_t *ra_svn_get_mergeinfo(
+  svn_ra_session_t *session,
+  svn_mergeinfo_catalog_t *catalog,
+  const apr_array_header_t *paths,
+  svn_revnum_t revision,
+  svn_mergeinfo_inheritance_t inherit,
+  svn_boolean_t *validate_inherited_mergeinfo,
+  svn_boolean_t include_descendants,
+  apr_pool_t *pool)
 {
   svn_ra_svn__session_baton_t *sess_baton = session->priv;
   svn_ra_svn_conn_t *conn = sess_baton->conn;
@@ -1170,6 +1188,7 @@ static svn_error_t *ra_svn_get_mergeinfo
   apr_array_header_t *mergeinfo_tuple;
   svn_ra_svn_item_t *elt;
   const char *path;
+  apr_uint64_t validated_inherited_mergeinfo;
 
   SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w((!", "get-mergeinfo"));
   for (i = 0; i < paths->nelts; i++)
@@ -1180,10 +1199,14 @@ static svn_error_t *ra_svn_get_mergeinfo
   SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)(?r)wbb)", revision,
                                  svn_inheritance_to_word(inherit),
                                  include_descendants,
-                                 validate_inherited_mergeinfo));
+                                 *validate_inherited_mergeinfo));
 
   SVN_ERR(handle_auth_request(sess_baton, pool));
-  SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "l", &mergeinfo_tuple));
+  SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "l?B", &mergeinfo_tuple,
+                                       &validated_inherited_mergeinfo));
+
+  *validate_inherited_mergeinfo =
+    (optbool_to_tristate(validated_inherited_mergeinfo) == svn_tristate_true);
 
   *catalog = NULL;
   if (mergeinfo_tuple->nelts > 0)
@@ -1315,22 +1338,6 @@ static svn_error_t *ra_svn_diff(svn_ra_s
   return SVN_NO_ERROR;
 }
 
-/* Converts a apr_uint64_t with values TRUE, FALSE or
-   SVN_RA_SVN_UNSPECIFIED_NUMBER as provided by svn_ra_svn_parse_tuple
-   to a svn_tristate_t */
-static svn_tristate_t
-optbool_to_tristate(apr_uint64_t v)
-{
-  switch (v)
-  {
-    case TRUE:
-      return svn_tristate_true;
-    case FALSE:
-      return svn_tristate_false;
-    default: /* Contains SVN_RA_SVN_UNSPECIFIED_NUMBER */
-      return svn_tristate_unknown;
-  }
-}
 
 static svn_error_t *ra_svn_log(svn_ra_session_t *session,
                                const apr_array_header_t *paths,

Modified: subversion/branches/issue-3668-3669/subversion/mod_dav_svn/reports/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/mod_dav_svn/reports/mergeinfo.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/mod_dav_svn/reports/mergeinfo.c (original)
+++ subversion/branches/issue-3668-3669/subversion/mod_dav_svn/reports/mergeinfo.c Mon Nov 15 18:31:41 2010
@@ -205,6 +205,22 @@ dav_svn__get_mergeinfo_report(const dav_
         }
     }
 
+  if (validate_inherited_mergeinfo)
+    {
+      serr = dav_svn__brigade_puts(bb, output,
+                                   "<S:" SVN_DAV__VALIDATE_INHERITED ">"
+                                   "yes"
+                                   "</S:" SVN_DAV__VALIDATE_INHERITED ">"
+                                   DEBUG_CR);
+      if (serr)
+        {
+          derr = dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+                                      "Error ending REPORT response.",
+                                      resource->pool);
+          goto cleanup;
+        }
+    }
+
   if ((serr = dav_svn__brigade_puts(bb, output,
                                     "</S:" SVN_DAV__MERGEINFO_REPORT ">"
                                     DEBUG_CR)))

Modified: subversion/branches/issue-3668-3669/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-3668-3669/subversion/svnserve/serve.c?rev=1035389&r1=1035388&r2=1035389&view=diff
==============================================================================
--- subversion/branches/issue-3668-3669/subversion/svnserve/serve.c (original)
+++ subversion/branches/issue-3668-3669/subversion/svnserve/serve.c Mon Nov 15 18:31:41 2010
@@ -1895,7 +1895,8 @@ static svn_error_t *get_mergeinfo(svn_ra
                                      mergeinfo_string));
     }
   svn_pool_destroy(iterpool);
-  SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!))"));
+  SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)b)",
+    validate_inherited_mergeinfo));
 
   return SVN_NO_ERROR;
 }