You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/04/30 01:36:46 UTC

svn commit: r1591144 [2/5] - in /subversion/branches/1.8.x-r1536931: ./ build/ build/ac-macros/ build/generator/ subversion/bindings/javahl/native/ subversion/bindings/swig/ subversion/bindings/swig/perl/native/ subversion/bindings/swig/ruby/libsvn_swi...

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_client/export.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_client/export.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_client/export.c Tue Apr 29 23:36:43 2014
@@ -267,7 +267,9 @@ export_node(void *baton,
                                                       scratch_pool));
     }
 
-  if (status->file_external)
+  /* Skip file externals if they are a descendant of the export,
+     BUT NOT if we are explictly exporting the file external. */
+  if (status->file_external && strcmp(eib->origin_abspath, local_abspath) != 0)
     return SVN_NO_ERROR;
 
   /* Produce overwrite errors for the export root */
@@ -1587,3 +1589,4 @@ svn_client_export5(svn_revnum_t *result_
 
   return SVN_NO_ERROR;
 }
+

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_client/externals.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_client/externals.c Tue Apr 29 23:36:43 2014
@@ -737,7 +737,7 @@ handle_external_item_change(svn_client_c
   switch (ext_kind)
     {
       case svn_node_dir:
-        SVN_ERR(switch_dir_external(local_abspath, new_url,
+        SVN_ERR(switch_dir_external(local_abspath, new_loc->url,
                                     &(new_item->peg_revision),
                                     &(new_item->revision),
                                     parent_dir_abspath,

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_client/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_client/log.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_client/log.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_client/log.c Tue Apr 29 23:36:43 2014
@@ -861,17 +861,19 @@ svn_client_log5(const apr_array_header_t
                                             actual_loc->url, pool));
 
   /* Save us an RA layer round trip if we are on the repository root and
-     know the result in advance.  All the revision data has already been
-     validated.
+     know the result in advance, or if we don't need multiple ranges.
+     All the revision data has already been validated.
    */
-  if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0)
+  if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0
+      || opt_rev_ranges->nelts <= 1)
     {
       svn_location_segment_t *segment = apr_pcalloc(pool, sizeof(*segment));
       log_segments = apr_array_make(pool, 1, sizeof(segment));
 
       segment->range_start = oldest_rev;
       segment->range_end = actual_loc->rev;
-      segment->path = "";
+      segment->path = svn_uri_skip_ancestor(actual_loc->repos_root_url,
+                                            actual_loc->url, pool);
       APR_ARRAY_PUSH(log_segments, svn_location_segment_t *) = segment;
     }
   else

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_client/merge.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_client/merge.c Tue Apr 29 23:36:43 2014
@@ -322,6 +322,10 @@ typedef struct merge_cmd_baton_t {
   const char *diff3_cmd;
   const apr_array_header_t *merge_options;
 
+  /* Array of file extension patterns to preserve as extensions in
+     generated conflict files. */
+  const apr_array_header_t *ext_patterns;
+
   /* RA sessions used throughout a merge operation.  Opened/re-parented
      as needed.
 
@@ -2023,17 +2027,36 @@ merge_file_changed(const char *relpath,
     {
       svn_boolean_t has_local_mods;
       enum svn_wc_merge_outcome_t content_outcome;
+      const char *target_label;
+      const char *left_label;
+      const char *right_label;
+      const char *path_ext = "";
+
+      if (merge_b->ext_patterns && merge_b->ext_patterns->nelts)
+        {
+          svn_path_splitext(NULL, &path_ext, local_abspath, scratch_pool);
+          if (! (*path_ext
+                 && svn_cstring_match_glob_list(path_ext,
+                                                merge_b->ext_patterns)))
+            {
+              path_ext = "";
+            }
+        }
 
       /* xgettext: the '.working', '.merge-left.r%ld' and
          '.merge-right.r%ld' strings are used to tag onto a file
          name in case of a merge conflict */
-      const char *target_label = _(".working");
-      const char *left_label = apr_psprintf(scratch_pool,
-                                            _(".merge-left.r%ld"),
-                                            left_source->revision);
-      const char *right_label = apr_psprintf(scratch_pool,
-                                             _(".merge-right.r%ld"),
-                                             right_source->revision);
+
+      target_label = apr_psprintf(scratch_pool, _(".working%s%s"),
+                                  *path_ext ? "." : "", path_ext);
+      left_label = apr_psprintf(scratch_pool,
+                                _(".merge-left.r%ld%s%s"),
+                                left_source->revision,
+                                *path_ext ? "." : "", path_ext);
+      right_label = apr_psprintf(scratch_pool,
+                                 _(".merge-right.r%ld%s%s"),
+                                 right_source->revision,
+                                 *path_ext ? "." : "", path_ext);
 
       SVN_ERR(svn_wc_text_modified_p2(&has_local_mods, ctx->wc_ctx,
                                       local_abspath, FALSE, scratch_pool));
@@ -3062,7 +3085,6 @@ merge_dir_deleted(const char *relpath,
   struct merge_dir_baton_t *db = dir_baton;
   const char *local_abspath = svn_dirent_join(merge_b->target->abspath,
                                               relpath, scratch_pool);
-  struct dir_delete_baton_t *delb;
   svn_boolean_t same;
   apr_hash_t *working_props;
 
@@ -3093,66 +3115,69 @@ merge_dir_deleted(const char *relpath,
                             scratch_pool, scratch_pool));
 
   if (merge_b->force_delete)
-    same = TRUE;
+    {
+      /* In this legacy mode we just assume that a directory delete
+         matches any directory. db->delete_state is NULL */
+      same = TRUE;
+    }
   else
     {
+      struct dir_delete_baton_t *delb;
+
       /* Compare the properties */
       SVN_ERR(properties_same_p(&same, left_props, working_props,
                                 scratch_pool));
-    }
+      delb = db->delete_state;
+      assert(delb != NULL);
 
-  delb = db->delete_state;
-  assert(delb != NULL);
+      if (! same)
+        {
+          delb->found_edit = TRUE;
+        }
+      else
+        {
+          store_path(delb->compared_abspaths, local_abspath);
+        }
 
-  if (! same)
-    {
-      delb->found_edit = TRUE;
-    }
-  else
-    {
-      store_path(delb->compared_abspaths, local_abspath);
-    }
+      if (delb->del_root != db)
+        return SVN_NO_ERROR;
 
-  if (delb->del_root != db)
-    return SVN_NO_ERROR;
+      if (delb->found_edit)
+        same = FALSE;
+      else
+        {
+          apr_array_header_t *ignores;
+          svn_error_t *err;
+          same = TRUE;
 
-  if (delb->found_edit)
-    same = FALSE;
-  else if (merge_b->force_delete)
-    same = TRUE;
-  else
-    {
-      apr_array_header_t *ignores;
-      svn_error_t *err;
-      same = TRUE;
+          SVN_ERR(svn_wc_get_default_ignores(&ignores, merge_b->ctx->config,
+                                             scratch_pool));
 
-      SVN_ERR(svn_wc_get_default_ignores(&ignores, merge_b->ctx->config,
-                                         scratch_pool));
+          /* None of the descendants was modified, but maybe there are
+             descendants we haven't walked?
 
-      /* None of the descendants was modified, but maybe there are
-         descendants we haven't walked?
+             Note that we aren't interested in changes, as we already verified
+             changes in the paths touched by the merge. And the existence of
+             other paths is enough to mark the directory edited */
+          err = svn_wc_walk_status(merge_b->ctx->wc_ctx, local_abspath,
+                                   svn_depth_infinity, TRUE /* get-all */,
+                                   FALSE /* no-ignore */,
+                                   TRUE /* ignore-text-mods */, ignores,
+                                   verify_touched_by_del_check, delb,
+                                   merge_b->ctx->cancel_func,
+                                   merge_b->ctx->cancel_baton,
+                                   scratch_pool);
 
-         Note that we aren't interested in changes, as we already verified
-         changes in the paths touched by the merge. And the existance of
-         other paths is enough to mark the directory edited */
-      err = svn_wc_walk_status(merge_b->ctx->wc_ctx, local_abspath,
-                               svn_depth_infinity, TRUE /* get-all */,
-                               FALSE /* no-ignore */,
-                               TRUE /* ignore-text-mods */, ignores,
-                               verify_touched_by_del_check, delb,
-                               merge_b->ctx->cancel_func,
-                               merge_b->ctx->cancel_baton,
-                               scratch_pool);
+          if (err)
+            {
+              if (err->apr_err != SVN_ERR_CEASE_INVOCATION)
+                return svn_error_trace(err);
 
-      if (err)
-        {
-          if (err->apr_err != SVN_ERR_CEASE_INVOCATION)
-            return svn_error_trace(err);
+              svn_error_clear(err);
+            }
 
-          svn_error_clear(err);
+          same = ! delb->found_edit;
         }
-
-      same = ! delb->found_edit;
     }
 
   if (same && !merge_b->dry_run)
@@ -9668,6 +9693,7 @@ do_merge(apr_hash_t **modified_subtrees,
   merge_cmd_baton_t merge_cmd_baton = { 0 };
   svn_config_t *cfg;
   const char *diff3_cmd;
+  const char *preserved_exts_str;
   int i;
   svn_boolean_t checked_mergeinfo_capability = FALSE;
   svn_ra_session_t *ra_session1 = NULL, *ra_session2 = NULL;
@@ -9728,6 +9754,11 @@ do_merge(apr_hash_t **modified_subtrees,
   if (diff3_cmd != NULL)
     SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, scratch_pool));
 
+    /* See which files the user wants to preserve the extension of when
+     conflict files are made. */
+  svn_config_get(cfg, &preserved_exts_str, SVN_CONFIG_SECTION_MISCELLANY,
+                 SVN_CONFIG_OPTION_PRESERVED_CF_EXTS, "");
+
   /* Build the merge context baton (or at least the parts of it that
      don't need to be reset for each merge source).  */
   merge_cmd_baton.force_delete = force_delete;
@@ -9743,6 +9774,11 @@ do_merge(apr_hash_t **modified_subtrees,
   merge_cmd_baton.pool = iterpool;
   merge_cmd_baton.merge_options = merge_options;
   merge_cmd_baton.diff3_cmd = diff3_cmd;
+  merge_cmd_baton.ext_patterns = *preserved_exts_str
+                          ? svn_cstring_split(preserved_exts_str, "\n\r\t\v ",
+                                              FALSE, scratch_pool)
+                          : NULL;
+
   merge_cmd_baton.use_sleep = use_sleep;
 
   /* Do we already know the specific subtrees with mergeinfo we want
@@ -10447,15 +10483,10 @@ merge_locked(conflict_report_t **conflic
     }
   else
     {
-      merge_source_t source;
-
-      source.loc1 = source1_loc;
-      source.loc2 = source2_loc;
-      source.ancestral = FALSE;
-
       /* Build a single-item merge_source_t array. */
       merge_sources = apr_array_make(scratch_pool, 1, sizeof(merge_source_t *));
-      APR_ARRAY_PUSH(merge_sources, merge_source_t *) = &source;
+      APR_ARRAY_PUSH(merge_sources, merge_source_t *)
+        = merge_source_create(source1_loc, source2_loc, FALSE, scratch_pool);
     }
 
   err = do_merge(NULL, NULL, conflict_report, &use_sleep,
@@ -10761,7 +10792,7 @@ log_find_operative_revs(void *baton,
    UNMERGED_CATALOG represents the history (as mergeinfo) from
    TARGET_LOC that is not represented in SOURCE_LOC's
    explicit/inherited mergeinfo as represented by MERGED_CATALOG.
-   MERGEINFO_CATALOG may be empty if the source has no explicit or inherited
+   MERGED_CATALOG may be empty if the source has no explicit or inherited
    mergeinfo.
 
    Check that all of the unmerged revisions in UNMERGED_CATALOG's
@@ -11464,7 +11495,7 @@ find_reintegrate_merge(merge_source_t **
          prefix. */
       svn_mergeinfo_catalog_t final_unmerged_catalog = apr_hash_make(scratch_pool);
 
-      SVN_ERR(find_unsynced_ranges(source_loc, yc_ancestor,
+      SVN_ERR(find_unsynced_ranges(source_loc, &target->loc,
                                    unmerged_to_source_mergeinfo_catalog,
                                    merged_to_source_mergeinfo_catalog,
                                    final_unmerged_catalog,

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_client/prop_commands.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_client/prop_commands.c Tue Apr 29 23:36:43 2014
@@ -890,8 +890,14 @@ svn_client_propget5(apr_hash_t **props,
           const char *copy_root_abspath;
           svn_boolean_t is_copy;
 
-          SVN_ERR(svn_dirent_get_absolute(&local_abspath, target,
-                                          scratch_pool));
+          /* Avoid assertion on the next line when somebody accidentally asks for
+             a working copy revision on a URL */
+          if (svn_path_is_url(target))
+            return svn_error_create(SVN_ERR_CLIENT_VERSIONED_PATH_REQUIRED,
+                                    NULL, NULL);
+
+          SVN_ERR_ASSERT(svn_dirent_is_absolute(target));
+          local_abspath = target;
 
           if (SVN_CLIENT__REVKIND_NEEDS_WC(peg_revision->kind))
             {
@@ -1201,6 +1207,7 @@ struct recursive_proplist_receiver_baton
   svn_wc_context_t *wc_ctx;  /* Working copy context. */
   svn_proplist_receiver2_t wrapped_receiver;  /* Proplist receiver to call. */
   void *wrapped_receiver_baton;    /* Baton for the proplist receiver. */
+  apr_array_header_t *iprops;
 
   /* Anchor, anchor_abspath pair for converting to relative paths */
   const char *anchor;
@@ -1216,6 +1223,27 @@ recursive_proplist_receiver(void *baton,
 {
   struct recursive_proplist_receiver_baton *b = baton;
   const char *path;
+  apr_array_header_t *iprops = NULL;
+
+  if (b->iprops
+      && ! strcmp(local_abspath, b->anchor_abspath))
+    {
+      /* Report iprops with the properties for the anchor */
+      iprops = b->iprops;
+      b->iprops = NULL;
+    }
+  else if (b->iprops)
+    {
+      /* No report for the root?
+         Report iprops anyway */
+
+      SVN_ERR(b->wrapped_receiver(b->wrapped_receiver_baton,
+                                  b->anchor ? b->anchor : b->anchor_abspath,
+                                  NULL /* prop_hash */,
+                                  b->iprops,
+                                  scratch_pool));
+      b->iprops = NULL;
+    }
 
   /* Attempt to convert absolute paths to relative paths for
    * presentation purposes, if needed. */
@@ -1230,7 +1258,7 @@ recursive_proplist_receiver(void *baton,
     path = local_abspath;
 
   return svn_error_trace(b->wrapped_receiver(b->wrapped_receiver_baton,
-                                             path, props, NULL,
+                                             path, props, iprops,
                                              scratch_pool));
 }
 
@@ -1271,6 +1299,12 @@ get_remote_props(const char *path_or_url
       const char *copy_root_abspath;
       svn_boolean_t is_copy;
 
+      /* Avoid assertion on the next line when somebody accidentally asks for
+         a working copy revision on a URL */
+      if (svn_path_is_url(path_or_url))
+        return svn_error_create(SVN_ERR_CLIENT_VERSIONED_PATH_REQUIRED,
+                                NULL, NULL);
+
       SVN_ERR(svn_dirent_get_absolute(&local_abspath, path_or_url,
                                       scratch_pool));
 
@@ -1370,6 +1404,7 @@ get_local_props(const char *path_or_url,
   svn_node_kind_t kind;
   apr_hash_t *changelist_hash = NULL;
   const char *local_abspath;
+  apr_array_header_t *iprops = NULL;
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path_or_url,
                                   scratch_pool));
@@ -1392,7 +1427,6 @@ get_local_props(const char *path_or_url,
 
   if (get_target_inherited_props)
     {
-      apr_array_header_t *iprops;
       const char *repos_root_url;
 
       SVN_ERR(svn_wc__get_iprops(&iprops, ctx->wc_ctx, local_abspath,
@@ -1402,8 +1436,6 @@ get_local_props(const char *path_or_url,
       SVN_ERR(svn_client__iprop_relpaths_to_urls(iprops, repos_root_url,
                                                  scratch_pool,
                                                  scratch_pool));
-      SVN_ERR(call_receiver(path_or_url, NULL, iprops, receiver,
-                            receiver_baton, scratch_pool));
     }
 
   if (changelists && changelists->nelts)
@@ -1418,16 +1450,16 @@ get_local_props(const char *path_or_url,
       rb.wc_ctx = ctx->wc_ctx;
       rb.wrapped_receiver = receiver;
       rb.wrapped_receiver_baton = receiver_baton;
+      rb.iprops = iprops;
+      rb.anchor_abspath = local_abspath;
 
       if (strcmp(path_or_url, local_abspath) != 0)
         {
           rb.anchor = path_or_url;
-          rb.anchor_abspath = local_abspath;
         }
       else
         {
           rb.anchor = NULL;
-          rb.anchor_abspath = NULL;
         }
 
       SVN_ERR(svn_wc__prop_list_recursive(ctx->wc_ctx, local_abspath, NULL,
@@ -1435,6 +1467,13 @@ get_local_props(const char *path_or_url,
                                           recursive_proplist_receiver, &rb,
                                           ctx->cancel_func, ctx->cancel_baton,
                                           scratch_pool));
+
+      if (rb.iprops)
+        {
+          /* We didn't report for the root. Report iprops anyway */
+          SVN_ERR(call_receiver(path_or_url, NULL /* props */, rb.iprops,
+                                receiver, receiver_baton, scratch_pool));
+        }
     }
   else if (svn_wc__changelist_match(ctx->wc_ctx, local_abspath,
                                     changelist_hash, scratch_pool))
@@ -1464,7 +1503,7 @@ get_local_props(const char *path_or_url,
               }
           }
 
-      SVN_ERR(call_receiver(path_or_url, props, NULL,
+      SVN_ERR(call_receiver(path_or_url, props, iprops,
                             receiver, receiver_baton, scratch_pool));
 
     }

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_client/update.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_client/update.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_client/update.c Tue Apr 29 23:36:43 2014
@@ -383,7 +383,7 @@ update_internal(svn_revnum_t *result_rev
       SVN_ERR(svn_ra_get_repos_root2(ra_session, &new_repos_root_url, pool));
 
       /* svn_client_relocate2() will check the uuid */
-      SVN_ERR(svn_client_relocate2(anchor_abspath, anchor_url,
+      SVN_ERR(svn_client_relocate2(anchor_abspath, repos_root_url,
                                    new_repos_root_url, ignore_externals,
                                    ctx, pool));
 

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_client/util.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_client/util.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_client/util.c Tue Apr 29 23:36:43 2014
@@ -166,6 +166,13 @@ svn_client_commit_item3_dup(const svn_cl
     new_item->outgoing_prop_changes =
       svn_prop_array_dup(new_item->outgoing_prop_changes, pool);
 
+  if (new_item->session_relpath)
+    new_item->session_relpath = apr_pstrdup(pool, new_item->session_relpath);
+
+  if (new_item->moved_from_abspath)
+    new_item->moved_from_abspath = apr_pstrdup(pool,
+                                               new_item->moved_from_abspath);
+
   return new_item;
 }
 

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_delta/svndiff.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_delta/svndiff.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_delta/svndiff.c Tue Apr 29 23:36:43 2014
@@ -723,8 +723,6 @@ decode_window(svn_txdelta_window_t *wind
       svn_stringbuf_t *instout = svn_stringbuf_create_empty(pool);
       svn_stringbuf_t *ndout = svn_stringbuf_create_empty(pool);
 
-      /* these may in fact simply return references to insend */
-
       SVN_ERR(zlib_decode(insend, newlen, ndout,
                           SVN_DELTA_WINDOW_SIZE));
       SVN_ERR(zlib_decode(data, insend - data, instout,
@@ -739,7 +737,13 @@ decode_window(svn_txdelta_window_t *wind
     }
   else
     {
-      new_data->data = (const char *) insend;
+      /* Copy the data because an svn_string_t must have the invariant
+         data[len]=='\0'. */
+      char *buf = apr_palloc(pool, newlen + 1);
+
+      memcpy(buf, insend, newlen);
+      buf[newlen] = '\0';
+      new_data->data = buf;
       new_data->len = newlen;
     }
 

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs.c Tue Apr 29 23:36:43 2014
@@ -98,8 +98,11 @@ fs_serialized_init(svn_fs_t *fs, apr_poo
       SVN_ERR(svn_mutex__init(&ffsd->txn_current_lock,
                               SVN_FS_FS__USE_LOCK_MUTEX, common_pool));
 
+      /* We also need a mutex for synchronizing access to the active
+         transaction list and free transaction pointer.  This one is
+         enabled unconditionally. */
       SVN_ERR(svn_mutex__init(&ffsd->txn_list_lock,
-                              SVN_FS_FS__USE_LOCK_MUTEX, common_pool));
+                              TRUE, common_pool));
 
       key = apr_pstrdup(common_pool, key);
       status = apr_pool_userdata_set(ffsd, key, NULL, common_pool);

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs.h?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs.h Tue Apr 29 23:36:43 2014
@@ -266,7 +266,7 @@ typedef struct fs_fs_data_t
   svn_cache__t *dir_cache;
 
   /* Fulltext cache; currently only used with memcached.  Maps from
-     rep key (revision/offset) to svn_string_t. */
+     rep key (revision/offset) to svn_stringbuf_t. */
   svn_cache__t *fulltext_cache;
 
   /* Access object to the atomics namespace used by revprop caching.

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs_fs.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/fs_fs.c Tue Apr 29 23:36:43 2014
@@ -5380,11 +5380,13 @@ svn_fs_fs__get_file_delta_stream(svn_txd
       /* Read target's base rep if any. */
       SVN_ERR(create_rep_state(&rep_state, &rep_args, NULL, NULL,
                                target->data_rep, fs, pool));
-      /* If that matches source, then use this delta as is. */
+
+      /* If that matches source, then use this delta as is.
+         Note that we want an actual delta here.  E.g. a self-delta would
+         not be good enough. */
       if (rep_args->is_delta
-          && (rep_args->is_delta_vs_empty
-              || (rep_args->base_revision == source->data_rep->revision
-                  && rep_args->base_offset == source->data_rep->offset)))
+          && rep_args->base_revision == source->data_rep->revision
+          && rep_args->base_offset == source->data_rep->offset)
         {
           /* Create the delta read baton. */
           struct delta_read_baton *drb = apr_pcalloc(pool, sizeof(*drb));
@@ -11293,16 +11295,18 @@ hotcopy_body(void *baton, apr_pool_t *po
           SVN_ERR(hotcopy_remove_rev_files(dst_fs, rev,
                                            rev + max_files_per_dir,
                                            max_files_per_dir, iterpool));
-          SVN_ERR(hotcopy_remove_revprop_files(dst_fs, rev,
-                                               rev + max_files_per_dir,
-                                               max_files_per_dir, iterpool));
+          if (dst_ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
+            SVN_ERR(hotcopy_remove_revprop_files(dst_fs, rev,
+                                                 rev + max_files_per_dir,
+                                                 max_files_per_dir,
+                                                 iterpool));
         }
 
       /* Now that all revisions have moved into the pack, the original
        * rev dir can be removed. */
       SVN_ERR(remove_folder(path_rev_shard(dst_fs, rev, iterpool),
                             cancel_func, cancel_baton, iterpool));
-      if (rev > 0)
+      if (rev > 0 && dst_ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
         SVN_ERR(remove_folder(path_revprops_shard(dst_fs, rev, iterpool),
                               cancel_func, cancel_baton, iterpool));
     }

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/rep-cache.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/rep-cache.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_fs_fs/rep-cache.c Tue Apr 29 23:36:43 2014
@@ -81,8 +81,33 @@ open_rep_cache(void *baton,
   int version;
 
   /* Open (or create) the sqlite database.  It will be automatically
-     closed when fs->pool is destoyed. */
+     closed when fs->pool is destoyed.  */
   db_path = path_rep_cache_db(fs->path, pool);
+#ifndef WIN32
+  {
+    /* We want to extend the permissions that apply to the repository
+       as a whole when creating a new rep cache and not simply default
+       to umask. */
+    svn_boolean_t exists;
+
+    SVN_ERR(svn_fs_fs__exists_rep_cache(&exists, fs, pool));
+    if (!exists)
+      {
+        const char *current = svn_fs_fs__path_current(fs, pool);
+        svn_error_t *err = svn_io_file_create(db_path, "", pool);
+
+        if (err && !APR_STATUS_IS_EEXIST(err->apr_err))
+          /* A real error. */
+          return svn_error_trace(err);
+        else if (err)
+          /* Some other thread/process created the file. */
+          svn_error_clear(err);
+        else
+          /* We created the file. */
+          SVN_ERR(svn_io_copy_perms(current, db_path, pool));
+      }
+  }
+#endif
   SVN_ERR(svn_sqlite__open(&sdb, db_path,
                            svn_sqlite__mode_rwcreate, statements,
                            0, NULL,

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/commit.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/commit.c Tue Apr 29 23:36:43 2014
@@ -1638,7 +1638,7 @@ add_directory(const char *path,
   dir->added = TRUE;
   dir->base_revision = SVN_INVALID_REVNUM;
   dir->copy_revision = copyfrom_revision;
-  dir->copy_path = copyfrom_path;
+  dir->copy_path = apr_pstrdup(dir->pool, copyfrom_path);
   dir->relpath = apr_pstrdup(dir->pool, path);
   dir->name = svn_relpath_basename(dir->relpath, NULL);
   dir->changed_props = apr_hash_make(dir->pool);
@@ -1880,7 +1880,7 @@ add_file(const char *path,
   new_file->name = svn_relpath_basename(new_file->relpath, NULL);
   new_file->added = TRUE;
   new_file->base_revision = SVN_INVALID_REVNUM;
-  new_file->copy_path = copy_path;
+  new_file->copy_path = apr_pstrdup(new_file->pool, copy_path);
   new_file->copy_revision = copy_revision;
   new_file->changed_props = apr_hash_make(new_file->pool);
   new_file->removed_props = apr_hash_make(new_file->pool);

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/getlocks.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/getlocks.c Tue Apr 29 23:36:43 2014
@@ -116,6 +116,7 @@ getlocks_closed(svn_ra_serf__xml_estate_
   if (leaving_state == LOCK)
     {
       const char *path = svn_hash_gets(attrs, "path");
+      const char *token = svn_hash_gets(attrs, "token");
       svn_boolean_t save_lock = FALSE;
 
       /* Filter out unwanted paths.  Since Subversion only allows
@@ -128,6 +129,12 @@ getlocks_closed(svn_ra_serf__xml_estate_
          c) we've asked for depth=files or depth=immediates, and this
             lock is on an immediate child of our query path.
       */
+      if (! token)
+        {
+          /* A lock without a token is not a lock; just an answer that there
+             is no lock on the node. */
+          save_lock = FALSE;
+        }
       if (strcmp(lock_ctx->path, path) == 0
           || lock_ctx->requested_depth == svn_depth_infinity)
         {
@@ -154,7 +161,7 @@ getlocks_closed(svn_ra_serf__xml_estate_
              them may have not been sent, so the value will be NULL.  */
 
           lock.path = path;
-          lock.token = svn_hash_gets(attrs, "token");
+          lock.token = token;
           lock.owner = svn_hash_gets(attrs, "owner");
           lock.comment = svn_hash_gets(attrs, "comment");
 
@@ -234,6 +241,7 @@ svn_ra_serf__get_locks(svn_ra_session_t 
   svn_ra_serf__handler_t *handler;
   svn_ra_serf__xml_context_t *xmlctx;
   const char *req_url, *rel_path;
+  svn_error_t *err;
 
   req_url = svn_path_url_add_component2(session->session_url.path, path, pool);
   SVN_ERR(svn_ra_serf__get_relative_path(&rel_path, req_url, session,
@@ -260,7 +268,14 @@ svn_ra_serf__get_locks(svn_ra_session_t 
   handler->body_delegate = create_getlocks_body;
   handler->body_delegate_baton = lock_ctx;
 
-  SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
+  err = svn_ra_serf__context_run_one(handler, pool);
+  
+  /* Wrap the server generated error for an unsupported report with the
+     documented error for this ra function. */
+  if (svn_error_find_cause(err, SVN_ERR_UNSUPPORTED_FEATURE))
+    err = svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err, NULL);
+    
+  SVN_ERR(err);
 
   /* We get a 404 when a path doesn't exist in HEAD, but it might
      have existed earlier (E.g. 'svn ls http://s/svn/trunk/file@1' */

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/inherited_props.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/inherited_props.c Tue Apr 29 23:36:43 2014
@@ -41,7 +41,7 @@
 
 /* The current state of our XML parsing. */
 typedef enum iprops_state_e {
-  NONE = 0,
+  INITIAL = 0,
   IPROPS_REPORT,
   IPROPS_ITEM,
   IPROPS_PATH,
@@ -61,18 +61,12 @@ typedef struct iprops_context_t {
   /* The repository's root URL. */
   const char *repos_root_url;
 
-  /* Current CDATA values*/
-  svn_stringbuf_t *curr_path;
+  /* Current property name */
   svn_stringbuf_t *curr_propname;
-  svn_stringbuf_t *curr_propval;
-  const char *curr_prop_val_encoding;
 
   /* Current element in IPROPS. */
   svn_prop_inherited_item_t *curr_iprop;
 
-  /* Serf context completion flag for svn_ra_serf__context_run_wait() */
-  svn_boolean_t done;
-
   /* Path we are finding inherited properties for.  This is relative to
      the RA session passed to svn_ra_serf__get_inherited_props. */
   const char *path;
@@ -80,162 +74,121 @@ typedef struct iprops_context_t {
   svn_revnum_t revision;
 } iprops_context_t;
 
+#define S_ SVN_XML_NAMESPACE
+static const svn_ra_serf__xml_transition_t iprops_table[] = {
+  { INITIAL, S_, SVN_DAV__INHERITED_PROPS_REPORT, IPROPS_REPORT,
+    FALSE, { NULL }, FALSE },
+
+  { IPROPS_REPORT, S_, SVN_DAV__IPROP_ITEM, IPROPS_ITEM,
+    FALSE, { NULL }, TRUE },
+
+  { IPROPS_ITEM, S_, SVN_DAV__IPROP_PATH, IPROPS_PATH,
+    TRUE, { NULL }, TRUE },
+
+  { IPROPS_ITEM, S_, SVN_DAV__IPROP_PROPNAME, IPROPS_PROPNAME,
+    TRUE, { NULL }, TRUE },
+
+  { IPROPS_ITEM, S_, SVN_DAV__IPROP_PROPVAL, IPROPS_PROPVAL,
+    TRUE, { "?V:encoding", NULL }, TRUE },
+
+  { 0 }
+};
+
+/* Conforms to svn_ra_serf__xml_opened_t */
 static svn_error_t *
-start_element(svn_ra_serf__xml_parser_t *parser,
-              svn_ra_serf__dav_props_t name,
-              const char **attrs,
+iprops_opened(svn_ra_serf__xml_estate_t *xes,
+              void *baton,
+              int entered_state,
+              const svn_ra_serf__dav_props_t *tag,
               apr_pool_t *scratch_pool)
 {
-  iprops_context_t *iprops_ctx = parser->user_data;
-  iprops_state_e state;
+  iprops_context_t *iprops_ctx = baton;
 
-  state = parser->state->current_state;
-  if (state == NONE
-      && strcmp(name.name, SVN_DAV__INHERITED_PROPS_REPORT) == 0)
+  if (entered_state == IPROPS_ITEM)
     {
-      svn_ra_serf__xml_push_state(parser, IPROPS_REPORT);
-    }
-  else if (state == IPROPS_REPORT &&
-           strcmp(name.name, SVN_DAV__IPROP_ITEM) == 0)
-    {
-      svn_stringbuf_setempty(iprops_ctx->curr_path);
       svn_stringbuf_setempty(iprops_ctx->curr_propname);
-      svn_stringbuf_setempty(iprops_ctx->curr_propval);
-      iprops_ctx->curr_prop_val_encoding = NULL;
-      iprops_ctx->curr_iprop = NULL;
-      svn_ra_serf__xml_push_state(parser, IPROPS_ITEM);
-    }
-  else if (state == IPROPS_ITEM &&
-           strcmp(name.name, SVN_DAV__IPROP_PROPVAL) == 0)
-    {
-      const char *prop_val_encoding = svn_xml_get_attr_value("encoding",
-                                                             attrs);
-      iprops_ctx->curr_prop_val_encoding = apr_pstrdup(iprops_ctx->pool,
-                                                       prop_val_encoding);
-      svn_ra_serf__xml_push_state(parser, IPROPS_PROPVAL);
-    }
-  else if (state == IPROPS_ITEM &&
-           strcmp(name.name, SVN_DAV__IPROP_PATH) == 0)
-    {
-      svn_ra_serf__xml_push_state(parser, IPROPS_PATH);
-    }
-  else if (state == IPROPS_ITEM &&
-           strcmp(name.name, SVN_DAV__IPROP_PROPNAME) == 0)
-    {
-      svn_ra_serf__xml_push_state(parser, IPROPS_PROPNAME);
-    }
-  else if (state == IPROPS_ITEM &&
-           strcmp(name.name, SVN_DAV__IPROP_PROPVAL) == 0)
-    {
-      svn_ra_serf__xml_push_state(parser, IPROPS_PROPVAL);
-    }
 
+      iprops_ctx->curr_iprop = apr_pcalloc(iprops_ctx->pool,
+                                           sizeof(*iprops_ctx->curr_iprop));
+
+      iprops_ctx->curr_iprop->prop_hash = apr_hash_make(iprops_ctx->pool);
+    }
   return SVN_NO_ERROR;
 }
 
+/* Conforms to svn_ra_serf__xml_closed_t  */
 static svn_error_t *
-end_element(svn_ra_serf__xml_parser_t *parser,
-            svn_ra_serf__dav_props_t name,
-            apr_pool_t *scratch_pool)
+iprops_closed(svn_ra_serf__xml_estate_t *xes,
+              void *baton,
+              int leaving_state,
+              const svn_string_t *cdata,
+              apr_hash_t *attrs,
+              apr_pool_t *scratch_pool)
 {
-  iprops_context_t *iprops_ctx = parser->user_data;
-  iprops_state_e state;
-
-  state = parser->state->current_state;
+  iprops_context_t *iprops_ctx = baton;
 
-    if (state == IPROPS_REPORT &&
-      strcmp(name.name, SVN_DAV__INHERITED_PROPS_REPORT) == 0)
+  if (leaving_state == IPROPS_ITEM)
     {
-      svn_ra_serf__xml_pop_state(parser);
+      APR_ARRAY_PUSH(iprops_ctx->iprops, svn_prop_inherited_item_t *) =
+        iprops_ctx->curr_iprop;
+
+      iprops_ctx->curr_iprop = NULL;
     }
-  else if (state == IPROPS_PATH
-           && strcmp(name.name, SVN_DAV__IPROP_PATH) == 0)
+  else if (leaving_state == IPROPS_PATH)
     {
-      iprops_ctx->curr_iprop = apr_palloc(
-        iprops_ctx->pool, sizeof(svn_prop_inherited_item_t));
+      /* Every <iprop-item> has a single <iprop-path> */
+      if (iprops_ctx->curr_iprop->path_or_url)
+        return svn_error_create(SVN_ERR_XML_MALFORMED, NULL, NULL);
 
       iprops_ctx->curr_iprop->path_or_url =
         svn_path_url_add_component2(iprops_ctx->repos_root_url,
-                                    iprops_ctx->curr_path->data,
+                                    cdata->data,
                                     iprops_ctx->pool);
-      iprops_ctx->curr_iprop->prop_hash = apr_hash_make(iprops_ctx->pool);
-      svn_ra_serf__xml_pop_state(parser);
     }
-  else if (state == IPROPS_PROPVAL
-           && strcmp(name.name, SVN_DAV__IPROP_PROPVAL) == 0)
+  else if (leaving_state == IPROPS_PROPNAME)
     {
-      const svn_string_t *prop_val;
+      if (iprops_ctx->curr_propname->len)
+        return svn_error_create(SVN_ERR_XML_MALFORMED, NULL, NULL);
 
-      if (iprops_ctx->curr_prop_val_encoding)
-        {
-          svn_string_t encoded_prop_val;
+      /* Store propname for value */
+      svn_stringbuf_set(iprops_ctx->curr_propname, cdata->data);
+    }
+  else if (leaving_state == IPROPS_PROPVAL)
+    {
+      const char *encoding;
+      const svn_string_t *val_str;
+
+      if (! iprops_ctx->curr_propname->len)
+        return svn_error_create(SVN_ERR_XML_MALFORMED, NULL, NULL);
+
+      encoding = svn_hash_gets(attrs, "V:encoding");
 
-          if (strcmp(iprops_ctx->curr_prop_val_encoding, "base64") != 0)
-            return svn_error_create(SVN_ERR_XML_MALFORMED, NULL, NULL);
+      if (encoding)
+        {
+          if (strcmp(encoding, "base64") != 0)
+            return svn_error_createf(SVN_ERR_XML_MALFORMED,
+                                     NULL,
+                                     _("Got unrecognized encoding '%s'"),
+                                     encoding);
 
-          encoded_prop_val.data = iprops_ctx->curr_propval->data;
-          encoded_prop_val.len = iprops_ctx->curr_propval->len;
-          prop_val = svn_base64_decode_string(&encoded_prop_val,
-                                              iprops_ctx->pool);
+          /* Decode into the right pool.  */
+          val_str = svn_base64_decode_string(cdata, iprops_ctx->pool);
         }
       else
         {
-          prop_val = svn_string_create_from_buf(iprops_ctx->curr_propval,
-                                                iprops_ctx->pool);
+          /* Copy into the right pool.  */
+          val_str = svn_string_dup(cdata, iprops_ctx->pool);
         }
 
       svn_hash_sets(iprops_ctx->curr_iprop->prop_hash,
                     apr_pstrdup(iprops_ctx->pool,
                                 iprops_ctx->curr_propname->data),
-                    prop_val);
-      /* Clear current propname and propval in the event there are
-         multiple properties on the current path. */
+                    val_str);
+      /* Clear current propname. */
       svn_stringbuf_setempty(iprops_ctx->curr_propname);
-      svn_stringbuf_setempty(iprops_ctx->curr_propval);
-      svn_ra_serf__xml_pop_state(parser);
-    }
-  else if (state == IPROPS_PROPNAME
-           && strcmp(name.name, SVN_DAV__IPROP_PROPNAME) == 0)
-    {
-      svn_ra_serf__xml_pop_state(parser);
-    }
-  else if (state == IPROPS_ITEM
-           && strcmp(name.name, SVN_DAV__IPROP_ITEM) == 0)
-    {
-      APR_ARRAY_PUSH(iprops_ctx->iprops, svn_prop_inherited_item_t *) =
-        iprops_ctx->curr_iprop;
-      svn_ra_serf__xml_pop_state(parser);
-    }
-  return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
-cdata_handler(svn_ra_serf__xml_parser_t *parser,
-              const char *data,
-              apr_size_t len,
-              apr_pool_t *scratch_pool)
-{
-  iprops_context_t *iprops_ctx = parser->user_data;
-  iprops_state_e state = parser->state->current_state;
-
-  switch (state)
-    {
-    case IPROPS_PATH:
-      svn_stringbuf_appendbytes(iprops_ctx->curr_path, data, len);
-      break;
-
-    case IPROPS_PROPNAME:
-      svn_stringbuf_appendbytes(iprops_ctx->curr_propname, data, len);
-      break;
-
-    case IPROPS_PROPVAL:
-      svn_stringbuf_appendbytes(iprops_ctx->curr_propval, data, len);
-      break;
-
-    default:
-      break;
     }
+  else
+    SVN_ERR_MALFUNCTION(); /* Invalid transition table */
 
   return SVN_NO_ERROR;
 }
@@ -281,7 +234,7 @@ svn_ra_serf__get_inherited_props(svn_ra_
   iprops_context_t *iprops_ctx;
   svn_ra_serf__session_t *session = ra_session->priv;
   svn_ra_serf__handler_t *handler;
-  svn_ra_serf__xml_parser_t *parser_ctx;
+  svn_ra_serf__xml_context_t *xmlctx;
   const char *req_url;
 
   SVN_ERR(svn_ra_serf__get_stable_url(&req_url,
@@ -295,19 +248,20 @@ svn_ra_serf__get_inherited_props(svn_ra_
   SVN_ERR_ASSERT(session->repos_root_str);
 
   iprops_ctx = apr_pcalloc(scratch_pool, sizeof(*iprops_ctx));
-  iprops_ctx->done = FALSE;
   iprops_ctx->repos_root_url = session->repos_root_str;
   iprops_ctx->pool = result_pool;
-  iprops_ctx->curr_path = svn_stringbuf_create_empty(scratch_pool);
   iprops_ctx->curr_propname = svn_stringbuf_create_empty(scratch_pool);
-  iprops_ctx->curr_propval = svn_stringbuf_create_empty(scratch_pool);
   iprops_ctx->curr_iprop = NULL;
   iprops_ctx->iprops = apr_array_make(result_pool, 1,
                                        sizeof(svn_prop_inherited_item_t *));
   iprops_ctx->path = path;
   iprops_ctx->revision = revision;
 
-  handler = apr_pcalloc(scratch_pool, sizeof(*handler));
+  xmlctx = svn_ra_serf__xml_context_create(iprops_table,
+                                           iprops_opened, iprops_closed, NULL,
+                                           iprops_ctx,
+                                           scratch_pool);
+  handler = svn_ra_serf__create_expat_handler(xmlctx, scratch_pool);
 
   handler->method = "REPORT";
   handler->path = req_url;
@@ -318,18 +272,6 @@ svn_ra_serf__get_inherited_props(svn_ra_
   handler->body_type = "text/xml";
   handler->handler_pool = scratch_pool;
 
-  parser_ctx = apr_pcalloc(scratch_pool, sizeof(*parser_ctx));
-
-  parser_ctx->pool = scratch_pool;
-  parser_ctx->user_data = iprops_ctx;
-  parser_ctx->start = start_element;
-  parser_ctx->end = end_element;
-  parser_ctx->cdata = cdata_handler;
-  parser_ctx->done = &iprops_ctx->done;
-
-  handler->response_handler = svn_ra_serf__handle_xml_parser;
-  handler->response_baton = parser_ctx;
-
   err = svn_ra_serf__context_run_one(handler, scratch_pool);
   SVN_ERR(svn_error_compose_create(
                     svn_ra_serf__error_on_status(handler->sline,
@@ -337,8 +279,7 @@ svn_ra_serf__get_inherited_props(svn_ra_
                                                  handler->location),
                     err));
 
-  if (iprops_ctx->done)
-    *iprops = iprops_ctx->iprops;
+  *iprops = iprops_ctx->iprops;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/locks.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/locks.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/locks.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/locks.c Tue Apr 29 23:36:43 2014
@@ -156,11 +156,20 @@ locks_closed(svn_ra_serf__xml_estate_t *
 
   if (leaving_state == TIMEOUT)
     {
-      if (strcmp(cdata->data, "Infinite") == 0)
+      if (strcasecmp(cdata->data, "Infinite") == 0)
         lock_ctx->lock->expiration_date = 0;
+      else if (strncasecmp(cdata->data, "Second-", 7) == 0)
+        {
+          unsigned n;
+          SVN_ERR(svn_cstring_atoui(&n, cdata->data+7));
+
+          lock_ctx->lock->expiration_date = apr_time_now() +
+                                            apr_time_from_sec(n);
+        }
       else
-        SVN_ERR(svn_time_from_cstring(&lock_ctx->lock->creation_date,
-                                      cdata->data, lock_ctx->pool));
+        return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                 _("Invalid LOCK timeout value '%s'"),
+                                 cdata->data);
     }
   else if (leaving_state == HREF)
     {
@@ -362,29 +371,30 @@ svn_error_t *
 svn_ra_serf__get_lock(svn_ra_session_t *ra_session,
                       svn_lock_t **lock,
                       const char *path,
-                      apr_pool_t *pool)
+                      apr_pool_t *result_pool)
 {
   svn_ra_serf__session_t *session = ra_session->priv;
   svn_ra_serf__handler_t *handler;
   svn_ra_serf__xml_context_t *xmlctx;
+  apr_pool_t *scratch_pool = svn_pool_create(result_pool);
   lock_info_t *lock_ctx;
   const char *req_url;
   svn_error_t *err;
 
-  req_url = svn_path_url_add_component2(session->session_url.path, path, pool);
-
-  lock_ctx = apr_pcalloc(pool, sizeof(*lock_ctx));
+  req_url = svn_path_url_add_component2(session->session_url.path, path,
+                                        scratch_pool);
 
-  lock_ctx->pool = pool;
+  lock_ctx = apr_pcalloc(scratch_pool, sizeof(*lock_ctx));
+  lock_ctx->pool = result_pool;
   lock_ctx->path = req_url;
-  lock_ctx->lock = svn_lock_create(pool);
-  lock_ctx->lock->path = apr_pstrdup(pool, path); /* be sure  */
+  lock_ctx->lock = svn_lock_create(result_pool);
+  lock_ctx->lock->path = apr_pstrdup(result_pool, path);
 
   xmlctx = svn_ra_serf__xml_context_create(locks_ttable,
                                            NULL, locks_closed, NULL,
                                            lock_ctx,
-                                           pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, pool);
+                                           scratch_pool);
+  handler = svn_ra_serf__create_expat_handler(xmlctx, scratch_pool);
 
   handler->method = "PROPFIND";
   handler->path = req_url;
@@ -405,7 +415,7 @@ svn_ra_serf__get_lock(svn_ra_session_t *
 
   lock_ctx->handler = handler;
 
-  err = svn_ra_serf__context_run_one(handler, pool);
+  err = svn_ra_serf__context_run_one(handler, scratch_pool);
   err = determine_error(handler, err);
 
   if (handler->sline.code == 404)
@@ -420,7 +430,12 @@ svn_ra_serf__get_lock(svn_ra_session_t *
                               _("Server does not support locking features"));
     }
 
-  *lock = lock_ctx->lock;
+  if (lock_ctx->lock && lock_ctx->lock->token)
+    *lock = lock_ctx->lock;
+  else
+    *lock = NULL;
+
+  svn_pool_destroy(scratch_pool);
 
   return SVN_NO_ERROR;
 }
@@ -574,7 +589,7 @@ svn_ra_serf__unlock(svn_ra_session_t *ra
         {
           SVN_ERR(svn_ra_serf__get_lock(ra_session, &existing_lock, path,
                                         iterpool));
-          token = existing_lock->token;
+          token = existing_lock ? existing_lock->token : NULL;
           if (!token)
             {
               err = svn_error_createf(SVN_ERR_RA_NOT_LOCKED, NULL,

Propchange: subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/locks.c
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Apr 29 23:36:43 2014
@@ -0,0 +1,116 @@
+/subversion/branches/1.5.x-r30215/subversion/libsvn_ra_serf/locks.c:870312
+/subversion/branches/1.7.x-fs-verify/subversion/libsvn_ra_serf/locks.c:1146708,1161180
+/subversion/branches/1.8.x/subversion/libsvn_ra_serf/locks.c:1536934-1591142
+/subversion/branches/1.8.x-apr-0.9/subversion/libsvn_ra_serf/locks.c:1585493-1589570
+/subversion/branches/1.8.x-busted-proxy/subversion/libsvn_ra_serf/locks.c:1499222-1502434
+/subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/locks.c:1507591-1512557
+/subversion/branches/1.8.x-issue4437/subversion/libsvn_ra_serf/locks.c:1567249-1591140
+/subversion/branches/1.8.x-issue4448/subversion/libsvn_ra_serf/locks.c:1540420-1541802
+/subversion/branches/1.8.x-issue4480/subversion/libsvn_ra_serf/locks.c:1588773-1591136
+/subversion/branches/1.8.x-javahl-exception-crash/subversion/libsvn_ra_serf/locks.c:1586424-1588151
+/subversion/branches/1.8.x-libsvnjavahl-version/subversion/libsvn_ra_serf/locks.c:1483910-1485054
+/subversion/branches/1.8.x-openssl-dirs/subversion/libsvn_ra_serf/locks.c:1535137-1540436
+/subversion/branches/1.8.x-r1477876/subversion/libsvn_ra_serf/locks.c:1477981-1487716
+/subversion/branches/1.8.x-r1481625/subversion/libsvn_ra_serf/locks.c:1481637-1482135
+/subversion/branches/1.8.x-r1495063/subversion/libsvn_ra_serf/locks.c:1495804-1501074
+/subversion/branches/1.8.x-r1497310-partial/subversion/libsvn_ra_serf/locks.c:1497500-1501063
+/subversion/branches/1.8.x-r1502267/subversion/libsvn_ra_serf/locks.c:1502268-1515998
+/subversion/branches/1.8.x-r1507044/subversion/libsvn_ra_serf/locks.c:1507282-1511571
+/subversion/branches/1.8.x-r1513879/subversion/libsvn_ra_serf/locks.c:1514699-1516021
+/subversion/branches/1.8.x-r1537147/subversion/libsvn_ra_serf/locks.c:1537201-1537216
+/subversion/branches/1.8.x-r1537193/subversion/libsvn_ra_serf/locks.c:1537217-1541815
+/subversion/branches/1.8.x-r1541790/subversion/libsvn_ra_serf/locks.c:1541791-1542075
+/subversion/branches/1.8.x-r1554978/subversion/libsvn_ra_serf/locks.c:1555500-1565076
+/subversion/branches/1.8.x-r1564215/subversion/libsvn_ra_serf/locks.c:1564281-1564620
+/subversion/branches/1.8.x-r1567286/subversion/libsvn_ra_serf/locks.c:1567364-1567731
+/subversion/branches/1.8.x-r1567985/subversion/libsvn_ra_serf/locks.c:1568016-1568055
+/subversion/branches/1.8.x-r1574868/subversion/libsvn_ra_serf/locks.c:1575329-1579873
+/subversion/branches/1.8.x-r1577151/subversion/libsvn_ra_serf/locks.c:1589064-1589574
+/subversion/branches/1.8.x-r1577812/subversion/libsvn_ra_serf/locks.c:1577814-1588145
+/subversion/branches/1.8.x-r1578311/subversion/libsvn_ra_serf/locks.c:1578312-1589576
+/subversion/branches/1.8.x-r1578853/subversion/libsvn_ra_serf/locks.c:1578879-1581682
+/subversion/branches/1.8.x-r1579588/subversion/libsvn_ra_serf/locks.c:1579589-1591112
+/subversion/branches/1.8.x-r1580626/subversion/libsvn_ra_serf/locks.c:1580631,1580652,1580661,1581435,1588382-1591134
+/subversion/branches/1.8.x-r1581305/subversion/libsvn_ra_serf/locks.c:1581320-1582587
+/subversion/branches/1.8.x-r1584342/subversion/libsvn_ra_serf/locks.c:1584350-1589572
+/subversion/branches/1.8.x-r175-daemonize/subversion/libsvn_ra_serf/locks.c:1515866-1516020
+/subversion/branches/1.8.x-serf-1.3+-windows/subversion/libsvn_ra_serf/locks.c:1517122-1533873
+/subversion/branches/1.8.x-serf-no-lock-support/subversion/libsvn_ra_serf/locks.c:1584583-1591109
+/subversion/branches/1.8.x-svn_fs_info-removal/subversion/libsvn_ra_serf/locks.c:1467420-1468159
+/subversion/branches/1.8.x-svnsync-serf-memory/subversion/libsvn_ra_serf/locks.c:1515248-1515701
+/subversion/branches/1.8.x-synvsync-serf-memory/subversion/libsvn_ra_serf/locks.c:1515247
+/subversion/branches/1.8.x-tristate-chunked-request/subversion/libsvn_ra_serf/locks.c:1502435-1503894
+/subversion/branches/10Gb/subversion/libsvn_ra_serf/locks.c:1388102,1388163-1388190,1388195,1388202,1388205,1388211,1388276,1388362,1388375,1388394,1388636,1388639-1388640,1388643-1388644,1388654,1388720,1388789,1388795,1388801,1388805,1388807,1388810,1388816,1389044,1389276,1389289,1389662,1389867,1390017,1390209,1390216,1390407,1390409,1390414,1390419,1390955
+/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/locks.c:965046-1000689
+/subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/locks.c:1384106-1401643
+/subversion/branches/bdb-reverse-deltas/subversion/libsvn_ra_serf/locks.c:872050-872529
+/subversion/branches/diff-callbacks3/subversion/libsvn_ra_serf/locks.c:870059-870761
+/subversion/branches/diff-optimizations/subversion/libsvn_ra_serf/locks.c:1031270-1037352
+/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/locks.c:1037353-1067789
+/subversion/branches/dont-save-plaintext-passwords-by-default/subversion/libsvn_ra_serf/locks.c:870728-871118
+/subversion/branches/double-delete/subversion/libsvn_ra_serf/locks.c:870511-872970
+/subversion/branches/ev2-export/subversion/libsvn_ra_serf/locks.c:1325914,1332738,1413107
+/subversion/branches/explore-wc/subversion/libsvn_ra_serf/locks.c:875486,875493,875497,875507,875511,875514,875559,875580-875581,875584,875587,875611,875627,875647,875667-875668,875711-875712,875733-875734,875736,875744-875748,875751,875758,875782,875795-875796,875830,875836,875838,875842,875852,875855,875864,875870,875873,875880,875885-875888,875890,875897-875898,875905,875907-875909,875935,875943-875944,875946,875979,875982-875983,875985-875986,875990,875997
+/subversion/branches/file-externals/subversion/libsvn_ra_serf/locks.c:871779-873302
+/subversion/branches/fs-rep-sharing/subversion/libsvn_ra_serf/locks.c:869036-873803
+/subversion/branches/fsfs-pack/subversion/libsvn_ra_serf/locks.c:873717-874575
+/subversion/branches/gnome-keyring/subversion/libsvn_ra_serf/locks.c:870558-871410
+/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/locks.c:1005036-1150766
+/subversion/branches/http-protocol-v2/subversion/libsvn_ra_serf/locks.c:874395-876041
+/subversion/branches/in-memory-cache/subversion/libsvn_ra_serf/locks.c:869829-871452
+/subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/locks.c:1414342-1424779
+/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/locks.c:1297080-1395089
+/subversion/branches/integrate-cache-item-serialization/subversion/libsvn_ra_serf/locks.c:1068724-1068739
+/subversion/branches/integrate-cache-membuffer/subversion/libsvn_ra_serf/locks.c:998649-998852
+/subversion/branches/integrate-compression-level/subversion/libsvn_ra_serf/locks.c:1068651-1072287
+/subversion/branches/integrate-io-improvements/subversion/libsvn_ra_serf/locks.c:1068684-1072297
+/subversion/branches/integrate-is-cachable/subversion/libsvn_ra_serf/locks.c:1072568-1074082
+/subversion/branches/integrate-partial-getter/subversion/libsvn_ra_serf/locks.c:1072558-1076552
+/subversion/branches/integrate-readline-speedup/subversion/libsvn_ra_serf/locks.c:1072553-1072555
+/subversion/branches/integrate-stream-api-extensions/subversion/libsvn_ra_serf/locks.c:1068695-1072516
+/subversion/branches/integrate-string-improvements/subversion/libsvn_ra_serf/locks.c:1068251-1190617
+/subversion/branches/integrate-txdelta-caching/subversion/libsvn_ra_serf/locks.c:1072541-1078213
+/subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/locks.c:965496-984198
+/subversion/branches/issue-2843-dev/subversion/libsvn_ra_serf/locks.c:871432-874179
+/subversion/branches/issue-3000/subversion/libsvn_ra_serf/locks.c:871713,871716-871719,871721-871726,871728,871734
+/subversion/branches/issue-3067-deleted-subtrees/subversion/libsvn_ra_serf/locks.c:873375-874084
+/subversion/branches/issue-3148-dev/subversion/libsvn_ra_serf/locks.c:875193-875204
+/subversion/branches/issue-3220-dev/subversion/libsvn_ra_serf/locks.c:872210-872226
+/subversion/branches/issue-3242-dev/subversion/libsvn_ra_serf/locks.c:879653-896436
+/subversion/branches/issue-3334-dirs/subversion/libsvn_ra_serf/locks.c:875156-875867
+/subversion/branches/issue-3975/subversion/libsvn_ra_serf/locks.c:1152931-1160746
+/subversion/branches/issue-4116-dev/subversion/libsvn_ra_serf/locks.c:1424719-1425040
+/subversion/branches/issue-4194-dev/subversion/libsvn_ra_serf/locks.c:1410507-1414880
+/subversion/branches/javahl-ra/subversion/libsvn_ra_serf/locks.c:1342682,1344977
+/subversion/branches/kwallet/subversion/libsvn_ra_serf/locks.c:870785-871314
+/subversion/branches/log-g-performance/subversion/libsvn_ra_serf/locks.c:870941-871032
+/subversion/branches/merge-skips-obstructions/subversion/libsvn_ra_serf/locks.c:874525-874615
+/subversion/branches/multi-layer-moves/subversion/libsvn_ra_serf/locks.c:1239019-1300930
+/subversion/branches/nfc-nfd-aware-client/subversion/libsvn_ra_serf/locks.c:870276,870376
+/subversion/branches/node_pool/subversion/libsvn_ra_serf/locks.c:1304828-1305388
+/subversion/branches/performance/subversion/libsvn_ra_serf/locks.c:979193,980118,981087,981090,981189,981194,981287,981684,981827,982043,982355,983398,983406,983430,983474,983488,983490,983760,983764,983766,983770,984927,984973,984984,985014,985037,985046,985472,985477,985482,985487-985488,985493,985497,985500,985514,985601,985603,985606,985669,985673,985695,985697,986453,986465,986485,986491-986492,986517,986521,986605,986608,986817,986832,987865,987868-987869,987872,987886-987888,987893,988319,988898,990330,990533,990535-990537,990541,990568,990572,990574-990575,990600,990759,992899,992904,992911,993127,993141,994956,995478,995507,995603,998012,998858,999098,1001413,1001417,1004291,1022668,1022670,1022676,1022715,1022719,1025660,1025672,1027193,1027203,1027206,1027214,1027227,1028077,1028092,1028094,1028104,1028107,1028111,1028354,1029038,1029042-1029043,1029054-1029055,1029062-1029063,1029078,1029080,1029090,1029092-1029093,1029111,1029151,1029158,1029229-1029230,1029232,1029335-
 1029336,1029339-1029340,1029342,1029344,1030763,1030827,1031203,1031235,1032285,1032333,1033040,1033057,1033294,1035869,1035882,1039511,1043705,1053735,1056015,1066452,1067683,1067697-1078365
+/subversion/branches/py-tests-as-modules/subversion/libsvn_ra_serf/locks.c:956579-1033052
+/subversion/branches/ra_serf-digest-authn/subversion/libsvn_ra_serf/locks.c:875693-876404
+/subversion/branches/reintegrate-improvements/subversion/libsvn_ra_serf/locks.c:873853-874164
+/subversion/branches/revprop-cache/subversion/libsvn_ra_serf/locks.c:1298521-1326293
+/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/locks.c:1143907,1143971,1143997,1144017,1144499,1144568,1146145
+/subversion/branches/subtree-mergeinfo/subversion/libsvn_ra_serf/locks.c:876734-878766
+/subversion/branches/svn-mergeinfo-enhancements/subversion/libsvn_ra_serf/locks.c:870119-870195,870197-870288
+/subversion/branches/svn-patch-improvements/subversion/libsvn_ra_serf/locks.c:918519-934609
+/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/locks.c:1141683-1182099
+/subversion/branches/svnpatch-diff/subversion/libsvn_ra_serf/locks.c:865738-876477
+/subversion/branches/svnraisetc/subversion/libsvn_ra_serf/locks.c:874709-875149
+/subversion/branches/svnserve-logging/subversion/libsvn_ra_serf/locks.c:869828-870893
+/subversion/branches/tc-issue-3334/subversion/libsvn_ra_serf/locks.c:874697-874773
+/subversion/branches/tc-merge-notify/subversion/libsvn_ra_serf/locks.c:874017-874062
+/subversion/branches/tc-resolve/subversion/libsvn_ra_serf/locks.c:874191-874239
+/subversion/branches/tc_url_rev/subversion/libsvn_ra_serf/locks.c:874351-874483
+/subversion/branches/tree-conflicts/subversion/libsvn_ra_serf/locks.c:868291-873154
+/subversion/branches/tree-conflicts-notify/subversion/libsvn_ra_serf/locks.c:873926-874008
+/subversion/branches/tristate-chunked-request/subversion/libsvn_ra_serf/locks.c:1502401,1502673
+/subversion/branches/tweak-build-take-two/subversion/libsvn_ra_serf/locks.c:1424288-1425049,1425051-1425613
+/subversion/branches/uris-as-urls/subversion/libsvn_ra_serf/locks.c:1060426-1064427
+/subversion/branches/verify-at-commit/subversion/libsvn_ra_serf/locks.c:1462039-1462408
+/subversion/branches/wc-collate-path/subversion/libsvn_ra_serf/locks.c:1407642
+/subversion/trunk/subversion/libsvn_ra_serf/get_lock.c:1578311
+/subversion/trunk/subversion/libsvn_ra_serf/locks.c:1467440,1467450,1467481,1467587,1467597,1467668,1467675,1467803,1467807,1467951,1468109,1468116,1468151,1468347,1468395,1468439,1468487,1468565-1468566,1468980,1469248,1469363,1469478,1469489,1469512-1469513,1469550,1469556,1469645,1469674,1469833,1469862,1469866,1469871,1469994,1470031,1470037,1470221,1470238,1470246,1470248,1470537,1470650,1470738,1470781,1470898,1470904,1470908,1470913,1470936,1470993-1470994,1471028-1471029,1471107,1471153,1471302,1471443,1471490,1471744,1475704,1475724,1475772,1475963,1476092,1476155,1476181,1476193,1476254,1476359,1476366,1476607,1477294,1477359,1477729-1477730,1477876,1477891,1478001,1478220-1478221,1478465,1478617,1478897,1478951,1478987,1478998,1479320-1479321,1479323,1479326,1479329,1479540,1479563,1479605,1479896,1480054,1480077,1480080,1480082,1480119,1480149,1480344,1480412,1480426,1480442,1480616,1480641-1480642,1480664,1480669,1480681,1480723,1480738,1480765,1481010,1481418,1481594,1
 481596,1481625,1481627-1481628,1481631-1481632,1481772,1481782,1481800,1481813,1481847,1481944,1481981,1482282,1482327,1482338,1482350,1482354,1482436,1482479,1482524,1482528,1482536,1482554,1482558,1482592,1482724,1482759,1482779,1482829,1482969-1482970,1482973,1483015,1483077,1483101,1483116,1483125,1483391,1483397,1483555,1483557,1483575,1483580,1483781,1483927,1483939,1483947,1483964-1483965,1483968,1483972,1483975,1483977,1483984,1484006,1484016-1484017,1484023,1484755,1485018,1485127,1485350,1485413,1485427,1485447,1485449,1485497,1485501,1485650,1486072,1486457,1486572,1486809,1486915,1486931,1487083,1487094,1488183,1488267,1488294,1488425,1488639,1488693,1488878,1489114,1489116-1489117,1489203,1489339,1489935,1490045,1490326,1490679,1490684,1490721,1491432,1491499,1491707,1491739,1491755-1491756,1491762,1491770,1491816,1491868,1492005,1492020,1492145,1492148,1492152,1492164,1492264,1492295,1493102,1493424,1493475,1493703,1493720,1493951,1494089,1494171,1494223,1494287,149429
 8,1494318,1494342,1494657,1494913,1494967,1495063,1495104,1495204,1495209,1495214,1495256,1495329,1495428,1495432,1495446,1495597,1495805,1495850,1495978,1496007,1496110-1496111,1496127,1496132,1496151,1496470,1496938,1496957,1497002,1497318-1497319,1497551,1497614,1497804,1497975,1497980,1498000,1498012,1498136,1498449,1498455-1498456,1498483-1498484,1498486,1498550,1498564,1498851,1498885,1498997,1499034,1499044,1499064,1499095-1499096,1499100,1499403,1499423,1499438,1499447,1499460,1499470,1499483,1499492,1499496,1499498,1499595,1499727,1500074,1500175,1500226,1500680,1500695,1500762,1500799,1500801-1500802,1500904,1500928,1501199,1501207,1501656,1501702,1502097,1502267,1502577,1502777,1502811,1502901,1502909,1502952,1503009-1503010,1503058,1503061,1503211,1503318,1503528,1503884,1504192,1504505,1506040-1506041,1506047,1506058,1506966,1507044,1507382,1507567,1507589,1507889,1507891,1508438,1509186,1509196,1511057,1511272,1511353,1511603,1512067,1512119,1512195,1512300-1512301,151
 2432,1512471-1512472,1513119,1513122,1513156,1513463,1513472,1513874,1513879-1513880,1513943,1514295,1514315,1514318,1514356,1514628,1514763,1514785,1514804,1515119,1515141,1515201,1515225,1515237,1515343,1515366,1515516,1515534,1515721,1515992,1515997,1516023-1516024,1516049,1516051-1516053,1516071,1516271,1516429,1516556,1516565,1516567,1516806,1518184,1518942,1519615,1519617,1519733,1519816,1519823,1519955,1520065,1520529,1520532,1520539,1520745,1522892,1523666,1524869,1525902,1526439,1526655,1527103,1527105,1530763,1530768,1530872,1530922,1530967,1531002,1531004,1531014,1531938,1532023,1532098,1532316,1534102,1534149,1534158,1534713,1534737,1534860,1535115,1535161,1535532,1535610,1535676,1536350,1536383,1536464,1536488,1536537,1536914,1536931,1537018,1537147,1537190,1537193,1537221,1537263,1537360,1537415,1537555,1537700,1538516-1538517,1538519,1538574,1538581,1540044,1540417,1540752,1541432,1541635,1541638,1541705,1541790,1542042,1542069,1542071,1542119,1542129,1542138,1542146,
 1542151,1542765,1542767,1542774,1543145,1543187,1543413,1543961,1544295,1544316,1544878,1544895,1545302,1545835,1545845,1547252,1547774,1547866,1547873,1548097,1548105,1548170,1548486,1548673,1549858,1549874,1550803,1551524,1551579,1553101,1553105,1553113,1553376-1553377,1554978,1555403,1555499,1557320,1557522,1559009,1560690,1560701,1563110,1564292,1564966,1564969,1565085,1567064,1567109,1567134,1567204,1567228,1567286,1567392,1567492,1567494,1567740,1567752,1567985,1568070,1568872,1568953,1568955,1570642,1571214,1571747,1571787,1571795,1572102,1572200,1573088,1573106,1573209,1574868,1575270,1575284,1575525,1575915,1577151,1577200,1577294,1577739,1577755,1577812-1577813,1578273,1578311,1578326,1578670,1578820,1578853,1578875,1579274,1579429,1579588,1579684,1580626,1580650,1580832,1580867,1580872,1581296,1581305,1581315,1581430,1581810,1583580,1583977,1584342,1584576,1584592,1584745,1585686,1586052,1586255,1586352,1586467,1587511,1587946,1587968,1588772,1588778

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/log.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/log.c Tue Apr 29 23:36:43 2014
@@ -571,7 +571,7 @@ svn_ra_serf__get_log(svn_ra_session_t *r
   /* At this point, we may have a deleted file.  So, we'll match ra_neon's
    * behavior and use the larger of start or end as our 'peg' rev.
    */
-  peg_rev = (start > end) ? start : end;
+  peg_rev = (start == SVN_INVALID_REVNUM || start > end) ? start : end;
 
   SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
                                       session, NULL /* conn */,

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/update.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/update.c Tue Apr 29 23:36:43 2014
@@ -329,9 +329,6 @@ struct report_context_t {
      files/dirs? */
   svn_boolean_t add_props_included;
 
-  /* Path -> lock token mapping. */
-  apr_hash_t *lock_path_tokens;
-
   /* Path -> const char *repos_relpath mapping */
   apr_hash_t *switched_paths;
 
@@ -2248,8 +2245,6 @@ end_report(svn_ra_serf__xml_parser_t *pa
                                         info->pool);
         }
 
-      info->lock_token = svn_hash_gets(ctx->lock_path_tokens, info->name);
-
       if (info->lock_token && !info->fetch_props)
         info->fetch_props = TRUE;
 
@@ -2578,13 +2573,6 @@ set_path(void *report_baton,
   SVN_ERR(svn_io_file_write_full(report->body_file, buf->data, buf->len,
                                  NULL, pool));
 
-  if (lock_token)
-    {
-      svn_hash_sets(report->lock_path_tokens,
-                    apr_pstrdup(report->pool, path),
-                    apr_pstrdup(report->pool, lock_token));
-    }
-
   return SVN_NO_ERROR;
 }
 
@@ -2660,12 +2648,6 @@ link_path(void *report_baton,
   if (!*path)
     report->root_is_switched = TRUE;
 
-  if (lock_token)
-    {
-      svn_hash_sets(report->lock_path_tokens,
-                    path, apr_pstrdup(report->pool, lock_token));
-    }
-
   return APR_SUCCESS;
 }
 
@@ -3193,7 +3175,6 @@ make_update_reporter(svn_ra_session_t *r
   report->ignore_ancestry = ignore_ancestry;
   report->send_copyfrom_args = send_copyfrom_args;
   report->text_deltas = text_deltas;
-  report->lock_path_tokens = apr_hash_make(report->pool);
   report->switched_paths = apr_hash_make(report->pool);
 
   report->source = src_path;

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/util.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_serf/util.c Tue Apr 29 23:36:43 2014
@@ -48,6 +48,7 @@
 #include "private/svn_dep_compat.h"
 #include "private/svn_fspath.h"
 #include "private/svn_subr_private.h"
+#include "private/svn_auth_private.h"
 
 #include "ra_serf.h"
 
@@ -269,26 +270,70 @@ ssl_server_cert(void *baton, int failure
   svn_auth_iterstate_t *state;
   const char *realmstring;
   apr_uint32_t svn_failures;
-  apr_hash_t *issuer, *subject, *serf_cert;
-  apr_array_header_t *san;
+  apr_hash_t *issuer;
+  apr_hash_t *subject = NULL;
+  apr_hash_t *serf_cert = NULL;
   void *creds;
   int found_matching_hostname = 0;
 
-  /* Implicitly approve any non-server certs. */
-  if (serf_ssl_cert_depth(cert) > 0)
+  svn_failures = (ssl_convert_serf_failures(failures)
+      | conn->server_cert_failures);
+
+  if (serf_ssl_cert_depth(cert) == 0)
     {
-      if (failures)
-        conn->server_cert_failures |= ssl_convert_serf_failures(failures);
-      return APR_SUCCESS;
+      /* If the depth is 0, the hostname must match the certificate.
+
+      ### This should really be handled by serf, which should pass an error
+          for this case, but that has backwards compatibility issues. */
+      apr_array_header_t *san;
+
+      serf_cert = serf_ssl_cert_certificate(cert, scratch_pool);
+
+      san = svn_hash_gets(serf_cert, "subjectAltName");
+      /* Try to find matching server name via subjectAltName first... */
+      if (san) {
+          int i;
+          for (i = 0; i < san->nelts; i++) {
+              const char *s = APR_ARRAY_IDX(san, i, const char*);
+              if (apr_fnmatch(s, conn->session->session_url.hostname,
+                  APR_FNM_PERIOD | APR_FNM_CASE_BLIND) == APR_SUCCESS)
+              {
+                  found_matching_hostname = 1;
+                  break;
+              }
+          }
+      }
+
+      /* Match server certificate CN with the hostname of the server */
+      if (!found_matching_hostname)
+        {
+          const char *hostname = NULL;
+
+          subject = serf_ssl_cert_subject(cert, scratch_pool);
+
+          if (subject)
+            hostname = svn_hash_gets(subject, "CN");
+
+          if (!hostname
+              || apr_fnmatch(hostname, conn->session->session_url.hostname,
+                             APR_FNM_PERIOD | APR_FNM_CASE_BLIND) != APR_SUCCESS)
+          {
+              svn_failures |= SVN_AUTH_SSL_CNMISMATCH;
+          }
+      }
     }
 
+  if (!svn_failures)
+    return SVN_NO_ERROR;
+
   /* Extract the info from the certificate */
-  subject = serf_ssl_cert_subject(cert, scratch_pool);
+  if (! subject)
+    subject = serf_ssl_cert_subject(cert, scratch_pool);
   issuer = serf_ssl_cert_issuer(cert, scratch_pool);
-  serf_cert = serf_ssl_cert_certificate(cert, scratch_pool);
+  if (! serf_cert)
+    serf_cert = serf_ssl_cert_certificate(cert, scratch_pool);
 
   cert_info.hostname = svn_hash_gets(subject, "CN");
-  san = svn_hash_gets(serf_cert, "subjectAltName");
   cert_info.fingerprint = svn_hash_gets(serf_cert, "sha1");
   if (! cert_info.fingerprint)
     cert_info.fingerprint = apr_pstrdup(scratch_pool, "<unknown>");
@@ -301,32 +346,56 @@ ssl_server_cert(void *baton, int failure
   cert_info.issuer_dname = convert_organisation_to_str(issuer, scratch_pool);
   cert_info.ascii_cert = serf_ssl_cert_export(cert, scratch_pool);
 
-  svn_failures = (ssl_convert_serf_failures(failures)
-                  | conn->server_cert_failures);
+  /* Handle any non-server certs. */
+  if (serf_ssl_cert_depth(cert) > 0)
+    {
+      svn_error_t *err;
 
-  /* Try to find matching server name via subjectAltName first... */
-  if (san) {
-      int i;
-      for (i = 0; i < san->nelts; i++) {
-          char *s = APR_ARRAY_IDX(san, i, char*);
-          if (apr_fnmatch(s, conn->session->session_url.hostname,
-                          APR_FNM_PERIOD | APR_FNM_CASE_BLIND) == APR_SUCCESS)
-            {
-              found_matching_hostname = 1;
-              cert_info.hostname = s;
-              break;
-            }
-      }
-  }
+      svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
+                             SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO,
+                             &cert_info);
+
+      svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
+                             SVN_AUTH_PARAM_SSL_SERVER_FAILURES,
+                             &svn_failures);
+
+      realmstring = apr_psprintf(scratch_pool, "AUTHORITY:%s",
+                                 cert_info.fingerprint);
+
+      err = svn_auth_first_credentials(&creds, &state,
+                                       SVN_AUTH_CRED_SSL_SERVER_AUTHORITY,
+                                       realmstring,
+                                       conn->session->wc_callbacks->auth_baton,
+                                       scratch_pool);
 
-  /* Match server certificate CN with the hostname of the server */
-  if (!found_matching_hostname && cert_info.hostname)
-    {
-      if (apr_fnmatch(cert_info.hostname, conn->session->session_url.hostname,
-                      APR_FNM_PERIOD | APR_FNM_CASE_BLIND) == APR_FNM_NOMATCH)
+      svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
+                             SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO, NULL);
+
+      svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
+                             SVN_AUTH_PARAM_SSL_SERVER_FAILURES, NULL);
+
+      if (err)
+        {
+          if (err->apr_err != SVN_ERR_AUTHN_NO_PROVIDER)
+            return svn_error_trace(err);
+
+          /* No provider registered that handles server authorities */
+          svn_error_clear(err);
+          creds = NULL;
+        }
+
+      if (creds)
         {
-          svn_failures |= SVN_AUTH_SSL_CNMISMATCH;
+          server_creds = creds;
+          SVN_ERR(svn_auth_save_credentials(state, scratch_pool));
+
+          svn_failures &= ~server_creds->accepted_failures;
         }
+
+      if (svn_failures)
+        conn->server_cert_failures |= svn_failures;
+
+      return APR_SUCCESS;
     }
 
   svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
@@ -347,13 +416,27 @@ ssl_server_cert(void *baton, int failure
   if (creds)
     {
       server_creds = creds;
+      svn_failures &= ~server_creds->accepted_failures;
       SVN_ERR(svn_auth_save_credentials(state, scratch_pool));
     }
 
+  while (svn_failures && creds)
+    {
+      SVN_ERR(svn_auth_next_credentials(&creds, state, scratch_pool));
+
+      if (creds)
+        {
+          server_creds = creds;
+          svn_failures &= ~server_creds->accepted_failures;
+          SVN_ERR(svn_auth_save_credentials(state, scratch_pool));
+        }
+    }
+
   svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
                          SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO, NULL);
 
-  if (!server_creds)
+  /* Are there non accepted failures left? */
+  if (svn_failures)
     {
       svn_stringbuf_t *errmsg;
       int reasons = 0;

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_svn/protocol
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_svn/protocol?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_svn/protocol (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_ra_svn/protocol Tue Apr 29 23:36:43 2014
@@ -310,6 +310,7 @@ second place for auth-request point as n
      sends file contents as a series of strings, terminated by the empty
      string, followed by a second empty command response to indicate
      whether an error occurred during the sending of the file.
+    NOTE: the standard client never sends want-iprops, it uses get-iprops. 
 
   get-dir
     params:   ( path:string [ rev:number ] want-props:bool want-contents:bool
@@ -321,6 +322,7 @@ second place for auth-request point as n
                 [ last-author:string ] )
     dirent-field: kind | size | has-props | created-rev | time | last-author
                   | word
+    NOTE: the standard client never sends want-iprops, it uses get-iprops. 
 
   check-path
     params:   ( path:string [ rev:number ] )

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/commit.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/commit.c Tue Apr 29 23:36:43 2014
@@ -761,6 +761,13 @@ close_edit(void *edit_baton,
 
   if (SVN_IS_VALID_REVNUM(new_revision))
     {
+      /* The actual commit succeeded, i.e. the transaction does no longer
+         exist and we can't use txn_root for conflict resolution etc.
+
+         Since close_edit is supposed to release resources, do it now. */
+      if (eb->txn_root)
+        svn_fs_close_root(eb->txn_root);
+
       if (err)
         {
           /* If the error was in post-commit, then the commit itself
@@ -821,6 +828,10 @@ abort_edit(void *edit_baton,
 
   eb->txn_aborted = TRUE;
 
+  /* Since abort_edit is supposed to release resources, do it now. */
+  if (eb->txn_root)
+    svn_fs_close_root(eb->txn_root);
+
   return svn_error_trace(svn_fs_abort_txn(eb->txn, pool));
 }
 

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/dump.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/dump.c Tue Apr 29 23:36:43 2014
@@ -217,6 +217,49 @@ make_dir_baton(const char *path,
 }
 
 
+/* If the mergeinfo in MERGEINFO_STR refers to any revisions older than
+ * OLDEST_DUMPED_REV, issue a warning and set *FOUND_OLD_MERGEINFO to TRUE,
+ * otherwise leave *FOUND_OLD_MERGEINFO unchanged.
+ */
+static svn_error_t *
+verify_mergeinfo_revisions(svn_boolean_t *found_old_mergeinfo,
+                           const char *mergeinfo_str,
+                           svn_revnum_t oldest_dumped_rev,
+                           svn_repos_notify_func_t notify_func,
+                           void *notify_baton,
+                           apr_pool_t *pool)
+{
+  svn_mergeinfo_t mergeinfo, old_mergeinfo;
+
+  SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mergeinfo_str, pool));
+  SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
+            &old_mergeinfo, mergeinfo,
+            oldest_dumped_rev - 1, 0,
+            TRUE, pool, pool));
+
+  if (apr_hash_count(old_mergeinfo))
+    {
+      svn_repos_notify_t *notify =
+        svn_repos_notify_create(svn_repos_notify_warning, pool);
+
+      notify->warning = svn_repos_notify_warning_found_old_mergeinfo;
+      notify->warning_str = apr_psprintf(
+        pool,
+        _("Mergeinfo referencing revision(s) prior "
+          "to the oldest dumped revision (r%ld). "
+          "Loading this dump may result in invalid "
+          "mergeinfo."),
+        oldest_dumped_rev);
+
+      if (found_old_mergeinfo)
+        *found_old_mergeinfo = TRUE;
+      notify_func(notify_baton, notify, pool);
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
 /* This helper is the main "meat" of the editor -- it does all the
    work of writing a node record.
 
@@ -475,32 +518,13 @@ dump_node(struct edit_baton *eb,
                                                       SVN_PROP_MERGEINFO);
           if (mergeinfo_str)
             {
-              svn_mergeinfo_t mergeinfo, old_mergeinfo;
-
-              SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mergeinfo_str->data,
-                                          pool));
-              SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
-                &old_mergeinfo, mergeinfo,
-                eb->oldest_dumped_rev - 1, 0,
-                TRUE, pool, pool));
-              if (apr_hash_count(old_mergeinfo))
-                {
-                  svn_repos_notify_t *notify =
-                    svn_repos_notify_create(svn_repos_notify_warning, pool);
-
-                  notify->warning = svn_repos_notify_warning_found_old_mergeinfo;
-                  notify->warning_str = apr_psprintf(
-                    pool,
-                    _("Mergeinfo referencing revision(s) prior "
-                      "to the oldest dumped revision (r%ld). "
-                      "Loading this dump may result in invalid "
-                      "mergeinfo."),
-                    eb->oldest_dumped_rev);
-
-                  if (eb->found_old_mergeinfo)
-                    *eb->found_old_mergeinfo = TRUE;
-                  eb->notify_func(eb->notify_baton, notify, pool);
-                }
+              /* An error in verifying the mergeinfo must not prevent dumping
+                 the data. Ignore any such error. */
+              svn_error_clear(verify_mergeinfo_revisions(
+                                eb->found_old_mergeinfo,
+                                mergeinfo_str->data, eb->oldest_dumped_rev,
+                                eb->notify_func, eb->notify_baton,
+                                pool));
             }
         }
 

Modified: subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/fs-wrap.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/libsvn_repos/fs-wrap.c Tue Apr 29 23:36:43 2014
@@ -117,6 +117,8 @@ svn_repos_fs_begin_txn_for_commit2(svn_f
   const char *txn_name;
   svn_string_t *author = svn_hash_gets(revprop_table, SVN_PROP_REVISION_AUTHOR);
   apr_hash_t *hooks_env;
+  svn_error_t *err;
+  svn_fs_txn_t *txn;
 
   /* Parse the hooks-env file (if any). */
   SVN_ERR(svn_repos__parse_hooks_env(&hooks_env, repos->hooks_env_path,
@@ -124,21 +126,30 @@ svn_repos_fs_begin_txn_for_commit2(svn_f
 
   /* Begin the transaction, ask for the fs to do on-the-fly lock checks.
      We fetch its name, too, so the start-commit hook can use it.  */
-  SVN_ERR(svn_fs_begin_txn2(txn_p, repos->fs, rev,
+  SVN_ERR(svn_fs_begin_txn2(&txn, repos->fs, rev,
                             SVN_FS_TXN_CHECK_LOCKS, pool));
-  SVN_ERR(svn_fs_txn_name(&txn_name, *txn_p, pool));
+  err = svn_fs_txn_name(&txn_name, txn, pool);
+  if (err)
+    return svn_error_compose_create(err, svn_fs_abort_txn(txn, pool));
 
   /* We pass the revision properties to the filesystem by adding them
      as properties on the txn.  Later, when we commit the txn, these
      properties will be copied into the newly created revision. */
   revprops = svn_prop_hash_to_array(revprop_table, pool);
-  SVN_ERR(svn_repos_fs_change_txn_props(*txn_p, revprops, pool));
+  err = svn_repos_fs_change_txn_props(txn, revprops, pool);
+  if (err)
+    return svn_error_compose_create(err, svn_fs_abort_txn(txn, pool));
 
   /* Run start-commit hooks. */
-  SVN_ERR(svn_repos__hooks_start_commit(repos, hooks_env,
-                                        author ? author->data : NULL,
-                                        repos->client_capabilities, txn_name,
-                                        pool));
+  err = svn_repos__hooks_start_commit(repos, hooks_env,
+                                      author ? author->data : NULL,
+                                      repos->client_capabilities, txn_name,
+                                      pool);
+  if (err)
+    return svn_error_compose_create(err, svn_fs_abort_txn(txn, pool));
+
+  /* We have API promise that *TXN_P is unaffected on faulure. */
+  *txn_p = txn;
   return SVN_NO_ERROR;
 }