subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1813858 [3/8] - in /subversion/branches/shelve-checkpoint3: ./ build/ build/generator/ notes/commit-access-templates/ subversion/bindings/javahl/native/ subversion/bindings/swig/include/ subversion/include/ subversion/include/private/ subv...
Date Tue, 31 Oct 2017 09:36:54 GMT
Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/dump.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/dump.c Tue Oct 31 09:36:53 2017
@@ -1922,14 +1922,17 @@ get_dump_editor(const svn_delta_editor_t
 
 /* Helper for svn_repos_dump_fs.
 
-   Write a revision record of REV in FS to writable STREAM, using POOL.
+   Write a revision record of REV in REPOS to writable STREAM, using POOL.
    Dump revision properties as well if INCLUDE_REVPROPS has been set.
+   AUTHZ_FUNC and AUTHZ_BATON are passed directly to the repos layer.
  */
 static svn_error_t *
 write_revision_record(svn_stream_t *stream,
-                      svn_fs_t *fs,
+                      svn_repos_t *repos,
                       svn_revnum_t rev,
                       svn_boolean_t include_revprops,
+                      svn_repos_authz_func_t authz_func,
+                      void *authz_baton,
                       apr_pool_t *pool)
 {
   apr_hash_t *props;
@@ -1938,7 +1941,8 @@ write_revision_record(svn_stream_t *stre
 
   if (include_revprops)
     {
-      SVN_ERR(svn_fs_revision_proplist2(&props, fs, rev, FALSE, pool, pool));
+      SVN_ERR(svn_repos_fs_revision_proplist(&props, repos, rev,
+                                             authz_func, authz_baton, pool));
 
       /* Run revision date properties through the time conversion to
         canonicalize them. */
@@ -1965,6 +1969,27 @@ write_revision_record(svn_stream_t *stre
   return SVN_NO_ERROR;
 }
 
+/* Baton for dump_filter_authz_func(). */
+typedef struct dump_filter_baton_t
+{
+  svn_repos_dump_filter_func_t filter_func;
+  void *filter_baton;
+} dump_filter_baton_t;
+
+/* Implements svn_repos_authz_func_t. */
+static svn_error_t *
+dump_filter_authz_func(svn_boolean_t *allowed,
+                       svn_fs_root_t *root,
+                       const char *path,
+                       void *baton,
+                       apr_pool_t *pool)
+{
+  dump_filter_baton_t *b = baton;
+
+  return svn_error_trace(b->filter_func(allowed, root, path, b->filter_baton,
+                                        pool));
+}
+
 
 
 /* The main dumper. */
@@ -1979,6 +2004,8 @@ svn_repos_dump_fs4(svn_repos_t *repos,
                    svn_boolean_t include_changes,
                    svn_repos_notify_func_t notify_func,
                    void *notify_baton,
+                   svn_repos_dump_filter_func_t filter_func,
+                   void *filter_baton,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
                    apr_pool_t *pool)
@@ -1994,6 +2021,8 @@ svn_repos_dump_fs4(svn_repos_t *repos,
   svn_boolean_t found_old_reference = FALSE;
   svn_boolean_t found_old_mergeinfo = FALSE;
   svn_repos_notify_t *notify;
+  svn_repos_authz_func_t authz_func;
+  dump_filter_baton_t authz_baton = {0};
 
   /* Make sure we catch up on the latest revprop changes.  This is the only
    * time we will refresh the revprop data in this query. */
@@ -2022,6 +2051,20 @@ svn_repos_dump_fs4(svn_repos_t *repos,
                                "(youngest revision is %ld)"),
                              end_rev, youngest);
 
+  /* We use read authz callback to implement dump filtering. If there is no
+   * read access for some node, it will be excluded from dump as well as
+   * references to it (e.g. copy source). */
+  if (filter_func)
+    {
+      authz_func = dump_filter_authz_func;
+      authz_baton.filter_func = filter_func;
+      authz_baton.filter_baton = filter_baton;
+    }
+  else
+    {
+      authz_func = NULL;
+    }
+
   /* Write out the UUID. */
   SVN_ERR(svn_fs_get_uuid(fs, &uuid, pool));
 
@@ -2057,8 +2100,8 @@ svn_repos_dump_fs4(svn_repos_t *repos,
         SVN_ERR(cancel_func(cancel_baton));
 
       /* Write the revision record. */
-      SVN_ERR(write_revision_record(stream, fs, rev, include_revprops,
-                                    iterpool));
+      SVN_ERR(write_revision_record(stream, repos, rev, include_revprops,
+                                    authz_func, &authz_baton, iterpool));
 
       /* When dumping revision 0, we just write out the revision record.
          The parser might want to use its properties.
@@ -2091,8 +2134,7 @@ svn_repos_dump_fs4(svn_repos_t *repos,
           SVN_ERR(svn_repos_dir_delta2(from_root, "", "",
                                        to_root, "",
                                        dump_editor, dump_edit_baton,
-                                       NULL,
-                                       NULL,
+                                       authz_func, &authz_baton,
                                        FALSE, /* don't send text-deltas */
                                        svn_depth_infinity,
                                        FALSE, /* don't send entry props */
@@ -2104,7 +2146,7 @@ svn_repos_dump_fs4(svn_repos_t *repos,
           /* The normal case: compare consecutive revs. */
           SVN_ERR(svn_repos_replay2(to_root, "", SVN_INVALID_REVNUM, FALSE,
                                     dump_editor, dump_edit_baton,
-                                    NULL, NULL, iterpool));
+                                    authz_func, &authz_baton, iterpool));
 
           /* While our editor close_edit implementation is a no-op, we still
              do this for completeness. */

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/fs-wrap.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/fs-wrap.c Tue Oct 31 09:36:53 2017
@@ -33,6 +33,7 @@
 #include "svn_repos.h"
 #include "svn_time.h"
 #include "svn_sorts.h"
+#include "svn_subst.h"
 #include "repos.h"
 #include "svn_private_config.h"
 #include "private/svn_repos_private.h"
@@ -235,10 +236,13 @@ svn_repos__validate_prop(const char *nam
            * carriage return characters ('\r'). */
           if (strchr(value->data, '\r') != NULL)
             {
-              return svn_error_createf
-                (SVN_ERR_BAD_PROPERTY_VALUE, NULL,
+              svn_error_t *err = svn_error_createf
+                (SVN_ERR_BAD_PROPERTY_VALUE_EOL, NULL,
                  _("Cannot accept non-LF line endings in '%s' property"),
                    name);
+
+              return svn_error_create(SVN_ERR_BAD_PROPERTY_VALUE, err,
+                                      _("Invalid property value"));
             }
         }
 
@@ -256,6 +260,34 @@ svn_repos__validate_prop(const char *nam
     }
 
   return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
+svn_repos__normalize_prop(const svn_string_t **result_p,
+                          svn_boolean_t *normalized_p,
+                          const char *name,
+                          const svn_string_t *value,
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool)
+{
+  if (svn_prop_needs_translation(name) && value)
+    {
+      svn_string_t *new_value;
+
+      SVN_ERR(svn_subst_translate_string2(&new_value, NULL, normalized_p,
+                                          value, "UTF-8", TRUE,
+                                          result_pool, scratch_pool));
+      *result_p = new_value;
+    }
+  else
+    {
+      *result_p = svn_string_dup(value, result_pool);
+      if (normalized_p)
+        *normalized_p = FALSE;
+    }
+
+  return SVN_NO_ERROR;
 }
 
 

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/hooks.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/hooks.c Tue Oct 31 09:36:53 2017
@@ -476,11 +476,8 @@ svn_repos__hooks_start_commit(svn_repos_
 
       if (capabilities)
         {
-          capabilities_string = svn_cstring_join(capabilities, ":", pool);
-
-          /* Get rid of that annoying final colon. */
-          if (capabilities_string[0])
-            capabilities_string[strlen(capabilities_string) - 1] = '\0';
+          capabilities_string = svn_cstring_join2(capabilities, ":",
+                                                  FALSE, pool);
         }
       else
         {
@@ -799,8 +796,8 @@ svn_repos__hooks_post_lock(svn_repos_t *
     {
       const char *args[5];
       apr_file_t *stdin_handle = NULL;
-      svn_string_t *paths_str = svn_string_create(svn_cstring_join
-                                                  (paths, "\n", pool),
+      svn_string_t *paths_str = svn_string_create(svn_cstring_join2
+                                                  (paths, "\n", TRUE, pool),
                                                   pool);
 
       SVN_ERR(create_temp_file(&stdin_handle, paths_str, pool));
@@ -875,8 +872,8 @@ svn_repos__hooks_post_unlock(svn_repos_t
     {
       const char *args[5];
       apr_file_t *stdin_handle = NULL;
-      svn_string_t *paths_str = svn_string_create(svn_cstring_join
-                                                  (paths, "\n", pool),
+      svn_string_t *paths_str = svn_string_create(svn_cstring_join2
+                                                  (paths, "\n", TRUE, pool),
                                                   pool);
 
       SVN_ERR(create_temp_file(&stdin_handle, paths_str, pool));

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/list.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/list.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/list.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/list.c Tue Oct 31 09:36:53 2017
@@ -30,6 +30,7 @@
 
 #include "private/svn_repos_private.h"
 #include "private/svn_sorts_private.h"
+#include "private/svn_utf_private.h"
 #include "svn_private_config.h" /* for SVN_TEMPLATE_ROOT_DIR */
 
 #include "repos.h"
@@ -91,23 +92,16 @@ svn_repos_stat(svn_dirent_t **dirent,
 }
 
 /* Return TRUE of DIRNAME matches any of the const char * in PATTERNS.
- * Note that any DIRNAME will match if PATTERNS is empty. */
+ * Note that any DIRNAME will match if PATTERNS is empty.
+ * Use SCRATCH_BUFFER for temporary string contents. */
 static svn_boolean_t
 matches_any(const char *dirname,
-            const apr_array_header_t *patterns)
+            const apr_array_header_t *patterns,
+            svn_membuf_t *scratch_buffer)
 {
-  int i;
-  if (!patterns)
-    return TRUE;
-
-  for (i = 0; i < patterns->nelts; ++i)
-    {
-      const char *pattern = APR_ARRAY_IDX(patterns, i, const char *);
-      if (apr_fnmatch(pattern, dirname, APR_FNM_PERIOD) == APR_SUCCESS)
-        return TRUE;
-    }
-
-  return FALSE;
+  return patterns
+       ? svn_utf__fuzzy_glob_match(dirname, patterns, scratch_buffer)
+       : TRUE;
 }
 
 /* Utility to prevent code duplication.
@@ -166,6 +160,8 @@ compare_filtered_dirent(const void *lhs,
  *
  * However, DEPTH is not svn_depth_empty and PATH has already been reported.
  * Therefore, we can call this recursively.
+ *
+ * Uses SCRATCH_BUFFER for temporary string contents.
  */
 static svn_error_t *
 do_list(svn_fs_root_t *root,
@@ -179,6 +175,7 @@ do_list(svn_fs_root_t *root,
         void *receiver_baton,
         svn_cancel_func_t cancel_func,
         void *cancel_baton,
+        svn_membuf_t *scratch_buffer,
         apr_pool_t *scratch_pool)
 {
   apr_hash_t *entries;
@@ -210,7 +207,8 @@ do_list(svn_fs_root_t *root,
         continue;
 
       /* We can skip files that don't match any of the search patterns. */
-      filtered.is_match = matches_any(filtered.dirent->name, patterns);
+      filtered.is_match = matches_any(filtered.dirent->name, patterns,
+                                      scratch_buffer);
       if (!filtered.is_match && filtered.dirent->kind == svn_node_file)
         continue;
 
@@ -258,7 +256,7 @@ do_list(svn_fs_root_t *root,
         SVN_ERR(do_list(root, sub_path, patterns, svn_depth_infinity,
                         path_info_only, authz_read_func, authz_read_baton,
                         receiver, receiver_baton, cancel_func,
-                        cancel_baton, iterpool));
+                        cancel_baton, scratch_buffer, iterpool));
     }
 
   svn_pool_destroy(iterpool);
@@ -280,6 +278,8 @@ svn_repos_list(svn_fs_root_t *root,
                void *cancel_baton,
                apr_pool_t *scratch_pool)
 {
+  svn_membuf_t scratch_buffer;
+
   /* Parameter check. */
   svn_node_kind_t kind;
   if (depth < svn_depth_empty)
@@ -317,8 +317,13 @@ svn_repos_list(svn_fs_root_t *root,
   if (patterns && patterns->nelts == 0)
     return SVN_NO_ERROR;
 
+  /* We need a scratch buffer for temporary string data.
+   * Create one with a reasonable initial size. */
+  svn_membuf__create(&scratch_buffer, 256, scratch_pool);
+
   /* Actually report PATH, if it passes the filters. */
-  if (matches_any(svn_dirent_dirname(path, scratch_pool), patterns))
+  if (matches_any(svn_dirent_dirname(path, scratch_pool), patterns,
+                  &scratch_buffer))
     SVN_ERR(report_dirent(root, path, kind, path_info_only,
                           receiver, receiver_baton, scratch_pool));
 
@@ -327,7 +332,7 @@ svn_repos_list(svn_fs_root_t *root,
     SVN_ERR(do_list(root, path, patterns, depth,
                     path_info_only, authz_read_func, authz_read_baton,
                     receiver, receiver_baton, cancel_func, cancel_baton,
-                    scratch_pool));
+                    &scratch_buffer, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/load-fs-vtable.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/load-fs-vtable.c Tue Oct 31 09:36:53 2017
@@ -55,6 +55,7 @@ struct parse_baton
   svn_boolean_t use_history;
   svn_boolean_t validate_props;
   svn_boolean_t ignore_dates;
+  svn_boolean_t normalize_props;
   svn_boolean_t use_pre_commit_hook;
   svn_boolean_t use_post_commit_hook;
   enum svn_repos_load_uuid uuid_action;
@@ -163,8 +164,12 @@ change_rev_prop(svn_repos_t *repos,
                 const char *name,
                 const svn_string_t *value,
                 svn_boolean_t validate_props,
+                svn_boolean_t normalize_props,
                 apr_pool_t *pool)
 {
+  if (normalize_props)
+    SVN_ERR(svn_repos__normalize_prop(&value, NULL, name, value, pool, pool));
+
   if (validate_props)
     return svn_repos_fs_change_rev_prop4(repos, revision, NULL, name,
                                          NULL, value, FALSE, FALSE,
@@ -1024,7 +1029,8 @@ close_revision(void *baton)
               const svn_prop_t *prop = &APR_ARRAY_IDX(diff, i, svn_prop_t);
 
               SVN_ERR(change_rev_prop(pb->repos, 0, prop->name, prop->value,
-                                      pb->validate_props, rb->pool));
+                                      pb->validate_props, pb->normalize_props,
+                                      rb->pool));
           }
         }
 
@@ -1042,6 +1048,23 @@ close_revision(void *baton)
       prop->value = NULL;
     }
 
+  if (rb->pb->normalize_props)
+    {
+      apr_pool_t *iterpool;
+      int i;
+
+      iterpool = svn_pool_create(rb->pool);
+      for (i = 0; i < rb->revprops->nelts; i++)
+        {
+          svn_prop_t *prop = &APR_ARRAY_IDX(rb->revprops, i, svn_prop_t);
+
+          svn_pool_clear(iterpool);
+          SVN_ERR(svn_repos__normalize_prop(&prop->value, NULL, prop->name,
+                                            prop->value, rb->pool, iterpool));
+        }
+      svn_pool_destroy(iterpool);
+    }
+
   /* Apply revision property changes. */
   if (rb->pb->validate_props)
     SVN_ERR(svn_repos_fs_change_txn_props(rb->txn, rb->revprops, rb->pool));
@@ -1158,7 +1181,7 @@ close_revision(void *baton)
 
 
 svn_error_t *
-svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **callbacks,
+svn_repos_get_fs_build_parser6(const svn_repos_parse_fns3_t **callbacks,
                                void **parse_baton,
                                svn_repos_t *repos,
                                svn_revnum_t start_rev,
@@ -1170,6 +1193,7 @@ svn_repos_get_fs_build_parser5(const svn
                                svn_boolean_t use_pre_commit_hook,
                                svn_boolean_t use_post_commit_hook,
                                svn_boolean_t ignore_dates,
+                               svn_boolean_t normalize_props,
                                svn_repos_notify_func_t notify_func,
                                void *notify_baton,
                                apr_pool_t *pool)
@@ -1218,6 +1242,7 @@ svn_repos_get_fs_build_parser5(const svn
   pb->use_pre_commit_hook = use_pre_commit_hook;
   pb->use_post_commit_hook = use_post_commit_hook;
   pb->ignore_dates = ignore_dates;
+  pb->normalize_props = normalize_props;
 
   *callbacks = parser;
   *parse_baton = pb;
@@ -1226,7 +1251,7 @@ svn_repos_get_fs_build_parser5(const svn
 
 
 svn_error_t *
-svn_repos_load_fs5(svn_repos_t *repos,
+svn_repos_load_fs6(svn_repos_t *repos,
                    svn_stream_t *dumpstream,
                    svn_revnum_t start_rev,
                    svn_revnum_t end_rev,
@@ -1235,6 +1260,7 @@ svn_repos_load_fs5(svn_repos_t *repos,
                    svn_boolean_t use_pre_commit_hook,
                    svn_boolean_t use_post_commit_hook,
                    svn_boolean_t validate_props,
+                   svn_boolean_t normalize_props,
                    svn_boolean_t ignore_dates,
                    svn_repos_notify_func_t notify_func,
                    void *notify_baton,
@@ -1247,7 +1273,7 @@ svn_repos_load_fs5(svn_repos_t *repos,
 
   /* This is really simple. */
 
-  SVN_ERR(svn_repos_get_fs_build_parser5(&parser, &parse_baton,
+  SVN_ERR(svn_repos_get_fs_build_parser6(&parser, &parse_baton,
                                          repos,
                                          start_rev, end_rev,
                                          TRUE, /* look for copyfrom revs */
@@ -1257,6 +1283,7 @@ svn_repos_load_fs5(svn_repos_t *repos,
                                          use_pre_commit_hook,
                                          use_post_commit_hook,
                                          ignore_dates,
+                                         normalize_props,
                                          notify_func,
                                          notify_baton,
                                          pool));
@@ -1345,7 +1372,8 @@ revprops_close_revision(void *baton)
       const svn_prop_t *prop = &APR_ARRAY_IDX(diff, i, svn_prop_t);
 
       SVN_ERR(change_rev_prop(pb->repos, rb->rev, prop->name, prop->value,
-                              pb->validate_props, rb->pool));
+                              pb->validate_props, pb->normalize_props,
+                              rb->pool));
     }
 
   if (pb->notify_func)
@@ -1386,6 +1414,11 @@ revprops_close_revision(void *baton)
  *
  * If IGNORE_DATES is set, ignore any revision datestamps found in
  * DUMPSTREAM, keeping whatever timestamps the revisions currently have.
+ *
+ * If NORMALIZE_PROPS is set, attempt to normalize invalid Subversion
+ * revision and node properties (those in the svn: namespace) so that
+ * their values would follow the established rules for them.  Currently,
+ * this means translating non-LF line endings in the property values to LF.
  */
 static svn_error_t *
 build_revprop_parser(const svn_repos_parse_fns3_t **callbacks,
@@ -1395,6 +1428,7 @@ build_revprop_parser(const svn_repos_par
                      svn_revnum_t end_rev,
                      svn_boolean_t validate_props,
                      svn_boolean_t ignore_dates,
+                     svn_boolean_t normalize_props,
                      svn_repos_notify_func_t notify_func,
                      void *notify_baton,
                      apr_pool_t *result_pool)
@@ -1440,6 +1474,7 @@ build_revprop_parser(const svn_repos_par
   pb->use_pre_commit_hook = FALSE;
   pb->use_post_commit_hook = FALSE;
   pb->ignore_dates = ignore_dates;
+  pb->normalize_props = normalize_props;
 
   *callbacks = parser;
   *parse_baton = pb;
@@ -1454,6 +1489,7 @@ svn_repos_load_fs_revprops(svn_repos_t *
                            svn_revnum_t end_rev,
                            svn_boolean_t validate_props,
                            svn_boolean_t ignore_dates,
+                           svn_boolean_t normalize_props,
                            svn_repos_notify_func_t notify_func,
                            void *notify_baton,
                            svn_cancel_func_t cancel_func,
@@ -1470,6 +1506,7 @@ svn_repos_load_fs_revprops(svn_repos_t *
                                start_rev, end_rev,
                                validate_props,
                                ignore_dates,
+                               normalize_props,
                                notify_func,
                                notify_baton,
                                scratch_pool));

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/reporter.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_repos/reporter.c Tue Oct 31 09:36:53 2017
@@ -976,8 +976,8 @@ update_entry(report_baton_t *b, svn_revn
           SVN_ERR(svn_fs_props_different(&changed, s_root, s_path,
                                          b->t_root, t_path, pool));
           if (!changed)
-            SVN_ERR(svn_fs_contents_different(&changed, s_root, s_path,
-                                              b->t_root, t_path, pool));
+            SVN_ERR(svn_fs_contents_changed(&changed, s_root, s_path,
+                                            b->t_root, t_path, pool));
         }
 
       if ((distance == 0 || !changed) && !any_path_info(b, e_path)

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/config_win.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/config_win.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/config_win.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/config_win.c Tue Oct 31 09:36:53 2017
@@ -273,4 +273,11 @@ svn_config__parse_registry(svn_config_t
   return svn_err;
 }
 
+#else  /* !WIN32 */
+
+/* Silence OSX ranlib warnings about object files with no symbols. */
+#include <apr.h>
+extern const apr_uint32_t svn__fake__config_win;
+const apr_uint32_t svn__fake__config_win = 0xdeadbeef;
+
 #endif /* WIN32 */

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/deprecated.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/deprecated.c Tue Oct 31 09:36:53 2017
@@ -1592,3 +1592,12 @@ svn_base64_encode(svn_stream_t *output,
 {
   return svn_base64_encode2(output, TRUE, pool);
 }
+
+/*** From string.c ***/
+char *
+svn_cstring_join(const apr_array_header_t *strings,
+                 const char *separator,
+                 apr_pool_t *pool)
+{
+  return svn_cstring_join2(strings, separator, TRUE, pool);
+}

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/io.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/io.c Tue Oct 31 09:36:53 2017
@@ -3940,21 +3940,20 @@ svn_io_file_write_full(apr_file_t *file,
                        apr_size_t nbytes, apr_size_t *bytes_written,
                        apr_pool_t *pool)
 {
-  /* We cannot simply call apr_file_write_full on Win32 as it may fail
-     for larger values of NBYTES. In that case, we have to emulate the
-     "_full" part here. Thus, always call apr_file_write directly on
-     Win32 as this minimizes overhead for small data buffers. */
 #ifdef WIN32
 #define MAXBUFSIZE 30*1024
   apr_size_t bw = nbytes;
   apr_size_t to_write = nbytes;
+  apr_status_t rv;
 
-  /* try a simple "write everything at once" first */
-  apr_status_t rv = apr_file_write(file, buf, &bw);
+  rv = apr_file_write_full(file, buf, nbytes, &bw);
   buf = (char *)buf + bw;
   to_write -= bw;
 
-  /* if the OS cannot handle that, use smaller chunks */
+  /* Issue #1789: On Windows, writing may fail for large values of NBYTES.
+     If that is the case, keep track of how many bytes have been written
+     by the apr_file_write_full() call, and attempt to write the remaining
+     part in smaller chunks. */
   if (rv == APR_FROM_OS_ERROR(ERROR_NOT_ENOUGH_MEMORY)
       && nbytes > MAXBUFSIZE)
     {

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/lz4/lz4.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/lz4/lz4.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/lz4/lz4.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/lz4/lz4.c Tue Oct 31 09:36:53 2017
@@ -94,6 +94,12 @@
 #include "lz4internal.h"
 /* see also "memory routines" below */
 
+/* Silence GCC's -Wmissing-prototypes warning. */
+int LZ4_compress_fast_force(const char*, char*, int, int, int);
+int LZ4_compress_forceExtDict (LZ4_stream_t*, const char*, char*, int);
+int LZ4_decompress_safe_forceExtDict(const char*, char*, int, int, const char*, int);
+int LZ4_uncompress (const char*, char*, int);
+int LZ4_uncompress_unknownOutputSize (const char*, char*, int, int);
 
 /*-************************************
 *  Compiler Options
@@ -397,7 +403,7 @@ typedef enum { full = 0, partial = 1 } e
 int LZ4_versionNumber (void) { return LZ4_VERSION_NUMBER; }
 const char* LZ4_versionString(void) { return LZ4_VERSION_STRING; }
 int LZ4_compressBound(int isize)  { return LZ4_COMPRESSBOUND(isize); }
-int LZ4_sizeofState() { return LZ4_STREAMSIZE; }
+int LZ4_sizeofState(void) { return LZ4_STREAMSIZE; }
 
 
 /*-******************************
@@ -1423,7 +1429,7 @@ int LZ4_uncompress_unknownOutputSize (co
 
 /* Obsolete Streaming functions */
 
-int LZ4_sizeofStreamState() { return LZ4_STREAMSIZE; }
+int LZ4_sizeofStreamState(void) { return LZ4_STREAMSIZE; }
 
 static void LZ4_init(LZ4_stream_t* lz4ds, BYTE* base)
 {

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/mergeinfo.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/mergeinfo.c Tue Oct 31 09:36:53 2017
@@ -271,197 +271,186 @@ combine_with_lastrange(const svn_merge_r
       APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) =
         svn_merge_range_dup(new_range, result_pool);
     }
+  else if (combine_ranges(&combined_range, lastrange, new_range,
+                     consider_inheritance))
+    {
+      *lastrange = combined_range;
+    }
   else if (!consider_inheritance)
     {
       /* We are not considering inheritance so we can merge intersecting
          ranges of different inheritability.  Of course if the ranges
          don't intersect at all we simply push NEW_RANGE onto RANGELIST. */
-      if (combine_ranges(&combined_range, lastrange, new_range, FALSE))
-        {
-          *lastrange = combined_range;
-        }
-      else
-        {
-          APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) =
+      APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) =
             svn_merge_range_dup(new_range, result_pool);
-        }
     }
   else /* Considering inheritance */
     {
-      if (combine_ranges(&combined_range, lastrange, new_range, TRUE))
-        {
-          /* Even when considering inheritance two intersection ranges
-             of the same inheritability can simply be combined. */
-          *lastrange = combined_range;
-        }
-      else
-        {
-          /* If we are here then the ranges either don't intersect or do
-             intersect but have differing inheritability.  Check for the
-             first case as that is easy to handle. */
-          intersection_type_t intersection_type;
-          svn_boolean_t sorted = FALSE;
+      /* If we are here then the ranges either don't intersect or do
+          intersect but have differing inheritability.  Check for the
+          first case as that is easy to handle. */
+      intersection_type_t intersection_type;
+      svn_boolean_t sorted = FALSE;
 
-          SVN_ERR(get_type_of_intersection(new_range, lastrange,
-                                           &intersection_type));
+      SVN_ERR(get_type_of_intersection(new_range, lastrange,
+                                        &intersection_type));
 
-          switch (intersection_type)
+      switch (intersection_type)
+        {
+          case svn__no_intersection:
+            /* NEW_RANGE and *LASTRANGE *really* don't intersect so
+                just push NEW_RANGE onto RANGELIST. */
+            APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) =
+              svn_merge_range_dup(new_range, result_pool);
+            sorted = (svn_sort_compare_ranges(&lastrange,
+                                              &new_range) < 0);
+            break;
+
+          case svn__equal_intersection:
+            /* They range are equal so all we do is force the
+                inheritability of lastrange to true. */
+            lastrange->inheritable = TRUE;
+            sorted = TRUE;
+            break;
+
+          case svn__adjoining_intersection:
+            /* They adjoin but don't overlap so just push NEW_RANGE
+                onto RANGELIST. */
+            APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) =
+              svn_merge_range_dup(new_range, result_pool);
+            sorted = (svn_sort_compare_ranges(&lastrange,
+                                              &new_range) < 0);
+            break;
+
+          case svn__overlapping_intersection:
+            /* They ranges overlap but neither is a proper subset of
+                the other.  We'll end up pusing two new ranges onto
+                RANGELIST, the intersecting part and the part unique to
+                NEW_RANGE.*/
             {
-              case svn__no_intersection:
-                /* NEW_RANGE and *LASTRANGE *really* don't intersect so
-                   just push NEW_RANGE onto RANGELIST. */
-                APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) =
-                  svn_merge_range_dup(new_range, result_pool);
-                sorted = (svn_sort_compare_ranges(&lastrange,
-                                                  &new_range) < 0);
-                break;
-
-              case svn__equal_intersection:
-                /* They range are equal so all we do is force the
-                   inheritability of lastrange to true. */
-                lastrange->inheritable = TRUE;
-                sorted = TRUE;
-                break;
-
-              case svn__adjoining_intersection:
-                /* They adjoin but don't overlap so just push NEW_RANGE
-                   onto RANGELIST. */
-                APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) =
-                  svn_merge_range_dup(new_range, result_pool);
-                sorted = (svn_sort_compare_ranges(&lastrange,
-                                                  &new_range) < 0);
-                break;
-
-              case svn__overlapping_intersection:
-                /* They ranges overlap but neither is a proper subset of
-                   the other.  We'll end up pusing two new ranges onto
-                   RANGELIST, the intersecting part and the part unique to
-                   NEW_RANGE.*/
-                {
-                  svn_merge_range_t *r1 = svn_merge_range_dup(lastrange,
-                                                              result_pool);
-                  svn_merge_range_t *r2 = svn_merge_range_dup(new_range,
-                                                              result_pool);
-
-                  /* Pop off *LASTRANGE to make our manipulations
-                     easier. */
-                  apr_array_pop(rangelist);
-
-                  /* Ensure R1 is the older range. */
-                  if (r2->start < r1->start)
-                    {
-                      /* Swap R1 and R2. */
-                      *r2 = *r1;
-                      *r1 = *new_range;
-                    }
+              svn_merge_range_t *r1 = svn_merge_range_dup(lastrange,
+                                                          result_pool);
+              svn_merge_range_t *r2 = svn_merge_range_dup(new_range,
+                                                          result_pool);
+
+              /* Pop off *LASTRANGE to make our manipulations
+                  easier. */
+              apr_array_pop(rangelist);
 
-                  /* Absorb the intersecting ranges into the
-                     inheritable range. */
-                  if (r1->inheritable)
-                    r2->start = r1->end;
-                  else
-                    r1->end = r2->start;
-
-                  /* Push everything back onto RANGELIST. */
-                  APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r1;
-                  sorted = (svn_sort_compare_ranges(&lastrange,
-                                                    &r1) < 0);
-                  APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r2;
-                  if (sorted)
-                    sorted = (svn_sort_compare_ranges(&r1, &r2) < 0);
-                  break;
+              /* Ensure R1 is the older range. */
+              if (r2->start < r1->start)
+                {
+                  /* Swap R1 and R2. */
+                  *r2 = *r1;
+                  *r1 = *new_range;
                 }
 
-              default: /* svn__proper_subset_intersection */
-                {
-                  /* One range is a proper subset of the other. */
-                  svn_merge_range_t *r1 = svn_merge_range_dup(lastrange,
-                                                              result_pool);
-                  svn_merge_range_t *r2 = svn_merge_range_dup(new_range,
-                                                              result_pool);
-                  svn_merge_range_t *r3 = NULL;
+              /* Absorb the intersecting ranges into the
+                  inheritable range. */
+              if (r1->inheritable)
+                r2->start = r1->end;
+              else
+                r1->end = r2->start;
+
+              /* Push everything back onto RANGELIST. */
+              APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r1;
+              sorted = (svn_sort_compare_ranges(&lastrange,
+                                                &r1) < 0);
+              APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r2;
+              if (sorted)
+                sorted = (svn_sort_compare_ranges(&r1, &r2) < 0);
+              break;
+            }
 
-                  /* Pop off *LASTRANGE to make our manipulations
-                     easier. */
-                  apr_array_pop(rangelist);
+          default: /* svn__proper_subset_intersection */
+            {
+              /* One range is a proper subset of the other. */
+              svn_merge_range_t *r1 = svn_merge_range_dup(lastrange,
+                                                          result_pool);
+              svn_merge_range_t *r2 = svn_merge_range_dup(new_range,
+                                                          result_pool);
+              svn_merge_range_t *r3 = NULL;
+
+              /* Pop off *LASTRANGE to make our manipulations
+                  easier. */
+              apr_array_pop(rangelist);
 
-                  /* Ensure R1 is the superset. */
-                  if (r2->start < r1->start || r2->end > r1->end)
-                    {
-                      /* Swap R1 and R2. */
-                      *r2 = *r1;
-                      *r1 = *new_range;
-                    }
+              /* Ensure R1 is the superset. */
+              if (r2->start < r1->start || r2->end > r1->end)
+                {
+                  /* Swap R1 and R2. */
+                  *r2 = *r1;
+                  *r1 = *new_range;
+                }
 
-                  if (r1->inheritable)
-                    {
-                      /* The simple case: The superset is inheritable, so
-                         just combine r1 and r2. */
-                      r1->start = MIN(r1->start, r2->start);
-                      r1->end = MAX(r1->end, r2->end);
-                      r2 = NULL;
-                    }
-                  else if (r1->start == r2->start)
-                    {
-                      svn_revnum_t tmp_revnum;
+              if (r1->inheritable)
+                {
+                  /* The simple case: The superset is inheritable, so
+                      just combine r1 and r2. */
+                  r1->start = MIN(r1->start, r2->start);
+                  r1->end = MAX(r1->end, r2->end);
+                  r2 = NULL;
+                }
+              else if (r1->start == r2->start)
+                {
+                  svn_revnum_t tmp_revnum;
 
-                      /* *LASTRANGE and NEW_RANGE share an end point. */
-                      tmp_revnum = r1->end;
-                      r1->end = r2->end;
-                      r2->inheritable = r1->inheritable;
-                      r1->inheritable = TRUE;
-                      r2->start = r1->end;
-                      r2->end = tmp_revnum;
-                    }
-                  else if (r1->end == r2->end)
-                    {
-                      /* *LASTRANGE and NEW_RANGE share an end point. */
-                      r1->end = r2->start;
-                      r2->inheritable = TRUE;
-                    }
-                  else
-                    {
-                      /* NEW_RANGE and *LASTRANGE share neither start
-                         nor end points. */
-                      r3 = apr_pcalloc(result_pool, sizeof(*r3));
-                      r3->start = r2->end;
-                      r3->end = r1->end;
-                      r3->inheritable = r1->inheritable;
-                      r2->inheritable = TRUE;
-                      r1->end = r2->start;
-                    }
+                  /* *LASTRANGE and NEW_RANGE share an end point. */
+                  tmp_revnum = r1->end;
+                  r1->end = r2->end;
+                  r2->inheritable = r1->inheritable;
+                  r1->inheritable = TRUE;
+                  r2->start = r1->end;
+                  r2->end = tmp_revnum;
+                }
+              else if (r1->end == r2->end)
+                {
+                  /* *LASTRANGE and NEW_RANGE share an end point. */
+                  r1->end = r2->start;
+                  r2->inheritable = TRUE;
+                }
+              else
+                {
+                  /* NEW_RANGE and *LASTRANGE share neither start
+                      nor end points. */
+                  r3 = apr_pcalloc(result_pool, sizeof(*r3));
+                  r3->start = r2->end;
+                  r3->end = r1->end;
+                  r3->inheritable = r1->inheritable;
+                  r2->inheritable = TRUE;
+                  r1->end = r2->start;
+                }
 
-                  /* Push everything back onto RANGELIST. */
-                  APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r1;
-                  sorted = (svn_sort_compare_ranges(&lastrange, &r1) < 0);
-                  if (r2)
-                    {
-                      APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r2;
-                      if (sorted)
-                        sorted = (svn_sort_compare_ranges(&r1, &r2) < 0);
-                    }
-                  if (r3)
+              /* Push everything back onto RANGELIST. */
+              APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r1;
+              sorted = (svn_sort_compare_ranges(&lastrange, &r1) < 0);
+              if (r2)
+                {
+                  APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r2;
+                  if (sorted)
+                    sorted = (svn_sort_compare_ranges(&r1, &r2) < 0);
+                }
+              if (r3)
+                {
+                  APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r3;
+                  if (sorted)
                     {
-                      APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = r3;
-                      if (sorted)
-                        {
-                          if (r2)
-                            sorted = (svn_sort_compare_ranges(&r2,
-                                                              &r3) < 0);
-                          else
-                            sorted = (svn_sort_compare_ranges(&r1,
-                                                              &r3) < 0);
-                        }
+                      if (r2)
+                        sorted = (svn_sort_compare_ranges(&r2,
+                                                          &r3) < 0);
+                      else
+                        sorted = (svn_sort_compare_ranges(&r1,
+                                                          &r3) < 0);
                     }
-                  break;
                 }
+              break;
             }
-
-          /* Some of the above cases might have put *RANGELIST out of
-             order, so re-sort.*/
-          if (!sorted)
-            svn_sort__array(rangelist, svn_sort_compare_ranges);
         }
+
+      /* Some of the above cases might have put *RANGELIST out of
+          order, so re-sort.*/
+      if (!sorted)
+        svn_sort__array(rangelist, svn_sort_compare_ranges);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/spillbuf.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/spillbuf.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/spillbuf.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/spillbuf.c Tue Oct 31 09:36:53 2017
@@ -265,10 +265,10 @@ svn_spillbuf__write(svn_spillbuf_t *buf,
 
           /* Adjust the start offset for reading from the spill file.
 
-             ### FIXME: Instead, we should simply discard the memory
-             buffers; but currently some tests expect to read data in
-             the same chunk sizes as were written, so we'll leave this
-             change for later.*/
+             This way, the first `buf->memory_size` bytes of data will
+             be read from the existing in-memory buffers, which makes
+             more sense than discarding the buffers and re-reading
+             data from the file. */
           buf->spill_start = buf->memory_size;
         }
     }

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/sqlite3wrapper.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/sqlite3wrapper.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/sqlite3wrapper.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/sqlite3wrapper.c Tue Oct 31 09:36:53 2017
@@ -58,4 +58,12 @@
 const sqlite3_api_routines *const svn_sqlite3__api_funcs = &sqlite3Apis;
 int (*const svn_sqlite3__api_initialize)(void) = sqlite3_initialize;
 int (*const svn_sqlite3__api_config)(int, ...)  = sqlite3_config;
-#endif
+
+#else  /* !SVN_SQLITE_INLINE */
+
+/* Silence OSX ranlib warnings about object files with no symbols. */
+#include <apr.h>
+extern const apr_uint32_t svn__fake__sqlite3wrapper;
+const apr_uint32_t svn__fake__sqlite3wrapper = 0xdeadbeef;
+
+#endif /* SVN_SQLITE_INLINE */

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/string.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/string.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/string.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/string.c Tue Oct 31 09:36:53 2017
@@ -1021,9 +1021,10 @@ int svn_cstring_count_newlines(const cha
 }
 
 char *
-svn_cstring_join(const apr_array_header_t *strings,
-                 const char *separator,
-                 apr_pool_t *pool)
+svn_cstring_join2(const apr_array_header_t *strings,
+                  const char *separator,
+                  svn_boolean_t trailing_separator,
+                  apr_pool_t *pool)
 {
   svn_stringbuf_t *new_str = svn_stringbuf_create_empty(pool);
   size_t sep_len = strlen(separator);
@@ -1032,9 +1033,14 @@ svn_cstring_join(const apr_array_header_
   for (i = 0; i < strings->nelts; i++)
     {
       const char *string = APR_ARRAY_IDX(strings, i, const char *);
+      if (i > 0)
+        svn_stringbuf_appendbytes(new_str, separator, sep_len);
       svn_stringbuf_appendbytes(new_str, string, strlen(string));
-      svn_stringbuf_appendbytes(new_str, separator, sep_len);
     }
+
+  if (strings->nelts > 0 && trailing_separator)
+    svn_stringbuf_appendbytes(new_str, separator, sep_len);
+
   return new_str->data;
 }
 

Propchange: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/utf8proc/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Oct 31 09:36:53 2017
@@ -0,0 +1,103 @@
+/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/utf8proc:1669168-1694487
+/subversion/branches/1.5.x-r30215/subversion/libsvn_subr/utf8proc:870312
+/subversion/branches/1.7.x-fs-verify/subversion/libsvn_subr/utf8proc:1146708,1161180
+/subversion/branches/1.9-cache-improvements/subversion/libsvn_subr/utf8proc:1678948-1679863
+/subversion/branches/1.9.x/subversion/libsvn_subr/utf8proc:1735680
+/subversion/branches/10Gb/subversion/libsvn_subr/utf8proc: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_subr/utf8proc:965046-1000689
+/subversion/branches/authzperf/subversion/libsvn_subr/utf8proc:1613053-1776831
+/subversion/branches/auto-props-sdc/subversion/libsvn_subr/utf8proc:1384106-1401643
+/subversion/branches/bdb-reverse-deltas/subversion/libsvn_subr/utf8proc:872050-872529
+/subversion/branches/cache-server/subversion/libsvn_subr/utf8proc:1458643-1476567
+/subversion/branches/diff-callbacks3/subversion/libsvn_subr/utf8proc:870059-870761
+/subversion/branches/diff-optimizations/subversion/libsvn_subr/utf8proc:1031270-1037352
+/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/utf8proc:1037353-1067789
+/subversion/branches/dont-save-plaintext-passwords-by-default/subversion/libsvn_subr/utf8proc:870728-871118
+/subversion/branches/double-delete/subversion/libsvn_subr/utf8proc:870511-872970
+/subversion/branches/dump-load-cross-check/subversion/libsvn_subr/utf8proc:1654853-1657295
+/subversion/branches/ev2-export/subversion/libsvn_subr/utf8proc:1325914,1332738,1413107
+/subversion/branches/explore-wc/subversion/libsvn_subr/utf8proc: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_subr/utf8proc:871779-873302
+/subversion/branches/fs-rep-sharing/subversion/libsvn_subr/utf8proc:869036-873803
+/subversion/branches/fsfs-format7/subversion/libsvn_subr/utf8proc:1426304,1430673,1433848,1438408,1438982,1441129,1442051,1442068,1442504,1442910,1443171,1443803,1444690,1444693,1444695,1445040,1445080,1446103,1451129,1453590,1454307,1460579,1461851,1461865,1462837,1462904,1463120,1467362,1467382,1469487,1471208,1477166,1478055,1481447,1489817,1489949,1490673-1490674,1491784,1493042,1498029,1498103,1498155,1500054,1507729-1507731,1507735-1507736
+/subversion/branches/fsfs-improvements/subversion/libsvn_subr/utf8proc:1499981-1547039
+/subversion/branches/fsfs-lock-many/subversion/libsvn_subr/utf8proc:1571740-1577217
+/subversion/branches/fsfs-pack/subversion/libsvn_subr/utf8proc:873717-874575
+/subversion/branches/fsx/subversion/libsvn_subr/utf8proc:1507845-1509914
+/subversion/branches/fsx-1.10/subversion/libsvn_subr/utf8proc:1658219-1694500
+/subversion/branches/fsx-id/subversion/libsvn_subr/utf8proc:1645603-1649011
+/subversion/branches/gnome-keyring/subversion/libsvn_subr/utf8proc:870558-871410
+/subversion/branches/gpg-agent-password-store/subversion/libsvn_subr/utf8proc:1005036-1150766
+/subversion/branches/gtest_addition/subversion/libsvn_subr/utf8proc:1452117-1502138
+/subversion/branches/http-protocol-v2/subversion/libsvn_subr/utf8proc:874395-876041
+/subversion/branches/in-memory-cache/subversion/libsvn_subr/utf8proc:869829-871452
+/subversion/branches/in-repo-authz/subversion/libsvn_subr/utf8proc:1414342-1424779
+/subversion/branches/inheritable-props/subversion/libsvn_subr/utf8proc:1297080-1395089
+/subversion/branches/integrate-cache-item-serialization/subversion/libsvn_subr/utf8proc:1068724-1068739
+/subversion/branches/integrate-cache-membuffer/subversion/libsvn_subr/utf8proc:998649-998852
+/subversion/branches/integrate-compression-level/subversion/libsvn_subr/utf8proc:1068651-1072287
+/subversion/branches/integrate-io-improvements/subversion/libsvn_subr/utf8proc:1068684-1072297
+/subversion/branches/integrate-is-cachable/subversion/libsvn_subr/utf8proc:1072568-1074082
+/subversion/branches/integrate-partial-getter/subversion/libsvn_subr/utf8proc:1072558-1076552
+/subversion/branches/integrate-readline-speedup/subversion/libsvn_subr/utf8proc:1072553-1072555
+/subversion/branches/integrate-stream-api-extensions/subversion/libsvn_subr/utf8proc:1068695-1072516
+/subversion/branches/integrate-string-improvements/subversion/libsvn_subr/utf8proc:1068251-1190617
+/subversion/branches/integrate-txdelta-caching/subversion/libsvn_subr/utf8proc:1072541-1078213
+/subversion/branches/issue-2779-dev/subversion/libsvn_subr/utf8proc:965496-984198
+/subversion/branches/issue-2843-dev/subversion/libsvn_subr/utf8proc:871432-874179
+/subversion/branches/issue-3000/subversion/libsvn_subr/utf8proc:871713,871716-871719,871721-871726,871728,871734
+/subversion/branches/issue-3067-deleted-subtrees/subversion/libsvn_subr/utf8proc:873375-874084
+/subversion/branches/issue-3148-dev/subversion/libsvn_subr/utf8proc:875193-875204
+/subversion/branches/issue-3220-dev/subversion/libsvn_subr/utf8proc:872210-872226
+/subversion/branches/issue-3242-dev/subversion/libsvn_subr/utf8proc:879653-896436
+/subversion/branches/issue-3334-dirs/subversion/libsvn_subr/utf8proc:875156-875867
+/subversion/branches/issue-3975/subversion/libsvn_subr/utf8proc:1152931-1160746
+/subversion/branches/issue-4116-dev/subversion/libsvn_subr/utf8proc:1424719-1425040
+/subversion/branches/issue-4194-dev/subversion/libsvn_subr/utf8proc:1410507-1414880
+/subversion/branches/javahl-ra/subversion/libsvn_subr/utf8proc:991978-1494640
+/subversion/branches/kwallet/subversion/libsvn_subr/utf8proc:870785-871314
+/subversion/branches/log-addressing/subversion/libsvn_subr/utf8proc:1509279-1546844
+/subversion/branches/log-g-performance/subversion/libsvn_subr/utf8proc:870941-871032
+/subversion/branches/merge-skips-obstructions/subversion/libsvn_subr/utf8proc:874525-874615
+/subversion/branches/move-tracking-2/subversion/libsvn_subr/utf8proc:1606692-1714632
+/subversion/branches/multi-layer-moves/subversion/libsvn_subr/utf8proc:1239019-1300930
+/subversion/branches/nfc-nfd-aware-client/subversion/libsvn_subr/utf8proc:870276,870376
+/subversion/branches/node_pool/subversion/libsvn_subr/utf8proc:1304828-1305388
+/subversion/branches/patch-exec/subversion/libsvn_subr/utf8proc:1692717-1705390
+/subversion/branches/performance/subversion/libsvn_subr/utf8proc: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-10
 29336,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/pin-externals/subversion/libsvn_subr/utf8proc:1643757-1659392
+/subversion/branches/py-tests-as-modules/subversion/libsvn_subr/utf8proc:956579-1033052
+/subversion/branches/ra-svn-tuning/subversion/libsvn_subr/utf8proc:1658201-1694489
+/subversion/branches/ra_serf-digest-authn/subversion/libsvn_subr/utf8proc:875693-876404
+/subversion/branches/reintegrate-improvements/subversion/libsvn_subr/utf8proc:873853-874164
+/subversion/branches/remote-only-status/subversion/libsvn_subr/utf8proc:1581845-1586090
+/subversion/branches/resolve-incoming-add/subversion/libsvn_subr/utf8proc:1762797-1764284
+/subversion/branches/revprop-cache/subversion/libsvn_subr/utf8proc:1298521-1326293
+/subversion/branches/revprop-caching-ng/subversion/libsvn_subr/utf8proc:1620597,1620599
+/subversion/branches/revprop-packing/subversion/libsvn_subr/utf8proc:1143907,1143971,1143997,1144017,1144499,1144568,1146145
+/subversion/branches/shelve/subversion/libsvn_subr/utf8proc:1802592-1813857
+/subversion/branches/shelve-checkpoint/subversion/libsvn_subr/utf8proc:1801970
+/subversion/branches/subtree-mergeinfo/subversion/libsvn_subr/utf8proc:876734-878766
+/subversion/branches/svn-auth-x509/subversion/libsvn_subr/utf8proc:1603509-1655900
+/subversion/branches/svn-info-detail/subversion/libsvn_subr/utf8proc:1660035-1662618
+/subversion/branches/svn-mergeinfo-enhancements/subversion/libsvn_subr/utf8proc:870119-870195,870197-870288
+/subversion/branches/svn-mergeinfo-normalizer/subversion/libsvn_subr/utf8proc:1642232-1695991
+/subversion/branches/svn-patch-improvements/subversion/libsvn_subr/utf8proc:918519-934609
+/subversion/branches/svn_mutex/subversion/libsvn_subr/utf8proc:1141683-1182099
+/subversion/branches/svnpatch-diff/subversion/libsvn_subr/utf8proc:865738-876477
+/subversion/branches/svnraisetc/subversion/libsvn_subr/utf8proc:874709-875149
+/subversion/branches/svnserve-logging/subversion/libsvn_subr/utf8proc:869828-870893
+/subversion/branches/tc-issue-3334/subversion/libsvn_subr/utf8proc:874697-874773
+/subversion/branches/tc-merge-notify/subversion/libsvn_subr/utf8proc:874017-874062
+/subversion/branches/tc-resolve/subversion/libsvn_subr/utf8proc:874191-874239
+/subversion/branches/tc_url_rev/subversion/libsvn_subr/utf8proc:874351-874483
+/subversion/branches/tree-conflicts/subversion/libsvn_subr/utf8proc:868291-873154
+/subversion/branches/tree-conflicts-notify/subversion/libsvn_subr/utf8proc:873926-874008
+/subversion/branches/tristate-chunked-request/subversion/libsvn_subr/utf8proc:1502394-1502681
+/subversion/branches/tweak-build-take-two/subversion/libsvn_subr/utf8proc:1424288-1425049,1425051-1425613
+/subversion/branches/uris-as-urls/subversion/libsvn_subr/utf8proc:1060426-1064427
+/subversion/branches/verify-at-commit/subversion/libsvn_subr/utf8proc:1462039-1462408
+/subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc:1439280-1546110
+/subversion/branches/wc-collate-path/subversion/libsvn_subr/utf8proc:1402685-1480384
+/subversion/trunk/subversion/libsvn_subr/utf8proc:1801593-1813856
+/subversion/upstream/utf8proc:1405750-1809082

Modified: subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/utf8proc.c?rev=1813858&r1=1813857&r2=1813858&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/utf8proc.c (original)
+++ subversion/branches/shelve-checkpoint3/subversion/libsvn_subr/utf8proc.c Tue Oct 31 09:36:53 2017
@@ -56,6 +56,12 @@ const char *
 svn_utf__utf8proc_runtime_version(void)
 {
   /* Unused static function warning removal hack. */
+  SVN_UNUSED(utf8proc_grapheme_break);
+  SVN_UNUSED(utf8proc_tolower);
+  SVN_UNUSED(utf8proc_toupper);
+  SVN_UNUSED(utf8proc_totitle);
+  SVN_UNUSED(utf8proc_charwidth);
+  SVN_UNUSED(utf8proc_category_string);
   SVN_UNUSED(utf8proc_NFD);
   SVN_UNUSED(utf8proc_NFC);
   SVN_UNUSED(utf8proc_NFKD);
@@ -77,7 +83,7 @@ svn_utf__utf8proc_runtime_version(void)
  * that STRING contains invalid UTF-8 or was so long that an overflow
  * occurred.
  */
-static ssize_t
+static apr_ssize_t
 unicode_decomposition(int transform_flags,
                       const char *string, apr_size_t length,
                       svn_membuf_t *buffer)
@@ -88,8 +94,8 @@ unicode_decomposition(int transform_flag
   for (;;)
     {
       apr_int32_t *const ucs4buf = buffer->data;
-      const ssize_t ucs4len = buffer->size / sizeof(*ucs4buf);
-      const ssize_t result =
+      const apr_ssize_t ucs4len = buffer->size / sizeof(*ucs4buf);
+      const apr_ssize_t result =
         utf8proc_decompose((const void*) string, length, ucs4buf, ucs4len,
                            UTF8PROC_DECOMPOSE | UTF8PROC_STABLE
                            | transform_flags | nullterm);
@@ -116,7 +122,7 @@ decompose_normalized(apr_size_t *result_
                      const char *string, apr_size_t length,
                      svn_membuf_t *buffer)
 {
-  ssize_t result = unicode_decomposition(0, string, length, buffer);
+  apr_ssize_t result = unicode_decomposition(0, string, length, buffer);
   if (result < 0)
     return svn_error_create(SVN_ERR_UTF8PROC_ERROR, NULL,
                             gettext(utf8proc_errmsg(result)));
@@ -145,7 +151,7 @@ normalize_cstring(apr_size_t *result_len
                   svn_membuf_t *buffer)
 {
   int flags = 0;
-  ssize_t result;
+  apr_ssize_t result;
 
   if (casefold)
     flags |= UTF8PROC_CASEFOLD;
@@ -240,6 +246,36 @@ svn_utf__xfrm(const char **result,
   return SVN_NO_ERROR;
 }
 
+svn_boolean_t
+svn_utf__fuzzy_glob_match(const char *str,
+                          const apr_array_header_t *patterns,
+                          svn_membuf_t *buf)
+{
+  const char *normalized;
+  svn_error_t *err;
+  int i;
+
+  /* Try to normalize case and accents in STR.
+   *
+   * If that should fail for some reason, consider STR a mismatch. */
+  err = svn_utf__xfrm(&normalized, str, strlen(str), TRUE, TRUE, buf);
+  if (err)
+    {
+      svn_error_clear(err);
+      return FALSE;
+    }
+
+  /* Now see whether it matches any/all of the patterns. */
+  for (i = 0; i < patterns->nelts; ++i)
+    {
+      const char *pattern = APR_ARRAY_IDX(patterns, i, const char *);
+      if (apr_fnmatch(pattern, normalized, 0) == APR_SUCCESS)
+        return TRUE;
+    }
+
+  return FALSE;
+}
+
 /* Decode a single UCS-4 code point to UTF-8, appending the result to BUFFER.
  * Assume BUFFER is already filled to *LENGTH and return the new size there.
  * This function does *not* nul-terminate the stringbuf!
@@ -254,7 +290,7 @@ encode_ucs4(svn_membuf_t *buffer, apr_in
   if (buffer->size - *length < 4)
     svn_membuf__resize(buffer, buffer->size + 4);
 
-  utf8len = utf8proc_encode_char(ucs4chr, ((uint8_t*)buffer->data + *length));
+  utf8len = utf8proc_encode_char(ucs4chr, ((apr_byte_t*)buffer->data + *length));
   if (!utf8len)
     return svn_error_createf(SVN_ERR_UTF8PROC_ERROR, NULL,
                              _("Invalid Unicode character U+%04lX"),
@@ -317,7 +353,7 @@ svn_utf__glob(svn_boolean_t *match,
         {
           const int nullterm = (escape_len == SVN_UTF__UNKNOWN_LENGTH
                                 ? UTF8PROC_NULLTERM : 0);
-          ssize_t result =
+          apr_ssize_t result =
             utf8proc_decompose((const void*) escape, escape_len, &ucs4esc, 1,
                                UTF8PROC_DECOMPOSE | UTF8PROC_STABLE | nullterm);
           if (result < 0)
@@ -415,8 +451,8 @@ svn_utf__fuzzy_escape(const char *src, a
 
   svn_stringbuf_t *result;
   svn_membuf_t buffer;
-  ssize_t decomp_length;
-  ssize_t len;
+  apr_ssize_t decomp_length;
+  apr_ssize_t len;
 
   /* Decompose to a non-reversible compatibility format. */
   svn_membuf__create(&buffer, length * sizeof(apr_int32_t), pool);
@@ -445,7 +481,7 @@ svn_utf__fuzzy_escape(const char *src, a
 
           while (done < length)
             {
-              len = utf8proc_iterate((uint8_t*)src + done, length - done, &uc);
+              len = utf8proc_iterate((apr_byte_t*)src + done, length - done, &uc);
               if (len < 0)
                 break;
               done += len;
@@ -473,7 +509,7 @@ svn_utf__fuzzy_escape(const char *src, a
 
               /* Determine the length of the UTF-8 sequence */
               const char *const p = src + done;
-              len = utf8proc_utf8class[(uint8_t)*p];
+              len = utf8proc_utf8class[(apr_byte_t)*p];
 
               /* Check if the multi-byte sequence is valid UTF-8. */
               if (len > 1 && len <= (apr_ssize_t)(length - done))



Mime
View raw message