subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v...@apache.org
Subject svn commit: r1426654 [2/7] - in /subversion/branches/javahl-ra: ./ build/ build/ac-macros/ subversion/bindings/cxxhl/include/svncxxhl/ subversion/bindings/cxxhl/src/ subversion/bindings/cxxhl/tests/ subversion/include/ subversion/include/private/ subve...
Date Fri, 28 Dec 2012 23:03:53 GMT
Modified: subversion/branches/javahl-ra/subversion/libsvn_client/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/cmdline.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/cmdline.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/cmdline.c Fri Dec 28 23:03:51 2012
@@ -43,51 +43,6 @@
 
 #define DEFAULT_ARRAY_SIZE 5
 
-/* Return true iff ARG is a repository-relative URL: specifically that
- * it starts with the characters "^/".
- * ARG is in UTF-8 encoding.
- * Do not check whether ARG is properly URI-encoded, canonical, or valid
- * in any other way. */
-static svn_boolean_t
-arg_is_repos_relative_url(const char *arg)
-{
-  return (0 == strncmp("^/", arg, 2));
-}
-
-/* Set *ABSOLUTE_URL to the absolute URL represented by RELATIVE_URL
- * relative to REPOS_ROOT_URL.
- * *ABSOLUTE_URL will end with a peg revision specifier if RELATIVE_URL did.
- * RELATIVE_URL is in repository-relative syntax:
- * "^/[REL-URL][@PEG]",
- * REPOS_ROOT_URL is the absolute URL of the repository root.
- * All strings are in UTF-8 encoding.
- * Allocate *ABSOLUTE_URL in POOL.
- *
- * REPOS_ROOT_URL and RELATIVE_URL do not have to be properly URI-encoded,
- * canonical, or valid in any other way.  The caller is expected to perform
- * canonicalization on *ABSOLUTE_URL after the call to the function.
- */
-static svn_error_t *
-resolve_repos_relative_url(const char **absolute_url,
-                           const char *relative_url,
-                           const char *repos_root_url,
-                           apr_pool_t *pool)
-{
-  if (! arg_is_repos_relative_url(relative_url))
-    return svn_error_createf(SVN_ERR_BAD_URL, NULL,
-                             _("Improper relative URL '%s'"),
-                             relative_url);
-
-  /* No assumptions are made about the canonicalization of the input
-   * arguments, it is presumed that the output will be canonicalized after
-   * this function, which will remove any duplicate path separator.
-   */
-  *absolute_url = apr_pstrcat(pool, repos_root_url, relative_url + 1,
-                              (char *)NULL);
-
-  return SVN_NO_ERROR;
-}
-
 
 /* Attempt to find the repository root url for TARGET, possibly using CTX for
  * authentication.  If one is found and *ROOT_URL is not NULL, then just check
@@ -189,7 +144,7 @@ svn_client_args_to_target_array2(apr_arr
       SVN_ERR(svn_utf_cstring_to_utf8(&utf8_target,
                                       raw_target, pool));
 
-      if (arg_is_repos_relative_url(utf8_target))
+      if (svn_path_is_repos_relative_url(utf8_target))
         rel_url_found = TRUE;
 
       APR_ARRAY_PUSH(input_targets, const char *) = utf8_target;
@@ -204,7 +159,7 @@ svn_client_args_to_target_array2(apr_arr
           const char *utf8_target = APR_ARRAY_IDX(known_targets,
                                                   i, const char *);
 
-          if (arg_is_repos_relative_url(utf8_target))
+          if (svn_path_is_repos_relative_url(utf8_target))
             rel_url_found = TRUE;
 
           APR_ARRAY_PUSH(input_targets, const char *) = utf8_target;
@@ -220,7 +175,7 @@ svn_client_args_to_target_array2(apr_arr
       /* Relative urls will be canonicalized when they are resolved later in
        * the function
        */
-      if (arg_is_repos_relative_url(utf8_target))
+      if (svn_path_is_repos_relative_url(utf8_target))
         {
           APR_ARRAY_PUSH(output_targets, const char *) = utf8_target;
         }
@@ -367,7 +322,7 @@ svn_client_args_to_target_array2(apr_arr
           const char *target = APR_ARRAY_IDX(output_targets, i,
                                              const char *);
 
-          if (arg_is_repos_relative_url(target))
+          if (svn_path_is_repos_relative_url(target))
             {
               const char *abs_target;
               const char *true_target;
@@ -376,8 +331,9 @@ svn_client_args_to_target_array2(apr_arr
               SVN_ERR(svn_opt__split_arg_at_peg_revision(&true_target, &peg_rev,
                                                          target, pool));
 
-              SVN_ERR(resolve_repos_relative_url(&abs_target, true_target,
-                                                 root_url, pool));
+              SVN_ERR(svn_path_resolve_repos_relative_url(&abs_target,
+                                                          true_target,
+                                                          root_url, pool));
 
               SVN_ERR(svn_opt__arg_canonicalize_url(&true_target, abs_target,
                                                     pool));

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/commit.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/commit.c Fri Dec 28 23:03:51 2012
@@ -1028,25 +1028,3 @@ svn_client_commit6(const apr_array_heade
   return svn_error_trace(reconcile_errors(cmt_err, unlock_err, bump_err,
                                           pool));
 }
-
-svn_error_t *
-svn_client_commit5(const apr_array_header_t *targets,
-                   svn_depth_t depth,
-                   svn_boolean_t keep_locks,
-                   svn_boolean_t keep_changelists,
-                   svn_boolean_t commit_as_operations,
-                   const apr_array_header_t *changelists,
-                   const apr_hash_t *revprop_table,
-                   svn_commit_callback2_t commit_callback,
-                   void *commit_baton,
-                   svn_client_ctx_t *ctx,
-                   apr_pool_t *pool)
-{
-  return svn_client_commit6(targets, depth, keep_locks, keep_changelists,
-                            commit_as_operations,
-                            TRUE,  /* include_file_externals */
-                            FALSE, /* include_dir_externals */
-                            changelists, revprop_table, commit_callback,
-                            commit_baton, ctx, pool);
-}
-

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/deprecated.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/deprecated.c Fri Dec 28 23:03:51 2012
@@ -512,6 +512,26 @@ downgrade_commit_copied_notify_func(void
     b->orig_notify_func2(b->orig_notify_baton2, notify, pool);
 }
 
+svn_error_t *
+svn_client_commit5(const apr_array_header_t *targets,
+                   svn_depth_t depth,
+                   svn_boolean_t keep_locks,
+                   svn_boolean_t keep_changelists,
+                   svn_boolean_t commit_as_operations,
+                   const apr_array_header_t *changelists,
+                   const apr_hash_t *revprop_table,
+                   svn_commit_callback2_t commit_callback,
+                   void *commit_baton,
+                   svn_client_ctx_t *ctx,
+                   apr_pool_t *pool)
+{
+  return svn_client_commit6(targets, depth, keep_locks, keep_changelists,
+                            commit_as_operations,
+                            FALSE,  /* include_file_externals */
+                            FALSE, /* include_dir_externals */
+                            changelists, revprop_table, commit_callback,
+                            commit_baton, ctx, pool);
+}
 
 svn_error_t *
 svn_client_commit4(svn_commit_info_t **commit_info_p,

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/diff.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/diff.c Fri Dec 28 23:03:51 2012
@@ -613,6 +613,8 @@ static svn_error_t *
 diff_props_changed(svn_wc_notify_state_t *state,
                    svn_boolean_t *tree_conflicted,
                    const char *path,
+                   svn_revnum_t rev1,
+                   svn_revnum_t rev2,
                    svn_boolean_t dir_was_added,
                    const apr_array_header_t *propchanges,
                    apr_hash_t *original_props,
@@ -642,8 +644,8 @@ diff_props_changed(svn_wc_notify_state_t
       SVN_ERR(display_prop_diffs(props, original_props, path,
                                  diff_cmd_baton->orig_path_1,
                                  diff_cmd_baton->orig_path_2,
-                                 diff_cmd_baton->revnum1,
-                                 diff_cmd_baton->revnum2,
+                                 rev1,
+                                 rev2,
                                  diff_cmd_baton->header_encoding,
                                  diff_cmd_baton->outstream,
                                  diff_cmd_baton->relative_to_dir,
@@ -686,6 +688,10 @@ diff_dir_props_changed(svn_wc_notify_sta
 
   return svn_error_trace(diff_props_changed(state,
                                             tree_conflicted, path,
+                                            /* ### These revs be filled
+                                             * ### with per node info */
+                                            diff_cmd_baton->revnum1,
+                                            diff_cmd_baton->revnum2,
                                             dir_was_added,
                                             propchanges,
                                             original_props,
@@ -952,7 +958,7 @@ diff_file_changed(svn_wc_notify_state_t 
                                  SVN_INVALID_REVNUM, diff_cmd_baton));
   if (prop_changes->nelts > 0)
     SVN_ERR(diff_props_changed(prop_state, tree_conflicted,
-                               path, FALSE, prop_changes,
+                               path, rev1, rev2, FALSE, prop_changes,
                                original_props, diff_cmd_baton, scratch_pool));
   if (content_state)
     *content_state = svn_wc_notify_state_unknown;
@@ -1025,7 +1031,8 @@ diff_file_added(svn_wc_notify_state_t *c
                                  diff_cmd_baton));
   if (prop_changes->nelts > 0)
     SVN_ERR(diff_props_changed(prop_state, tree_conflicted,
-                               path, FALSE, prop_changes,
+                               path, rev1, rev2,
+                               FALSE, prop_changes,
                                original_props, diff_cmd_baton, scratch_pool));
   if (content_state)
     *content_state = svn_wc_notify_state_unknown;
@@ -1877,6 +1884,8 @@ arbitrary_diff_walker(void *baton, const
                              scratch_pool));
       if (prop_changes->nelts > 0)
         SVN_ERR(diff_props_changed(NULL, NULL, child_relpath,
+                                   b->callback_baton->revnum1,
+                                   b->callback_baton->revnum2,
                                    b->recursing_within_added_subtree,
                                    prop_changes, original_props,
                                    b->callback_baton, scratch_pool));

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/externals.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/externals.c Fri Dec 28 23:03:51 2012
@@ -484,7 +484,8 @@ switch_file_external(const char *local_a
                                               ctx, subpool));
     /* Get the external file's iprops. */
     SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props, "",
-                                       switch_loc->rev, subpool, subpool));
+                                       switch_loc->rev, TRUE,
+                                       subpool, subpool));
 
     SVN_ERR(svn_ra_reparent(ra_session, svn_uri_dirname(url, subpool),
                             subpool));

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/iprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/iprops.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/iprops.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/iprops.c Fri Dec 28 23:03:51 2012
@@ -41,10 +41,12 @@
 /*** Code. ***/
 
 /* Determine if LOCAL_ABSPATH needs an inherited property cache.  If it does,
-   then set *NEEDS_CACHE to TRUE, set it to FALSE otherwise. */
+   then set *NEEDS_CACHE to TRUE, set it to FALSE otherwise.  All other args
+   are as per svn_client__get_inheritable_props(). */
 static svn_error_t *
 need_to_cache_iprops(svn_boolean_t *needs_cache,
                      const char *local_abspath,
+                     svn_ra_session_t *ra_session,
                      svn_client_ctx_t *ctx,
                      apr_pool_t *scratch_pool)
 {
@@ -71,7 +73,25 @@ need_to_cache_iprops(svn_boolean_t *need
         }
     }
 
-  *needs_cache = (is_wc_root || is_switched);
+  /* Starting assumption. */
+  *needs_cache = FALSE;
+
+  if (is_wc_root || is_switched)
+    {
+      const char *session_url;
+      const char *session_root_url;
+
+      /* Looks likely that we need an inherited properties cache...Unless
+         LOCAL_ABSPATH is a WC root that points to the repos root.  Then it
+         doesn't need a cache because it has nowhere to inherit from.  Check
+         for that case. */
+      SVN_ERR(svn_ra_get_session_url(ra_session, &session_url, scratch_pool));
+      SVN_ERR(svn_ra_get_repos_root2(ra_session, &session_root_url,
+                                     scratch_pool));
+
+      if (strcmp(session_root_url, session_url) != 0)
+        *needs_cache = TRUE;
+    }
 
   return SVN_NO_ERROR;
 }
@@ -81,6 +101,7 @@ svn_client__get_inheritable_props(apr_ha
                                   const char *local_abspath,
                                   svn_revnum_t revision,
                                   svn_depth_t depth,
+                                  svn_boolean_t use_relpath_keys,
                                   svn_ra_session_t *ra_session,
                                   svn_client_ctx_t *ctx,
                                   apr_pool_t *result_pool,
@@ -111,7 +132,7 @@ svn_client__get_inheritable_props(apr_ha
           svn_boolean_t needs_cached_iprops;
 
           SVN_ERR(need_to_cache_iprops(&needs_cached_iprops, local_abspath,
-                                       ctx, iterpool));
+                                       ra_session, ctx, iterpool));
           if (needs_cached_iprops)
             {
               const char *target_abspath = apr_pstrdup(scratch_pool,
@@ -163,8 +184,8 @@ svn_client__get_inheritable_props(apr_ha
             }
 
           SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props,
-                                             "", revision, result_pool,
-                                             iterpool));
+                                             "", revision, use_relpath_keys,
+                                             result_pool, iterpool));
           apr_hash_set(*wcroot_iprops,
                        apr_pstrdup(result_pool, child_abspath),
                        APR_HASH_KEY_STRING,

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/merge.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/merge.c Fri Dec 28 23:03:51 2012
@@ -313,6 +313,23 @@ typedef struct merge_cmd_baton_t {
      meet the criteria or DRY_RUN is true. */
   apr_hash_t *paths_with_deleted_mergeinfo;
 
+  /* The list of absolute skipped paths, which should be examined and
+     cleared after each invocation of the callback.  The paths
+     are absolute.  Is NULL if MERGE_B->SOURCES_ANCESTRAL and
+     MERGE_B->REINTEGRATE_MERGE are both false. */
+  apr_hash_t *skipped_abspaths;
+
+  /* The list of absolute merged paths.  Unused if MERGE_B->SOURCES_ANCESTRAL
+     and MERGE_B->REINTEGRATE_MERGE are both false. */
+  apr_hash_t *merged_abspaths;
+
+  /* A hash of (const char *) absolute WC paths mapped to the same which
+     represent the roots of subtrees added by the merge. */
+  apr_hash_t *added_abspaths;
+
+  /* A list of tree conflict victim absolute paths which may be NULL. */
+  apr_hash_t *tree_conflicted_abspaths;
+
   /* The diff3_cmd in ctx->config, if any, else null.  We could just
      extract this as needed, but since more than one caller uses it,
      we just set it up when this baton is created. */
@@ -504,7 +521,7 @@ dry_run_added_parent_p(const merge_cmd_b
                        apr_pool_t *scratch_pool)
 {
   const char *abspath = local_abspath;
-  int i;
+  apr_size_t i;
 
   if (!merge_b->dry_run)
     return FALSE;
@@ -1920,6 +1937,21 @@ merge_file_added(svn_wc_notify_state_t *
     {
     case svn_node_none:
       {
+        svn_node_kind_t parent_kind;
+
+        /* Does the parent exist on disk (vs missing). If no we should
+           report an obstruction. Or svn_wc_add_repos_file4() will just
+           do its work and the workqueue will create the missing dirs */
+        SVN_ERR(svn_io_check_path(
+                        svn_dirent_dirname(mine_abspath, scratch_pool), 
+                        &parent_kind, scratch_pool));
+
+        if (parent_kind != svn_node_dir)
+          {
+            *content_state = svn_wc_notify_state_obstructed;
+            return SVN_NO_ERROR;
+          }
+
         if (! merge_b->dry_run)
           {
             const char *copyfrom_url;
@@ -2013,8 +2045,6 @@ merge_file_added(svn_wc_notify_state_t *
                                                merge_b->ctx->cancel_func,
                                                merge_b->ctx->cancel_baton,
                                                scratch_pool));
-
-                /* ### delete 'yours' ? */
               }
           }
         if (content_state)
@@ -2723,9 +2753,45 @@ merge_dir_opened(svn_boolean_t *tree_con
 
   if (obstr_state != svn_wc_notify_state_inapplicable)
     {
-      if (skip_children)
-        *skip_children = TRUE;
-      /* But don't skip THIS, to allow a skip notification */
+      /* In Subversion <= 1.7 we always skipped descendants here */
+      if (obstr_state == svn_wc_notify_state_obstructed)
+        {
+          svn_boolean_t is_wcroot;
+
+          SVN_ERR(svn_wc_check_root(&is_wcroot, NULL, NULL,
+                                  merge_b->ctx->wc_ctx,
+                                  local_abspath, scratch_pool));
+
+          if (is_wcroot)
+            {
+              const char *skipped_path;
+
+              skipped_path = apr_pstrdup(apr_hash_pool_get(
+                                                  merge_b->skipped_abspaths),
+                                         local_abspath);
+
+              apr_hash_set(merge_b->skipped_abspaths, skipped_path,
+                           APR_HASH_KEY_STRING, skipped_path);
+
+              *skip = TRUE;
+              *skip_children = TRUE;
+
+              if (merge_b->ctx->notify_func2)
+                {
+                  svn_wc_notify_t *notify;
+
+                  notify = svn_wc_create_notify(
+                                        skipped_path,
+                                        svn_wc_notify_update_skip_obstruction,
+                                        scratch_pool);
+                  notify->kind = svn_node_dir;
+                  notify->content_state = obstr_state;
+                  merge_b->ctx->notify_func2(merge_b->ctx->notify_baton2,
+                                             notify, scratch_pool);
+                }
+            }
+        }
+
       return SVN_NO_ERROR;
     }
 
@@ -2747,8 +2813,7 @@ merge_dir_opened(svn_boolean_t *tree_con
           if (parent_depth != svn_depth_unknown &&
               parent_depth < svn_depth_immediates)
             {
-              if (skip_children)
-                *skip_children = TRUE;
+              /* In Subversion <= 1.7 we skipped descendants here */
               return SVN_NO_ERROR;
             }
         }
@@ -2845,25 +2910,6 @@ typedef struct notification_receiver_bat
   /* The number of operative notifications received. */
   apr_uint32_t nbr_operative_notifications;
 
-  /* The list of absolute merged paths.  Is NULL if MERGE_B->SOURCES_ANCESTRAL
-     and MERGE_B->REINTEGRATE_MERGE are both false. */
-  apr_hash_t *merged_abspaths;
-
-  /* The list of absolute skipped paths, which should be examined and
-     cleared after each invocation of the callback.  The paths
-     are absolute.  Is NULL if MERGE_B->SOURCES_ANCESTRAL and
-     MERGE_B->REINTEGRATE_MERGE are both false. */
-  apr_hash_t *skipped_abspaths;
-
-  /* A hash of (const char *) absolute WC paths mapped to the same which
-     represent the roots of subtrees added by the merge.  May be NULL. */
-  apr_hash_t *added_abspaths;
-
-  /* A list of tree conflict victim absolute paths which may be NULL.  Is NULL
-     if MERGE_B->SOURCES_ANCESTRAL and MERGE_B->REINTEGRATE_MERGE are both
-     false. */
-  apr_hash_t *tree_conflicted_abspaths;
-
   /* Flag indicating whether it is a single file merge or not. */
   svn_boolean_t is_single_file_merge;
 
@@ -3084,6 +3130,7 @@ notification_receiver(void *baton, const
                       apr_pool_t *pool)
 {
   notification_receiver_baton_t *notify_b = baton;
+  merge_cmd_baton_t *merge_b = notify_b->merge_b;
   svn_boolean_t is_operative_notification = IS_OPERATIVE_NOTIFICATION(notify);
   const char *notify_abspath;
 
@@ -3105,7 +3152,7 @@ notification_receiver(void *baton, const
    * not yet implemented.
    * ### We should stash the info about which moves have been followed and
    * retrieve that info here, instead of querying the WC again here. */
-  notify_abspath = svn_dirent_join(notify_b->merge_b->target->abspath,
+  notify_abspath = svn_dirent_join(merge_b->target->abspath,
                                    notify->path, pool);
   if (notify->action == svn_wc_notify_update_update
       && notify->kind == svn_node_file)
@@ -3114,7 +3161,7 @@ notification_receiver(void *baton, const
       const char *moved_to_abspath;
 
       err = svn_wc__node_was_moved_away(&moved_to_abspath, NULL,
-                                        notify_b->merge_b->ctx->wc_ctx,
+                                        merge_b->ctx->wc_ctx,
                                         notify_abspath, pool, pool);
       if (err)
         {
@@ -3135,8 +3182,8 @@ notification_receiver(void *baton, const
     }
 
   /* Update the lists of merged, skipped, tree-conflicted and added paths. */
-  if (notify_b->merge_b->merge_source.ancestral
-      || notify_b->merge_b->reintegrate_merge)
+  if (merge_b->merge_source.ancestral
+      || merge_b->reintegrate_merge)
     {
       if (notify->content_state == svn_wc_notify_state_merged
           || notify->content_state == svn_wc_notify_state_changed
@@ -3147,10 +3194,7 @@ notification_receiver(void *baton, const
           const char *merged_path = apr_pstrdup(notify_b->pool,
                                                 notify_abspath);
 
-          if (notify_b->merged_abspaths == NULL)
-            notify_b->merged_abspaths = apr_hash_make(notify_b->pool);
-
-          apr_hash_set(notify_b->merged_abspaths, merged_path,
+          apr_hash_set(merge_b->merged_abspaths, merged_path,
                        APR_HASH_KEY_STRING, merged_path);
         }
 
@@ -3159,10 +3203,7 @@ notification_receiver(void *baton, const
           const char *skipped_path = apr_pstrdup(notify_b->pool,
                                                  notify_abspath);
 
-          if (notify_b->skipped_abspaths == NULL)
-            notify_b->skipped_abspaths = apr_hash_make(notify_b->pool);
-
-          apr_hash_set(notify_b->skipped_abspaths, skipped_path,
+          apr_hash_set(merge_b->skipped_abspaths, skipped_path,
                        APR_HASH_KEY_STRING, skipped_path);
         }
 
@@ -3171,30 +3212,26 @@ notification_receiver(void *baton, const
           const char *tree_conflicted_path = apr_pstrdup(notify_b->pool,
                                                          notify_abspath);
 
-          if (notify_b->tree_conflicted_abspaths == NULL)
-            notify_b->tree_conflicted_abspaths =
-              apr_hash_make(notify_b->pool);
-
-          apr_hash_set(notify_b->tree_conflicted_abspaths,
+          apr_hash_set(merge_b->tree_conflicted_abspaths,
                        tree_conflicted_path, APR_HASH_KEY_STRING,
                        tree_conflicted_path);
         }
 
       if (notify->action == svn_wc_notify_update_add)
         {
-          update_the_list_of_added_subtrees(notify_b->merge_b->target->abspath,
+          update_the_list_of_added_subtrees(merge_b->target->abspath,
                                             notify_abspath,
-                                            &(notify_b->added_abspaths),
+                                            &(merge_b->added_abspaths),
                                             notify_b->pool, pool);
         }
 
       if (notify->action == svn_wc_notify_update_delete
-          && notify_b->added_abspaths)
+          && merge_b->added_abspaths)
         {
           /* Issue #4166: If a previous merge added NOTIFY_ABSPATH, but we
              are now deleting it, then remove it from the list of added
              paths. */
-          apr_hash_set(notify_b->added_abspaths, notify_abspath,
+          apr_hash_set(merge_b->added_abspaths, notify_abspath,
                        APR_HASH_KEY_STRING, NULL);
         }
     }
@@ -3202,7 +3239,7 @@ notification_receiver(void *baton, const
   /* Notify that a merge is beginning, if we haven't already done so.
    * (A single-file merge is notified separately: see single_file_merge_notify().) */
   /* If our merge sources are ancestors of one another... */
-  if (notify_b->merge_b->merge_source.ancestral)
+  if (merge_b->merge_source.ancestral)
     {
       /* See if this is an operative directory merge. */
       if (!(notify_b->is_single_file_merge) && is_operative_notification)
@@ -3237,8 +3274,8 @@ notification_receiver(void *baton, const
                   notify_merge_begin(child->abspath,
                                      APR_ARRAY_IDX(child->remaining_ranges, 0,
                                                    svn_merge_range_t *),
-                                     notify_b->merge_b->same_repos,
-                                     notify_b->merge_b->ctx, pool);
+                                     merge_b->same_repos,
+                                     merge_b->ctx, pool);
                 }
             }
         }
@@ -3248,9 +3285,9 @@ notification_receiver(void *baton, const
            && notify_b->nbr_operative_notifications == 1
            && is_operative_notification)
     {
-      notify_merge_begin(notify_b->merge_b->target->abspath, NULL,
-                         notify_b->merge_b->same_repos,
-                         notify_b->merge_b->ctx, pool);
+      notify_merge_begin(merge_b->target->abspath, NULL,
+                         merge_b->same_repos,
+                         merge_b->ctx, pool);
     }
 
   if (notify_b->wrapped_func)
@@ -4429,13 +4466,24 @@ find_gaps_in_merge_source_history(svn_re
 
   if (rangelist->nelts > 1) /* Copy */
     {
+      const svn_merge_range_t *gap;
       /* As mentioned above, multiple gaps *shouldn't* be possible. */
       SVN_ERR_ASSERT(apr_hash_count(implicit_src_mergeinfo) == 1);
 
+      gap = APR_ARRAY_IDX(rangelist, rangelist->nelts - 1,
+                          const svn_merge_range_t *);
+
       *gap_start = MIN(source->loc1->rev, source->loc2->rev);
-      *gap_end = (APR_ARRAY_IDX(rangelist,
-                                rangelist->nelts - 1,
-                                svn_merge_range_t *))->start;
+      *gap_end = gap->start;
+
+      /* ### Issue #4132:
+         ### This assertion triggers in merge_tests.py svnmucc_abuse_1()
+         ### when a node is replaced by an older copy of itself.
+
+         BH: I think we should review this and the 'rename' case to find
+             out which behavior we really want, and if we can really
+             determine what happened this way. */
+      SVN_ERR_ASSERT(*gap_start < *gap_end);
     }
   else if (apr_hash_count(implicit_src_mergeinfo) > 1) /* Rename */
     {
@@ -4896,7 +4944,7 @@ update_wc_mergeinfo(svn_mergeinfo_catalo
 
    Record override mergeinfo on any paths skipped during a merge.
 
-   Set empty mergeinfo on each path in SKIPPED_ABSPATHS so the path
+   Set empty mergeinfo on each path in MERGE_B->SKIPPED_ABSPATHS so the path
    does not incorrectly inherit mergeinfo that will later be describing
    the merge.
 
@@ -4910,14 +4958,12 @@ static svn_error_t *
 record_skips(const char *mergeinfo_path,
              const svn_rangelist_t *rangelist,
              svn_boolean_t is_rollback,
-             apr_hash_t *skipped_abspaths,
              merge_cmd_baton_t *merge_b,
              apr_pool_t *scratch_pool)
 {
   apr_hash_index_t *hi;
   apr_hash_t *merges;
-  apr_size_t nbr_skips = (skipped_abspaths != NULL ?
-                          apr_hash_count(skipped_abspaths) : 0);
+  apr_size_t nbr_skips = apr_hash_count(merge_b->skipped_abspaths);
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
   if (nbr_skips == 0)
@@ -4926,7 +4972,7 @@ record_skips(const char *mergeinfo_path,
   merges = apr_hash_make(scratch_pool);
 
   /* Override the mergeinfo for child paths which weren't actually merged. */
-  for (hi = apr_hash_first(scratch_pool, skipped_abspaths); hi;
+  for (hi = apr_hash_first(scratch_pool, merge_b->skipped_abspaths); hi;
        hi = apr_hash_next(hi))
     {
       const char *skipped_abspath = svn__apr_hash_index_key(hi);
@@ -7209,8 +7255,7 @@ do_file_merge(svn_mergeinfo_catalog_t re
          self-referential mergeinfo, but don't record mergeinfo if
          TARGET_WCPATH was skipped. */
       if (filtered_rangelist->nelts
-          && (!notify_b->skipped_abspaths
-              || (apr_hash_count(notify_b->skipped_abspaths) == 0)))
+          && (apr_hash_count(notify_b->merge_b->skipped_abspaths) == 0))
         {
           apr_hash_t *merges = apr_hash_make(iterpool);
 
@@ -7410,11 +7455,11 @@ subtree_touched_by_merge(const char *loc
                          notification_receiver_baton_t *notify_b,
                          apr_pool_t *pool)
 {
-  return (path_is_subtree(local_abspath, notify_b->merged_abspaths, pool)
-          || path_is_subtree(local_abspath, notify_b->skipped_abspaths, pool)
-          || path_is_subtree(local_abspath, notify_b->added_abspaths, pool)
-          || path_is_subtree(local_abspath,
-                             notify_b->tree_conflicted_abspaths,
+  merge_cmd_baton_t *merge_b = notify_b->merge_b;
+  return (path_is_subtree(local_abspath, merge_b->merged_abspaths, pool)
+          || path_is_subtree(local_abspath, merge_b->skipped_abspaths, pool)
+          || path_is_subtree(local_abspath, merge_b->added_abspaths, pool)
+          || path_is_subtree(local_abspath, merge_b->tree_conflicted_abspaths,
                              pool));
 }
 
@@ -7698,9 +7743,8 @@ flag_subtrees_needing_mergeinfo(svn_bool
         continue;
 
       /* Don't record mergeinfo on skipped paths. */
-      if (notify_b->skipped_abspaths
-          && apr_hash_get(notify_b->skipped_abspaths, child->abspath,
-                          APR_HASH_KEY_STRING))
+      if (apr_hash_get(notify_b->merge_b->skipped_abspaths, child->abspath,
+                       APR_HASH_KEY_STRING))
         continue;
 
       /* ### ptb: Yes, we could combine the following into a single
@@ -7751,7 +7795,7 @@ flag_subtrees_needing_mergeinfo(svn_bool
               if (!merge_b->reintegrate_merge
                   && child->missing_child
                   && !path_is_subtree(child->abspath,
-                                      notify_b->skipped_abspaths,
+                                      notify_b->merge_b->skipped_abspaths,
                                       iterpool))
                 {
                   child->missing_child = FALSE;
@@ -7980,8 +8024,7 @@ record_mergeinfo_for_dir_merge(svn_merge
              don't incorrectly inherit the mergeinfo we are about to set. */
           if (i == 0)
             SVN_ERR(record_skips(mergeinfo_fspath, child_merge_rangelist,
-                                 is_rollback, notify_b->skipped_abspaths,
-                                 merge_b, iterpool));
+                                 is_rollback, merge_b, iterpool));
 
           /* We may need to record non-inheritable mergeinfo that applies
              only to CHILD->ABSPATH. */
@@ -9006,7 +9049,7 @@ do_mergeinfo_aware_dir_merge(svn_mergein
           err = record_mergeinfo_for_added_subtrees(
                   &range, mergeinfo_path, depth,
                   squelch_mergeinfo_notifications,
-                  notify_b->added_abspaths, merge_b, scratch_pool);
+                  merge_b->added_abspaths, merge_b, scratch_pool);
         }
     }
 
@@ -9248,13 +9291,14 @@ do_merge(apr_hash_t **modified_subtrees,
   /* Do we already know the specific subtrees with mergeinfo we want
      to record-only mergeinfo on? */
   if (record_only && record_only_paths)
-    notify_baton.merged_abspaths = record_only_paths;
+    merge_cmd_baton.merged_abspaths = record_only_paths;
   else
-    notify_baton.merged_abspaths = NULL;
+    merge_cmd_baton.merged_abspaths = apr_hash_make(result_pool);
+
+  merge_cmd_baton.skipped_abspaths = apr_hash_make(result_pool);
+  merge_cmd_baton.added_abspaths = apr_hash_make(result_pool);
+  merge_cmd_baton.tree_conflicted_abspaths = apr_hash_make(result_pool);
 
-  notify_baton.skipped_abspaths = NULL;
-  notify_baton.added_abspaths = NULL;
-  notify_baton.tree_conflicted_abspaths = NULL;
   notify_baton.children_with_mergeinfo = NULL;
   notify_baton.cur_ancestor_abspath = NULL;
   notify_baton.merge_b = &merge_cmd_baton;
@@ -9342,22 +9386,18 @@ do_merge(apr_hash_t **modified_subtrees,
           /* ### Why only if the target is a dir and not a file? */
           if (modified_subtrees)
             {
-              if (notify_baton.merged_abspaths)
-                *modified_subtrees =
+              *modified_subtrees =
                   apr_hash_overlay(result_pool, *modified_subtrees,
-                                   notify_baton.merged_abspaths);
-              if (notify_baton.added_abspaths)
-                *modified_subtrees =
+                                   merge_cmd_baton.merged_abspaths);
+              *modified_subtrees =
                   apr_hash_overlay(result_pool, *modified_subtrees,
-                                   notify_baton.added_abspaths);
-              if (notify_baton.skipped_abspaths)
-                *modified_subtrees =
+                                   merge_cmd_baton.added_abspaths);
+              *modified_subtrees =
                   apr_hash_overlay(result_pool, *modified_subtrees,
-                                   notify_baton.skipped_abspaths);
-              if (notify_baton.tree_conflicted_abspaths)
-                *modified_subtrees =
+                                   merge_cmd_baton.skipped_abspaths);
+              *modified_subtrees =
                   apr_hash_overlay(result_pool, *modified_subtrees,
-                                   notify_baton.tree_conflicted_abspaths);
+                                   merge_cmd_baton.tree_conflicted_abspaths);
             }
         }
 

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/patch.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/patch.c Fri Dec 28 23:03:51 2012
@@ -2288,9 +2288,10 @@ create_missing_parents(patch_target_t *t
               if (ctx->cancel_func)
                 SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
 
-              SVN_ERR(svn_wc_add_from_disk(ctx->wc_ctx, local_abspath,
-                                           ctx->notify_func2, ctx->notify_baton2,
-                                           iterpool));
+              SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, local_abspath,
+                                            NULL /*props*/,
+                                            ctx->notify_func2, ctx->notify_baton2,
+                                            iterpool));
             }
         }
     }
@@ -2402,8 +2403,9 @@ install_patched_target(patch_target_t *t
                * Suppress notification, we'll do that later (and also
                * during dry-run). Don't allow cancellation because
                * we'd rather notify about what we did before aborting. */
-              SVN_ERR(svn_wc_add_from_disk(ctx->wc_ctx, target->local_abspath,
-                                           NULL, NULL, pool));
+              SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, target->local_abspath,
+                                            NULL /*props*/,
+                                            NULL, NULL, pool));
             }
 
           /* Restore the target's executable bit if necessary. */
@@ -2494,10 +2496,11 @@ install_patched_prop_targets(patch_targe
             {
               SVN_ERR(svn_io_file_create(target->local_abspath, "",
                                          scratch_pool));
-              SVN_ERR(svn_wc_add_from_disk(ctx->wc_ctx, target->local_abspath,
-                                           /* suppress notification */
-                                           NULL, NULL,
-                                           iterpool));
+              SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, target->local_abspath,
+                                            NULL /*props*/,
+                                            /* suppress notification */
+                                            NULL, NULL,
+                                            iterpool));
             }
           target->added = TRUE;
         }

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/prop_commands.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/prop_commands.c Fri Dec 28 23:03:51 2012
@@ -639,7 +639,7 @@ remote_propget(apr_hash_t *props,
       /* We will filter out all but PROPNAME later, making a final copy
          in RESULT_POOL, so pass SCRATCH_POOL for both pools. */
       SVN_ERR(svn_ra_get_inherited_props(ra_session, inherited_props,
-                                         target_relative, revnum,
+                                         target_relative, revnum, FALSE,
                                          scratch_pool, scratch_pool));
     }
 
@@ -1125,7 +1125,7 @@ remote_proplist(const char *target_prefi
 
   if (get_target_inherited_props)
     SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props,
-                                       target_relative, revnum,
+                                       target_relative, revnum, FALSE,
                                        result_pool, scratch_pool));
   else
     inherited_props = NULL;

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/repos_diff.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/repos_diff.c Fri Dec 28 23:03:51 2012
@@ -143,6 +143,9 @@ struct dir_baton {
   /* A cache of any property changes (svn_prop_t) received for this dir. */
   apr_array_header_t *propchanges;
 
+  /* Boolean indicating whether a node property was changed */
+  svn_boolean_t has_propchange;
+
   /* The pool passed in by add_dir, open_dir, or open_root.
      Also, the pool this dir baton is allocated in. */
   apr_pool_t *pool;
@@ -199,6 +202,9 @@ struct file_baton {
   /* A cache of any property changes (svn_prop_t) received for this file. */
   apr_array_header_t *propchanges;
 
+  /* Boolean indicating whether a node property was changed */
+  svn_boolean_t has_propchange;
+
   /* The pool passed in by add_file or open_file.
      Also, the pool this file_baton is allocated in. */
   apr_pool_t *pool;
@@ -230,7 +236,7 @@ make_dir_baton(const char *path,
   dir_baton->skip_children = FALSE;
   dir_baton->pool = dir_pool;
   dir_baton->path = apr_pstrdup(dir_pool, path);
-  dir_baton->propchanges  = apr_array_make(pool, 1, sizeof(svn_prop_t));
+  dir_baton->propchanges  = apr_array_make(pool, 8, sizeof(svn_prop_t));
   dir_baton->base_revision = base_revision;
 
   return dir_baton;
@@ -256,7 +262,7 @@ make_file_baton(const char *path,
   file_baton->skip = FALSE;
   file_baton->pool = file_pool;
   file_baton->path = apr_pstrdup(file_pool, path);
-  file_baton->propchanges  = apr_array_make(pool, 1, sizeof(svn_prop_t));
+  file_baton->propchanges  = apr_array_make(pool, 8, sizeof(svn_prop_t));
   file_baton->base_revision = edit_baton->revision;
 
   return file_baton;
@@ -271,29 +277,29 @@ make_file_baton(const char *path,
 static void
 get_file_mime_types(const char **mimetype1,
                     const char **mimetype2,
-                    struct file_baton *b)
+                    struct file_baton *fb)
 {
   /* Defaults */
   *mimetype1 = NULL;
   *mimetype2 = NULL;
 
-  if (b->pristine_props)
+  if (fb->pristine_props)
     {
       svn_string_t *pristine_val;
-      pristine_val = apr_hash_get(b->pristine_props, SVN_PROP_MIME_TYPE,
+      pristine_val = apr_hash_get(fb->pristine_props, SVN_PROP_MIME_TYPE,
                                   strlen(SVN_PROP_MIME_TYPE));
       if (pristine_val)
         *mimetype2 = *mimetype1 = pristine_val->data;
     }
 
-  if (b->propchanges)
+  if (fb->propchanges)
     {
       int i;
       svn_prop_t *propchange;
 
-      for (i = 0; i < b->propchanges->nelts; i++)
+      for (i = 0; i < fb->propchanges->nelts; i++)
         {
-          propchange = &APR_ARRAY_IDX(b->propchanges, i, svn_prop_t);
+          propchange = &APR_ARRAY_IDX(fb->propchanges, i, svn_prop_t);
           if (strcmp(propchange->name, SVN_PROP_MIME_TYPE) == 0)
             {
               if (propchange->value)
@@ -305,22 +311,22 @@ get_file_mime_types(const char **mimetyp
 }
 
 
-/* Get revision B->base_revision of the file described by B from the
- * repository, through B->edit_baton->ra_session.
+/* Get revision FB->base_revision of the file described by FB from the
+ * repository, through FB->edit_baton->ra_session.
  *
  * Unless PROPS_ONLY is true:
- *   Set B->path_start_revision to the path of a new temporary file containing
+ *   Set FB->path_start_revision to the path of a new temporary file containing
  *   the file's text.
- *   Set B->start_md5_checksum to that file's MD-5 checksum.
- *   Install a pool cleanup handler on B->pool to delete the file.
+ *   Set FB->start_md5_checksum to that file's MD-5 checksum.
+ *   Install a pool cleanup handler on FB->pool to delete the file.
  *
  * Always:
- *   Set B->pristine_props to a new hash containing the file's properties.
+ *   Set FB->pristine_props to a new hash containing the file's properties.
  *
- * Allocate all results in B->pool.
+ * Allocate all results in FB->pool.
  */
 static svn_error_t *
-get_file_from_ra(struct file_baton *b,
+get_file_from_ra(struct file_baton *fb,
                  svn_boolean_t props_only,
                  apr_pool_t *scratch_pool)
 {
@@ -328,30 +334,30 @@ get_file_from_ra(struct file_baton *b,
     {
       svn_stream_t *fstream;
 
-      SVN_ERR(svn_stream_open_unique(&fstream, &(b->path_start_revision), NULL,
-                                     svn_io_file_del_on_pool_cleanup,
-                                     b->pool, scratch_pool));
+      SVN_ERR(svn_stream_open_unique(&fstream, &(fb->path_start_revision),
+                                     NULL, svn_io_file_del_on_pool_cleanup,
+                                     fb->pool, scratch_pool));
 
-      fstream = svn_stream_checksummed2(fstream, NULL, &b->start_md5_checksum,
+      fstream = svn_stream_checksummed2(fstream, NULL, &fb->start_md5_checksum,
                                         svn_checksum_md5, TRUE, scratch_pool);
 
       /* Retrieve the file and its properties */
-      SVN_ERR(svn_ra_get_file(b->edit_baton->ra_session,
-                              b->path,
-                              b->base_revision,
+      SVN_ERR(svn_ra_get_file(fb->edit_baton->ra_session,
+                              fb->path,
+                              fb->base_revision,
                               fstream, NULL,
-                              &(b->pristine_props),
-                              b->pool));
+                              &(fb->pristine_props),
+                              fb->pool));
       SVN_ERR(svn_stream_close(fstream));
     }
   else
     {
-      SVN_ERR(svn_ra_get_file(b->edit_baton->ra_session,
-                              b->path,
-                              b->base_revision,
+      SVN_ERR(svn_ra_get_file(fb->edit_baton->ra_session,
+                              fb->path,
+                              fb->base_revision,
                               NULL, NULL,
-                              &(b->pristine_props),
-                              b->pool));
+                              &(fb->pristine_props),
+                              fb->pool));
     }
 
   return SVN_NO_ERROR;
@@ -461,10 +467,10 @@ open_root(void *edit_baton,
           void **root_baton)
 {
   struct edit_baton *eb = edit_baton;
-  struct dir_baton *b = make_dir_baton("", NULL, eb, FALSE, base_revision,
-                                       pool);
+  struct dir_baton *db = make_dir_baton("", NULL, eb, FALSE, base_revision,
+                                        pool);
 
-  *root_baton = b;
+  *root_baton = db;
   return SVN_NO_ERROR;
 }
 
@@ -477,26 +483,26 @@ diff_deleted_file(svn_wc_notify_state_t 
                   struct edit_baton *eb,
                   apr_pool_t *scratch_pool)
 {
-  struct file_baton *b = make_file_baton(path, FALSE, eb, scratch_pool);
-/*  struct edit_baton *eb = b->edit_baton;*/
+  struct file_baton *fb = make_file_baton(path, FALSE, eb, scratch_pool);
+/*  struct edit_baton *eb = fb->edit_baton;*/
   const char *mimetype1, *mimetype2;
 
   if (eb->cancel_func)
     SVN_ERR(eb->cancel_func(eb->cancel_baton));
 
   if (eb->text_deltas)
-    SVN_ERR(get_file_from_ra(b, FALSE, scratch_pool));
+    SVN_ERR(get_file_from_ra(fb, FALSE, scratch_pool));
   else
-    SVN_ERR(get_empty_file(eb, &b->path_start_revision));
-  SVN_ERR(get_empty_file(eb, &b->path_end_revision));
-  get_file_mime_types(&mimetype1, &mimetype2, b);
+    SVN_ERR(get_empty_file(eb, &fb->path_start_revision));
+  SVN_ERR(get_empty_file(eb, &fb->path_end_revision));
+  get_file_mime_types(&mimetype1, &mimetype2, fb);
 
   SVN_ERR(eb->diff_callbacks->file_deleted(state_p, tree_conflicted_p,
-                                           b->path,
-                                           b->path_start_revision,
-                                           b->path_end_revision,
+                                           fb->path,
+                                           fb->path_start_revision,
+                                           fb->path_end_revision,
                                            mimetype1, mimetype2,
-                                           b->pristine_props,
+                                           fb->pristine_props,
                                            eb->diff_cmd_baton,
                                            scratch_pool));
   return SVN_NO_ERROR;
@@ -654,26 +660,26 @@ add_directory(const char *path,
 {
   struct dir_baton *pb = parent_baton;
   struct edit_baton *eb = pb->edit_baton;
-  struct dir_baton *b;
+  struct dir_baton *db;
   svn_wc_notify_state_t state;
 
   /* ### TODO: support copyfrom? */
 
-  b = make_dir_baton(path, pb, eb, TRUE, SVN_INVALID_REVNUM, pool);
-  *child_baton = b;
+  db = make_dir_baton(path, pb, eb, TRUE, SVN_INVALID_REVNUM, pool);
+  *child_baton = db;
 
   /* Skip *everything* within a newly tree-conflicted directory,
    * and directories the children of which should be skipped. */
   if (pb->skip || pb->tree_conflicted || pb->skip_children)
     {
-      b->skip = TRUE;
+      db->skip = TRUE;
       return SVN_NO_ERROR;
     }
 
 
   SVN_ERR(eb->diff_callbacks->dir_added(
-                &state, &b->tree_conflicted,
-                &b->skip, &b->skip_children, b->path,
+                &state, &db->tree_conflicted,
+                &db->skip, &db->skip_children, db->path,
                 eb->target_revision, copyfrom_path, copyfrom_revision,
                 eb->diff_cmd_baton, pool));
 
@@ -692,12 +698,12 @@ add_directory(const char *path,
 
       /* Find out if a pending delete notification for this path is
        * still around. */
-      dpn = apr_hash_get(eb->deleted_paths, b->path, APR_HASH_KEY_STRING);
+      dpn = apr_hash_get(eb->deleted_paths, db->path, APR_HASH_KEY_STRING);
       if (dpn)
         {
           /* If any was found, we will handle the pending 'deleted path
            * notification' (DPN) here. Remove it from the list. */
-          apr_hash_set(eb->deleted_paths, b->path,
+          apr_hash_set(eb->deleted_paths, db->path,
                        APR_HASH_KEY_STRING, NULL);
 
           /* the pending delete might be on a different node kind. */
@@ -707,7 +713,7 @@ add_directory(const char *path,
 
       /* Determine what the notification (ACTION) should be.
        * In case of a pending 'delete', this might become a 'replace'. */
-      if (b->tree_conflicted)
+      if (db->tree_conflicted)
         action = svn_wc_notify_tree_conflict;
       else if (dpn)
         {
@@ -723,7 +729,7 @@ add_directory(const char *path,
       else
         action = svn_wc_notify_update_add;
 
-      notify = svn_wc_create_notify(b->path, action, pool);
+      notify = svn_wc_create_notify(db->path, action, pool);
       notify->kind = kind;
       notify->content_state = notify->prop_state = state;
       (*eb->notify_func)(eb->notify_baton, notify, pool);
@@ -742,24 +748,24 @@ open_directory(const char *path,
 {
   struct dir_baton *pb = parent_baton;
   struct edit_baton *eb = pb->edit_baton;
-  struct dir_baton *b;
+  struct dir_baton *db;
 
-  b = make_dir_baton(path, pb, pb->edit_baton, FALSE, base_revision, pool);
+  db = make_dir_baton(path, pb, eb, FALSE, base_revision, pool);
 
-  *child_baton = b;
+  *child_baton = db;
 
   /* Skip *everything* within a newly tree-conflicted directory
    * and directories the children of which should be skipped. */
   if (pb->skip || pb->tree_conflicted || pb->skip_children)
     {
-      b->skip = TRUE;
+      db->skip = TRUE;
       return SVN_NO_ERROR;
     }
 
   SVN_ERR(eb->diff_callbacks->dir_opened(
-                &b->tree_conflicted, &b->skip,
-                &b->skip_children, b->path, base_revision,
-                b->edit_baton->diff_cmd_baton, pool));
+                &db->tree_conflicted, &db->skip,
+                &db->skip_children, db->path, base_revision,
+                eb->diff_cmd_baton, pool));
 
   return SVN_NO_ERROR;
 }
@@ -775,22 +781,22 @@ add_file(const char *path,
          void **file_baton)
 {
   struct dir_baton *pb = parent_baton;
-  struct file_baton *b;
+  struct file_baton *fb;
 
   /* ### TODO: support copyfrom? */
 
-  b = make_file_baton(path, TRUE, pb->edit_baton, pool);
-  *file_baton = b;
+  fb = make_file_baton(path, TRUE, pb->edit_baton, pool);
+  *file_baton = fb;
 
   /* Skip *everything* within a newly tree-conflicted directory.
    * and directories the children of which should be skipped. */
   if (pb->skip || pb->tree_conflicted || pb->skip_children)
     {
-      b->skip = TRUE;
+      fb->skip = TRUE;
       return SVN_NO_ERROR;
     }
 
-  b->pristine_props = pb->edit_baton->empty_hash;
+  fb->pristine_props = pb->edit_baton->empty_hash;
 
   return SVN_NO_ERROR;
 }
@@ -804,24 +810,24 @@ open_file(const char *path,
           void **file_baton)
 {
   struct dir_baton *pb = parent_baton;
-  struct file_baton *b;
+  struct file_baton *fb;
   struct edit_baton *eb = pb->edit_baton;
-  b = make_file_baton(path, FALSE, pb->edit_baton, pool);
-  *file_baton = b;
+  fb = make_file_baton(path, FALSE, pb->edit_baton, pool);
+  *file_baton = fb;
 
   /* Skip *everything* within a newly tree-conflicted directory
    * and directories the children of which should be skipped. */
   if (pb->skip || pb->tree_conflicted || pb->skip_children)
     {
-      b->skip = TRUE;
+      fb->skip = TRUE;
       return SVN_NO_ERROR;
     }
 
-  b->base_revision = base_revision;
+  fb->base_revision = base_revision;
 
   SVN_ERR(eb->diff_callbacks->file_opened(
-                   &b->tree_conflicted, &b->skip,
-                   b->path, base_revision, eb->diff_cmd_baton, pool));
+                   &fb->tree_conflicted, &fb->skip,
+                   fb->path, base_revision, eb->diff_cmd_baton, pool));
 
   return SVN_NO_ERROR;
 }
@@ -831,14 +837,15 @@ static svn_error_t *
 window_handler(svn_txdelta_window_t *window,
                void *window_baton)
 {
-  struct file_baton *b = window_baton;
+  struct file_baton *fb = window_baton;
 
-  SVN_ERR(b->apply_handler(window, b->apply_baton));
+  SVN_ERR(fb->apply_handler(window, fb->apply_baton));
 
   if (!window)
     {
-      b->result_md5_checksum = svn_checksum__from_digest_md5(b->result_digest,
-                                                             b->pool);
+      fb->result_md5_checksum = svn_checksum__from_digest_md5(
+                                        fb->result_digest,
+                                        fb->pool);
     }
 
   return SVN_NO_ERROR;
@@ -852,13 +859,13 @@ apply_textdelta(void *file_baton,
                 svn_txdelta_window_handler_t *handler,
                 void **handler_baton)
 {
-  struct file_baton *b = file_baton;
+  struct file_baton *fb = file_baton;
   svn_stream_t *src_stream;
   svn_stream_t *result_stream;
-  apr_pool_t *scratch_pool = b->pool;
+  apr_pool_t *scratch_pool = fb->pool;
 
   /* Skip *everything* within a newly tree-conflicted directory. */
-  if (b->skip)
+  if (fb->skip)
     {
       *handler = svn_delta_noop_window_handler;
       *handler_baton = NULL;
@@ -866,11 +873,11 @@ apply_textdelta(void *file_baton,
     }
 
   /* If we're not sending file text, then ignore any that we receive. */
-  if (! b->edit_baton->text_deltas)
+  if (! fb->edit_baton->text_deltas)
     {
       /* Supply valid paths to indicate there is a text change. */
-      SVN_ERR(get_empty_file(b->edit_baton, &b->path_start_revision));
-      SVN_ERR(get_empty_file(b->edit_baton, &b->path_end_revision));
+      SVN_ERR(get_empty_file(fb->edit_baton, &fb->path_start_revision));
+      SVN_ERR(get_empty_file(fb->edit_baton, &fb->path_end_revision));
 
       *handler = svn_delta_noop_window_handler;
       *handler_baton = NULL;
@@ -879,12 +886,12 @@ apply_textdelta(void *file_baton,
     }
 
   /* We need the expected pristine file, so go get it */
-  if (!b->added)
-    SVN_ERR(get_file_from_ra(b, FALSE, scratch_pool));
+  if (!fb->added)
+    SVN_ERR(get_file_from_ra(fb, FALSE, scratch_pool));
   else
-    SVN_ERR(get_empty_file(b->edit_baton, &(b->path_start_revision)));
+    SVN_ERR(get_empty_file(fb->edit_baton, &(fb->path_start_revision)));
 
-  SVN_ERR_ASSERT(b->path_start_revision != NULL);
+  SVN_ERR_ASSERT(fb->path_start_revision != NULL);
 
   if (base_md5_digest != NULL)
     {
@@ -893,30 +900,30 @@ apply_textdelta(void *file_baton,
       SVN_ERR(svn_checksum_parse_hex(&base_md5_checksum, svn_checksum_md5,
                                      base_md5_digest, scratch_pool));
 
-      if (!svn_checksum_match(base_md5_checksum, b->start_md5_checksum))
+      if (!svn_checksum_match(base_md5_checksum, fb->start_md5_checksum))
         return svn_error_trace(svn_checksum_mismatch_err(
                                       base_md5_checksum,
-                                      b->start_md5_checksum,
+                                      fb->start_md5_checksum,
                                       scratch_pool,
                                       _("Base checksum mismatch for '%s'"),
-                                      b->path));
+                                      fb->path));
     }
 
   /* Open the file to be used as the base for second revision */
-  SVN_ERR(svn_stream_open_readonly(&src_stream, b->path_start_revision,
+  SVN_ERR(svn_stream_open_readonly(&src_stream, fb->path_start_revision,
                                    scratch_pool, scratch_pool));
 
   /* Open the file that will become the second revision after applying the
      text delta, it starts empty */
-  SVN_ERR(svn_stream_open_unique(&result_stream, &b->path_end_revision, NULL,
+  SVN_ERR(svn_stream_open_unique(&result_stream, &fb->path_end_revision, NULL,
                                  svn_io_file_del_on_pool_cleanup,
                                  scratch_pool, scratch_pool));
 
   svn_txdelta_apply(src_stream,
                     result_stream,
-                    b->result_digest,
-                    b->path, b->pool,
-                    &(b->apply_handler), &(b->apply_baton));
+                    fb->result_digest,
+                    fb->path, fb->pool,
+                    &(fb->apply_handler), &(fb->apply_baton));
 
   *handler = window_handler;
   *handler_baton = file_baton;
@@ -939,20 +946,20 @@ close_file(void *file_baton,
            const char *expected_md5_digest,
            apr_pool_t *pool)
 {
-  struct file_baton *b = file_baton;
-  struct edit_baton *eb = b->edit_baton;
+  struct file_baton *fb = file_baton;
+  struct edit_baton *eb = fb->edit_baton;
   svn_wc_notify_state_t content_state = svn_wc_notify_state_unknown;
   svn_wc_notify_state_t prop_state = svn_wc_notify_state_unknown;
   apr_pool_t *scratch_pool;
 
   /* Skip *everything* within a newly tree-conflicted directory. */
-  if (b->skip)
+  if (fb->skip)
     {
-      svn_pool_destroy(b->pool);
+      svn_pool_destroy(fb->pool);
       return SVN_NO_ERROR;
     }
 
-  scratch_pool = b->pool;
+  scratch_pool = fb->pool;
 
   if (expected_md5_digest && eb->text_deltas)
     {
@@ -961,57 +968,56 @@ close_file(void *file_baton,
       SVN_ERR(svn_checksum_parse_hex(&expected_md5_checksum, svn_checksum_md5,
                                      expected_md5_digest, scratch_pool));
 
-      if (!svn_checksum_match(expected_md5_checksum, b->result_md5_checksum))
+      if (!svn_checksum_match(expected_md5_checksum, fb->result_md5_checksum))
         return svn_error_trace(svn_checksum_mismatch_err(
                                       expected_md5_checksum,
-                                      b->result_md5_checksum,
+                                      fb->result_md5_checksum,
                                       pool,
                                       _("Checksum mismatch for '%s'"),
-                                      b->path));
+                                      fb->path));
     }
 
-  if (!b->added && b->propchanges->nelts > 0)
+  if (fb->path_end_revision || fb->has_propchange)
     {
-      if (!b->pristine_props)
+      const char *mimetype1, *mimetype2;
+
+      if (!fb->added && !fb->pristine_props)
         {
           /* We didn't receive a text change, so we have no pristine props.
              Retrieve just the props now. */
-          SVN_ERR(get_file_from_ra(b, TRUE, scratch_pool));
+          SVN_ERR(get_file_from_ra(fb, TRUE, scratch_pool));
         }
 
-      remove_non_prop_changes(b->pristine_props, b->propchanges);
-    }
+      if (fb->pristine_props)
+        remove_non_prop_changes(fb->pristine_props, fb->propchanges);
 
-  if (b->path_end_revision || b->propchanges->nelts > 0)
-    {
-      const char *mimetype1, *mimetype2;
-      get_file_mime_types(&mimetype1, &mimetype2, b);
+      get_file_mime_types(&mimetype1, &mimetype2, fb);
 
 
-      if (b->added)
+      if (fb->added)
         SVN_ERR(eb->diff_callbacks->file_added(
-                 &content_state, &prop_state, &b->tree_conflicted,
-                 b->path,
-                 b->path_end_revision ? b->path_start_revision : NULL,
-                 b->path_end_revision,
+                 &content_state, &prop_state, &fb->tree_conflicted,
+                 fb->path,
+                 fb->path_end_revision ? fb->path_start_revision : NULL,
+                 fb->path_end_revision,
                  0,
-                 b->edit_baton->target_revision,
+                 eb->target_revision,
                  mimetype1, mimetype2,
                  NULL, SVN_INVALID_REVNUM,
-                 b->propchanges, b->pristine_props,
-                 b->edit_baton->diff_cmd_baton,
+                 fb->propchanges, fb->pristine_props,
+                 eb->diff_cmd_baton,
                  scratch_pool));
       else
         SVN_ERR(eb->diff_callbacks->file_changed(
                  &content_state, &prop_state,
-                 &b->tree_conflicted, b->path,
-                 b->path_end_revision ? b->path_start_revision : NULL,
-                 b->path_end_revision,
-                 b->edit_baton->revision,
-                 b->edit_baton->target_revision,
+                 &fb->tree_conflicted, fb->path,
+                 fb->path_end_revision ? fb->path_start_revision : NULL,
+                 fb->path_end_revision,
+                 eb->revision,
+                 eb->target_revision,
                  mimetype1, mimetype2,
-                 b->propchanges, b->pristine_props,
-                 b->edit_baton->diff_cmd_baton,
+                 fb->propchanges, fb->pristine_props,
+                 eb->diff_cmd_baton,
                  scratch_pool));
     }
 
@@ -1025,12 +1031,12 @@ close_file(void *file_baton,
 
       /* Find out if a pending delete notification for this path is
        * still around. */
-      dpn = apr_hash_get(eb->deleted_paths, b->path, APR_HASH_KEY_STRING);
+      dpn = apr_hash_get(eb->deleted_paths, fb->path, APR_HASH_KEY_STRING);
       if (dpn)
         {
           /* If any was found, we will handle the pending 'deleted path
            * notification' (DPN) here. Remove it from the list. */
-          apr_hash_set(eb->deleted_paths, b->path,
+          apr_hash_set(eb->deleted_paths, fb->path,
                        APR_HASH_KEY_STRING, NULL);
 
           /* the pending delete might be on a different node kind. */
@@ -1040,12 +1046,12 @@ close_file(void *file_baton,
 
       /* Determine what the notification (ACTION) should be.
        * In case of a pending 'delete', this might become a 'replace'. */
-      if (b->tree_conflicted)
+      if (fb->tree_conflicted)
         action = svn_wc_notify_tree_conflict;
       else if (dpn)
         {
           if (dpn->action == svn_wc_notify_update_delete
-              && b->added)
+              && fb->added)
             action = svn_wc_notify_update_replace;
           else
             /* Note: dpn->action might be svn_wc_notify_tree_conflict */
@@ -1054,19 +1060,19 @@ close_file(void *file_baton,
       else if ((content_state == svn_wc_notify_state_missing)
                 || (content_state == svn_wc_notify_state_obstructed))
         action = svn_wc_notify_skip;
-      else if (b->added)
+      else if (fb->added)
         action = svn_wc_notify_update_add;
       else
         action = svn_wc_notify_update_update;
 
-      notify = svn_wc_create_notify(b->path, action, scratch_pool);
+      notify = svn_wc_create_notify(fb->path, action, scratch_pool);
       notify->kind = kind;
       notify->content_state = content_state;
       notify->prop_state = prop_state;
       (*eb->notify_func)(eb->notify_baton, notify, scratch_pool);
     }
 
-  svn_pool_destroy(b->pool); /* Destroy file and scratch pool */
+  svn_pool_destroy(fb->pool); /* Destroy file and scratch pool */
 
   return SVN_NO_ERROR;
 }
@@ -1082,8 +1088,8 @@ static svn_error_t *
 close_directory(void *dir_baton,
                 apr_pool_t *pool)
 {
-  struct dir_baton *b = dir_baton;
-  struct edit_baton *eb = b->edit_baton;
+  struct dir_baton *db = dir_baton;
+  struct edit_baton *eb = db->edit_baton;
   svn_wc_notify_state_t content_state = svn_wc_notify_state_unknown;
   svn_wc_notify_state_t prop_state = svn_wc_notify_state_unknown;
   svn_boolean_t skipped = FALSE;
@@ -1091,56 +1097,59 @@ close_directory(void *dir_baton,
   apr_hash_t *pristine_props;
 
   /* Skip *everything* within a newly tree-conflicted directory. */
-  if (b->skip)
+  if (db->skip)
     {
-      svn_pool_destroy(b->pool);
+      svn_pool_destroy(db->pool);
       return SVN_NO_ERROR;
     }
 
-  scratch_pool = b->pool;
-
-  if (b->added)
-    {
-      pristine_props = eb->empty_hash;
-    }
-  else
-    {
-      SVN_ERR(svn_ra_get_dir2(eb->ra_session, NULL, NULL, &pristine_props,
-                              b->path, b->base_revision, 0, scratch_pool));
-    }
+  scratch_pool = db->pool;
 
-  if (b->propchanges->nelts > 0)
+  if (db->has_propchange)
     {
-      remove_non_prop_changes(pristine_props, b->propchanges);
-    }
+      if (db->added)
+        {
+          pristine_props = eb->empty_hash;
+        }
+      else
+        {
+          SVN_ERR(svn_ra_get_dir2(eb->ra_session, NULL, NULL, &pristine_props,
+                                  db->path, db->base_revision, 0, scratch_pool));
+        }
 
-  if (b->propchanges->nelts > 0)
-    {
-      svn_boolean_t tree_conflicted = FALSE;
-      SVN_ERR(eb->diff_callbacks->dir_props_changed(
-               &prop_state, &tree_conflicted,
-               b->path, b->added,
-               b->propchanges, pristine_props,
-               b->edit_baton->diff_cmd_baton, scratch_pool));
-      if (tree_conflicted)
-        b->tree_conflicted = TRUE;
+      if (db->propchanges->nelts > 0)
+        {
+          remove_non_prop_changes(pristine_props, db->propchanges);
+        }
 
-      if (prop_state == svn_wc_notify_state_obstructed
-          || prop_state == svn_wc_notify_state_missing)
+      if (db->propchanges->nelts > 0)
         {
-          content_state = prop_state;
-          skipped = TRUE;
+          svn_boolean_t tree_conflicted = FALSE;
+          SVN_ERR(eb->diff_callbacks->dir_props_changed(
+                   &prop_state, &tree_conflicted,
+                   db->path, db->added,
+                   db->propchanges, pristine_props,
+                   eb->diff_cmd_baton, scratch_pool));
+          if (tree_conflicted)
+            db->tree_conflicted = TRUE;
+
+          if (prop_state == svn_wc_notify_state_obstructed
+              || prop_state == svn_wc_notify_state_missing)
+            {
+              content_state = prop_state;
+              skipped = TRUE;
+            }
         }
     }
 
   SVN_ERR(eb->diff_callbacks->dir_closed(NULL, NULL, NULL,
-                                         b->path, b->added,
-                                         b->edit_baton->diff_cmd_baton,
+                                         db->path, db->added,
+                                         eb->diff_cmd_baton,
                                          scratch_pool));
 
   /* Notify about any deleted paths within this directory that have not
    * already been notified. */
-  if (!skipped && !b->added && eb->notify_func)
+  if (!skipped && !db->added && eb->notify_func)
     {
       apr_hash_index_t *hi;
 
@@ -1151,11 +1160,11 @@ close_directory(void *dir_baton,
           const char *deleted_path = svn__apr_hash_index_key(hi);
           deleted_path_notify_t *dpn = svn__apr_hash_index_val(hi);
 
-          /* Ignore paths which are not children of b->path.  (There
+          /* Ignore paths which are not children of bb->path.  (There
              should be none due to editor ordering constraints, but
              ra_serf drops the ball here -- see issue #3802 for
              details.) */
-          if (! svn_relpath_skip_ancestor(b->path, deleted_path))
+          if (! svn_relpath_skip_ancestor(db->path, deleted_path))
             continue;
 
           notify = svn_wc_create_notify(deleted_path, dpn->action, pool);
@@ -1170,19 +1179,19 @@ close_directory(void *dir_baton,
 
   /* Notify about this directory itself (unless it was added, in which
    * case the notification was done at that time). */
-  if (!b->added && eb->notify_func)
+  if (!db->added && eb->notify_func)
     {
       svn_wc_notify_t *notify;
       svn_wc_notify_action_t action;
 
-      if (b->tree_conflicted)
+      if (db->tree_conflicted)
         action = svn_wc_notify_tree_conflict;
       else if (skipped)
         action = svn_wc_notify_skip;
       else
         action = svn_wc_notify_update_update;
 
-      notify = svn_wc_create_notify(b->path, action, pool);
+      notify = svn_wc_create_notify(db->path, action, pool);
       notify->kind = svn_node_dir;
 
       /* In case of a tree conflict during merge, the diff callback
@@ -1195,7 +1204,7 @@ close_directory(void *dir_baton,
       (*eb->notify_func)(eb->notify_baton, notify, scratch_pool);
     }
 
-  svn_pool_destroy(b->pool); /* Destroy baton and scratch_pool */
+  svn_pool_destroy(db->pool); /* Destroy baton and scratch_pool */
 
   return SVN_NO_ERROR;
 }
@@ -1210,16 +1219,23 @@ change_file_prop(void *file_baton,
                  const svn_string_t *value,
                  apr_pool_t *pool)
 {
-  struct file_baton *b = file_baton;
+  struct file_baton *fb = file_baton;
   svn_prop_t *propchange;
+  svn_prop_kind_t propkind;
 
   /* Skip *everything* within a newly tree-conflicted directory. */
-  if (b->skip)
+  if (fb->skip)
     return SVN_NO_ERROR;
 
-  propchange = apr_array_push(b->propchanges);
-  propchange->name = apr_pstrdup(b->pool, name);
-  propchange->value = value ? svn_string_dup(value, b->pool) : NULL;
+  propkind = svn_property_kind2(name);
+  if (propkind == svn_prop_wc_kind)
+    return SVN_NO_ERROR;
+  else if (propkind == svn_prop_regular_kind)
+    fb->has_propchange = TRUE;
+
+  propchange = apr_array_push(fb->propchanges);
+  propchange->name = apr_pstrdup(fb->pool, name);
+  propchange->value = value ? svn_string_dup(value, fb->pool) : NULL;
 
   return SVN_NO_ERROR;
 }
@@ -1235,11 +1251,18 @@ change_dir_prop(void *dir_baton,
 {
   struct dir_baton *db = dir_baton;
   svn_prop_t *propchange;
+  svn_prop_kind_t propkind;
 
   /* Skip *everything* within a newly tree-conflicted directory. */
   if (db->skip)
     return SVN_NO_ERROR;
 
+  propkind = svn_property_kind2(name);
+  if (propkind == svn_prop_wc_kind)
+    return SVN_NO_ERROR;
+  else if (propkind == svn_prop_regular_kind)
+    db->has_propchange = TRUE;
+
   propchange = apr_array_push(db->propchanges);
   propchange->name = apr_pstrdup(db->pool, name);
   propchange->value = value ? svn_string_dup(value, db->pool) : NULL;

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/switch.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/switch.c Fri Dec 28 23:03:51 2012
@@ -267,7 +267,7 @@ switch_internal(svn_revnum_t *result_rev
       if (needs_iprop_cache)
         {
           SVN_ERR(svn_ra_get_inherited_props(ra_session, &inherited_props,
-                                             "", switch_loc->rev, pool,
+                                             "", switch_loc->rev, TRUE, pool,
                                              pool));
           apr_hash_set(wcroot_iprops, local_abspath, APR_HASH_KEY_STRING,
                        inherited_props);

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/update.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/update.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/update.c Fri Dec 28 23:03:51 2012
@@ -377,8 +377,8 @@ update_internal(svn_revnum_t *result_rev
   dfb.anchor_url = anchor_loc->url;
 
   err = svn_client__get_inheritable_props(&wcroot_iprops, local_abspath,
-                                          revnum, depth, ra_session, ctx,
-                                          pool, pool);
+                                          revnum, depth, TRUE, ra_session,
+                                          ctx, pool, pool);
 
   /* We might be trying to update to a non-existant path-rev. */
   if (err)

Modified: subversion/branches/javahl-ra/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_diff/diff_file.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_diff/diff_file.c Fri Dec 28 23:03:51 2012
@@ -122,6 +122,7 @@ datasource_to_index(svn_diff_datasource_
  * whatsoever.  If there is a number someone comes up with that has some
  * argumentation, let's use that.
  */
+/* If you change this number, update test_wrap() in diff-diff3-test.c */
 #define CHUNK_SHIFT 17
 #define CHUNK_SIZE (1 << CHUNK_SHIFT)
 

Modified: subversion/branches/javahl-ra/subversion/libsvn_fs/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_fs/editor.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_fs/editor.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_fs/editor.c Fri Dec 28 23:03:51 2012
@@ -474,7 +474,8 @@ alter_directory_cb(void *baton,
   SVN_ERR(get_root(&root, eb));
   SVN_ERR(can_modify(root, fspath, revision, scratch_pool));
 
-  SVN_ERR(alter_props(root, fspath, props, scratch_pool));
+  if (props)
+    SVN_ERR(alter_props(root, fspath, props, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/javahl-ra/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_fs_fs/fs_fs.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_fs_fs/fs_fs.c Fri Dec 28 23:03:51 2012
@@ -8560,23 +8560,6 @@ write_reps_to_cache(svn_fs_t *fs,
   return SVN_NO_ERROR;
 }
 
-/* Implements svn_sqlite__transaction_callback_t. */
-static svn_error_t *
-commit_sqlite_txn_callback(void *baton, svn_sqlite__db_t *db,
-                           apr_pool_t *scratch_pool)
-{
-  struct commit_baton *cb = baton;
-
-  /* Write new entries to the rep-sharing database.
-   *
-   * We use an sqlite transcation to speed things up;
-   * see <http://www.sqlite.org/faq.html#q19>.
-   */
-  SVN_ERR(write_reps_to_cache(cb->fs, cb->reps_to_cache, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_fs_fs__commit(svn_revnum_t *new_rev_p,
                   svn_fs_t *fs,
@@ -8611,9 +8594,15 @@ svn_fs_fs__commit(svn_revnum_t *new_rev_
   if (ffd->rep_sharing_allowed)
     {
       SVN_ERR(svn_fs_fs__open_rep_cache(fs, pool));
-      SVN_ERR(svn_sqlite__with_transaction(ffd->rep_cache_db,
-                                           commit_sqlite_txn_callback,
-                                           &cb, pool));
+
+      /* Write new entries to the rep-sharing database.
+       *
+       * We use an sqlite transaction to speed things up;
+       * see <http://www.sqlite.org/faq.html#q19>.
+       */
+      SVN_SQLITE__WITH_TXN(
+        write_reps_to_cache(fs, cb.reps_to_cache, pool),
+        ffd->rep_cache_db);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/javahl-ra/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_ra/ra_loader.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_ra/ra_loader.c Fri Dec 28 23:03:51 2012
@@ -1298,6 +1298,7 @@ svn_ra_get_inherited_props(svn_ra_sessio
                            apr_array_header_t **iprops,
                            const char *path,
                            svn_revnum_t revision,
+                           svn_boolean_t use_relpath_keys,
                            apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool)
 {
@@ -1323,6 +1324,23 @@ svn_ra_get_inherited_props(svn_ra_sessio
                                                result_pool, scratch_pool));
     }
 
+  if (use_relpath_keys && (*iprops)->nelts)
+    {
+      const char *repos_root_url;
+      int i;
+
+      SVN_ERR(svn_ra_get_repos_root2(session, &repos_root_url, scratch_pool));
+      for (i = 0; i < (*iprops)->nelts; i++)
+        {
+          svn_prop_inherited_item_t *elt =
+            APR_ARRAY_IDX(*iprops, i, svn_prop_inherited_item_t *);
+          elt->path_or_url =
+            svn_dirent_skip_ancestor(repos_root_url, elt->path_or_url);
+          elt->path_or_url = svn_path_uri_decode(elt->path_or_url,
+                                                 result_pool);
+        }
+    }
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/javahl-ra/subversion/libsvn_repos/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_repos/authz.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_repos/authz.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_repos/authz.c Fri Dec 28 23:03:51 2012
@@ -34,6 +34,7 @@
 #include "svn_config.h"
 #include "svn_ctype.h"
 #include "private/svn_fspath.h"
+#include "repos.h"
 
 
 /*** Structures. ***/
@@ -750,21 +751,173 @@ static svn_boolean_t authz_validate_sect
   return TRUE;
 }
 
+/* Retrieve the file at DIRENT (contained in a repo) then parse it as a config
+ * file placing the result into CFG_P allocated in POOL.
+ *
+ * If DIRENT is not a valid authz rule file then return SVN_AUTHZ_INVALD_CONFIG
+ * as the error.  The contents of CFG_P is then undefined.  If MUST_EXIST is
+ * TRUE, a missing authz file is also an error.
+ *
+ * SCRATCH_POOL will be used for temporary allocations. */
+static svn_error_t *
+authz_retrieve_config_repo(svn_config_t **cfg_p, const char *dirent,
+                          svn_boolean_t must_exist,
+                          apr_pool_t *result_pool, apr_pool_t *scratch_pool)
+{
+  svn_error_t *err;
+  svn_repos_t *repos;
+  const char *repos_root_dirent;
+  const char *fs_path;
+  svn_fs_t *fs;
+  svn_fs_root_t *root;
+  svn_revnum_t youngest_rev;
+  svn_node_kind_t node_kind;
+  svn_stream_t *contents;
+  const char *canon_dirent = svn_dirent_canonicalize(dirent, scratch_pool);
+
+  /* Search for a repository in the full path. */
+  repos_root_dirent = svn_repos_find_root_path(canon_dirent, scratch_pool);
+  if (!repos_root_dirent)
+    return svn_error_createf(SVN_ERR_AUTHZ_INVALID_CONFIG, NULL,
+                             "Unable to find repository at '%s'", dirent);
 
-
-/*** Public functions. ***/
+  /* Attempt to open a repository at repos_root_dirent. */
+  SVN_ERR(svn_repos_open2(&repos, repos_root_dirent, NULL, scratch_pool));
+
+  fs_path = &canon_dirent[strlen(repos_root_dirent)];
+
+  /* Root path is always a directory so no reason to go any further */
+  if (*fs_path == '\0')
+    return svn_error_createf(SVN_ERR_AUTHZ_INVALID_CONFIG, NULL,
+                             "'/' is not a file in repo '%s'",
+                             repos_root_dirent);
+
+  /* We skip some things that are non-important for how we're going to use
+   * this repo connection.  We do not set any capabilities since none of
+   * the current ones are important for what we're doing.  We also do not
+   * setup the environment that repos hooks would run under since we won't
+   * be triggering any. */
+
+  /* Get the filesystem. */
+  fs = svn_repos_fs(repos);
+
+  /* Find HEAD and the revision root */
+  SVN_ERR(svn_fs_youngest_rev(&youngest_rev, fs, scratch_pool));
+  SVN_ERR(svn_fs_revision_root(&root, fs, youngest_rev, scratch_pool));
+
+  SVN_ERR(svn_fs_check_path(&node_kind, root, fs_path, scratch_pool));
+  if (node_kind == svn_node_none)
+    {
+      if (!must_exist)
+        {
+          SVN_ERR(svn_config_create(cfg_p, TRUE, scratch_pool));
+          return SVN_NO_ERROR;
+        }
+      else
+        {
+          return svn_error_createf(SVN_ERR_AUTHZ_INVALID_CONFIG, NULL,
+                                   "'%s' path not found in repo '%s'", fs_path,
+                                   repos_root_dirent);
+        }
+    }
+  else if (node_kind != svn_node_file)
+    {
+      return svn_error_createf(SVN_ERR_AUTHZ_INVALID_CONFIG, NULL,
+                               "'%s' is not a file in repo '%s'", fs_path,
+                               repos_root_dirent);
+    }
+
+  SVN_ERR(svn_fs_file_contents(&contents, root, fs_path, scratch_pool));
+  err = svn_config_parse(cfg_p, contents, TRUE, result_pool);
+
+  /* Add the URL to the error stack since the parser doesn't have it. */
+  if (err != SVN_NO_ERROR)
+    return svn_error_createf(err->apr_err, err, 
+                             "Error parsing config file: '%s' in repo '%s':",
+                             fs_path, repos_root_dirent);
+
+  return SVN_NO_ERROR;
+}
+
+/* Given a PATH which might be a realative repo URL (^/), an absolute
+ * local repo URL (file://), an absolute path outside of the repo
+ * or a location in the Windows registry.
+ *
+ * Retrieve the configuration data that PATH points at and parse it into
+ * CFG_P allocated in POOL.
+ *
+ * If PATH is not a valid authz rule file then return SVN_AUTHZ_INVALD_CONFIG
+ * as the error.  The contents of CFG_P is then undefined.  If MUST_EXIST is
+ * TRUE, a missing authz file is also an error.
+ *
+ * REPOS_ROOT points at the root of the repos you are
+ * going to apply the authz against, can be NULL if you are sure that you
+ * don't have a repos relative URL in PATH. */
+static svn_error_t *
+authz_retrieve_config(svn_config_t **cfg_p, const char *path,
+                      svn_boolean_t must_exist, const char *repos_root,
+                      apr_pool_t *pool)
+{
+  if (svn_path_is_repos_relative_url(path))
+    {
+      const char *dirent;
+      svn_error_t *err;
+      apr_pool_t *scratch_pool = svn_pool_create(pool);
+
+      err = svn_path_resolve_repos_relative_url(&dirent, path,
+                                                repos_root, scratch_pool);
+
+      if (err == SVN_NO_ERROR) 
+        err = authz_retrieve_config_repo(cfg_p, dirent, must_exist, pool,
+                                         scratch_pool);
+
+      /* Close the repos and streams we opened. */
+      svn_pool_destroy(scratch_pool);
+
+      return err;
+    }
+  else if (svn_path_is_url(path))
+    {
+      const char *dirent;
+      svn_error_t *err;
+      apr_pool_t *scratch_pool = svn_pool_create(pool); 
+
+      err = svn_uri_get_dirent_from_file_url(&dirent, path, scratch_pool);
+
+      if (err == SVN_NO_ERROR)
+        err = authz_retrieve_config_repo(cfg_p, dirent, must_exist, pool,
+                                         scratch_pool);
+
+      /* Close the repos and streams we opened. */
+      svn_pool_destroy(scratch_pool);
+
+      return err;
+    }
+  else
+    {
+      /* Outside of repo file or Windows registry*/
+      SVN_ERR(svn_config_read2(cfg_p, path, must_exist, TRUE, pool));
+    }
+
+  return SVN_NO_ERROR;
+}
 
 svn_error_t *
-svn_repos_authz_read(svn_authz_t **authz_p, const char *file,
-                     svn_boolean_t must_exist, apr_pool_t *pool)
+svn_repos__authz_read(svn_authz_t **authz_p, const char *path,
+                      svn_boolean_t must_exist, svn_boolean_t accept_urls,
+                      const char *repos_root, apr_pool_t *pool)
 {
   svn_authz_t *authz = apr_palloc(pool, sizeof(*authz));
   struct authz_validate_baton baton = { 0 };
 
   baton.err = SVN_NO_ERROR;
 
-  /* Load the rule file. */
-  SVN_ERR(svn_config_read2(&authz->cfg, file, must_exist, TRUE, pool));
+  /* Load the rule file */
+  if (accept_urls)
+    SVN_ERR(authz_retrieve_config(&authz->cfg, path, must_exist, repos_root,
+                                  pool));
+  else
+    SVN_ERR(svn_config_read2(&authz->cfg, path, must_exist, TRUE, pool));
   baton.config = authz->cfg;
 
   /* Step through the entire rule file, stopping on error. */
@@ -777,6 +930,20 @@ svn_repos_authz_read(svn_authz_t **authz
 }
 
 
+
+/*** Public functions. ***/
+
+svn_error_t *
+svn_repos_authz_read2(svn_authz_t **authz_p, const char *path,
+                      svn_boolean_t must_exist, const char *repos_root,
+                      apr_pool_t *pool)
+{
+  return svn_repos__authz_read(authz_p, path, must_exist, TRUE, repos_root,
+                               pool);
+}
+
+
+
 svn_error_t *
 svn_repos_authz_check_access(svn_authz_t *authz, const char *repos_name,
                              const char *path, const char *user,

Modified: subversion/branches/javahl-ra/subversion/libsvn_repos/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_repos/deprecated.c?rev=1426654&r1=1426653&r2=1426654&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_repos/deprecated.c Fri Dec 28 23:03:51 2012
@@ -1006,3 +1006,12 @@ svn_repos_fs_begin_txn_for_update(svn_fs
 
   return SVN_NO_ERROR;
 }
+
+/*** From authz.c ***/
+
+svn_error_t *
+svn_repos_authz_read(svn_authz_t **authz_p, const char *file,
+                     svn_boolean_t must_exist, apr_pool_t *pool)
+{
+  return svn_repos__authz_read(authz_p, file, must_exist, FALSE, NULL, pool);
+}



Mime
View raw message