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 2011/07/20 01:06:07 UTC

svn commit: r1148581 [3/12] - in /subversion/branches/gpg-agent-password-store: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/hook-scripts/ contrib/hook-scripts/enforcer/ contrib/server-side/ contrib/server-side/fsfsfix...

Modified: subversion/branches/gpg-agent-password-store/subversion/include/svn_version.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/include/svn_version.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/include/svn_version.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/include/svn_version.h Tue Jul 19 23:05:44 2011
@@ -62,7 +62,7 @@ extern "C" {
  * Modify when new functionality is added or new interfaces are
  * defined, but all changes are backward compatible.
  */
-#define SVN_VER_MINOR      7
+#define SVN_VER_MINOR      8
 
 /**
  * Patch number.

Modified: subversion/branches/gpg-agent-password-store/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/include/svn_wc.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/include/svn_wc.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/include/svn_wc.h Tue Jul 19 23:05:44 2011
@@ -1107,6 +1107,10 @@ typedef enum svn_wc_notify_action_t
    * @since New in 1.7. */
   svn_wc_notify_update_skip_working_only,
 
+  /** An update tried to update a file or directory to which access could
+   * not be obtained. @since New in 1.7. */
+  svn_wc_notify_update_skip_access_denied,
+
   /** An update operation removed an external working copy.
    * @since New in 1.7. */
   svn_wc_notify_update_external_removed,
@@ -1201,6 +1205,10 @@ typedef enum svn_wc_notify_action_t
    * @since New in 1.7. */
   svn_wc_notify_failed_forbidden_by_server,
 
+  /** The operation skipped the path because it was conflicted.
+   * @since New in 1.7. */
+  svn_wc_notify_skip_conflicted,
+
 } svn_wc_notify_action_t;
 
 
@@ -3539,6 +3547,9 @@ typedef struct svn_wc_status3_t
   /** The URL of the repository */
   const char *repos_root_url;
 
+  /** The UUID of the repository */
+  const char *repos_uuid;
+
   /** The in-repository path relative to the repository root. */
   const char *repos_relpath;
 
@@ -4011,6 +4022,10 @@ svn_wc_walk_status(svn_wc_context_t *wc_
  * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
  * the @a statushash to determine if the client has canceled the operation.
  *
+ * If @a depth_as_sticky is set handle @a depth like when depth_is_sticky is
+ * passed for updating. This will show excluded nodes show up as added in the
+ * repository.
+ *
  * If @a server_performs_filtering is TRUE, assume that the server handles
  * the ambient depth filtering, so this doesn't have to be handled in the
  * editor.
@@ -4032,6 +4047,7 @@ svn_wc_get_status_editor5(const svn_delt
                           svn_depth_t depth,
                           svn_boolean_t get_all,
                           svn_boolean_t no_ignore,
+                          svn_boolean_t depth_as_sticky,
                           svn_boolean_t server_performs_filtering,
                           const apr_array_header_t *ignore_patterns,
                           svn_wc_status_func4_t status_func,

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/blame.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/blame.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/blame.c Tue Jul 19 23:05:44 2011
@@ -107,8 +107,6 @@ struct delta_baton {
   svn_txdelta_window_handler_t wrapped_handler;
   void *wrapped_baton;
   struct file_rev_baton *file_rev_baton;
-  svn_stream_t *source_stream;  /* the delta source */
-  svn_stream_t *stream;  /* the result of the delta */
   const char *filename;
 };
 
@@ -321,14 +319,6 @@ window_handler(svn_txdelta_window_t *win
   if (window)
     return SVN_NO_ERROR;
 
-  /* Close the files used for the delta.
-     It is important to do this early, since otherwise, they will be deleted
-     before all handles are closed, which leads to failures on some platforms
-     when new tempfiles are to be created. */
-  if (dbaton->source_stream)
-    SVN_ERR(svn_stream_close(dbaton->source_stream));
-  SVN_ERR(svn_stream_close(dbaton->stream));
-
   /* If we are including merged revisions, we need to add each rev to the
      merged chain. */
   if (frb->include_merged_revisions)
@@ -455,24 +445,20 @@ file_rev_handler(void *baton, const char
 
   /* Prepare the text delta window handler. */
   if (frb->last_filename)
-    SVN_ERR(svn_stream_open_readonly(&delta_baton->source_stream, frb->last_filename,
+    SVN_ERR(svn_stream_open_readonly(&last_stream, frb->last_filename,
                                      frb->currpool, pool));
   else
     /* Means empty stream below. */
-    delta_baton->source_stream = NULL;
-  last_stream = svn_stream_disown(delta_baton->source_stream, pool);
+    last_stream = NULL;
 
   if (frb->include_merged_revisions && !frb->merged_revision)
     filepool = frb->filepool;
   else
     filepool = frb->currpool;
 
-  SVN_ERR(svn_stream_open_unique(&delta_baton->stream,
-                                 &delta_baton->filename,
-                                 NULL,
+  SVN_ERR(svn_stream_open_unique(&cur_stream, &delta_baton->filename, NULL,
                                  svn_io_file_del_on_pool_cleanup,
                                  filepool, filepool));
-  cur_stream = svn_stream_disown(delta_baton->stream, filepool);
 
   /* Get window handler for applying delta. */
   svn_txdelta_apply(last_stream, cur_stream, NULL, NULL,

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/cat.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/cat.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/cat.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/cat.c Tue Jul 19 23:05:44 2011
@@ -219,8 +219,8 @@ svn_client_cat2(svn_stream_t *out,
       output = svn_stream_disown(output, pool);
 
       return svn_error_trace(svn_stream_copy3(normal_stream, output,
-                                               ctx->cancel_func,
-                                               ctx->cancel_baton, pool));
+                                              ctx->cancel_func,
+                                              ctx->cancel_baton, pool));
     }
 
   /* Get an RA plugin for this filesystem object. */

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/client.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/client.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/client.h Tue Jul 19 23:05:44 2011
@@ -223,7 +223,21 @@ svn_client__ra_session_from_path(svn_ra_
    NULL.
 
    If SESSION_URL is NULL, treat this as a magic value meaning "point
-   the RA session to the root of the repository".  */
+   the RA session to the root of the repository".
+
+   NOTE: The typical usage pattern for this functions is:
+
+       const char *old_session_url;
+       SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url,
+                                                 ra_session,
+                                                 new_session_url,
+                                                 pool);
+
+       [...]
+
+       if (old_session_url)
+         SVN_ERR(svn_ra_reparent(ra_session, old_session_url, pool));
+*/
 svn_error_t *
 svn_client__ensure_ra_session_url(const char **old_session_url,
                                   svn_ra_session_t *ra_session,
@@ -292,7 +306,7 @@ svn_client__default_walker_error_handler
    in *CORRECTED_URL.  (This function mirrors svn_ra_open4(), which
    see, regarding the interpretation and handling of these two parameters.)
 
-   The root of the session is specified by BASE_URL and BASE_DIR.
+   The root of the session is specified by BASE_URL and BASE_DIR_ABSPATH.
 
    Additional control parameters:
 
@@ -758,7 +772,7 @@ typedef svn_error_t *(*svn_client__check
                                                      svn_revnum_t revision,
                                                      apr_pool_t *scratch_pool);
 
-/* Recursively crawl a set of working copy paths (DIR_ABSPATH + each
+/* Recursively crawl a set of working copy paths (BASE_DIR_ABSPATH + each
    item in the TARGETS array) looking for commit candidates, locking
    working copy directories as the crawl progresses.  For each
    candidate found:

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/cmdline.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/cmdline.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/cmdline.c Tue Jul 19 23:05:44 2011
@@ -347,20 +347,10 @@ svn_client_args_to_target_array2(apr_arr
         {
           err = svn_client_root_url_from_path(&root_url, "", ctx, pool);
           if (err || root_url == NULL)
-            {
-              if (reserved_names)
-                for (i = 0; i < reserved_names->nelts; ++i)
-                  err = svn_error_createf(SVN_ERR_RESERVED_FILENAME_SPECIFIED,
-                                          err,
-                                          _("'%s' ends in a reserved name"),
-                                          APR_ARRAY_IDX(reserved_names, i,
-                                                        const char *));
-
-              return svn_error_create(SVN_ERR_WC_NOT_WORKING_COPY, err,
-                                      _("Resolving '^/': no repository root "
-                                        "found in the target arguments or "
-                                        "in the current directory"));
-            }
+            return svn_error_create(SVN_ERR_WC_NOT_WORKING_COPY, err,
+                                    _("Resolving '^/': no repository root "
+                                      "found in the target arguments or "
+                                      "in the current directory"));
         }
 
       *targets_p = apr_array_make(pool, output_targets->nelts,
@@ -395,7 +385,7 @@ svn_client_args_to_target_array2(apr_arr
   else
     *targets_p = output_targets;
 
-  if (reserved_names)
+  if (reserved_names && ! err)
     for (i = 0; i < reserved_names->nelts; ++i)
       err = svn_error_createf(SVN_ERR_RESERVED_FILENAME_SPECIFIED, err,
                               _("'%s' ends in a reserved name"),

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/commit.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/commit.c Tue Jul 19 23:05:44 2011
@@ -166,8 +166,8 @@ send_file_contents(const char *path,
 
   /* Send the file's contents to the delta-window handler. */
   return svn_error_trace(svn_txdelta_send_stream(contents, handler,
-                                                  handler_baton, digest,
-                                                  pool));
+                                                 handler_baton, digest,
+                                                 pool));
 }
 
 
@@ -1373,15 +1373,15 @@ svn_client_commit5(const apr_array_heade
 
   /* Sort and condense our COMMIT_ITEMS. */
   cmt_err = svn_error_trace(svn_client__condense_commit_items(&base_url,
-                                                               commit_items,
-                                                               pool));
+                                                              commit_items,
+                                                              pool));
 
   if (cmt_err)
     goto cleanup;
 
   /* Collect our lock tokens with paths relative to base_url. */
   cmt_err = svn_error_trace(collect_lock_tokens(&lock_tokens, lock_tokens,
-                                                 base_url, pool));
+                                                base_url, pool));
 
   if (cmt_err)
     goto cleanup;
@@ -1479,5 +1479,5 @@ svn_client_commit5(const apr_array_heade
   svn_pool_destroy(iterpool);
 
   return svn_error_trace(reconcile_errors(cmt_err, unlock_err, bump_err,
-                                           pool));
+                                          pool));
 }

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/copy.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/copy.c Tue Jul 19 23:05:44 2011
@@ -113,8 +113,6 @@ 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
@@ -126,8 +124,7 @@ calculate_target_mergeinfo(svn_ra_sessio
       SVN_ERR(svn_client__get_repos_mergeinfo(ra_session, &src_mergeinfo,
                                               "", src_revnum,
                                               svn_mergeinfo_inherited, TRUE,
-                                              &validate_inherited_mergeinfo,
-                                              pool));
+                                              FALSE, pool));
       if (old_session_url)
         SVN_ERR(svn_ra_reparent(ra_session, old_session_url, pool));
     }
@@ -2257,7 +2254,7 @@ try_copy(const apr_array_header_t *sourc
       /* Copy or move all targets. */
       if (is_move)
         return svn_error_trace(do_wc_to_wc_moves(copy_pairs, dst_path_in, ctx,
-                                                  pool));
+                                                 pool));
       else
         return svn_error_trace(do_wc_to_wc_copies(copy_pairs, ctx, pool));
     }

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/delete.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/delete.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/delete.c Tue Jul 19 23:05:44 2011
@@ -121,11 +121,11 @@ svn_client__can_delete(const char *path,
      determination, returning an error if it finds anything that shouldn't
      be deleted. */
   return svn_error_trace(svn_client_status5(NULL, ctx, path, &revision,
-                                             svn_depth_infinity, FALSE,
-                                             FALSE, FALSE, FALSE, FALSE,
-                                             NULL,
-                                             find_undeletables, NULL,
-                                             scratch_pool));
+                                            svn_depth_infinity, FALSE,
+                                            FALSE, FALSE, FALSE, FALSE,
+                                            NULL,
+                                            find_undeletables, NULL,
+                                            scratch_pool));
 }
 
 
@@ -322,9 +322,9 @@ svn_client__wc_delete(const char *path,
   if (!dry_run)
     /* Mark the entry for commit deletion and perform wc deletion */
     return svn_error_trace(svn_wc_delete4(ctx->wc_ctx, local_abspath,
-                                           keep_local, TRUE,
-                                           ctx->cancel_func, ctx->cancel_baton,
-                                           notify_func, notify_baton, pool));
+                                          keep_local, TRUE,
+                                          ctx->cancel_func, ctx->cancel_baton,
+                                          notify_func, notify_baton, pool));
 
   return SVN_NO_ERROR;
 }
@@ -365,7 +365,6 @@ svn_client_delete4(const apr_array_heade
                    apr_pool_t *pool)
 {
   svn_boolean_t is_url;
-  int i;
 
   if (! paths->nelts)
     return SVN_NO_ERROR;
@@ -381,6 +380,7 @@ svn_client_delete4(const apr_array_heade
   else
     {
       apr_pool_t *subpool = svn_pool_create(pool);
+      int i;
 
       for (i = 0; i < paths->nelts; i++)
         {

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/deprecated.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/deprecated.c Tue Jul 19 23:05:44 2011
@@ -38,6 +38,7 @@
 #include "svn_compat.h"
 #include "svn_props.h"
 #include "svn_utf.h"
+#include "svn_string.h"
 
 #include "client.h"
 #include "mergeinfo.h"
@@ -1721,6 +1722,40 @@ svn_client_propget(apr_hash_t **props,
 }
 
 
+/* Duplicate a HASH containing (char * -> svn_string_t *) key/value
+   pairs using POOL. */
+static apr_hash_t *
+string_hash_dup(apr_hash_t *hash, apr_pool_t *pool)
+{
+  apr_hash_index_t *hi;
+  apr_hash_t *new_hash = apr_hash_make(pool);
+
+  for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
+    {
+      const char *key = apr_pstrdup(pool, svn__apr_hash_index_key(hi));
+      apr_ssize_t klen = svn__apr_hash_index_klen(hi);
+      svn_string_t *val = svn_string_dup(svn__apr_hash_index_val(hi), pool);
+
+      apr_hash_set(new_hash, key, klen, val);
+    }
+  return new_hash;
+}
+
+svn_client_proplist_item_t *
+svn_client_proplist_item_dup(const svn_client_proplist_item_t *item,
+                             apr_pool_t * pool)
+{
+  svn_client_proplist_item_t *new_item = apr_pcalloc(pool, sizeof(*new_item));
+
+  if (item->node_name)
+    new_item->node_name = svn_stringbuf_dup(item->node_name, pool);
+
+  if (item->prop_hash)
+    new_item->prop_hash = string_hash_dup(item->prop_hash, pool);
+
+  return new_item;
+}
+
 /* Receiver baton used by proplist2() */
 struct proplist_receiver_baton {
   apr_array_header_t *props;
@@ -2078,8 +2113,8 @@ svn_client_checkout(svn_revnum_t *result
   peg_revision.kind = svn_opt_revision_unspecified;
 
   return svn_error_trace(svn_client_checkout2(result_rev, URL, path,
-                                               &peg_revision, revision, recurse,
-                                               FALSE, ctx, pool));
+                                              &peg_revision, revision, recurse,
+                                              FALSE, ctx, pool));
 }
 
 /*** From info.c ***/
@@ -2142,7 +2177,9 @@ info_from_info2(svn_info_t **new_info,
   info->last_changed_rev    = info2->last_changed_rev;
   info->last_changed_date   = info2->last_changed_date;
   info->last_changed_author = info2->last_changed_author;
-  info->lock                = info2->lock;
+
+  /* Stupid old structure has a non-const LOCK member. Sigh.  */
+  info->lock                = (svn_lock_t *)info2->lock;
 
   info->size64              = info2->size;
   if (info2->size == SVN_INVALID_FILESIZE)
@@ -2302,10 +2339,11 @@ svn_client_info2(const char *path_or_url
   SVN_ERR(svn_client_info3(abspath_or_url,
                            peg_revision,
                            revision,
-                           info_receiver_relpath_wrapper,
-                           &rb,
                            depth,
+                           FALSE, TRUE,
                            changelists,
+                           info_receiver_relpath_wrapper,
+                           &rb,
                            ctx,
                            pool));
 

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/diff.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/diff.c Tue Jul 19 23:05:44 2011
@@ -873,12 +873,12 @@ diff_dir_props_changed(svn_wc_notify_sta
     path = svn_dirent_join(diff_cmd_baton->anchor, path, scratch_pool);
 
   return svn_error_trace(diff_props_changed(state,
-                                             tree_conflicted, path,
-                                             dir_was_added,
-                                             propchanges,
-                                             original_props,
-                                             diff_baton,
-                                             scratch_pool));
+                                            tree_conflicted, path,
+                                            dir_was_added,
+                                            propchanges,
+                                            original_props,
+                                            diff_baton,
+                                            scratch_pool));
 }
 
 

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/info.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/info.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/info.c Tue Jul 19 23:05:44 2011
@@ -262,10 +262,12 @@ svn_error_t *
 svn_client_info3(const char *abspath_or_url,
                  const svn_opt_revision_t *peg_revision,
                  const svn_opt_revision_t *revision,
-                 svn_client_info_receiver2_t receiver,
-                 void *receiver_baton,
                  svn_depth_t depth,
+                 svn_boolean_t fetch_excluded,
+                 svn_boolean_t fetch_actual_only,
                  const apr_array_header_t *changelists,
+                 svn_client_info_receiver2_t receiver,
+                 void *receiver_baton,
                  svn_client_ctx_t *ctx,
                  apr_pool_t *pool)
 {
@@ -294,7 +296,8 @@ svn_client_info3(const char *abspath_or_
       wc_info_receiver_baton_t b = { receiver, receiver_baton };
       return svn_error_trace(
         svn_wc__get_info(ctx->wc_ctx, abspath_or_url, depth,
-                         wc_info_receiver, &b, changelists,
+                        fetch_excluded, fetch_actual_only, changelists,
+                         wc_info_receiver, &b,
                          ctx->cancel_func, ctx->cancel_baton, pool));
     }
 

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/locking_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/locking_commands.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/locking_commands.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/locking_commands.c Tue Jul 19 23:05:44 2011
@@ -60,6 +60,8 @@ struct lock_baton
  * (depending on whether DO_LOCK is true or false respectively), but
  * only if RA_ERR is null, or (in the unlock case) is something other
  * than SVN_ERR_FS_LOCK_OWNER_MISMATCH.
+ *
+ * Implements svn_ra_lock_callback_t.
  */
 static svn_error_t *
 store_locks_callback(void *baton,

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/merge.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/merge.c Tue Jul 19 23:05:44 2011
@@ -180,6 +180,10 @@ typedef struct merge_cmd_baton_t {
                                          is TRUE.*/
   svn_boolean_t mergeinfo_capable;    /* Whether the merge source server
                                          is capable of Merge Tracking. */
+  svn_boolean_t mergeinfo_validation_capable; /* Whether the merge source
+                                                 server is capable of
+                                                 validating inherited
+                                                 mergeinfo. */
   svn_boolean_t ignore_ancestry;      /* Are we ignoring ancestry (and by
                                          extension, mergeinfo)?  FALSE if
                                          SOURCES_ANCESTRAL is FALSE. */
@@ -356,7 +360,8 @@ is_path_conflicted_by_merge(merge_cmd_ba
  *   - Return 'obstructed' if there is a node on disk where none or a
  *     different kind is expected, or if the disk node cannot be read.
  *   - Return 'missing' if there is no node on disk but one is expected.
- *     Also return 'missing' for absent nodes (not here due to authz).
+ *     Also return 'missing' for server-excluded nodes (not here due to
+ *     authz or other reasons determined by the server).
  *
  * Optionally return a bit more info for interested users.
  **/
@@ -1262,12 +1267,12 @@ merge_dir_props_changed(svn_wc_notify_st
     }
 
   return svn_error_trace(merge_props_changed(state,
-                                              tree_conflicted,
-                                              local_abspath,
-                                              propchanges,
-                                              original_props,
-                                              diff_baton,
-                                              scratch_pool));
+                                             tree_conflicted,
+                                             local_abspath,
+                                             propchanges,
+                                             original_props,
+                                             diff_baton,
+                                             scratch_pool));
 }
 
 /* Contains any state collected while resolving conflicts. */
@@ -2898,21 +2903,34 @@ adjust_deleted_subtree_ranges(svn_client
                                                 scratch_pool));
                 }
 
-              /* Create a rangelist describing the range PRIMARY_URL@older_rev
-                 exists and find the intersection of that and
-                 CHILD->REMAINING_RANGES. */
-              exists_rangelist =
-                svn_rangelist__initialize(older_rev,
-                                          revision_primary_url_deleted - 1,
-                                          TRUE, scratch_pool);
-              SVN_ERR(svn_rangelist_intersect(&(child->remaining_ranges),
-                                              exists_rangelist,
-                                              child->remaining_ranges,
-                                              FALSE, scratch_pool));
+              /* Find the intersection of CHILD->REMAINING_RANGES with the
+                 range over which PRIMARY_URL@older_rev exists (ending at
+                 the youngest revision at which it still exists). */
+              if (revision_primary_url_deleted - 1 > older_rev)
+                {
+                  /* It was not deleted immediately after OLDER_REV, so
+                     it has some relevant changes. */
+                  exists_rangelist =
+                    svn_rangelist__initialize(older_rev,
+                                              revision_primary_url_deleted - 1,
+                                              TRUE, scratch_pool);
+                  SVN_ERR(svn_rangelist_intersect(&(child->remaining_ranges),
+                                                  exists_rangelist,
+                                                  child->remaining_ranges,
+                                                  FALSE, scratch_pool));
+                }
+              else
+                {
+                  /* It was deleted immediately after the OLDER rev, so
+                     it has no relevant changes. */
+                  child->remaining_ranges
+                    = apr_array_make(scratch_pool, 0,
+                                     sizeof(svn_merge_range_t *));
+                }
 
-              /* Create a second rangelist describing the range beginning when
-                 PRIMARY_URL@older_rev was deleted until younger_rev.  Then
-                 find the intersection of that and PARENT->REMAINING_RANGES.
+              /* Find the intersection of PARENT->REMAINING_RANGES with the
+                 range beginning when PRIMARY_URL@older_rev was deleted
+                 until younger_rev.
                  Finally merge this rangelist with the rangelist above and
                  store the result in CHILD->REMANING_RANGES. */
               deleted_rangelist =
@@ -3156,53 +3174,45 @@ 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.
+/* Given the inherited mergeinfo INHERITED_MERGEINFO on TARGET_ABSPATH,
+   set *CORRECTED_MERGEINFO equal to INHERITED_MERGEINFO less any
+   mergeinfo TARGET_ABSPATH, at its base revision, inherits from the
+   repository.  If TARGET_ABSPATH doesn't exist in the repository, or if
+   no mergeinfo or only empty mergeinfo is inherited from the repository,
+   then set *CORRECTED_MERGEINFO equal to INHERITED_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.
-
-   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
-   be temporarily reparented.
-
-   RESULT_POOL is used to allocate *INVALID_INHERITED_MERGEINFO, SCRATCH_POOL
-   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,
-                                apr_pool_t *result_pool,
-                                apr_pool_t *scratch_pool)
+   RA_SESSION is an open session that may be temporarily reparented as
+   needed by this function.
+
+   RESULT_POOL is used to allocate *CORRECTED_MERGEINFO if necessary.
+   SCRATCH_POOL is used for temporary allocations.
+
+   Note: This function should only be called if the server supports the
+   SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability.  If the server
+   does not have that capability then this function is a no-op.
+
+   ### While this function addresses issue #3669 'inheritance can result
+   ### in mergeinfo describing nonexistent sources', it is worth noting
+   ### that issue #3756 'subtree merge can inherit invalid working
+   ### mergeinfo' is still a problem here, i.e. if TARGET_ABSPATH inherits
+   ### working mergeinfo from a working copy parent, some of the merge
+   ### sources in that mergeinfo may describe non-existent path-revs.
+   ###
+   ### See http://subversion.tigris.org/issues/show_bug.cgi?id=3669
+   ### and http://subversion.tigris.org/issues/show_bug.cgi?id=3756 */
+static svn_error_t *
+remove_non_existent_inherited_mergeinfo(svn_mergeinfo_t *corrected_mergeinfo,
+                                        svn_mergeinfo_t inherited_mergeinfo,
+                                        svn_ra_session_t *ra_session,
+                                        const char *target_abspath,
+                                        svn_client_ctx_t *ctx,
+                                        apr_pool_t *result_pool,
+                                        apr_pool_t *scratch_pool)
 {
-  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 assumptions. */
-  *invalid_inherited_mergeinfo = NULL;
-  *validated = TRUE;
+  /* Our starting assumption. */
+  *corrected_mergeinfo = inherited_mergeinfo;
 
   SVN_ERR(svn_wc__node_get_base_rev(&base_revision, ctx->wc_ctx,
                                     target_abspath, scratch_pool));
@@ -3211,6 +3221,8 @@ get_invalid_inherited_mergeinfo(svn_merg
      in the repository yet, so we're done. */
   if (SVN_IS_VALID_REVNUM(base_revision))
     {
+      svn_mergeinfo_t repos_raw_inherited;
+      svn_mergeinfo_t nonexistent_inherited_mergeinfo;
       const char *target_url;
       const char *session_url;
 
@@ -3220,41 +3232,66 @@ get_invalid_inherited_mergeinfo(svn_merg
       SVN_ERR(svn_client__ensure_ra_session_url(&session_url, ra_session,
                                                 target_url, scratch_pool));
 
-      /* 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,
-        &validate_inherited_mergeinfo,
-        scratch_pool));
+      /* Get TARGET_ABSPATH's inherited mergeinfo from the repository with
+         that most unusual of requests: We don't want the server to check
+         that the inherited merge sources actually exist. */
+      SVN_ERR(svn_client__get_repos_mergeinfo(ra_session,
+                                              &repos_raw_inherited, "",
+                                              base_revision,
+                                              svn_mergeinfo_inherited,
+                                              TRUE,
+                                              FALSE, /* No validation */
+                                              scratch_pool));
 
-      if (repos_raw_inherited == NULL)
+      if (repos_raw_inherited == NULL
+          || apr_hash_count(repos_raw_inherited) == 0)
         {
-          *invalid_inherited_mergeinfo = NULL;
-        }
-      else if (apr_hash_count(repos_raw_inherited) == 0)
-        {
-          *invalid_inherited_mergeinfo = apr_hash_make(result_pool);
+          /* No mergeinfo or only empty mergeinfo was inherited. */
+          nonexistent_inherited_mergeinfo = NULL;
         }
       else
         {
-          SVN_ERR(svn_client__get_repos_mergeinfo(
-            ra_session, &repos_validated_inherited, "", base_revision,
-            svn_mergeinfo_inherited, TRUE,
-            validated,
-            scratch_pool));
-          if (*validated)
-            SVN_ERR(svn_mergeinfo_remove2(invalid_inherited_mergeinfo,
-                                          repos_validated_inherited,
-                                          repos_raw_inherited, FALSE,
-                                          result_pool, scratch_pool));
+          /* Now ask the server for TARGET_ABSPATH's inherited mergeinfo
+             but this time request that the inherited mergeinfo be valiated
+             so it contains only existing merge sources. */
+          svn_mergeinfo_t repos_validated_inherited;
+
+          SVN_ERR(svn_client__get_repos_mergeinfo(ra_session,
+                                                  &repos_validated_inherited,
+                                                  "", base_revision,
+                                                  svn_mergeinfo_inherited,
+                                                  TRUE,
+                                                  TRUE, /* Validated */
+                                                  scratch_pool));
+          if (repos_validated_inherited == NULL
+              || apr_hash_count(repos_validated_inherited) == 0)
+            {
+              /* All of the inherited mergeinfo describes non-existent
+                 merge sources. */
+              nonexistent_inherited_mergeinfo = repos_raw_inherited;
+            }
           else
-            *invalid_inherited_mergeinfo = NULL;
+            {
+              SVN_ERR(svn_mergeinfo_remove2(&nonexistent_inherited_mergeinfo,
+                                            repos_validated_inherited,
+                                            repos_raw_inherited, FALSE,
+                                            scratch_pool, scratch_pool));
+            }
         }
-      SVN_ERR(svn_client__ensure_ra_session_url(&session_url, ra_session,
-                                                session_url, scratch_pool));
+
+      /* If we needed to temporarily reparent RA_SESSION, then point it
+         back to its original URL. */
+      if (session_url)
+        SVN_ERR(svn_ra_reparent(ra_session, session_url, scratch_pool));
+
+      /* Remove any non-existent inherited merge sources from
+         INHERITED_MERGEINFO. */
+      if (nonexistent_inherited_mergeinfo
+          && apr_hash_count(nonexistent_inherited_mergeinfo))
+        SVN_ERR(svn_mergeinfo_remove2(corrected_mergeinfo,
+                                      nonexistent_inherited_mergeinfo,
+                                      inherited_mergeinfo, FALSE,
+                                      result_pool, scratch_pool));
     }
   return SVN_NO_ERROR;
 }
@@ -3273,9 +3310,14 @@ get_invalid_inherited_mergeinfo(svn_merg
    *RECORDED_MERGEINFO is inherited, then *IMPLICIT_MERGEINFO will be
    removed from *RECORDED_MERGEINFO.
 
-   If INDIRECT is not NULL set *INDIRECT to TRUE if *RECORDED_MERGEINFO
-   is inherited and not explicit.  If RECORDED_MERGEINFO is NULL then
-   INDIRECT is ignored.
+   If INHERITED is not NULL set *INHERITED to TRUE if *RECORDED_MERGEINFO
+   is inherited rather than explicit.  If RECORDED_MERGEINFO is NULL then
+   INHERITED is ignored.
+
+   If the server supports the SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO
+   capability, and the resulting *RECORDED_MERGEINFO is inherited, and
+   VALIDATE_INHERITED is TRUE, then *RECORDED_MERGEINFO is validated as per
+   svn_ra_get_mergeinfo2().
 
    If IMPLICIT_MERGEINFO is not NULL then START and END are limits on the
    the natural history sought, must both be valid revision numbers, and
@@ -3291,8 +3333,9 @@ get_invalid_inherited_mergeinfo(svn_merg
 static svn_error_t *
 get_full_mergeinfo(svn_mergeinfo_t *recorded_mergeinfo,
                    svn_mergeinfo_t *implicit_mergeinfo,
-                   svn_boolean_t *indirect,
+                   svn_boolean_t *inherited,
                    svn_mergeinfo_inheritance_t inherit,
+                   svn_boolean_t validate_inherited,
                    svn_ra_session_t *ra_session,
                    const char *target_abspath,
                    svn_revnum_t start,
@@ -3301,40 +3344,45 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
                    apr_pool_t *result_pool,
                    apr_pool_t *scratch_pool)
 {
-  svn_boolean_t inherited = FALSE;
-  svn_boolean_t inherited_validated = FALSE;
+  svn_boolean_t inherited_mergeinfo = 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)
     {
+      svn_boolean_t inherited_from_repos;
+
       SVN_ERR(svn_client__get_wc_or_repos_mergeinfo(recorded_mergeinfo,
-                                                    &inherited, FALSE,
+                                                    &inherited_mergeinfo,
+                                                    &inherited_from_repos,
+                                                    FALSE,
                                                     inherit, ra_session,
                                                     target_abspath,
                                                     ctx, scratch_pool));
-      if (indirect)
-        *indirect = inherited;
-
-      /* Issue #3669: Remove any non-existent mergeinfo sources
-         from TARGET_ABSPATH's inherited mergeinfo. */
       if (inherited)
-        {
-          svn_mergeinfo_t invalid_inherited_mergeinfo;
+        *inherited = inherited_mergeinfo;
+
+      /* 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. */
+      if (inherited_mergeinfo
+          && validate_inherited
+          && !inherited_from_repos)
+        {
+          SVN_ERR(remove_non_existent_inherited_mergeinfo(recorded_mergeinfo,
+                                                          *recorded_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 (inherited_validated
-              && invalid_inherited_mergeinfo
-              && apr_hash_count(invalid_inherited_mergeinfo))
-            SVN_ERR(svn_mergeinfo_remove2(recorded_mergeinfo,
-                                          invalid_inherited_mergeinfo,
-                                          *recorded_mergeinfo, FALSE,
-                                          scratch_pool, scratch_pool));
         }
     }
 
@@ -3405,9 +3453,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
                                                        result_pool));
 
           /* Return RA_SESSION back to where it was when we were called. */
-         SVN_ERR(svn_client__ensure_ra_session_url(&session_url,
-                                                   ra_session, session_url,
-                                                   scratch_pool));
+          SVN_ERR(svn_ra_reparent(ra_session, session_url, scratch_pool));
         }
     } /*if (implicit_mergeinfo) */
 
@@ -3420,8 +3466,8 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
          up with fragmented mergeinfo, see
          http://subversion.tigris.org/issues/show_bug.cgi?id=3668#desc5 */
       if (implicit_mergeinfo
-          && inherited
-          && inherited_validated)
+          && inherited_mergeinfo
+          && validate_inherited)
         SVN_ERR(svn_mergeinfo_remove2(recorded_mergeinfo,
                                       *implicit_mergeinfo,
                                       *recorded_mergeinfo, FALSE,
@@ -3443,6 +3489,9 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
 
    If PARENT->IMPLICIT_MERGEINFO is NULL, obtain it from the server.
 
+   VALIDATE_INHERITED functions as per the argument of the same name
+   in get_full_mergeinfo().
+
    Set CHILD->IMPLICIT_MERGEINFO to the mergeinfo inherited from
    PARENT->IMPLICIT_MERGEINFO.  CHILD->IMPLICIT_MERGEINFO is allocated
    in POOL.
@@ -3452,6 +3501,7 @@ inherit_implicit_mergeinfo_from_parent(s
                                        svn_client__merge_path_t *child,
                                        svn_revnum_t revision1,
                                        svn_revnum_t revision2,
+                                       svn_boolean_t validate_inherited,
                                        svn_ra_session_t *ra_session,
                                        svn_client_ctx_t *ctx,
                                        apr_pool_t *result_pool,
@@ -3468,7 +3518,7 @@ inherit_implicit_mergeinfo_from_parent(s
   if (!parent->implicit_mergeinfo)
     SVN_ERR(get_full_mergeinfo(NULL, &(parent->implicit_mergeinfo),
                                NULL, svn_mergeinfo_inherited,
-                               ra_session, child->abspath,
+                               validate_inherited, ra_session, child->abspath,
                                MAX(revision1, revision2),
                                MIN(revision1, revision2),
                                ctx, result_pool, scratch_pool));
@@ -3496,6 +3546,9 @@ inherit_implicit_mergeinfo_from_parent(s
    PARNET->IMPLICIT_MERGEINFO, otherwise contact the repository.  Use
    SCRATCH_POOL for all temporary allocations.
 
+   VALIDATE_INHERITED functions as per the argument of the same name
+   in get_full_mergeinfo().
+
    PARENT, CHILD, REVISION1, REVISION2, RA_SESSION, and
    CTX are all cascased from the arguments of the same name in
    filter_merged_revisions() and the same conditions for that function
@@ -3504,6 +3557,7 @@ static svn_error_t *
 ensure_implicit_mergeinfo(svn_client__merge_path_t *parent,
                           svn_client__merge_path_t *child,
                           svn_boolean_t child_inherits_parent,
+                          svn_boolean_t validate_inherited,
                           svn_revnum_t revision1,
                           svn_revnum_t revision2,
                           svn_ra_session_t *ra_session,
@@ -3522,6 +3576,7 @@ ensure_implicit_mergeinfo(svn_client__me
                                                    child,
                                                    revision1,
                                                    revision2,
+                                                   validate_inherited,
                                                    ra_session,
                                                    ctx,
                                                    result_pool,
@@ -3530,6 +3585,7 @@ ensure_implicit_mergeinfo(svn_client__me
     SVN_ERR(get_full_mergeinfo(NULL,
                                &(child->implicit_mergeinfo),
                                NULL, svn_mergeinfo_inherited,
+                               validate_inherited,
                                ra_session, child->abspath,
                                MAX(revision1, revision2),
                                MIN(revision1, revision2),
@@ -3577,6 +3633,9 @@ ensure_implicit_mergeinfo(svn_client__me
    mergeinfo on CHILD->ABSPATH or an empty hash if CHILD->ABSPATH has empty
    mergeinfo.
 
+   VALIDATE_INHERITED functions as per the argument of the same name
+   in get_full_mergeinfo().
+
    SCRATCH_POOL is used for all temporary allocations.
 
    NOTE: This should only be called when honoring mergeinfo.
@@ -3592,6 +3651,7 @@ filter_merged_revisions(svn_client__merg
                         svn_revnum_t revision1,
                         svn_revnum_t revision2,
                         svn_boolean_t child_inherits_implicit,
+                        svn_boolean_t validate_inherited,
                         svn_ra_session_t *ra_session,
                         svn_client_ctx_t *ctx,
                         apr_pool_t *result_pool,
@@ -3681,6 +3741,7 @@ filter_merged_revisions(svn_client__merg
           SVN_ERR(ensure_implicit_mergeinfo(parent,
                                             child,
                                             child_inherits_implicit,
+                                            validate_inherited,
                                             revision1,
                                             revision2,
                                             ra_session,
@@ -3770,6 +3831,7 @@ filter_merged_revisions(svn_client__merg
           SVN_ERR(ensure_implicit_mergeinfo(parent,
                                             child,
                                             child_inherits_implicit,
+                                            validate_inherited,
                                             revision1,
                                             revision2,
                                             ra_session,
@@ -3823,6 +3885,9 @@ filter_merged_revisions(svn_client__merg
    If not null, IMPLICIT_SRC_GAP is the gap, if any, in the natural history
    of URL1@REVISION1:URL2@REVISION2, see merge_cmd_baton_t.implicit_src_gap.
 
+   VALIDATE_INHERITED functions as per the argument of the same name
+   in get_full_mergeinfo().
+
    SCRATCH_POOL is used for all temporary allocations.  Changes to CHILD and
    PARENT are made in RESULT_POOL.
 
@@ -3850,6 +3915,7 @@ calculate_remaining_ranges(svn_client__m
                            svn_mergeinfo_t target_mergeinfo,
                            const apr_array_header_t *implicit_src_gap,
                            svn_boolean_t child_inherits_implicit,
+                           svn_boolean_t validate_inherited,
                            svn_ra_session_t *ra_session,
                            svn_client_ctx_t *ctx,
                            apr_pool_t *result_pool,
@@ -3900,6 +3966,7 @@ calculate_remaining_ranges(svn_client__m
                                   adjusted_target_mergeinfo,
                                   revision1, revision2,
                                   child_inherits_implicit,
+                                  validate_inherited,
                                   ra_session, ctx, result_pool,
                                   scratch_pool));
 
@@ -4176,7 +4243,8 @@ populate_remaining_ranges(apr_array_head
             {
               SVN_ERR(get_full_mergeinfo(NULL, /* child->pre_merge_mergeinfo */
                                          &(child->implicit_mergeinfo),
-                                         NULL, /* child->indirect_mergeinfo */
+                                         NULL, /* child->inherited_mergeinfo */
+                                         merge_b->mergeinfo_validation_capable,
                                          svn_mergeinfo_inherited, ra_session,
                                          child->abspath,
                                          MAX(revision1, revision2),
@@ -4198,11 +4266,13 @@ populate_remaining_ranges(apr_array_head
               SVN_ERR_ASSERT(parent);
 
               child_inherits_implicit = (parent && !child->switched);
-              SVN_ERR(ensure_implicit_mergeinfo(parent, child,
-                                                child_inherits_implicit,
-                                                revision1, revision2,
-                                                ra_session, merge_b->ctx,
-                                                result_pool, iterpool));
+              SVN_ERR(ensure_implicit_mergeinfo(
+                parent, child,
+                child_inherits_implicit,
+                merge_b->mergeinfo_validation_capable,
+                revision1, revision2,
+                ra_session, merge_b->ctx,
+                result_pool, iterpool));
             }
 
           child->remaining_ranges = svn_rangelist__initialize(revision1,
@@ -4273,8 +4343,9 @@ populate_remaining_ranges(apr_array_head
         child->pre_merge_mergeinfo ? NULL : &(child->pre_merge_mergeinfo),
         /* Get implicit only for merge target. */
         (i == 0) ? &(child->implicit_mergeinfo) : NULL,
-        &(child->indirect_mergeinfo),
-        svn_mergeinfo_inherited, ra_session,
+        &(child->inherited_mergeinfo),
+        svn_mergeinfo_inherited,
+        merge_b->mergeinfo_validation_capable, ra_session,
         child->abspath,
         MAX(revision1, revision2),
         0, /* Get all implicit mergeinfo */
@@ -4300,16 +4371,18 @@ populate_remaining_ranges(apr_array_head
          exists but is not CHILD's repository parent. */
       child_inherits_implicit = (parent && !child->switched);
 
-      SVN_ERR(calculate_remaining_ranges(parent, child,
-                                         source_root_url,
-                                         child_url1, revision1,
-                                         child_url2, revision2,
-                                         child->pre_merge_mergeinfo,
-                                         merge_b->implicit_src_gap,
-                                         child_inherits_implicit,
-                                         ra_session,
-                                         merge_b->ctx, result_pool,
-                                         iterpool));
+      SVN_ERR(calculate_remaining_ranges(
+        parent, child,
+        source_root_url,
+        child_url1, revision1,
+        child_url2, revision2,
+        child->pre_merge_mergeinfo,
+        merge_b->implicit_src_gap,
+        child_inherits_implicit,
+        merge_b->mergeinfo_validation_capable,
+        ra_session,
+        merge_b->ctx, result_pool,
+        iterpool));
 
       /* Deal with any gap in URL1@REVISION1:URL2@REVISION2's natural history.
 
@@ -5593,7 +5666,7 @@ pre_merge_status_cb(void *baton,
         the child is switched or absent from the WC, or due to a sparse
         checkout.
      5) Path has a sibling (or siblings) missing from the WC because the
-        sibling is switched, absent, schduled for deletion, or missing due to
+        sibling is switched, absent, scheduled for deletion, or missing due to
         a sparse checkout.
      6) Path is absent from disk due to an authz restriction.
      7) Path is equal to MERGE_CMD_BATON->TARGET_ABSPATH.
@@ -5643,7 +5716,7 @@ get_mergeinfo_paths(apr_array_header_t *
   int i;
   apr_pool_t *iterpool = NULL;
   apr_hash_t *subtrees_with_mergeinfo;
-  apr_hash_t *absent_subtrees;
+  apr_hash_t *server_excluded_subtrees;
   apr_hash_t *switched_subtrees;
   apr_hash_t *shallow_subtrees;
   apr_hash_t *missing_subtrees;
@@ -5844,16 +5917,16 @@ get_mergeinfo_paths(apr_array_header_t *
        }
     }
 
-  /* Case 6: Paths absent from disk due to an authz restrictions. */
-  SVN_ERR(svn_wc__get_absent_subtrees(&absent_subtrees,
-                                      merge_cmd_baton->ctx->wc_ctx,
-                                      merge_cmd_baton->target_abspath,
-                                      result_pool, scratch_pool));
-  if (absent_subtrees)
+  /* Case 6: Paths absent from disk due to server-side exclusion. */
+  SVN_ERR(svn_wc__get_server_excluded_subtrees(&server_excluded_subtrees,
+                                               merge_cmd_baton->ctx->wc_ctx,
+                                               merge_cmd_baton->target_abspath,
+                                               result_pool, scratch_pool));
+  if (server_excluded_subtrees)
     {
       apr_hash_index_t *hi;
 
-      for (hi = apr_hash_first(scratch_pool, absent_subtrees);
+      for (hi = apr_hash_first(scratch_pool, server_excluded_subtrees);
            hi;
            hi = apr_hash_next(hi))
         {
@@ -6105,7 +6178,6 @@ remove_noop_merge_ranges(apr_array_heade
   int i;
   svn_revnum_t oldest_rev = SVN_INVALID_REVNUM;
   svn_revnum_t youngest_rev = SVN_INVALID_REVNUM;
-  svn_revnum_t oldest_changed_rev, youngest_changed_rev;
   apr_array_header_t *changed_revs =
     apr_array_make(pool, ranges->nelts, sizeof(svn_revnum_t *));
   apr_array_header_t *operative_ranges =
@@ -6137,6 +6209,8 @@ remove_noop_merge_ranges(apr_array_heade
   /* Are there *any* changes? */
   if (changed_revs->nelts)
     {
+      svn_revnum_t oldest_changed_rev, youngest_changed_rev;
+
       /* Our list of changed revisions should be in youngest-to-oldest
          order. */
       youngest_changed_rev = *(APR_ARRAY_IDX(changed_revs,
@@ -6696,7 +6770,7 @@ do_file_merge(svn_mergeinfo_catalog_t re
   svn_merge_range_t range;
   svn_mergeinfo_t target_mergeinfo;
   svn_merge_range_t *conflicted_range = NULL;
-  svn_boolean_t indirect = FALSE;
+  svn_boolean_t inherited = FALSE;
   svn_boolean_t is_rollback = (revision1 > revision2);
   const char *primary_url = is_rollback ? url1 : url2;
   const char *target_url;
@@ -6740,7 +6814,8 @@ do_file_merge(svn_mergeinfo_catalog_t re
                               iterpool));
       err = get_full_mergeinfo(&target_mergeinfo,
                                &(merge_target->implicit_mergeinfo),
-                               &indirect, svn_mergeinfo_inherited,
+                               &inherited, svn_mergeinfo_inherited,
+                               merge_b->mergeinfo_validation_capable,
                                merge_b->ra_session1, target_abspath,
                                MAX(revision1, revision2),
                                0, /* Get all implicit mergeinfo */
@@ -6766,14 +6841,16 @@ do_file_merge(svn_mergeinfo_catalog_t re
          by REVISION1:REVISION2. */
       if (!merge_b->record_only)
         {
-          SVN_ERR(calculate_remaining_ranges(NULL, merge_target,
-                                             source_root_url,
-                                             url1, revision1, url2, revision2,
-                                             target_mergeinfo,
-                                             merge_b->implicit_src_gap, FALSE,
-                                             merge_b->ra_session1,
-                                             ctx, scratch_pool,
-                                             iterpool));
+          SVN_ERR(calculate_remaining_ranges(
+            NULL, merge_target,
+            source_root_url,
+            url1, revision1, url2, revision2,
+            target_mergeinfo,
+            merge_b->implicit_src_gap, FALSE,
+            merge_b->mergeinfo_validation_capable,
+            merge_b->ra_session1,
+            ctx, scratch_pool,
+            iterpool));
           remaining_ranges = merge_target->remaining_ranges;
         }
     }
@@ -6980,9 +7057,9 @@ do_file_merge(svn_mergeinfo_catalog_t re
         {
           apr_hash_t *merges = apr_hash_make(iterpool);
 
-          /* If merge target has indirect mergeinfo set it before
+          /* If merge target has inherited mergeinfo set it before
              recording the first merge range. */
-          if (indirect)
+          if (inherited)
             SVN_ERR(svn_client__record_wc_mergeinfo(target_abspath,
                                                     target_mergeinfo,
                                                     FALSE, ctx,
@@ -7078,7 +7155,7 @@ process_children_with_new_mergeinfo(merg
       const char *path_url;
       svn_mergeinfo_t path_inherited_mergeinfo;
       svn_mergeinfo_t path_explicit_mergeinfo;
-      svn_boolean_t indirect;
+      svn_boolean_t inherited;
       svn_client__merge_path_t *new_child;
 
       apr_pool_clear(iterpool);
@@ -7088,7 +7165,7 @@ process_children_with_new_mergeinfo(merg
 
       /* Get the path's new explicit mergeinfo... */
       SVN_ERR(svn_client__get_wc_mergeinfo(&path_explicit_mergeinfo,
-                                           &indirect,
+                                           &inherited,
                                            svn_mergeinfo_explicit,
                                            abspath_with_new_mergeinfo,
                                            NULL, NULL, FALSE,
@@ -7108,7 +7185,7 @@ process_children_with_new_mergeinfo(merg
              the merge. */
           SVN_ERR(svn_client__get_wc_or_repos_mergeinfo(
             &path_inherited_mergeinfo,
-            &indirect,
+            &inherited, NULL,
             FALSE,
             svn_mergeinfo_nearest_ancestor, /* We only want inherited MI */
             merge_b->ra_session2,
@@ -7577,9 +7654,9 @@ record_mergeinfo_for_dir_merge(svn_merge
                                               merge_b->ctx->wc_ctx,
                                               iterpool));
 
-          /* If CHILD has indirect mergeinfo set it before
+          /* If CHILD has inherited mergeinfo set it before
              recording the first merge range. */
-          if (child->indirect_mergeinfo)
+          if (child->inherited_mergeinfo)
             SVN_ERR(svn_client__record_wc_mergeinfo(
               child->abspath,
               child->pre_merge_mergeinfo,
@@ -8217,7 +8294,7 @@ do_directory_merge(svn_mergeinfo_catalog
 
   if (honor_mergeinfo && !merge_b->reintegrate_merge)
     {
-      svn_revnum_t new_range_start, start_rev, end_rev;
+      svn_revnum_t new_range_start, start_rev;
       apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
       /* The merge target TARGET_ABSPATH and/or its subtrees may not need all
@@ -8260,7 +8337,7 @@ do_directory_merge(svn_mergeinfo_catalog
           /* Now examine NOTIFY_B->CHILDREN_WITH_MERGEINFO to find the youngest
              ending revision that actually needs to be merged (for reverse
              merges this is the oldest starting revision). */
-           end_rev =
+           svn_revnum_t end_rev =
              get_most_inclusive_end_rev(notify_b->children_with_mergeinfo,
                                         is_rollback);
 
@@ -8657,6 +8734,7 @@ do_merge(apr_hash_t **modified_subtrees,
   merge_cmd_baton.ignore_ancestry = ignore_ancestry;
   merge_cmd_baton.same_repos = same_repos;
   merge_cmd_baton.mergeinfo_capable = FALSE;
+  merge_cmd_baton.mergeinfo_validation_capable = FALSE;
   merge_cmd_baton.sources_ancestral = sources_ancestral;
   merge_cmd_baton.ctx = ctx;
   merge_cmd_baton.target_missing_child = FALSE;
@@ -8738,10 +8816,30 @@ do_merge(apr_hash_t **modified_subtrees,
          an RA session to set, but shouldn't be reset for each iteration. */
       if (! checked_mergeinfo_capability)
         {
+          svn_error_t *err;
+
           SVN_ERR(svn_ra_has_capability(ra_session1,
                                         &merge_cmd_baton.mergeinfo_capable,
                                         SVN_RA_CAPABILITY_MERGEINFO,
                                         iterpool));
+          err = svn_ra_has_capability(
+            ra_session1,
+            &merge_cmd_baton.mergeinfo_validation_capable,
+            SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
+            iterpool);
+          if (err)
+            {
+              if (err->apr_err == SVN_ERR_UNKNOWN_CAPABILITY)
+                {
+                  svn_error_clear(err);
+                  merge_cmd_baton.mergeinfo_validation_capable = FALSE;
+                }
+              else
+                {
+                  return svn_error_trace(err);
+                }
+            }
+
           checked_mergeinfo_capability = TRUE;
         }
 
@@ -9874,13 +9972,11 @@ find_unmerged_mergeinfo(svn_mergeinfo_ca
 
       svn_pool_clear(iterpool);
 
-      source_path = path + strlen(target_repos_rel_path);
-      if (source_path[0] == '/')  /* Remove leading '/'. */
-        source_path++;
-      source_path = svn_relpath_join(source_repos_rel_path, source_path,
-                                     iterpool);
-      source_path_rel_to_session =
-        svn_relpath_skip_ancestor(source_repos_rel_path, source_path);
+      source_path_rel_to_session = path + strlen(target_repos_rel_path);
+      if (source_path_rel_to_session[0] == '/')  /* Remove leading '/'. */
+        source_path_rel_to_session++;
+      source_path = svn_relpath_join(source_repos_rel_path,
+                                     source_path_rel_to_session, iterpool);
 
       /* Convert this target path's natural history into mergeinfo. */
       SVN_ERR(svn_mergeinfo__mergeinfo_from_segments(
@@ -9940,6 +10036,7 @@ find_unmerged_mergeinfo(svn_mergeinfo_ca
           svn_node_kind_t kind;
           svn_mergeinfo_catalog_t subtree_catalog;
           apr_array_header_t *source_repos_rel_path_as_array;
+
           SVN_ERR(svn_ra_check_path(source_ra_session,
                                     source_path_rel_to_session,
                                     source_rev, &kind, iterpool));
@@ -9952,12 +10049,14 @@ find_unmerged_mergeinfo(svn_mergeinfo_ca
             apr_array_make(iterpool, 1, sizeof(const char *));
           APR_ARRAY_PUSH(source_repos_rel_path_as_array, const char *)
             = source_path_rel_to_session;
-          SVN_ERR(svn_ra_get_mergeinfo(source_ra_session, &subtree_catalog,
-                                       source_repos_rel_path_as_array,
-                                       source_rev, svn_mergeinfo_inherited,
-                                       FALSE, iterpool));
+          SVN_ERR(svn_ra_get_mergeinfo2(source_ra_session, &subtree_catalog,
+                                        source_repos_rel_path_as_array,
+                                        source_rev, svn_mergeinfo_inherited,
+                                        FALSE, FALSE,
+                                        iterpool));
           if (subtree_catalog)
-            source_mergeinfo = apr_hash_get(subtree_catalog, source_path,
+            source_mergeinfo = apr_hash_get(subtree_catalog,
+                                            source_path_rel_to_session,
                                             APR_HASH_KEY_STRING);
 
           /* A path might not have any inherited mergeinfo either. */
@@ -10297,9 +10396,11 @@ calculate_left_hand_side(const char **ur
   /* Get the mergeinfo from the source, including its descendants
      with differing explicit mergeinfo. */
   APR_ARRAY_PUSH(source_repos_rel_path_as_array, const char *) = "";
-  SVN_ERR(svn_ra_get_mergeinfo(source_ra_session, &mergeinfo_catalog,
-                               source_repos_rel_path_as_array, source_rev,
-                               svn_mergeinfo_inherited, TRUE, iterpool));
+  SVN_ERR(svn_ra_get_mergeinfo2(source_ra_session, &mergeinfo_catalog,
+                                source_repos_rel_path_as_array, source_rev,
+                                svn_mergeinfo_inherited,
+                                FALSE, TRUE,
+                                iterpool));
 
   if (mergeinfo_catalog)
     SVN_ERR(svn_mergeinfo__add_prefix_to_catalog(&mergeinfo_catalog,

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/mergeinfo.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/mergeinfo.c Tue Jul 19 23:05:44 2011
@@ -267,7 +267,7 @@ svn_client__get_wc_mergeinfo(svn_mergein
                                                 scratch_pool));
 
           /* Look in LOCAL_ABSPATH's parent for inherited mergeinfo if
-             LOCAL_ABSPATH's has no base revision because it is an uncommited
+             LOCAL_ABSPATH's has no base revision because it is an uncommitted
              addition, or if its base revision falls within the inclusive
              range of its parent's last changed revision to the parent's base
              revision; otherwise stop looking for inherited mergeinfo. */
@@ -438,7 +438,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)
 {
   svn_mergeinfo_catalog_t tgt_mergeinfo_cat;
@@ -471,7 +471,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)
 {
@@ -504,7 +504,8 @@ svn_client__get_repos_mergeinfo_catalog(
 
 svn_error_t *
 svn_client__get_wc_or_repos_mergeinfo(svn_mergeinfo_t *target_mergeinfo,
-                                      svn_boolean_t *indirect,
+                                      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,
-                                                        indirect, FALSE,
+                                                        inherited, from_repos,
+                                                        FALSE,
                                                         repos_only,
                                                         FALSE, inherit,
                                                         ra_session,
@@ -541,7 +543,8 @@ svn_client__get_wc_or_repos_mergeinfo(sv
 svn_error_t *
 svn_client__get_wc_or_repos_mergeinfo_catalog(
   svn_mergeinfo_catalog_t *target_mergeinfo_catalog,
-  svn_boolean_t *indirect,
+  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
@@ -579,7 +585,7 @@ svn_client__get_wc_or_repos_mergeinfo_ca
     *target_mergeinfo_catalog = NULL;
   else
     SVN_ERR(svn_client__get_wc_mergeinfo_catalog(target_mergeinfo_catalog,
-                                                 indirect,
+                                                 inherited,
                                                  include_descendants,
                                                  inherit,
                                                  local_abspath,
@@ -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))
-                *indirect = 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
@@ -1104,11 +1112,11 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
     }
   else /* ! svn_path_is_url() */
     {
-      svn_boolean_t indirect;
+      svn_boolean_t inherited;
 
       /* Acquire return values. */
       SVN_ERR(svn_client__get_wc_or_repos_mergeinfo_catalog(
-        mergeinfo_catalog, &indirect, 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/branches/gpg-agent-password-store/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/mergeinfo.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/mergeinfo.h Tue Jul 19 23:05:44 2011
@@ -49,7 +49,7 @@ typedef struct svn_client__merge_path_t
                                         probably due to authz
                                         restrictions. */
 
-  svn_boolean_t child_of_noninheritable; /* ABSPATH has no explict mergeinfo
+  svn_boolean_t child_of_noninheritable; /* ABSPATH has no explicit mergeinfo
                                             itself but is the child of a
                                             path with noniheritable
                                             mergeinfo. */
@@ -69,7 +69,7 @@ typedef struct svn_client__merge_path_t
                                            May be NULL. */
   svn_mergeinfo_t implicit_mergeinfo;   /* Implicit mergeinfo on ABSPATH
                                            prior to a merge.  May be NULL. */
-  svn_boolean_t indirect_mergeinfo;     /* Whether PRE_MERGE_MERGEINFO was
+  svn_boolean_t inherited_mergeinfo;    /* Whether PRE_MERGE_MERGEINFO was
                                            explicit or inherited. */
   svn_boolean_t scheduled_for_deletion; /* ABSPATH is scheduled for
                                            deletion. */
@@ -168,18 +168,11 @@ svn_client__get_wc_mergeinfo_catalog(svn
    doesn't support a mergeinfo capability and SQUELCH_INCAPABLE is
    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
-   will only contain merge source path-revisions that actually
-   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. */
+   If the mergeinfo for REL_PATH path is inherited,
+   VALIDATE_INHERITED_MERGEINFO is TRUE, and the server supports
+   the #SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability,
+   then *TARGET_MERGEINFO will only contain merge source path-revisions
+   that actually exist in the repository. */
 svn_error_t *
 svn_client__get_repos_mergeinfo(svn_ra_session_t *ra_session,
                                 svn_mergeinfo_t *target_mergeinfo,
@@ -187,7 +180,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
@@ -209,7 +202,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);
 
@@ -234,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 inherited 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 *INDIRECT to TRUE, set it
-   to FALSE *otherwise. */
+   or if it was obtained from the repository, set *INHERITED to TRUE, set it
+   to FALSE otherwise.
+
+   Note: If the repository is contacted to find inherited mergeinfo, then
+   inherited mergeinfo validation is requested by default (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 *indirect,
+                                      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,
@@ -253,6 +258,10 @@ svn_client__get_wc_or_repos_mergeinfo(sv
    TARGET_MERGEINFO_CATALOG, mapped from TARGET_WCPATH's repository
    root-relative path.
 
+   IGNORE_INVALID_MERGEINFO behaves as per the argument of the same
+   name to svn_client__get_wc_mergeinfo().  It is applicable only if
+   the mergeinfo for TARGET_WCPATH is obtained from the working copy.
+
    If INCLUDE_DESCENDANTS is true, then any subtrees under
    TARGET_WCPATH with explicit mergeinfo are also included in
    TARGET_MERGEINFO_CATALOG and again the keys are the repository
@@ -261,7 +270,8 @@ svn_client__get_wc_or_repos_mergeinfo(sv
 svn_error_t *
 svn_client__get_wc_or_repos_mergeinfo_catalog(
   svn_mergeinfo_catalog_t *target_mergeinfo_catalog,
-  svn_boolean_t *indirect,
+  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,
@@ -306,7 +316,7 @@ svn_client__parse_mergeinfo(svn_mergeinf
 /* Write MERGEINFO into the WC for LOCAL_ABSPATH.  If MERGEINFO is NULL,
    remove any SVN_PROP_MERGEINFO for LOCAL_ABSPATH.  If MERGEINFO is empty,
    record an empty property value (e.g. "").  If CTX->NOTIFY_FUNC2 is
-   not null call it with notification type svn_wc_notify_update_update
+   not null call it with notification type svn_wc_notify_merge_record_info
    if DO_NOTIFICATION is true.
 
    Use WC_CTX to access the working copy, and SCRATCH_POOL for any temporary

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/patch.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/patch.c Tue Jul 19 23:05:44 2011
@@ -2333,20 +2333,15 @@ install_patched_target(patch_target_t *t
             {
               svn_stream_t *stream;
               svn_stream_t *patched_stream;
-              apr_file_t *file;
 
-              SVN_ERR(svn_io_file_open(&file, target->patched_path,
-                                       APR_READ | APR_BINARY, APR_OS_DEFAULT,
-                                       pool));
-
-              patched_stream = svn_stream_from_aprfile2(file, FALSE /* disown */,
-                                                pool);
+              SVN_ERR(svn_stream_open_readonly(&patched_stream,
+                                               target->patched_path,
+                                               pool, pool));
               SVN_ERR(svn_subst_create_specialfile(&stream,
                                                    target->local_abspath,
                                                    pool, pool));
               SVN_ERR(svn_stream_copy3(patched_stream, stream,
-                                       NULL, /* cancel_func */
-                                       NULL, /* cancel_baton */
+                                       ctx->cancel_func, ctx->cancel_baton,
                                        pool));
             }
           else

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/prop_commands.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/prop_commands.c Tue Jul 19 23:05:44 2011
@@ -586,10 +586,10 @@ pristine_or_working_props(apr_hash_t **p
   if (pristine)
     {
       return svn_error_trace(svn_wc_get_pristine_props(props,
-                                                        wc_ctx,
-                                                        local_abspath,
-                                                        result_pool,
-                                                        scratch_pool));
+                                                       wc_ctx,
+                                                       local_abspath,
+                                                       result_pool,
+                                                       scratch_pool));
     }
 
   /* ### until svn_wc_prop_list2() returns a NULL value for locally-deleted
@@ -607,7 +607,7 @@ pristine_or_working_props(apr_hash_t **p
   }
 
   return svn_error_trace(svn_wc_prop_list2(props, wc_ctx, local_abspath,
-                                            result_pool, scratch_pool));
+                                           result_pool, scratch_pool));
 }
 
 
@@ -1093,7 +1093,7 @@ recursive_proplist_receiver(void *baton,
     path = local_abspath;
 
   return svn_error_trace(b->wrapped_receiver(b->wrapped_receiver_baton,
-                                              path, props, scratch_pool));
+                                             path, props, scratch_pool));
 }
 
 svn_error_t *