Modified: 
subversion/branches/revprop-packing/subversion/libsvn_subr/config_file.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/config_file.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/config_file.c 
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/config_file.c 
Fri Jan 13 21:40:26 2012
@@ -386,9 +386,9 @@ svn_config__parse_file(svn_config_t *cfg
                                            pool);
   ctx.line = 1;
   ctx.have_ungotten_char = FALSE;
-  ctx.section = svn_stringbuf_create("", pool);
-  ctx.option = svn_stringbuf_create("", pool);
-  ctx.value = svn_stringbuf_create("", pool);
+  ctx.section = svn_stringbuf_create_empty(pool);
+  ctx.option = svn_stringbuf_create_empty(pool);
+  ctx.value = svn_stringbuf_create_empty(pool);
 
   do
     {
@@ -766,16 +766,20 @@ svn_config_ensure(const char *config_dir
         "###                              to authenticate against a"         NL
         "###                              Subversion server may be cached"   NL
         "###                              to disk in any way."               NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "###   store-plaintext-passwords  Specifies whether passwords may"   NL
         "###                              be cached on disk unencrypted."    NL
+#endif
         "###   store-ssl-client-cert-pp   Specifies whether passphrase used" NL
         "###                              to authenticate against a client"  NL
         "###                              certificate may be cached to disk" NL
         "###                              in any way"                        NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "###   store-ssl-client-cert-pp-plaintext"                           NL
         "###                              Specifies whether client cert"     NL
         "###                              passphrases may be cached on disk" NL
         "###                              unencrypted (i.e., as plaintext)." NL
+#endif
         "###   store-auth-creds           Specifies whether any auth info"   NL
         "###                              (passwords as well as server certs)"
                                                                              NL
@@ -783,15 +787,14 @@ svn_config_ensure(const char *config_dir
         "###   username                   Specifies the default username."   NL
         "###"                                                                NL
         "### Set store-passwords to 'no' to avoid storing passwords on disk" NL
-        "### in any way, including in password stores. It defaults to 'yes',"
-                                                                             NL
-        "### but Subversion will never save your password to disk in plaintext"
-                                                                             NL
-        "### unless you tell it to."                                         NL
+        "### in any way, including in password stores.  It defaults to"      NL
+        "### 'yes', but Subversion will never save your password to disk in" NL
+        "### plaintext unless explicitly configured to do so."               NL
         "### Note that this option only prevents saving of *new* passwords;" NL
         "### it doesn't invalidate existing passwords.  (To do that, remove" NL
         "### the cache files by hand as described in the Subversion book.)"  NL
         "###"                                                                NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "### Set store-plaintext-passwords to 'no' to avoid storing"         NL
         "### passwords in unencrypted form in the auth/ area of your config" NL
         "### directory. Set it to 'yes' to allow Subversion to store"        NL
@@ -801,11 +804,12 @@ svn_config_ensure(const char *config_dir
         "### this option has no effect if either 'store-passwords' or "      NL
         "### 'store-auth-creds' is set to 'no'."                             NL
         "###"                                                                NL
+#endif
         "### Set store-ssl-client-cert-pp to 'no' to avoid storing ssl"      NL
         "### client certificate passphrases in the auth/ area of your"       NL
         "### config directory.  It defaults to 'yes', but Subversion will"   NL
-        "### never save your passphrase to disk in plaintext unless you tell"NL
-        "### it to via 'store-ssl-client-cert-pp-plaintext' (see below)."    NL
+        "### never save your passphrase to disk in plaintext unless"         NL
+        "### explicitly configured to do so."                                NL
         "###"                                                                NL
         "### Note store-ssl-client-cert-pp only prevents the saving of *new*"NL
         "### passphrases; it doesn't invalidate existing passphrases.  To do"NL
@@ -814,6 +818,7 @@ svn_config_ensure(const char *config_dir
         "###                    svn.serverconfig.netmodel.html\\"            NL
         "###                    #svn.serverconfig.netmodel.credcache"        NL
         "###"                                                                NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "### Set store-ssl-client-cert-pp-plaintext to 'no' to avoid storing"NL
         "### passphrases in unencrypted form in the auth/ area of your"      NL
         "### config directory.  Set it to 'yes' to allow Subversion to"      NL
@@ -823,6 +828,7 @@ svn_config_ensure(const char *config_dir
         "### this option has no effect if either 'store-auth-creds' or "     NL
         "### 'store-ssl-client-cert-pp' is set to 'no'."                     NL
         "###"                                                                NL
+#endif
         "### Set store-auth-creds to 'no' to avoid storing any Subversion"   NL
         "### credentials in the auth/ area of your config directory."        NL
         "### Note that this includes SSL server certificates."               NL
@@ -858,7 +864,9 @@ svn_config_ensure(const char *config_dir
         "# http-auth-types = basic;digest;negotiate"                         NL
 #endif
         "# neon-debug-mask = 130"                                            NL
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
         "# store-plaintext-passwords = no"                                   NL
+#endif
         "# username = harry"                                                 NL
         ""                                                                   NL
         "### Information for the second group:"                              NL
@@ -904,9 +912,12 @@ svn_config_ensure(const char *config_dir
         "#"                                                                  NL
         "# Password / passphrase caching parameters:"                        NL
         "# store-passwords = no"                                             NL
-        "# store-plaintext-passwords = no"                                   NL
         "# store-ssl-client-cert-pp = no"                                    NL
-        "# store-ssl-client-cert-pp-plaintext = no"                          
NL;
+#ifndef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE
+        "# store-plaintext-passwords = no"                                   NL
+        "# store-ssl-client-cert-pp-plaintext = no"                          NL
+#endif
+        ;
 
       err = svn_io_file_open(&f, path,
                              (APR_WRITE | APR_CREATE | APR_EXCL),
@@ -1071,6 +1082,11 @@ svn_config_ensure(const char *config_dir
         "### Set interactive-conflicts to 'no' to disable interactive"       NL
         "### conflict resolution prompting.  It defaults to 'yes'."          NL
         "# interactive-conflicts = no"                                       NL
+        "### Set memory-cache-size to define the size of the memory cache"   NL
+        "### used by the client when accessing a FSFS repository via"        NL
+        "### ra_local (the file:// scheme). The value represents the number" NL
+        "### of MB used by the cache."                                       NL
+        "# memory-cache-size = 16"                                           NL
         ""                                                                   NL
         "### Section for configuring automatic properties."                  NL
         "[auto-props]"                                                       NL

Modified: 
subversion/branches/revprop-packing/subversion/libsvn_subr/config_win.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/config_win.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/config_win.c 
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/config_win.c Fri 
Jan 13 21:40:26 2012
@@ -200,9 +200,9 @@ svn_config__parse_registry(svn_config_t 
 
 
   subpool = svn_pool_create(pool);
-  section = svn_stringbuf_create("", subpool);
-  option = svn_stringbuf_create("", subpool);
-  value = svn_stringbuf_create("", subpool);
+  section = svn_stringbuf_create_empty(subpool);
+  option = svn_stringbuf_create_empty(subpool);
+  value = svn_stringbuf_create_empty(subpool);
 
   /* The top-level values belong to the [DEFAULT] section */
   svn_err = parse_section(cfg, hkey, SVN_CONFIG__DEFAULT_SECTION,

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/debug.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/debug.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/debug.c 
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/debug.c Fri Jan 
13 21:40:26 2012
@@ -27,10 +27,13 @@
 #include <stdarg.h>
 
 #include "svn_types.h"
+#include "svn_string.h"
 
 #include "private/svn_debug.h"
 
 
+#define DBG_FLAG "DBG: "
+
 /* This will be tweaked by the preamble code.  */
 static FILE * volatile debug_output = NULL;
 
@@ -59,21 +62,63 @@ svn_dbg__preamble(const char *file, long
       else
         ++slash;
 
-      fprintf(output, "DBG: %s:%4ld: ", slash, line);
+      fprintf(output, DBG_FLAG "%s:%4ld: ", slash, line);
     }
 }
 
 
-void
-svn_dbg__printf(const char *fmt, ...)
+static void
+print_line(const char *fmt, va_list ap)
 {
   FILE *output = debug_output;
-  va_list ap;
 
   if (output == NULL || quiet_mode())
     return;
 
-  va_start(ap, fmt);
   (void) vfprintf(output, fmt, ap);
+}
+
+
+void
+svn_dbg__printf(const char *fmt, ...)
+{
+  va_list ap;
+
+  va_start(ap, fmt);
+  print_line(fmt, ap);
   va_end(ap);
 }
+
+
+void
+svn_dbg__print_props(apr_hash_t *props,
+                     const char *header_fmt,
+                     ...)
+{
+/* We only build this code if SVN_DEBUG is defined. */
+#ifdef SVN_DEBUG
+
+  apr_hash_index_t *hi;
+  va_list ap;
+
+  va_start(ap, header_fmt);
+  print_line(header_fmt, ap);
+  va_end(ap);
+
+  if (props == NULL)
+    {
+      SVN_DBG(("    (null)\n"));
+      return;
+    }
+
+  for (hi = apr_hash_first(apr_hash_pool_get(props), props); hi;
+        hi = apr_hash_next(hi))
+    {
+      const char *name = svn__apr_hash_index_key(hi);
+      svn_string_t *val = svn__apr_hash_index_val(hi);
+
+      SVN_DBG(("    '%s' -> '%s'\n", name, val->data));
+    }
+#endif /* SVN_DEBUG */
+}
+

Modified: 
subversion/branches/revprop-packing/subversion/libsvn_subr/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/deprecated.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/deprecated.c 
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/deprecated.c Fri 
Jan 13 21:40:26 2012
@@ -1073,6 +1073,53 @@ svn_rangelist_inheritable(apr_array_head
                                                     pool, pool));
 }
 
+svn_error_t *
+svn_rangelist_merge(apr_array_header_t **rangelist,
+                    const apr_array_header_t *changes,
+                    apr_pool_t *pool)
+{
+  return svn_error_trace(svn_rangelist_merge2(*rangelist, changes,
+                                              pool, pool));
+}
+
+svn_error_t *
+svn_mergeinfo_diff(svn_mergeinfo_t *deleted, svn_mergeinfo_t *added,
+                   svn_mergeinfo_t from, svn_mergeinfo_t to,
+                   svn_boolean_t consider_inheritance,
+                   apr_pool_t *pool)
+{
+  return svn_error_trace(svn_mergeinfo_diff2(deleted, added, from, to,
+                                             consider_inheritance, pool,
+                                             pool));
+}
+
+svn_error_t *
+svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo,
+                    svn_mergeinfo_t changes,
+                    apr_pool_t *pool)
+{
+  return svn_error_trace(svn_mergeinfo_merge2(mergeinfo, changes, pool,
+                         pool));
+}
+
+svn_error_t *
+svn_mergeinfo_remove(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser,
+                     svn_mergeinfo_t whiteboard, apr_pool_t *pool)
+{
+  return svn_mergeinfo_remove2(mergeinfo, eraser, whiteboard, TRUE, pool,
+                               pool);
+}
+
+svn_error_t *
+svn_mergeinfo_intersect(svn_mergeinfo_t *mergeinfo,
+                        svn_mergeinfo_t mergeinfo1,
+                        svn_mergeinfo_t mergeinfo2,
+                        apr_pool_t *pool)
+{
+  return svn_mergeinfo_intersect2(mergeinfo, mergeinfo1, mergeinfo2,
+                                  TRUE, pool, pool);
+}
+
 /*** From config.c ***/
 
 svn_error_t *
@@ -1126,12 +1173,3 @@ svn_xml_make_header(svn_stringbuf_t **st
 {
   svn_xml_make_header2(str, NULL, pool);
 }
-
-svn_error_t *
-svn_rangelist_merge(apr_array_header_t **rangelist,
-                    const apr_array_header_t *changes,
-                    apr_pool_t *pool)
-{
-  return svn_error_trace(svn_rangelist_merge2(*rangelist, changes,
-                                              pool, pool));
-}

Modified: 
subversion/branches/revprop-packing/subversion/libsvn_subr/dirent_uri.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/dirent_uri.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/dirent_uri.c 
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/dirent_uri.c Fri 
Jan 13 21:40:26 2012
@@ -884,10 +884,10 @@ svn_dirent_local_style(const char *diren
 }
 
 const char *
-svn_relpath__internal_style(const char *dirent,
-                           apr_pool_t *pool)
+svn_relpath__internal_style(const char *relpath,
+                            apr_pool_t *pool)
 {
-  return svn_relpath_canonicalize(internal_style(dirent, pool), pool);
+  return svn_relpath_canonicalize(internal_style(relpath, pool), pool);
 }
 
 
@@ -1295,25 +1295,17 @@ svn_uri_basename(const char *uri, apr_po
 {
   apr_size_t len = strlen(uri);
   apr_size_t start;
-  const char *base_name;
 
   assert(svn_uri_is_canonical(uri, NULL));
 
   if (svn_uri_is_root(uri, len))
     return "";
-  else
-    {
-      start = len;
-      while (start > 0 && uri[start - 1] != '/')
-        --start;
-    }
 
-  if (pool)
-    base_name = apr_pstrmemdup(pool, uri + start, len - start);
-  else
-    base_name = uri + start;
+  start = len;
+  while (start > 0 && uri[start - 1] != '/')
+    --start;
 
-  return svn_path_uri_decode(base_name, pool);
+  return svn_path_uri_decode(uri + start, pool);
 }
 
 void
@@ -1403,33 +1395,6 @@ svn_dirent_is_child(const char *parent_d
 }
 
 const char *
-svn_relpath__is_child(const char *parent_relpath,
-                      const char *child_relpath,
-                      apr_pool_t *pool)
-{
-  /* assert(relpath_is_canonical(parent_relpath)); */
-  /* assert(relpath_is_canonical(child_relpath)); */
-
-  return is_child(type_relpath, parent_relpath, child_relpath, pool);
-}
-
-const char *
-svn_uri__is_child(const char *parent_uri,
-                  const char *child_uri,
-                  apr_pool_t *pool)
-{
-  const char *relpath;
-
-  assert(svn_uri_is_canonical(parent_uri, NULL));
-  assert(svn_uri_is_canonical(child_uri, NULL));
-
-  relpath = is_child(type_uri, parent_uri, child_uri, pool);
-  if (relpath)
-    relpath = svn_path_uri_decode(relpath, pool);
-  return relpath;
-}
-
-const char *
 svn_dirent_skip_ancestor(const char *parent_dirent,
                          const char *child_dirent)
 {
@@ -1546,12 +1511,6 @@ svn_dirent_is_ancestor(const char *paren
 }
 
 svn_boolean_t
-svn_relpath__is_ancestor(const char *parent_relpath, const char *child_relpath)
-{
-  return svn_relpath_skip_ancestor(parent_relpath, child_relpath) != NULL;
-}
-
-svn_boolean_t
 svn_uri__is_ancestor(const char *parent_uri, const char *child_uri)
 {
   return uri_skip_ancestor(parent_uri, child_uri) != NULL;
@@ -1652,7 +1611,7 @@ svn_dirent_canonicalize(const char *dire
 }
 
 svn_boolean_t
-svn_dirent_is_canonical(const char *dirent, apr_pool_t *pool)
+svn_dirent_is_canonical(const char *dirent, apr_pool_t *scratch_pool)
 {
   const char *ptr = dirent;
   if (*ptr == '/')
@@ -1665,7 +1624,8 @@ svn_dirent_is_canonical(const char *dire
           /* TODO: Scan hostname and sharename and fall back to part code */
 
           /* ### Fall back to old implementation */
-          return (strcmp(dirent, svn_dirent_canonicalize(dirent, pool)) == 0);
+          return (strcmp(dirent, svn_dirent_canonicalize(dirent, scratch_pool))
+                  == 0);
         }
 #endif /* SVN_USE_DOS_PATHS */
     }
@@ -1739,7 +1699,7 @@ svn_relpath_is_canonical(const char *rel
 }
 
 svn_boolean_t
-svn_uri_is_canonical(const char *uri, apr_pool_t *pool)
+svn_uri_is_canonical(const char *uri, apr_pool_t *scratch_pool)
 {
   const char *ptr = uri, *seg = uri;
   const char *schema_data = NULL;
@@ -2414,10 +2374,10 @@ svn_uri_get_file_url_from_dirent(const c
 #else
   if (dirent[0] == '/')
     {
-      /* Handle UNC paths */
-      assert(dirent[1] != '/'); /* Not absolute! */
+      /* Handle UNC paths //server/share -> file://server/share */
+      assert(dirent[1] == '/'); /* Expect UNC, not non-absolute */
 
-      *url = apr_pstrcat(pool, "file://", dirent+1, NULL);
+      *url = apr_pstrcat(pool, "file:", dirent, NULL);
     }
   else
     *url = apr_pstrcat(pool, "file:///", dirent, NULL);
@@ -2458,21 +2418,6 @@ svn_fspath__is_root(const char *fspath, 
 
 
 const char *
-svn_fspath__is_child(const char *parent_fspath,
-                     const char *child_fspath,
-                     apr_pool_t *pool)
-{
-  const char *result;
-  assert(svn_fspath__is_canonical(parent_fspath));
-  assert(svn_fspath__is_canonical(child_fspath));
-
-  result = svn_relpath__is_child(parent_fspath + 1, child_fspath + 1, pool);
-
-  assert(result == NULL || svn_relpath_is_canonical(result));
-  return result;
-}
-
-const char *
 svn_fspath__skip_ancestor(const char *parent_fspath,
                           const char *child_fspath)
 {
@@ -2482,16 +2427,6 @@ svn_fspath__skip_ancestor(const char *pa
   return svn_relpath_skip_ancestor(parent_fspath + 1, child_fspath + 1);
 }
 
-svn_boolean_t
-svn_fspath__is_ancestor(const char *parent_fspath,
-                        const char *child_fspath)
-{
-  assert(svn_fspath__is_canonical(parent_fspath));
-  assert(svn_fspath__is_canonical(child_fspath));
-
-  return svn_relpath__is_ancestor(parent_fspath + 1, child_fspath + 1);
-}
-
 
 const char *
 svn_fspath__dirname(const char *fspath,

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c Fri Jan 13 
21:40:26 2012
@@ -26,10 +26,10 @@
 #include "svn_pools.h"
 #include "svn_private_config.h"
 
+#include "private/svn_mutex.h"
+
 /* A mutex to protect our global pool and cache. */
-#if APR_HAS_THREADS
-static apr_thread_mutex_t *dso_mutex;
-#endif
+static svn_mutex__t *dso_mutex = NULL;
 
 /* Global pool to allocate DSOs in. */
 static apr_pool_t *dso_pool;
@@ -49,40 +49,21 @@ static int not_there_sentinel;
 svn_error_t *
 svn_dso_initialize2(void)
 {
-#if APR_HAS_THREADS
-  apr_status_t status;
-#endif
   if (dso_pool)
     return SVN_NO_ERROR;
 
   dso_pool = svn_pool_create(NULL);
 
-#if APR_HAS_THREADS
-  status = apr_thread_mutex_create(&dso_mutex,
-                                   APR_THREAD_MUTEX_DEFAULT, dso_pool);
-  if (status)
-    return svn_error_wrap_apr(status, _("Can't create DSO mutex"));
-#endif
+  SVN_ERR(svn_mutex__init(&dso_mutex, TRUE, dso_pool));
 
   dso_cache = apr_hash_make(dso_pool);
   return SVN_NO_ERROR;
 }
 
 #if APR_HAS_DSO
-svn_error_t *
-svn_dso_load(apr_dso_handle_t **dso, const char *fname)
+static svn_error_t *
+svn_dso_load_internal(apr_dso_handle_t **dso, const char *fname)
 {
-  apr_status_t status;
-
-  if (! dso_pool)
-    SVN_ERR(svn_dso_initialize2());
-
-#if APR_HAS_THREADS
-  status = apr_thread_mutex_lock(dso_mutex);
-  if (status)
-    return svn_error_wrap_apr(status, _("Can't grab DSO mutex"));
-#endif
-
   *dso = apr_hash_get(dso_cache, fname, APR_HASH_KEY_STRING);
 
   /* First check to see if we've been through this before...  We do this
@@ -91,18 +72,13 @@ svn_dso_load(apr_dso_handle_t **dso, con
   if (*dso == NOT_THERE)
     {
       *dso = NULL;
-#if APR_HAS_THREADS
-      status = apr_thread_mutex_unlock(dso_mutex);
-      if (status)
-        return svn_error_wrap_apr(status, _("Can't ungrab DSO mutex"));
-#endif
       return SVN_NO_ERROR;
     }
 
   /* If we got nothing back from the cache, try and load the library. */
   if (! *dso)
     {
-      status = apr_dso_load(dso, fname, dso_pool);
+      apr_status_t status = apr_dso_load(dso, fname, dso_pool);
       if (status)
         {
 #ifdef SVN_DEBUG_DSO
@@ -120,11 +96,6 @@ svn_dso_load(apr_dso_handle_t **dso, con
                        APR_HASH_KEY_STRING,
                        NOT_THERE);
 
-#if APR_HAS_THREADS
-          status = apr_thread_mutex_unlock(dso_mutex);
-          if (status)
-            return svn_error_wrap_apr(status, _("Can't ungrab DSO mutex"));
-#endif
           return SVN_NO_ERROR;
         }
 
@@ -135,11 +106,16 @@ svn_dso_load(apr_dso_handle_t **dso, con
                    *dso);
     }
 
-#if APR_HAS_THREADS
-  status = apr_thread_mutex_unlock(dso_mutex);
-  if (status)
-    return svn_error_wrap_apr(status, _("Can't ungrab DSO mutex"));
-#endif
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_dso_load(apr_dso_handle_t **dso, const char *fname)
+{
+  if (! dso_pool)
+    SVN_ERR(svn_dso_initialize2());
+
+  SVN_MUTEX__WITH_LOCK(dso_mutex, svn_dso_load_internal(dso, fname));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/error.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/error.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/error.c 
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/error.c Fri Jan 
13 21:40:26 2012
@@ -28,6 +28,8 @@
 #include <apr_pools.h>
 #include <apr_strings.h>
 
+#include <zlib.h>
+
 #include "svn_cmdline.h"
 #include "svn_error.h"
 #include "svn_pools.h"
@@ -64,8 +66,9 @@ static const char SVN_FILE_LINE_UNDEFINE
 #undef svn_error_quick_wrap
 #undef svn_error_wrap_apr
 
-/* Note: This function was historically in the public API, so we need
- * to define it even when !SVN_DEBUG. */
+/* Note: Although this is a "__" function, it was historically in the
+ * public ABI, so we can never change it or remove its signature, even
+ * though it is now only used in SVN_DEBUG mode. */
 void
 svn_error__locate(const char *file, long line)
 {
@@ -663,6 +666,8 @@ svn_error_set_malfunction_handler(svn_er
   return old_malfunction_handler;
 }
 
+/* Note: Although this is a "__" function, it is in the public ABI, so
+ * we can never remove it or change its signature. */
 svn_error_t *
 svn_error__malfunction(svn_boolean_t can_return,
                        const char *file, int line,
@@ -670,3 +675,52 @@ svn_error__malfunction(svn_boolean_t can
 {
   return malfunction_handler(can_return, file, line, expr);
 }
+
+svn_error_t *
+svn_error__wrap_zlib(int zerr, const char *function, const char *message)
+{
+  apr_status_t status;
+  const char *zmsg;
+
+  if (zerr == Z_OK)
+    return SVN_NO_ERROR;
+
+  switch (zerr)
+    {
+    case Z_STREAM_ERROR:
+      status = SVN_ERR_STREAM_MALFORMED_DATA;
+      zmsg = _("stream error");
+      break;
+
+    case Z_MEM_ERROR:
+      status = APR_ENOMEM;
+      zmsg = _("out of memory");
+      break;
+
+    case Z_BUF_ERROR:
+      status = APR_ENOMEM;
+      zmsg = _("buffer error");
+      break;
+
+    case Z_VERSION_ERROR:
+      status = SVN_ERR_STREAM_UNRECOGNIZED_DATA;
+      zmsg = _("version error");
+      break;
+
+    case Z_DATA_ERROR:
+      status = SVN_ERR_STREAM_MALFORMED_DATA;
+      zmsg = _("corrupt data");
+      break;
+
+    default:
+      status = SVN_ERR_STREAM_UNRECOGNIZED_DATA;
+      zmsg = _("unknown error");
+      break;
+    }
+
+  if (message != NULL)
+    return svn_error_createf(status, NULL, "zlib (%s): %s: %s", function,
+                             zmsg, message);
+  else
+    return svn_error_createf(status, NULL, "zlib (%s): %s", function, zmsg);
+}

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/gpg_agent.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/gpg_agent.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/gpg_agent.c 
(original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/gpg_agent.c Fri 
Jan 13 21:40:26 2012
@@ -378,8 +378,12 @@ password_get_gpg_agent(const char **pass
 }
 
 
-/* Implementation of svn_auth__password_set_t that stores the password in
-   GPG Agent. */
+/* Implementation of svn_auth__password_set_t that would store the
+   password in GPG Agent if that's how this particular integration
+   worked.  But it isn't.  GPG Agent stores the password provided by
+   the user via the pinentry program immediately upon its provision
+   (and regardless of its accuracy as passwords go), so there's
+   nothing really to do here.  */
 static svn_boolean_t
 password_set_gpg_agent(apr_hash_t *creds,
                        const char *realmstring,

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/io.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/io.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/io.c Fri Jan 13 
21:40:26 2012
@@ -170,7 +170,7 @@ cstring_from_utf8(const char **path_apr,
 
 
 /* Set *NAME_P to the UTF-8 representation of directory entry NAME.
- * NAME is in the the internal encoding used by APR; PARENT is in
+ * NAME is in the internal encoding used by APR; PARENT is in
  * UTF-8 and in internal (not local) style.
  *
  * Use PARENT only for generating an error string if the conversion
@@ -438,7 +438,7 @@ svn_io_open_uniquely_named(apr_file_t **
               /* The variable parts of unique_name will not require UTF8
                  conversion. Therefore, if UTF8 conversion had no effect
                  on it in the first iteration, it won't require conversion
-                 in any future interation. */
+                 in any future iteration. */
               needs_utf8_conversion = strcmp(unique_name_apr, unique_name);
             }
         }
@@ -1343,7 +1343,7 @@ get_default_file_perms(apr_fileperms_t *
   static apr_fileperms_t default_perms = 0;
 
   /* Technically, this "racy": Multiple threads may use enter here and
-     try to figure out the default permisission concurrently. That's fine
+     try to figure out the default permission concurrently. That's fine
      since they will end up with the same results. Even more technical,
      apr_fileperms_t is an atomic type on 32+ bit machines.
    */
@@ -1555,7 +1555,7 @@ static apr_status_t io_utf8_to_unicode_p
      * Allocate the maximum string length based on leading 4
      * characters of \\?\ (allowing nearly unlimited path lengths)
      * plus the trailing null, then transform /'s into \\'s since
-     * the \\?\ form doesn't allow '/' path seperators.
+     * the \\?\ form doesn't allow '/' path separators.
      *
      * Note that the \\?\ form only works for local drive paths, and
      * \\?\UNC\ is needed UNC paths.
@@ -1565,7 +1565,7 @@ static apr_status_t io_utf8_to_unicode_p
     apr_status_t rv;
 
     /* This is correct, we don't twist the filename if it will
-     * definately be shorter than 248 characters.  It merits some
+     * definitely be shorter than 248 characters.  It merits some
      * performance testing to see if this has any effect, but there
      * seem to be applications that get confused by the resulting
      * Unicode \\?\ style file names, especially if they use argv[0]
@@ -2158,8 +2158,11 @@ svn_io_remove_file2(const char *path,
     }
 #endif
 
-  return svn_error_wrap_apr(apr_err, _("Can't remove file '%s'"),
-                            svn_dirent_local_style(path, scratch_pool));
+  if (apr_err)
+    return svn_error_wrap_apr(apr_err, _("Can't remove file '%s'"),
+                              svn_dirent_local_style(path, scratch_pool));
+
+  return SVN_NO_ERROR;
 }
 
 
@@ -2170,7 +2173,7 @@ svn_io_remove_dir(const char *path, apr_
 }
 
 /*
- Mac OS X has a bug where if you're readding the contents of a
+ Mac OS X has a bug where if you're reading the contents of a
  directory via readdir in a loop, and you remove one of the entries in
  the directory and the directory has 338 or more files in it you will
  skip over some of the entries in the directory.  Needless to say,
@@ -2934,9 +2937,11 @@ svn_io_detect_mimetype2(const char **mim
      heuristic. */
   if (mimetype_map)
     {
-      const char *type_from_map, *path_ext;
-      svn_path_splitext(NULL, &path_ext, file, pool);
-      fileext_tolower((char *)path_ext);
+      const char *type_from_map;
+      char *path_ext; /* Can point to physical const memory but only when
+                         svn_path_splitext sets it to "". */
+      svn_path_splitext(NULL, (const char **)&path_ext, file, pool);
+      fileext_tolower(path_ext);
       if ((type_from_map = apr_hash_get(mimetype_map, path_ext,
                                         APR_HASH_KEY_STRING)))
         {
@@ -2975,6 +2980,13 @@ svn_io_is_binary_data(const void *data, 
 {
   const unsigned char *buf = data;
 
+  if (len == 3 && buf[0] == 0xEF && buf[1] == 0xBB && buf[2] == 0xBF)
+    {
+      /* This is an empty UTF-8 file which only contains the UTF-8 BOM.
+       * Treat it as plain text. */
+      return FALSE;
+    }
+
   /* Right now, this function is going to be really stupid.  It's
      going to examine the block of data, and make sure that 15%
      of the bytes are such that their value is in the ranges 0x07-0x0D

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/iter.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/iter.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/iter.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/iter.c Fri Jan 
13 21:40:26 2012
@@ -176,6 +176,8 @@ svn_iter_apr_array(svn_boolean_t *comple
   return err;
 }
 
+/* Note: Although this is a "__" function, it is in the public ABI, so
+ * we can never remove it or change its signature. */
 svn_error_t *
 svn_iter__break(void)
 {

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/log.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/log.c?rev=1231318&r1=1231317&r2=1231318&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/log.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/log.c Fri Jan 13 
21:40:26 2012
@@ -121,7 +121,7 @@ svn_log__get_mergeinfo(const apr_array_h
 {
   int i;
   apr_pool_t *iterpool = svn_pool_create(pool);
-  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create("", pool);
+  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create_empty(pool);
 
   for (i = 0; i < paths->nelts; i++)
     {
@@ -210,8 +210,8 @@ svn_log__log(const apr_array_header_t *p
 {
   int i;
   apr_pool_t *iterpool = svn_pool_create(pool);
-  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create("", pool);
-  svn_stringbuf_t *options = svn_stringbuf_create("", pool);
+  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create_empty(pool);
+  svn_stringbuf_t *options = svn_stringbuf_create_empty(pool);
 
   for (i = 0; i < paths->nelts; i++)
     {
@@ -264,7 +264,7 @@ svn_log__get_locations(const char *path,
 {
   const svn_revnum_t *revision_ptr, *revision_ptr_start, *revision_ptr_end;
   apr_pool_t *iterpool = svn_pool_create(pool);
-  svn_stringbuf_t *space_separated_revnums = svn_stringbuf_create("", pool);
+  svn_stringbuf_t *space_separated_revnums = svn_stringbuf_create_empty(pool);
 
   revision_ptr_start = (const svn_revnum_t *)location_revisions->elts;
   revision_ptr = revision_ptr_start;
@@ -311,7 +311,7 @@ svn_log__lock(const apr_array_header_t *
 {
   int i;
   apr_pool_t *iterpool = svn_pool_create(pool);
-  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create("", pool);
+  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create_empty(pool);
 
   for (i = 0; i < paths->nelts; i++)
     {
@@ -334,7 +334,7 @@ svn_log__unlock(const apr_array_header_t
 {
   int i;
   apr_pool_t *iterpool = svn_pool_create(pool);
-  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create("", pool);
+  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create_empty(pool);
 
   for (i = 0; i < paths->nelts; i++)
     {


Reply via email to