You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/02/20 08:45:54 UTC

svn commit: r1072522 [7/9] - in /subversion/branches/performance: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ notes/ notes/wc-ng/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/...

Modified: subversion/branches/performance/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_wc/wc_db.h?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/performance/subversion/libsvn_wc/wc_db.h Sun Feb 20 07:45:48 2011
@@ -298,7 +298,7 @@ typedef struct svn_wc__db_lock_t {
 svn_error_t *
 svn_wc__db_open(svn_wc__db_t **db,
                 svn_wc__db_openmode_t mode,
-                svn_config_t *config,
+                const svn_config_t *config,
                 svn_boolean_t auto_upgrade,
                 svn_boolean_t enforce_empty_wq,
                 apr_pool_t *result_pool,
@@ -1243,10 +1243,18 @@ svn_wc__db_op_revert_actual(svn_wc__db_t
 
 
 
+/* Revert all local changes which are being maintained in the database,
+ * including conflict storage, properties and text modification status.
+ *
+ * This is a non-recursive operation.
+ *
+ * Returns SVN_ERR_WC_INVALID_OPERATION_DEPTH if the revert is not
+ * possible, e.g. copy/delete but not a root, or a copy root with
+ * children.
+ */
 svn_error_t *
 svn_wc__db_op_revert(svn_wc__db_t *db,
                      const char *local_abspath,
-                     svn_depth_t depth,
                      apr_pool_t *scratch_pool);
 
 
@@ -1580,9 +1588,10 @@ svn_wc__db_read_props(apr_hash_t **props
 svn_error_t *
 svn_wc__db_read_props_of_files(svn_wc__db_t *db,
                                const char *local_abspath,
-                               svn_wc__proplist_receiver_t
-                                 receiver_func,
+                               svn_wc__proplist_receiver_t receiver_func,
                                void *receiver_baton,
+                               svn_cancel_func_t cancel_func,
+                               void *cancel_baton,
                                apr_pool_t *scratch_pool);
 
 /* Call RECEIVER_FUNC, passing RECEIVER_BATON, an absolute path, and
@@ -1592,11 +1601,25 @@ svn_wc__db_read_props_of_files(svn_wc__d
 svn_error_t *
 svn_wc__db_read_props_of_immediates(svn_wc__db_t *db,
                                     const char *local_abspath,
-                                    svn_wc__proplist_receiver_t
-                                      receiver_func,
+                                    svn_wc__proplist_receiver_t receiver_func,
                                     void *receiver_baton,
+                                    svn_cancel_func_t cancel_func,
+                                    void *cancel_baton,
                                     apr_pool_t *scratch_pool);
 
+/* Call RECEIVER_FUNC, passing RECEIVER_BATON, an absolute path, and
+ * a hash table mapping <tt>char *</tt> names onto svn_string_t *
+ * values for any properties of all (recursive) child nodes of LOCAL_ABSPATH.
+ */
+svn_error_t *
+svn_wc__db_read_props_recursive(svn_wc__db_t *db,
+                                const char *local_abspath,
+                                svn_wc__proplist_receiver_t receiver_func,
+                                void *receiver_baton,
+                                svn_cancel_func_t cancel_func,
+                                void *cancel_baton,
+                                apr_pool_t *scratch_pool);
+
 /* Set *PROPS to the properties of the node LOCAL_ABSPATH in the WORKING
    tree (looking through to the BASE tree as required).
 
@@ -2294,14 +2317,6 @@ svn_wc__db_temp_get_format(int *format,
                            const char *local_dir_abspath,
                            apr_pool_t *scratch_pool);
 
-/* ### reset any cached format version. it has probably changed.  */
-svn_error_t *
-svn_wc__db_temp_reset_format(int format,
-                             svn_wc__db_t *db,
-                             const char *local_dir_abspath,
-                             apr_pool_t *scratch_pool);
-
-
 /* ### temp functions to manage/store access batons within the DB.  */
 svn_wc_adm_access_t *
 svn_wc__db_temp_get_access(svn_wc__db_t *db,

Modified: subversion/branches/performance/subversion/libsvn_wc/wc_db_pdh.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_wc/wc_db_pdh.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_wc/wc_db_pdh.c (original)
+++ subversion/branches/performance/subversion/libsvn_wc/wc_db_pdh.c Sun Feb 20 07:45:48 2011
@@ -158,7 +158,7 @@ svn_wc__db_pdh_get_or_create(svn_wc__db_
 svn_error_t *
 svn_wc__db_open(svn_wc__db_t **db,
                 svn_wc__db_openmode_t mode,
-                svn_config_t *config,
+                const svn_config_t *config,
                 svn_boolean_t auto_upgrade,
                 svn_boolean_t enforce_empty_wq,
                 apr_pool_t *result_pool,
@@ -284,6 +284,7 @@ svn_wc__db_pdh_create_wcroot(svn_wc__db_
      uses. */
   (*wcroot)->owned_locks = apr_array_make(result_pool, 8,
                                           sizeof(svn_wc__db_wclock_t));
+  (*wcroot)->access_cache = apr_hash_make(result_pool);
 
   /* SDB will be NULL for pre-NG working copies. We only need to run a
      cleanup when the SDB is present.  */
@@ -607,7 +608,6 @@ svn_wc__db_pdh_parse_local_abspath(svn_w
 
       /* Point the child PDH at this (new) parent PDH. This will allow for
          easy traversals without path munging.  */
-      child_pdh->parent = parent_pdh;
       child_pdh = parent_pdh;
 
       /* Loop if we haven't reached the PDH we found, or the abspath
@@ -622,30 +622,24 @@ svn_wc__db_pdh_parse_local_abspath(svn_w
 }
 
 svn_error_t *
-svn_wc__db_pdh_navigate_to_parent(svn_wc__db_pdh_t **parent_pdh,
-                                  svn_wc__db_t *db,
-                                  svn_wc__db_pdh_t *child_pdh,
-                                  svn_sqlite__mode_t smode,
-                                  apr_pool_t *scratch_pool)
+svn_wc__db_wcroot_parse_local_abspath(svn_wc__db_wcroot_t **wcroot,
+                                      const char **local_relpath,
+                                      svn_wc__db_t *db,
+                                      const char *local_abspath,
+                                      svn_sqlite__mode_t smode,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool)
 {
-  const char *parent_abspath;
-  const char *local_relpath;
+  svn_wc__db_pdh_t *pdh;
 
-  if ((*parent_pdh = child_pdh->parent) != NULL
-      && (*parent_pdh)->wcroot != NULL)
-    return SVN_NO_ERROR;
-
-  /* Make sure we don't see the root as its own parent */
-  SVN_ERR_ASSERT(!svn_dirent_is_root(child_pdh->local_abspath,
-                                     strlen(child_pdh->local_abspath)));
-
-  parent_abspath = svn_dirent_dirname(child_pdh->local_abspath, scratch_pool);
-  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(parent_pdh, &local_relpath, db,
-                              parent_abspath, smode,
-                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(*parent_pdh);
-
-  child_pdh->parent = *parent_pdh;
+  /* Ideally, we'd only grab the PDH if requested, rather than unconditionally.
+     That is, we'd call this function from pdh_parse_local_abspath(), instead
+     of the other way around.  However, for the time being, we're going to
+     go with short and simple here. */
+  SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, local_relpath, db,
+                                             local_abspath, smode, result_pool,
+                                             scratch_pool));
+  *wcroot = pdh->wcroot;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/performance/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_wc/wc_db_pristine.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/performance/subversion/libsvn_wc/wc_db_pristine.c Sun Feb 20 07:45:48 2011
@@ -133,7 +133,7 @@ svn_wc__db_pristine_get_path(const char 
                                              db, wri_abspath,
                                              svn_sqlite__mode_readonly,
                                              scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(pdh);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   SVN_ERR(svn_wc__db_pristine_check(&present, db, wri_abspath, sha1_checksum,
                                     scratch_pool));
@@ -189,7 +189,7 @@ svn_wc__db_pristine_read(svn_stream_t **
   SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(pdh);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   /* ### should we look in the PRISTINE table for anything?  */
 
@@ -219,7 +219,7 @@ svn_wc__db_pristine_get_tempdir(const ch
   SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(pdh);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   *temp_dir_abspath = svn_dirent_join_many(result_pool,
                                            pdh->wcroot->abspath,
@@ -262,7 +262,7 @@ svn_wc__db_pristine_install(svn_wc__db_t
   SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(pdh);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   SVN_ERR(get_pristine_fname(&pristine_abspath, pdh->wcroot->abspath,
                              sha1_checksum,
@@ -318,7 +318,7 @@ svn_wc__db_pristine_get_md5(const svn_ch
   SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(pdh);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
                                     STMT_SELECT_PRISTINE_MD5_CHECKSUM));
@@ -358,7 +358,7 @@ svn_wc__db_pristine_get_sha1(const svn_c
   SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(pdh);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
                                     STMT_SELECT_PRISTINE_SHA1_CHECKSUM));
@@ -431,7 +431,7 @@ svn_wc__db_pristine_remove(svn_wc__db_t 
   SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
                               wri_abspath, svn_sqlite__mode_readwrite,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(pdh);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   /* If the work queue is not empty, don't delete any pristine text because
    * the work queue may contain a reference to it. */
@@ -498,7 +498,7 @@ svn_wc__db_pristine_cleanup(svn_wc__db_t
   SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(pdh);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   SVN_ERR(pristine_cleanup_wcroot(pdh->wcroot, scratch_pool));
 
@@ -534,7 +534,7 @@ svn_wc__db_pristine_check(svn_boolean_t 
   SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
                               wri_abspath, svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
-  VERIFY_USABLE_PDH(pdh);
+  VERIFY_USABLE_WCROOT(pdh->wcroot);
 
   /* Check that there is an entry in the PRISTINE table. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,

Modified: subversion/branches/performance/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_wc/wc_db_private.h?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/performance/subversion/libsvn_wc/wc_db_private.h Sun Feb 20 07:45:48 2011
@@ -39,7 +39,7 @@ struct svn_wc__db_t {
 
   /* We need the config whenever we run into a new WC directory, in order
      to figure out where we should look for the corresponding datastore. */
-  svn_config_t *config;
+  const svn_config_t *config;
 
   /* Should we attempt to automatically upgrade the database when it is
      opened, and found to be not-current?  */
@@ -88,6 +88,10 @@ typedef struct svn_wc__db_wcroot_t {
      Typically just one or two locks maximum. */
   apr_array_header_t *owned_locks;
 
+  /* Map a working copy diretory to a cached adm_access baton.
+     const char *local_abspath -> svn_wc_adm_access_t *adm_access */
+  apr_hash_t *access_cache;
+
 } svn_wc__db_wcroot_t;
 
 /**  Pristine Directory Handle
@@ -103,11 +107,6 @@ typedef struct svn_wc__db_pdh_t {
   /* What wcroot does this directory belong to?  */
   svn_wc__db_wcroot_t *wcroot;
 
-  /* The parent directory's per-dir information. */
-  struct svn_wc__db_pdh_t *parent;
-
-  /* Hold onto the old-style access baton that corresponds to this PDH.  */
-  svn_wc_adm_access_t *adm_access;
 } svn_wc__db_pdh_t;
 
 
@@ -159,25 +158,26 @@ svn_wc__db_pdh_parse_local_abspath(svn_w
                                    apr_pool_t *result_pool,
                                    apr_pool_t *scratch_pool);
 
+/* Similar to svn_wc__db_pdh_parse_local_abspath(), but only return the WCROOT,
+   rather than a full PDH. */
+svn_error_t *
+svn_wc__db_wcroot_parse_local_abspath(svn_wc__db_wcroot_t **wcroot,
+                                      const char **local_relpath,
+                                      svn_wc__db_t *db,
+                                      const char *local_abspath,
+                                      svn_sqlite__mode_t smode,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool);
+
 /* POOL may be NULL if the lifetime of LOCAL_ABSPATH is sufficient.  */
 const char *
 svn_wc__db_pdh_compute_relpath(const svn_wc__db_pdh_t *pdh,
                                apr_pool_t *result_pool);
 
-/* Gets or opens the PDH of the parent directory of CHILD_PDH.
-   (This function doesn't verify if the PDHs are related) */
-svn_error_t *
-svn_wc__db_pdh_navigate_to_parent(svn_wc__db_pdh_t **parent_pdh,
-                                  svn_wc__db_t *db,
-                                  svn_wc__db_pdh_t *child_pdh,
-                                  svn_sqlite__mode_t smode,
-                                  apr_pool_t *scratch_pool);
-
-/* Assert that the given PDH is usable.
+/* Assert that the given WCROOT is usable.
    NOTE: the expression is multiply-evaluated!!  */
-#define VERIFY_USABLE_PDH(pdh) SVN_ERR_ASSERT(  \
-    (pdh)->wcroot != NULL                       \
-    && (pdh)->wcroot->format == SVN_WC__VERSION)
+#define VERIFY_USABLE_WCROOT(wcroot)  SVN_ERR_ASSERT(               \
+    (wcroot) != NULL && (wcroot)->format == SVN_WC__VERSION)
 
 /* */
 svn_error_t *

Modified: subversion/branches/performance/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_authz_svn/mod_authz_svn.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/performance/subversion/mod_authz_svn/mod_authz_svn.c Sun Feb 20 07:45:48 2011
@@ -85,8 +85,8 @@ AuthzSVNAccessFile_cmd(cmd_parms *cmd, v
   authz_svn_config_rec *conf = config;
 
   if (conf->repo_relative_access_file != NULL)
-    return "AuthzSVNAccessFile cannot be defined at "
-           "same time as AuthzSVNReposRelativeAccessFile.";
+    return "AuthzSVNAccessFile and AuthzSVNReposRelativeAccessFile "
+           "directives are mutually exclusive.";
 
   conf->access_file = ap_server_root_relative(cmd->pool, arg1);
 
@@ -102,8 +102,8 @@ AuthzSVNReposRelativeAccessFile_cmd(cmd_
   authz_svn_config_rec *conf = config;
 
   if (conf->access_file != NULL)
-    return "AuthzSVNReposRelativeAccessFile cannot be defined at "
-           "same time as AuthzSVNAccessFile.";
+    return "AuthzSVNAccessFile and AuthzSVNReposRelativeAccessFile "
+           "directives are mutually exclusive.";
 
   conf->repo_relative_access_file = arg1;
 
@@ -577,15 +577,15 @@ subreq_bypass(request_rec *r,
   username_to_authorize = get_username_to_authorize(r, conf);
 
   /* If configured properly, this should never be true, but just in case. */
-  if (!conf->anonymous || !conf->access_file
-      || !conf->repo_relative_access_file)
+  if (!conf->anonymous
+      || (! (conf->access_file || conf->repo_relative_access_file)))
     {
       log_access_verdict(APLOG_MARK, r, 0, repos_path, NULL);
       return HTTP_FORBIDDEN;
     }
 
   /* Retrieve authorization file */
-  access_conf = get_access_conf(r,conf);
+  access_conf = get_access_conf(r, conf);
   if (access_conf == NULL)
     return HTTP_FORBIDDEN;
 
@@ -643,7 +643,7 @@ access_checker(request_rec *r)
 
   /* We are not configured to run */
   if (!conf->anonymous
-      || (!conf->access_file && !conf->repo_relative_access_file))
+      || (! (conf->access_file || conf->repo_relative_access_file)))
     return DECLINED;
 
   if (ap_some_auth_required(r))
@@ -701,8 +701,8 @@ check_user_id(request_rec *r)
 
   /* We are not configured to run, or, an earlier module has already
    * authenticated this request. */
-  if ((!conf->access_file && !conf->repo_relative_access_file)
-      || !conf->no_auth_when_anon_ok || r->user)
+  if (!conf->no_auth_when_anon_ok || r->user
+      || (! (conf->access_file || conf->repo_relative_access_file)))
     return DECLINED;
 
   /* If anon access is allowed, return OK, preventing later modules
@@ -729,7 +729,7 @@ auth_checker(request_rec *r)
   int status;
 
   /* We are not configured to run */
-  if (!conf->access_file && !conf->repo_relative_access_file)
+  if (! (conf->access_file || conf->repo_relative_access_file))
     return DECLINED;
 
   /* Previous hook (check_user_id) already did all the work,

Modified: subversion/branches/performance/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/dav_svn.h?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/dav_svn.h Sun Feb 20 07:45:48 2011
@@ -370,6 +370,8 @@ const char *dav_svn__get_activities_db(r
 /* ### Is this assumed to be URI-encoded? */
 const char *dav_svn__get_root_dir(request_rec *r);
 
+/* Return the data compression level to be used over the wire. */
+int dav_svn__get_compression_level(void);
 
 /** For HTTP protocol v2, these are the new URIs and URI stubs
     returned to the client in our OPTIONS response.  They all depend

Modified: subversion/branches/performance/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/mod_dav_svn.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/mod_dav_svn.c Sun Feb 20 07:45:48 2011
@@ -101,6 +101,10 @@ extern module AP_MODULE_DECLARE_DATA dav
 /* The authz_svn provider for bypassing path authz. */
 static authz_svn__subreq_bypass_func_t pathauthz_bypass_func = NULL;
 
+/* The compression level we will pass to svn_txdelta_to_svndiff3()
+ * for wire-compression */
+static int svn__compression_level = SVN_DEFAULT_COMPRESSION_LEVEL;
+
 static int
 init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 {
@@ -420,25 +424,18 @@ SVNSpecialURI_cmd(cmd_parms *cmd, void *
   return NULL;
 }
 
-static apr_uint64_t
-parse_number(const char *arg)
-{
-  const char *c;
-  for (c = arg; *c != 0; ++c)
-    if (!svn_ctype_isdigit (*c))
-      return (apr_uint64_t)(-1);
-
-  return apr_strtoi64(arg, NULL, 0);
-}
-
 static const char *
 SVNInMemoryCacheSize_cmd(cmd_parms *cmd, void *config, const char *arg1)
 {
   svn_fs_cache_config_t settings = *svn_fs_get_cache_config();
 
-  apr_uint64_t value = parse_number(arg1);
-  if (value == (apr_uint64_t)(-1))
-    return "Invalid decimal number for the SVN cache size.";
+  apr_uint64_t value = 0;
+  svn_error_t *err = svn_cstring_atoui64(&value, arg1);
+  if (err)
+    {
+      svn_error_clear(err);
+      return "Invalid decimal number for the SVN cache size.";
+    }
 
   settings.cache_size = value * 0x100000;
 
@@ -448,6 +445,32 @@ SVNInMemoryCacheSize_cmd(cmd_parms *cmd,
 }
 
 static const char *
+SVNCompressionLevel_cmd(cmd_parms *cmd, void *config, const char *arg1)
+{
+  svn_fs_cache_config_t settings = *svn_fs_get_cache_config();
+
+  int value = 0;
+  svn_error_t *err = svn_cstring_atoi(&value, arg1);
+  if (err)
+    {
+      svn_error_clear(err);
+      return "Invalid decimal number for the SVN compression level.";
+    }
+
+  if ((value < SVN_NO_COMPRESSION_LEVEL) || (value > SVN_BEST_COMPRESSION_LEVEL))
+    return apr_psprintf(cmd->pool,
+                        "%d is not a valid compression level. "
+                        "The valid range is %d .. %d.",
+                        value,
+                        (int)SVN_NO_COMPRESSION_LEVEL,
+                        (int)SVN_BEST_COMPRESSION_LEVEL);
+
+  svn__compression_level = value;
+
+  return NULL;
+}
+
+static const char *
 SVNMaxOpenFileHandles_cmd(cmd_parms *cmd, void *config, const char *arg1)
 {
   svn_fs_cache_config_t settings = *svn_fs_get_cache_config();
@@ -698,6 +721,12 @@ dav_svn__get_activities_db(request_rec *
 }
 
 
+int
+dav_svn__get_compression_level(void)
+{
+  return svn__compression_level;
+}
+
 static void
 merge_xml_filter_insert(request_rec *r)
 {
@@ -903,10 +932,16 @@ static const command_rec cmds[] =
 
   /* per server */
   AP_INIT_TAKE1("SVNInMemoryCacheSize", SVNInMemoryCacheSize_cmd, NULL,
-               RSRC_CONF,
-               "specify the maximum size im MB per process of Subversion's "
-               "in-memory object cache (default values is 128 if threading "
-               "is supported, 16 if not; 0 deactivates the cache)."),
+                RSRC_CONF,
+                "specifies the maximum size im MB per process of Subversion's "
+                "in-memory object cache (default value is 16; 0 deactivates "
+                "the cache)."),
+  /* per server */
+  AP_INIT_TAKE1("SVNCompressionLevel", SVNCompressionLevel_cmd, NULL,
+                RSRC_CONF,
+                "specifies the ZIP compression level used before sending file "
+                "content over the network (0 for no compression, 9 for best, "
+                "5 is default)."),
 
   /* per server */
   AP_INIT_TAKE1("SVNMaxOpenFileHandles", SVNMaxOpenFileHandles_cmd, NULL,

Modified: subversion/branches/performance/subversion/mod_dav_svn/reports/file-revs.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/reports/file-revs.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/reports/file-revs.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/reports/file-revs.c Sun Feb 20 07:45:48 2011
@@ -206,8 +206,9 @@ file_rev_handler(void *baton,
 
       base64_stream = dav_svn__make_base64_output_stream(frb->bb, frb->output,
                                                          pool);
-      svn_txdelta_to_svndiff2(&frb->window_handler, &frb->window_baton,
-                              base64_stream, frb->svndiff_version, pool);
+      svn_txdelta_to_svndiff3(&frb->window_handler, &frb->window_baton,
+                              base64_stream, frb->svndiff_version,
+                              dav_svn__get_compression_level(), pool);
       *window_handler = delta_window_handler;
       *window_baton = frb;
       /* Start the txdelta element wich will be terminated by the window

Modified: subversion/branches/performance/subversion/mod_dav_svn/reports/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/reports/replay.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/reports/replay.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/reports/replay.c Sun Feb 20 07:45:48 2011
@@ -320,12 +320,13 @@ apply_textdelta(void *file_baton,
   else
     SVN_ERR(dav_svn__brigade_puts(eb->bb, eb->output, ">"));
 
-  svn_txdelta_to_svndiff2(handler,
+  svn_txdelta_to_svndiff3(handler,
                           handler_baton,
                           dav_svn__make_base64_output_stream(eb->bb,
                                                              eb->output,
                                                              pool),
                           0,
+                          dav_svn__get_compression_level(),
                           pool);
 
   eb->sending_textdelta = TRUE;

Modified: subversion/branches/performance/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/reports/update.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/reports/update.c Sun Feb 20 07:45:48 2011
@@ -779,9 +779,9 @@ upd_apply_textdelta(void *file_baton,
                                                      wb->uc->output,
                                                      file->pool);
 
-  svn_txdelta_to_svndiff2(&(wb->handler), &(wb->handler_baton),
+  svn_txdelta_to_svndiff3(&(wb->handler), &(wb->handler_baton),
                           base64_stream, file->uc->svndiff_version,
-                          file->pool);
+                          dav_svn__get_compression_level(), file->pool);
 
   *handler = window_handler;
   *handler_baton = wb;

Modified: subversion/branches/performance/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/repos.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/repos.c Sun Feb 20 07:45:48 2011
@@ -2078,8 +2078,7 @@ get_resource(request_rec *r,
             apr_array_header_t *vals
               = svn_cstring_split(val, ",", TRUE, r->pool);
 
-            if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_MERGEINFO,
-                                            vals))
+            if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
               {
                 apr_hash_set(repos->client_capabilities,
                              SVN_RA_CAPABILITY_MERGEINFO,
@@ -2186,8 +2185,10 @@ get_resource(request_rec *r,
       dav_locktoken_list *list = ltl;
 
       serr = svn_fs_get_access(&access_ctx, repos->fs);
-      if (serr)
+      if (serr || !access_ctx)
         {
+          if (serr == NULL)
+            serr = svn_error_create(SVN_ERR_FS_LOCK_OWNER_MISMATCH, NULL, NULL);
           return dav_svn__sanitize_error(serr, "Lock token is in request, "
                                          "but no user name",
                                          HTTP_BAD_REQUEST, r);
@@ -3508,8 +3509,9 @@ deliver(const dav_resource *resource, ap
           svn_stream_set_close(o_stream, close_filter);
 
           /* get a handler/baton for writing into the output stream */
-          svn_txdelta_to_svndiff2(&handler, &h_baton,
+          svn_txdelta_to_svndiff3(&handler, &h_baton,
                                   o_stream, resource->info->svndiff_version,
+                                  dav_svn__get_compression_level(),
                                   resource->pool);
 
           /* got everything set up. read in delta windows and shove them into

Modified: subversion/branches/performance/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/version.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/version.c Sun Feb 20 07:45:48 2011
@@ -1271,11 +1271,13 @@ dav_svn__push_locks(dav_resource *resour
   svn_error_t *serr;
 
   serr = svn_fs_get_access(&fsaccess, resource->info->repos->fs);
-  if (serr)
+  if (serr || !fsaccess)
     {
       /* If an authenticated user name was attached to the request,
          then dav_svn_get_resource() should have already noticed and
          created an fs_access_t in the filesystem.  */
+      if (serr == NULL)
+        serr = svn_error_create(SVN_ERR_FS_LOCK_OWNER_MISMATCH, NULL, NULL);
       return dav_svn__sanitize_error(serr, "Lock token(s) in request, but "
                                      "missing an user name", HTTP_BAD_REQUEST,
                                      resource->info->r);

Modified: subversion/branches/performance/subversion/po/zh_CN.po
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/po/zh_CN.po?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/po/zh_CN.po [UTF-8] (original)
+++ subversion/branches/performance/subversion/po/zh_CN.po [UTF-8] Sun Feb 20 07:45:48 2011
@@ -55,8 +55,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: subversion 1.7\n"
 "Report-Msgid-Bugs-To: dev@subversion.apache.org\n"
-"POT-Creation-Date: 2011-02-04 14:37+0800\n"
-"PO-Revision-Date: 2011-02-04 14:34+0800\n"
+"POT-Creation-Date: 2011-02-15 15:12+0800\n"
+"PO-Revision-Date: 2011-02-15 15:11+0800\n"
 "Last-Translator: Subversion Developers <de...@subversion.apache.org>\n"
 "Language-Team: Simplified Chinese <de...@subversion.apache.org>\n"
 "Language: \n"
@@ -1282,14 +1282,8 @@ msgid "'%s' already exists"
 msgstr "“%s” 已存在"
 
 #, c-format
-msgid ""
-"Checksum mismatch for '%s':\n"
-"   expected:  %s\n"
-"     actual:  %s\n"
-msgstr ""
-"'%s' 的校验和不匹配:\n"
-"      期望:  %s\n"
-"      实际:  %s\n"
+msgid "Checksum mismatch for '%s'"
+msgstr "'%s' 的校验和不匹配"
 
 #, c-format
 msgid ""
@@ -2298,10 +2292,6 @@ msgid ""
 "Can't increment mergeinfo count on *file* node-revision %%s to %%%s (> 1)"
 msgstr "不能在*文件*修订节点增加合并信息计数 %%s 到 %%%s (> 1)"
 
-#, c-format
-msgid "Checksum mismatch for '%s'"
-msgstr "'%s' 的校验和不匹配"
-
 msgid "Empty noderev in cache"
 msgstr "缓存中 noderev 为空"
 
@@ -3131,44 +3121,6 @@ msgid "Error reading spooled %s request 
 msgstr "读取请求 %s 响应的脱机数据时出现错误"
 
 #, c-format
-msgid "%s Authentication failed"
-msgstr "%s 认证失败"
-
-#, c-format
-msgid ""
-"%s authentication not supported.\n"
-"Authentication failed"
-msgstr ""
-"不支持 %s 认证。\n"
-"认证失败"
-
-msgid "Missing 'realm' attribute in Authorization header"
-msgstr "授权头丢失属性 “realm”"
-
-msgid ""
-"No more credentials or we tried too many times.\n"
-"Authentication failed"
-msgstr ""
-"没有凭证或已经试了太多次。\n"
-"认证失败"
-
-msgid "Proxy authentication failed"
-msgstr "代理认证失败"
-
-msgid "Incorrect response-digest in Authentication-Info header."
-msgstr "认证信息头中的 response-digest 错误"
-
-#, c-format
-msgid ""
-"Initialization of the GSSAPI context failed.\n"
-" %s\n"
-" %s\n"
-msgstr ""
-"初始化 GSSAPI 失败。\n"
-" %s\n"
-" %s\n"
-
-#, c-format
 msgid "%s of '%s': %d %s"
 msgstr "%s 于 '%s': %d %s"
 
@@ -3256,8 +3208,8 @@ msgid "Module for accessing a repository
 msgstr "通过 WebDAV 协议使用 serf 访问版本库的模块。"
 
 #, c-format
-msgid "Could not lookup hostname `%s'"
-msgstr "无法解析主机 “%s” 的地址"
+msgid "Could not resolve proxy server '%s'"
+msgstr "不能解析代理服务器“%s”"
 
 msgid "The OPTIONS response did not include the requested resourcetype value"
 msgstr "OPTIONS 响应中没有包含请求的 resourcetype 值。"
@@ -3289,6 +3241,16 @@ msgstr "非法 DAV:status CDATA '%s'"
 msgid "XML parsing failed: (%d %s)"
 msgstr "XML 解析失败: (%d %s)"
 
+msgid ""
+"No more credentials or we tried too many times.\n"
+"Authentication failed"
+msgstr ""
+"没有凭证或已经试了太多次。\n"
+"认证失败"
+
+msgid "Proxy authentication failed"
+msgstr "代理认证失败"
+
 #, c-format
 msgid "Premature EOF seen from server (http status=%d)"
 msgstr "从服务器发现 EOF 太早 (http status=%d)"
@@ -3307,14 +3269,6 @@ msgid "'%s': no lock token available"
 msgstr "“%s”:没有可用的锁定令牌"
 
 #, c-format
-msgid "SSPI Initialization failed."
-msgstr "SSPI初始化失败"
-
-#, c-format
-msgid "Authentication failed with error 0x%x."
-msgstr "认证失败,错误代码 0x%x 。"
-
-#, c-format
 msgid "Unknown hostname '%s'"
 msgstr "未知的主机“%s”"
 
@@ -3961,6 +3915,10 @@ msgid "Error opening db lockfile"
 msgstr "打开数据库锁文件出错"
 
 #, c-format
+msgid "'%s' is an existing repository"
+msgstr "版本库的“%s”已经存在"
+
+#, c-format
 msgid "'%s' is a subdirectory of an existing repository rooted at '%s'"
 msgstr "“%s” 是当前根为 “%s” 的版本库的子目录"
 
@@ -4010,6 +3968,19 @@ msgstr "不能解锁缓存互斥体"
 msgid "Can't create cache mutex"
 msgstr "不能创建缓存互斥体"
 
+#. We are OOM. There is no need to proceed with "half a cache".
+#.
+#, c-format
+msgid "OOM"
+msgstr "内存不足"
+
+#, c-format
+msgid "APR doesn't support threads"
+msgstr "APR 不支持 线程"
+
+msgid "Can't iterate a membuffer-based cache"
+msgstr "不能迭代基于内存的缓存"
+
 #, c-format
 msgid "Unknown memcached error while reading"
 msgstr "当读取时出现未知的 memcached 错误"
@@ -4046,6 +4017,16 @@ msgid "Unknown error creating apr_memcac
 msgstr "创建 memcache apr_memcache_t 时出现未知错误"
 
 #, c-format
+msgid ""
+"%s:\n"
+"   expected:  %s\n"
+"     actual:  %s\n"
+msgstr ""
+"%s:\n"
+"      期望:  %s\n"
+"      实际:  %s\n"
+
+#, c-format
 msgid "Error initializing command line arguments"
 msgstr "初始化命令行参数出错"
 
@@ -5539,6 +5520,16 @@ msgstr ""
 "       记录:  %s\n"
 
 #, c-format
+msgid ""
+"Checksum mismatch for '%s':\n"
+"   expected:  %s\n"
+"     actual:  %s\n"
+msgstr ""
+"'%s' 的校验和不匹配:\n"
+"      期望:  %s\n"
+"      实际:  %s\n"
+
+#, c-format
 msgid "Unrecognized node kind: '%s'"
 msgstr "无法识别的节点种类: “%s”"
 
@@ -5631,6 +5622,14 @@ msgid "Can't store properties for '%s' i
 msgstr "不能存储 '%s' 的属性,在 '%s' 中。"
 
 #, c-format
+msgid "Can't revert '%s' without reverting children"
+msgstr "不能恢复 '%s',而不恢复孩子。"
+
+#, c-format
+msgid "Can't revert '%s' without reverting parent"
+msgstr "不能恢复 '%s',而不恢复父亲。"
+
+#, c-format
 msgid "Corrupt data for '%s'"
 msgstr "'%s' 的数据损坏"
 
@@ -5743,6 +5742,9 @@ msgstr "为 '%s' 处理 post-commit 出� msgid "Unrecognized work item in the queue associated with '%s'"
 msgstr "“%s” 关联的队列中的项目无法识别"
 
+msgid "Could not add all targets because some targets don't exist"
+msgstr "因为一些目标不存在,所以不能增加全部目标"
+
 msgid "'verbose' option invalid in XML mode"
 msgstr "在XML模式中“verbose”选项无效"
 
@@ -6224,6 +6226,9 @@ msgstr "%b %d %H:%M"
 msgid "%b %d  %Y"
 msgstr "%Y-%m-%d"
 
+msgid "Could not list all targets because some targets don't exist"
+msgstr "因为一些目标不存在,所以不能列出全部目标"
+
 msgid "Lock comment contains a zero byte"
 msgstr "加锁注释中有一个零字节"
 
@@ -7907,6 +7912,9 @@ msgstr ""
 "          >   local missing, incoming edit upon update\n"
 "    D       wc/qax.c\n"
 
+msgid "don't print unversioned items"
+msgstr "不打印未版本控制的条目"
+
 #, fuzzy
 msgid ""
 "Update the working copy to a different URL within the same repository.\n"
@@ -10054,8 +10062,20 @@ msgid ""
 msgstr ""
 "在使用主机名称监听时,首选 IPv6\n"
 "                             [默认首选 IPv4。不支持在守护进程模式中同时使用 "
-"IPv4 和 IPv6\n"
-"                             如果需要,请使用 inetd 模式或隧道模式。]"
+"IPv4\n"
+"                             和 IPv6。如果需要,请使用 inetd 模式或隧道模式。]"
+
+msgid ""
+"size of the extra in-memory cache in MB used to\n"
+"                             minimize redundant operations.\n"
+"                             Default is 128 for threaded and 16 for non-\n"
+"                             threaded mode.\n"
+"                             [used for FSFS repositories only]"
+msgstr ""
+"用来减少冗余操作的内存中的额外高速缓存的大小(MB)\n"
+"                             线程模型的默认值是 128,非线程模型的默认值是 "
+"16。\n"
+"                             [仅用于 FSFS 仓库]"
 
 #. ### Making the assumption here that WIN32 never has fork and so
 #. * ### this option never exists when --service exists.

Modified: subversion/branches/performance/subversion/svn/add-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/add-cmd.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/add-cmd.c (original)
+++ subversion/branches/performance/subversion/svn/add-cmd.c Sun Feb 20 07:45:48 2011
@@ -51,6 +51,7 @@ svn_cl__add(apr_getopt_t *os,
   apr_array_header_t *targets;
   int i;
   apr_pool_t *iterpool;
+  svn_boolean_t seen_nonexistent_target = FALSE;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -79,6 +80,7 @@ svn_cl__add(apr_getopt_t *os,
   for (i = 0; i < targets->nelts; i++)
     {
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
+      svn_boolean_t success;
 
       svn_pool_clear(iterpool);
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
@@ -87,12 +89,21 @@ svn_cl__add(apr_getopt_t *os,
                                opt_state->depth,
                                opt_state->force, opt_state->no_ignore,
                                opt_state->parents, ctx, iterpool),
-               NULL, opt_state->quiet,
+               &success, opt_state->quiet,
                SVN_ERR_ENTRY_EXISTS,
                SVN_ERR_WC_PATH_NOT_FOUND,
                SVN_NO_ERROR));
+
+      if (! success)
+        seen_nonexistent_target = TRUE;
     }
 
   svn_pool_destroy(iterpool);
-  return SVN_NO_ERROR;
+
+  if (seen_nonexistent_target)
+    return svn_error_create(
+      SVN_ERR_ILLEGAL_TARGET, NULL,
+      _("Could not add all targets because some targets don't exist"));
+  else
+    return SVN_NO_ERROR;
 }

Modified: subversion/branches/performance/subversion/svn/blame-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/blame-cmd.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/blame-cmd.c (original)
+++ subversion/branches/performance/subversion/svn/blame-cmd.c Sun Feb 20 07:45:48 2011
@@ -245,6 +245,7 @@ svn_cl__blame(apr_getopt_t *os,
   int i;
   svn_boolean_t end_revision_unspecified = FALSE;
   svn_diff_file_options_t *diff_options = svn_diff_file_options_create(pool);
+  svn_boolean_t seen_nonexistent_target = FALSE;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -377,6 +378,15 @@ svn_cl__blame(apr_getopt_t *os,
                                           _("Skipping binary file: '%s'\n"),
                                           target));
             }
+          else if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND ||
+                   err->apr_err == SVN_ERR_FS_NOT_FILE ||
+                   err->apr_err == SVN_ERR_FS_NOT_FOUND)
+            {
+              svn_handle_warning2(stderr, err, "svn: ");
+              svn_error_clear(err);
+              err = NULL;
+              seen_nonexistent_target = TRUE;
+            }
           else
             {
               return svn_error_return(err);
@@ -396,5 +406,11 @@ svn_cl__blame(apr_getopt_t *os,
   if (opt_state->xml && ! opt_state->incremental)
     SVN_ERR(svn_cl__xml_print_footer("blame", pool));
 
-  return SVN_NO_ERROR;
+  if (seen_nonexistent_target)
+    return svn_error_create(
+      SVN_ERR_ILLEGAL_TARGET, NULL,
+      _("Could not perform blame on all targets because some "
+        "targets don't exist"));
+  else
+    return SVN_NO_ERROR;
 }

Modified: subversion/branches/performance/subversion/svn/cat-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/cat-cmd.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/cat-cmd.c (original)
+++ subversion/branches/performance/subversion/svn/cat-cmd.c Sun Feb 20 07:45:48 2011
@@ -32,6 +32,8 @@
 #include "svn_error.h"
 #include "cl.h"
 
+#include "svn_private_config.h"
+
 
 /*** Code. ***/
 
@@ -47,6 +49,7 @@ svn_cl__cat(apr_getopt_t *os,
   int i;
   svn_stream_t *out;
   apr_pool_t *subpool = svn_pool_create(pool);
+  svn_boolean_t seen_nonexistent_target = FALSE;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -63,6 +66,7 @@ svn_cl__cat(apr_getopt_t *os,
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
       const char *truepath;
       svn_opt_revision_t peg_revision;
+      svn_boolean_t success;
 
       svn_pool_clear(subpool);
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
@@ -74,13 +78,21 @@ svn_cl__cat(apr_getopt_t *os,
       SVN_ERR(svn_cl__try(svn_client_cat2(out, truepath, &peg_revision,
                                           &(opt_state->start_revision),
                                           ctx, subpool),
-                           NULL, opt_state->quiet,
+                           &success, opt_state->quiet,
                            SVN_ERR_UNVERSIONED_RESOURCE,
                            SVN_ERR_ENTRY_NOT_FOUND,
                            SVN_ERR_CLIENT_IS_DIRECTORY,
+                           SVN_ERR_FS_NOT_FOUND,
                            SVN_NO_ERROR));
+      if (! success)
+        seen_nonexistent_target = TRUE;
     }
   svn_pool_destroy(subpool);
 
-  return SVN_NO_ERROR;
+  if (seen_nonexistent_target)
+    return svn_error_create(
+      SVN_ERR_ILLEGAL_TARGET, NULL, 
+      _("Could not cat all targets because some targets don't exist"));
+  else
+    return SVN_NO_ERROR;
 }

Modified: subversion/branches/performance/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/diff-cmd.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/diff-cmd.c (original)
+++ subversion/branches/performance/subversion/svn/diff-cmd.c Sun Feb 20 07:45:48 2011
@@ -330,7 +330,7 @@ svn_cl__diff(apr_getopt_t *os,
             target1 = svn_path_url_add_component2(old_target, path, iterpool);
           else
             target1 = svn_dirent_join(old_target, path, iterpool);
-          if (svn_path_is_url(old_target))
+          if (svn_path_is_url(new_target))
             target2 = svn_path_url_add_component2(new_target, path, iterpool);
           else
             target2 = svn_dirent_join(new_target, path, iterpool);

Modified: subversion/branches/performance/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/info-cmd.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/info-cmd.c (original)
+++ subversion/branches/performance/subversion/svn/info-cmd.c Sun Feb 20 07:45:48 2011
@@ -494,7 +494,7 @@ svn_cl__info(apr_getopt_t *os,
   apr_pool_t *subpool = svn_pool_create(pool);
   int i;
   svn_error_t *err;
-  svn_boolean_t saw_a_problem = FALSE;
+  svn_boolean_t seen_nonexistent_target = FALSE;
   svn_opt_revision_t peg_revision;
   svn_info_receiver_t receiver;
   const char *path_prefix;
@@ -579,7 +579,7 @@ svn_cl__info(apr_getopt_t *os,
 
           svn_error_clear(err);
           err = NULL;
-          saw_a_problem = TRUE;
+          seen_nonexistent_target = TRUE;
         }
     }
   svn_pool_destroy(subpool);
@@ -587,8 +587,11 @@ svn_cl__info(apr_getopt_t *os,
   if (opt_state->xml && (! opt_state->incremental))
     SVN_ERR(svn_cl__xml_print_footer("info", pool));
 
-  if (saw_a_problem)
-    return svn_error_create(SVN_ERR_BASE, NULL, NULL);
+  if (seen_nonexistent_target)
+    return svn_error_create(
+      SVN_ERR_ILLEGAL_TARGET, NULL, 
+      _("Could not display info for all targets because some "
+        "targets don't exist"));
   else
     return SVN_NO_ERROR;
 }

Modified: subversion/branches/performance/subversion/svn/list-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/list-cmd.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/list-cmd.c (original)
+++ subversion/branches/performance/subversion/svn/list-cmd.c Sun Feb 20 07:45:48 2011
@@ -215,6 +215,8 @@ svn_cl__list(apr_getopt_t *os,
   apr_pool_t *subpool = svn_pool_create(pool);
   apr_uint32_t dirent_fields;
   struct print_baton pb;
+  svn_boolean_t seen_nonexistent_target = FALSE;
+  svn_error_t *err;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -280,13 +282,28 @@ svn_cl__list(apr_getopt_t *os,
           SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
         }
 
-      SVN_ERR(svn_client_list2(truepath, &peg_revision,
-                               &(opt_state->start_revision),
-                               opt_state->depth,
-                               dirent_fields,
-                               (opt_state->xml || opt_state->verbose),
-                               opt_state->xml ? print_dirent_xml : print_dirent,
-                               &pb, ctx, subpool));
+      err = svn_client_list2(truepath, &peg_revision,
+                             &(opt_state->start_revision),
+                             opt_state->depth,
+                             dirent_fields,
+                             (opt_state->xml || opt_state->verbose),
+                             opt_state->xml ? print_dirent_xml : print_dirent,
+                             &pb, ctx, subpool);
+
+      if (err)
+        {
+          /* If one of the targets is a non-existent URL or wc-entry,
+             don't bail out.  Just warn and move on to the next target. */
+          if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND ||
+              err->apr_err == SVN_ERR_FS_NOT_FOUND)
+              svn_handle_warning2(stderr, err, "svn: ");
+          else
+              return svn_error_return(err);
+
+          svn_error_clear(err);
+          err = NULL;
+          seen_nonexistent_target = TRUE;
+        }
 
       if (opt_state->xml)
         {
@@ -301,5 +318,10 @@ svn_cl__list(apr_getopt_t *os,
   if (opt_state->xml && ! opt_state->incremental)
     SVN_ERR(svn_cl__xml_print_footer("lists", pool));
 
-  return SVN_NO_ERROR;
+  if (seen_nonexistent_target)
+    return svn_error_create(
+      SVN_ERR_ILLEGAL_TARGET, NULL,
+      _("Could not list all targets because some targets don't exist"));
+  else
+    return SVN_NO_ERROR;
 }

Modified: subversion/branches/performance/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/main.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/main.c (original)
+++ subversion/branches/performance/subversion/svn/main.c Sun Feb 20 07:45:48 2011
@@ -1286,7 +1286,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "          >   local missing, incoming edit upon update\n"
      "    D       wc/qax.c\n"),
     { 'u', 'v', 'N', opt_depth, 'q', opt_no_ignore, opt_incremental, opt_xml,
-      opt_ignore_externals, opt_changelist} },
+      opt_ignore_externals, opt_changelist},
+    {{'q', N_("don't print unversioned items")}} },
 
   { "switch", svn_cl__switch, {"sw"}, N_
     ("Update the working copy to a different URL within the same repository.\n"

Modified: subversion/branches/performance/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/status.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/status.c (original)
+++ subversion/branches/performance/subversion/svn/status.c Sun Feb 20 07:45:48 2011
@@ -150,12 +150,17 @@ print_status(const char *path,
       svn_boolean_t text_conflicted;
       svn_boolean_t prop_conflicted;
       svn_boolean_t tree_conflicted;
+      svn_error_t *err;
 
-      SVN_ERR(svn_wc__node_check_conflicts(&prop_conflicted,
-                                           &text_conflicted,
-                                           &tree_conflicted, ctx->wc_ctx,
-                                           local_abspath, pool, pool));
+      err = svn_wc__node_check_conflicts(&prop_conflicted,
+                                         &text_conflicted,
+                                         &tree_conflicted, ctx->wc_ctx,
+                                         local_abspath, pool, pool);
 
+      if (err && err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED)
+        svn_error_clear(err);
+      else
+        SVN_ERR(err);
 
       if (tree_conflicted)
         {

Modified: subversion/branches/performance/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svn/util.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svn/util.c (original)
+++ subversion/branches/performance/subversion/svn/util.c Sun Feb 20 07:45:48 2011
@@ -438,11 +438,21 @@ svn_cl__edit_string_externally(svn_strin
       goto cleanup;
     }
 
-  /* Now, run the editor command line.  */
+  /* Prepare the editor command line.  */
   err = svn_utf_cstring_from_utf8(&tmpfile_native, tmpfile_name, pool);
   if (err)
     goto cleanup;
   cmd = apr_psprintf(pool, "%s %s", editor, tmpfile_native);
+
+  /* If the caller wants us to leave the file around, return the path
+     of the file we'll use, and make a note not to destroy it.  */
+  if (tmpfile_left)
+    {
+      *tmpfile_left = svn_dirent_join(base_dir, tmpfile_name, pool);
+      remove_file = FALSE;
+    }
+
+  /* Now, run the editor command line.  */
   sys_err = system(cmd);
   if (sys_err != 0)
     {
@@ -462,14 +472,6 @@ svn_cl__edit_string_externally(svn_strin
       goto cleanup;
     }
 
-  /* If the caller wants us to leave the file around, return the path
-     of the file we used, and make a note not to destroy it.  */
-  if (tmpfile_left)
-    {
-      *tmpfile_left = svn_dirent_join(base_dir, tmpfile_name, pool);
-      remove_file = FALSE;
-    }
-
   /* If the file looks changed... */
   if ((finfo_before.mtime != finfo_after.mtime) ||
       (finfo_before.size != finfo_after.size))

Modified: subversion/branches/performance/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svnadmin/main.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svnadmin/main.c (original)
+++ subversion/branches/performance/subversion/svnadmin/main.c Sun Feb 20 07:45:48 2011
@@ -108,41 +108,6 @@ create_stdio_stream(svn_stream_t **strea
 }
 
 
-/* Helper to parse local repository path.  Try parsing next parameter
- * of OS as a local path to repository.  If successfull *REPOS_PATH
- * will contain internal style path to the repository.
- */
-static svn_error_t *
-parse_local_repos_path(apr_getopt_t *os,
-                       const char ** repos_path,
-                       apr_pool_t *pool)
-{
-  *repos_path = NULL;
-
-  /* Check to see if there is one more parameter. */
-  if (os->ind < os->argc)
-    {
-      const char * path = os->argv[os->ind++];
-      SVN_ERR(svn_utf_cstring_to_utf8(repos_path, path, pool));
-      *repos_path = svn_dirent_internal_style(*repos_path, pool);
-    }
-
-  if (*repos_path == NULL)
-    {
-      return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                              _("Repository argument required"));
-    }
-  else if (svn_path_is_url(*repos_path))
-    {
-      return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                               _("'%s' is an URL when it should be a path"),
-                               *repos_path);
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
 /* Custom filesystem warning function. */
 static void
 warning_func(void *baton,
@@ -504,7 +469,6 @@ static const svn_opt_subcommand_desc2_t 
 struct svnadmin_opt_state
 {
   const char *repository_path;
-  const char *new_repository_path;                  /* hotcopy dest. path */
   const char *fs_type;                              /* --fs-type */
   svn_boolean_t pre_1_4_compatible;                 /* --pre-1.4-compatible */
   svn_boolean_t pre_1_5_compatible;                 /* --pre-1.5-compatible */
@@ -564,6 +528,61 @@ get_revnum(svn_revnum_t *revnum, const s
   return SVN_NO_ERROR;
 }
 
+/* Set *PATH to an internal-style, UTF8-encoded, local dirent path
+   allocated from POOL and parsed from raw command-line argument ARG. */
+static svn_error_t *
+target_arg_to_dirent(const char **dirent,
+                     const char *arg,
+                     apr_pool_t *pool)
+{
+  const char *path;
+
+  SVN_ERR(svn_utf_cstring_to_utf8(&path, arg, pool));
+  if (svn_path_is_url(path))
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             "Path '%s' is not a local path", path);
+  *dirent = svn_dirent_internal_style(path, pool);
+  return SVN_NO_ERROR;
+}
+  
+/* Parse the remaining command-line arguments from OS, returning them
+   in a new array *ARGS (allocated from POOL) and optionally verifying
+   that we got the expected number thereof.  If MIN_EXPECTED is not
+   negative, return an error if the function would return fewer than
+   MIN_EXPECTED arguments.  If MAX_EXPECTED is not negative, return an
+   error if the function would return more than MAX_EXPECTED
+   arguments.
+
+   As a special case, when MIN_EXPECTED and MAX_EXPECTED are both 0,
+   allow ARGS to be NULL.  */
+static svn_error_t *
+parse_args(apr_array_header_t **args,
+           apr_getopt_t *os,
+           int min_expected,
+           int max_expected,
+           apr_pool_t *pool)
+{
+  int num_args = os ? (os->argc - os->ind) : 0;
+
+  if (min_expected || max_expected)
+    SVN_ERR_ASSERT(args);
+  
+  if ((min_expected >= 0) && (num_args < min_expected))
+    return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0,
+                            "Not enough arguments");
+  if ((max_expected >= 0) && (num_args > max_expected))
+    return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0,
+                            "Too many arguments");
+  if (args)
+    {
+      *args = apr_array_make(pool, num_args, sizeof(const char *));
+      while (os->ind < os->argc)
+        APR_ARRAY_PUSH(*args, const char *) = 
+          apr_pstrdup(pool, os->argv[os->ind++]);
+    }
+  
+  return SVN_NO_ERROR;
+}
 
 /* This implements `svn_opt_subcommand_t'. */
 static svn_error_t *
@@ -574,6 +593,9 @@ subcommand_create(apr_getopt_t *os, void
   apr_hash_t *config;
   apr_hash_t *fs_config = apr_hash_make(pool);
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   apr_hash_set(fs_config, SVN_FS_CONFIG_BDB_TXN_NOSYNC,
                APR_HASH_KEY_STRING,
                (opt_state->bdb_txn_nosync ? "1" : "0"));
@@ -627,6 +649,9 @@ subcommand_deltify(apr_getopt_t *os, voi
   svn_revnum_t youngest, revision;
   apr_pool_t *subpool = svn_pool_create(pool);
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
   fs = svn_repos_fs(repos);
   SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
@@ -877,6 +902,9 @@ subcommand_dump(apr_getopt_t *os, void *
   svn_revnum_t youngest;
   svn_stream_t *progress_stream = NULL;
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
   fs = svn_repos_fs(repos);
   SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
@@ -934,6 +962,9 @@ subcommand_help(apr_getopt_t *os, void *
 
   svn_stringbuf_t *version_footer;
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   version_footer = svn_stringbuf_create(fs_desc_start, pool);
   SVN_ERR(svn_fs_print_modules(version_footer, pool));
 
@@ -957,6 +988,9 @@ subcommand_load(apr_getopt_t *os, void *
   svn_repos_t *repos;
   svn_stream_t *stdin_stream, *stdout_stream = NULL;
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
 
   /* Read the stream from STDIN.  Users can redirect a file. */
@@ -994,6 +1028,9 @@ subcommand_lstxns(apr_getopt_t *os, void
   apr_array_header_t *txns;
   int i;
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
   fs = svn_repos_fs(repos);
   SVN_ERR(svn_fs_list_transactions(&txns, fs, pool));
@@ -1019,6 +1056,9 @@ subcommand_recover(apr_getopt_t *os, voi
   struct svnadmin_opt_state *opt_state = baton;
   svn_stream_t *stdout_stream;
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(create_stdio_stream(&stdout_stream, apr_file_open_stdout, pool));
 
   /* Restore default signal handlers until after we have acquired the
@@ -1072,6 +1112,9 @@ list_dblogs(apr_getopt_t *os, void *bato
   apr_array_header_t *logfiles;
   int i;
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(svn_repos_db_logfiles(&logfiles,
                                 opt_state->repository_path,
                                 only_unused,
@@ -1107,6 +1150,9 @@ subcommand_list_dblogs(apr_getopt_t *os,
 static svn_error_t *
 subcommand_list_unused_dblogs(apr_getopt_t *os, void *baton, apr_pool_t *pool)
 {
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(list_dblogs(os, baton, TRUE, pool));
   return SVN_NO_ERROR;
 }
@@ -1124,11 +1170,11 @@ subcommand_rmtxns(apr_getopt_t *os, void
   int i;
   apr_pool_t *subpool = svn_pool_create(pool);
 
+  SVN_ERR(svn_opt_parse_all_args(&args, os, pool));
+
   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
   fs = svn_repos_fs(repos);
 
-  SVN_ERR(svn_opt_parse_all_args(&args, os, pool));
-
   /* All the rest of the arguments are transaction names. */
   for (i = 0; i < args->nelts; i++)
     {
@@ -1186,12 +1232,8 @@ set_revprop(const char *prop_name, const
   svn_repos_t *repos;
   svn_string_t *prop_value = svn_string_create("", pool);
   svn_stringbuf_t *file_contents;
-  const char *filename_utf8;
 
-  SVN_ERR(svn_utf_cstring_to_utf8(&filename_utf8, filename, pool));
-  filename_utf8 = svn_dirent_internal_style(filename_utf8, pool);
-
-  SVN_ERR(svn_stringbuf_from_file2(&file_contents, filename_utf8, pool));
+  SVN_ERR(svn_stringbuf_from_file2(&file_contents, filename, pool));
 
   prop_value->data = file_contents->data;
   prop_value->len = file_contents->len;
@@ -1221,6 +1263,13 @@ subcommand_setrevprop(apr_getopt_t *os, 
 {
   struct svnadmin_opt_state *opt_state = baton;
   apr_array_header_t *args;
+  const char *prop_name, *filename;
+
+  /* Expect two more arguments: NAME FILE */
+  SVN_ERR(parse_args(&args, os, 2, 2, pool));
+  prop_name = APR_ARRAY_IDX(args, 0, const char *);
+  filename = APR_ARRAY_IDX(args, 1, const char *);
+  SVN_ERR(target_arg_to_dirent(&filename, filename, pool));
 
   if (opt_state->start_revision.kind != svn_opt_revision_number)
     return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
@@ -1229,16 +1278,7 @@ subcommand_setrevprop(apr_getopt_t *os, 
     return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("Only one revision allowed"));
 
-  SVN_ERR(svn_opt_parse_all_args(&args, os, pool));
-
-  if (args->nelts != 2)
-    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                             _("Exactly one property name and one file "
-                               "argument required"));
-
-  return set_revprop(APR_ARRAY_IDX(args, 0, const char *),
-                     APR_ARRAY_IDX(args, 1, const char *),
-                     opt_state, pool);
+  return set_revprop(prop_name, filename, opt_state, pool);
 }
 
 
@@ -1252,10 +1292,8 @@ subcommand_setuuid(apr_getopt_t *os, voi
   svn_fs_t *fs;
   const char *uuid = NULL;
 
-  SVN_ERR(svn_opt_parse_all_args(&args, os, pool));
-
-  if (args->nelts > 1)
-    return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, NULL);
+  /* Expect zero or one more arguments: [UUID] */
+  SVN_ERR(parse_args(&args, os, 0, 1, pool));
   if (args->nelts == 1)
     uuid = APR_ARRAY_IDX(args, 0, const char *);
 
@@ -1271,6 +1309,12 @@ subcommand_setlog(apr_getopt_t *os, void
 {
   struct svnadmin_opt_state *opt_state = baton;
   apr_array_header_t *args;
+  const char *filename;
+
+  /* Expect one more argument: FILE */
+  SVN_ERR(parse_args(&args, os, 1, 1, pool));
+  filename = APR_ARRAY_IDX(args, 0, const char *);
+  SVN_ERR(target_arg_to_dirent(&filename, filename, pool));
 
   if (opt_state->start_revision.kind != svn_opt_revision_number)
     return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
@@ -1279,12 +1323,6 @@ subcommand_setlog(apr_getopt_t *os, void
     return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                              _("Only one revision allowed"));
 
-  SVN_ERR(svn_opt_parse_all_args(&args, os, pool));
-
-  if (args->nelts != 1)
-    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                             _("Exactly one file argument required"));
-
   /* set_revprop() responds only to pre-/post-revprop-change opts. */
   if (!opt_state->bypass_hooks)
     {
@@ -1292,9 +1330,7 @@ subcommand_setlog(apr_getopt_t *os, void
       opt_state->use_post_revprop_change_hook = TRUE;
     }
 
-  return set_revprop(SVN_PROP_REVISION_LOG,
-                     APR_ARRAY_IDX(args, 0, const char *),
-                     opt_state, pool);
+  return set_revprop(SVN_PROP_REVISION_LOG, filename, opt_state, pool);
 }
 
 
@@ -1306,6 +1342,9 @@ subcommand_pack(apr_getopt_t *os, void *
   svn_repos_t *repos;
   svn_stream_t *progress_stream = NULL;
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
 
   /* Progress feedback goes to STDOUT, unless they asked to suppress it. */
@@ -1328,6 +1367,9 @@ subcommand_verify(apr_getopt_t *os, void
   svn_revnum_t youngest, lower, upper;
   svn_stream_t *progress_stream;
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
   fs = svn_repos_fs(repos);
   SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
@@ -1352,19 +1394,21 @@ subcommand_verify(apr_getopt_t *os, void
                               progress_stream, check_cancel, NULL, pool);
 }
 
-
 /* This implements `svn_opt_subcommand_t'. */
 svn_error_t *
 subcommand_hotcopy(apr_getopt_t *os, void *baton, apr_pool_t *pool)
 {
   struct svnadmin_opt_state *opt_state = baton;
+  apr_array_header_t *targets;
+  const char *new_repos_path;
 
-  SVN_ERR(svn_repos_hotcopy(opt_state->repository_path,
-                            opt_state->new_repository_path,
-                            opt_state->clean_logs,
-                            pool));
+  /* Expect one more argument: NEW_REPOS_PATH */
+  SVN_ERR(parse_args(&targets, os, 1, 1, pool));
+  new_repos_path = APR_ARRAY_IDX(targets, 0, const char *);
+  SVN_ERR(target_arg_to_dirent(&new_repos_path, new_repos_path, pool));
 
-  return SVN_NO_ERROR;
+  return svn_repos_hotcopy(opt_state->repository_path, new_repos_path,
+                           opt_state->clean_logs, pool);
 }
 
 
@@ -1516,6 +1560,9 @@ subcommand_upgrade(apr_getopt_t *os, voi
   struct svnadmin_opt_state *opt_state = baton;
   svn_stream_t *stdout_stream;
 
+  /* Expect no more arguments. */
+  SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+
   SVN_ERR(create_stdio_stream(&stdout_stream, apr_file_open_stdout, pool));
 
   /* Restore default signal handlers. */
@@ -1810,7 +1857,7 @@ main(int argc, const char *argv[])
           subcommand = svn_opt_get_canonical_subcommand2(cmd_table, first_arg);
           if (subcommand == NULL)
             {
-              const char* first_arg_utf8;
+              const char *first_arg_utf8;
               err = svn_utf_cstring_to_utf8(&first_arg_utf8, first_arg, pool);
               if (err)
                 return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
@@ -1824,28 +1871,34 @@ main(int argc, const char *argv[])
         }
     }
 
-  /* If there's a second argument, it's probably the repository.
-     Every subcommand except `help' requires one, so we parse it out
-     here and store it in opt_state. */
+  /* Every subcommand except `help' requires a second argument -- the
+     repository path.  Parse it out here and store it in opt_state. */
   if (subcommand->cmd_func != subcommand_help)
     {
-      err = parse_local_repos_path(os,
-                                   &(opt_state.repository_path),
-                                   pool);
-      if (err)
-        return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
-    }
+      const char *repos_path = NULL;
+
+      if (os->ind >= os->argc)
+        {
+          err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                 _("Repository argument required"));
+          return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+        }
 
+      if ((err = svn_utf_cstring_to_utf8(&repos_path,
+                                         os->argv[os->ind++], pool)))
+        {
+          return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+        }
 
-  /* If command is hot copy the third argument will be the new
-     repository path. */
-  if (subcommand->cmd_func == subcommand_hotcopy)
-    {
-      err = parse_local_repos_path(os,
-                                   &(opt_state.new_repository_path),
-                                   pool);
-      if (err)
-        return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+      if (svn_path_is_url(repos_path))
+        {
+          err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                  _("'%s' is a URL when it should be a "
+                                    "local path"), repos_path);
+          return svn_cmdline_handle_exit_error(err, pool, "svnadmin: ");
+        }
+
+      opt_state.repository_path = svn_dirent_internal_style(repos_path, pool);
     }
 
   /* Check that the subcommand wasn't passed any inappropriate options. */

Modified: subversion/branches/performance/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svnrdump/load_editor.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/performance/subversion/svnrdump/load_editor.c Sun Feb 20 07:45:48 2011
@@ -464,7 +464,20 @@ static svn_error_t *
 set_fulltext(svn_stream_t **stream,
              void *node_baton)
 {
-  /* ### Not implemented */
+  struct node_baton *nb;
+  const struct svn_delta_editor_t *commit_editor;
+  svn_txdelta_window_handler_t handler;
+  void *handler_baton;
+  apr_pool_t *pool;
+
+  nb = node_baton;
+  commit_editor = nb->rb->pb->commit_editor;
+  pool = nb->rb->pool;
+  LDR_DBG(("Setting fulltext for %p\n", nb->file_baton));
+  SVN_ERR(commit_editor->apply_textdelta(nb->file_baton, nb->base_checksum,
+                                         pool, &handler, &handler_baton));
+  *stream = svn_txdelta_target_push(handler, handler_baton,
+                                    svn_stream_empty(pool), pool);
   return SVN_NO_ERROR;
 }
 
@@ -496,7 +509,9 @@ close_node(void *baton)
   nb = baton;
   commit_editor = nb->rb->pb->commit_editor;
 
-  if (nb->kind == svn_node_file)
+  /* Pass a file node closure through to the editor *unless* we
+     deleted the file (which doesn't require us to open it). */
+  if ((nb->kind == svn_node_file) && (nb->file_baton))
     {
       LDR_DBG(("Closing file %p\n", nb->file_baton));
       SVN_ERR(commit_editor->close_file(nb->file_baton, NULL, nb->rb->pool));

Modified: subversion/branches/performance/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svnrdump/svnrdump.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/performance/subversion/svnrdump/svnrdump.c Sun Feb 20 07:45:48 2011
@@ -877,19 +877,30 @@ main(int argc, const char **argv)
       exit(EXIT_SUCCESS);
     }
 
-  /* Only continue if the only not option argument is a url */
-  if ((os->ind != os->argc-1)
-      || !svn_path_is_url(os->argv[os->ind]))
+  /* Expect one more non-option argument:  the repository URL. */
+  if (os->ind != os->argc - 1)
     {
       SVNRDUMP_ERR(usage(argv[0], pool));
       svn_pool_destroy(pool);
       exit(EXIT_FAILURE);
     }
+  else
+    {
+      const char *repos_url;
 
-  SVNRDUMP_ERR(svn_utf_cstring_to_utf8(&(opt_baton->url),
-                                       os->argv[os->ind], pool));
-
-  opt_baton->url = svn_uri_canonicalize(os->argv[os->ind], pool);
+      SVNRDUMP_ERR(svn_utf_cstring_to_utf8(&repos_url,
+                                           os->argv[os->ind], pool));
+      if (! svn_path_is_url(repos_url))
+        {
+          err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, 0,
+                                  "Target '%s' is not a URL", 
+                                  repos_url);
+          SVNRDUMP_ERR(err);
+          svn_pool_destroy(pool);
+          exit(EXIT_FAILURE);
+        }
+      opt_baton->url = svn_uri_canonicalize(repos_url, pool);
+    }
 
   SVNRDUMP_ERR(open_connection(&(opt_baton->session),
                                opt_baton->url,

Modified: subversion/branches/performance/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svnserve/main.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svnserve/main.c (original)
+++ subversion/branches/performance/subversion/svnserve/main.c Sun Feb 20 07:45:48 2011
@@ -194,8 +194,7 @@ static const apr_getopt_option_t svnserv
         "                             "
         "[0 .. no compression, 5 .. default, \n"
         "                             "
-        " 9 .. maximum compresssion]")},
-
+        " 9 .. maximum compression]")},
     {"memory-cache-size", 'M', 1, 
      N_("size of the extra in-memory cache in MB used to\n"
         "                             "
@@ -460,7 +459,7 @@ int main(int argc, const char *argv[])
   params.cfg = NULL;
   params.pwdb = NULL;
   params.authzdb = NULL;
-  params.compression_level = SVNDIFF1_COMPRESS_LEVEL;
+  params.compression_level = SVN_DEFAULT_COMPRESSION_LEVEL;
   params.log_file = NULL;
   params.username_case = CASE_ASIS;
   params.memory_cache_size = (apr_uint64_t)-1;
@@ -579,10 +578,10 @@ int main(int argc, const char *argv[])
 
         case 'c':
           params.compression_level = atoi(arg);
-          if (params.compression_level < 0)
-            params.compression_level = 0;
-          if (params.compression_level > 9)
-            params.compression_level = 9;
+          if (params.compression_level < SVN_NO_COMPRESSION_LEVEL)
+            params.compression_level = SVN_NO_COMPRESSION_LEVEL;
+          if (params.compression_level > SVN_BEST_COMPRESSION_LEVEL)
+            params.compression_level = SVN_BEST_COMPRESSION_LEVEL;
           break;
 
         case 'M':

Modified: subversion/branches/performance/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svnserve/serve.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svnserve/serve.c (original)
+++ subversion/branches/performance/subversion/svnserve/serve.c Sun Feb 20 07:45:48 2011
@@ -235,7 +235,7 @@ svn_error_t *load_configs(svn_config_t *
   const char *pwdb_path, *authzdb_path;
   svn_error_t *err;
 
-  SVN_ERR(svn_config_read(cfg, filename, must_exist, pool));
+  SVN_ERR(svn_config_read2(cfg, filename, must_exist, FALSE, pool));
 
   svn_config_get(*cfg, &pwdb_path, SVN_CONFIG_SECTION_GENERAL,
                  SVN_CONFIG_OPTION_PASSWORD_DB, NULL);
@@ -245,7 +245,7 @@ svn_error_t *load_configs(svn_config_t *
     {
       pwdb_path = svn_dirent_join(base, pwdb_path, pool);
 
-      err = svn_config_read(pwdb, pwdb_path, TRUE, pool);
+      err = svn_config_read2(pwdb, pwdb_path, TRUE, FALSE, pool);
       if (err)
         {
           if (server)
@@ -1844,15 +1844,17 @@ static svn_error_t *get_mergeinfo(svn_ra
   apr_hash_index_t *hi;
   const char *inherit_word;
   svn_mergeinfo_inheritance_t inherit;
-  svn_boolean_t validate_inherited_mergeinfo;
+  apr_uint64_t validate_inherited_mergeinfo;
   svn_boolean_t include_descendants;
   apr_pool_t *iterpool;
 
-  SVN_ERR(svn_ra_svn_parse_tuple(params, pool, "l(?r)wb?b", &paths, &rev,
+  SVN_ERR(svn_ra_svn_parse_tuple(params, pool, "l(?r)wb?B", &paths, &rev,
                                  &inherit_word,
                                  &include_descendants,
                                  &validate_inherited_mergeinfo));
   inherit = svn_inheritance_from_word(inherit_word);
+  if (validate_inherited_mergeinfo == SVN_RA_SVN_UNSPECIFIED_NUMBER)
+    validate_inherited_mergeinfo = FALSE;
 
   /* Canonicalize the paths which mergeinfo has been requested for. */
   canonical_paths = apr_array_make(pool, paths->nelts, sizeof(const char *));
@@ -1878,6 +1880,7 @@ static svn_error_t *get_mergeinfo(svn_ra
   SVN_CMD_ERR(svn_repos_fs_get_mergeinfo2(&mergeinfo, b->repos,
                                           canonical_paths, rev,
                                           inherit,
+                                          (svn_boolean_t)
                                           validate_inherited_mergeinfo,
                                           include_descendants,
                                           authz_check_access_cb_func(b), b,

Modified: subversion/branches/performance/subversion/svnserve/server.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/svnserve/server.h?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/svnserve/server.h (original)
+++ subversion/branches/performance/subversion/svnserve/server.h Sun Feb 20 07:45:48 2011
@@ -109,15 +109,15 @@ typedef struct serve_params_t {
   /* Username case normalization style. */
   enum username_case_type username_case;
 
+  /* Size of the in-memory cache (used by FSFS only). */
+  apr_uint64_t memory_cache_size;
+
   /* Data compression level to reduce for network traffic. If this
      is 0, no compression should be applied and the protocol may
-     fall back to txdelta "version 0" bypassing zlib entirely.
-     Defaults to SVNDIFF1_COMPRESS_LEVEL. */
+     fall back to svndiff "version 0" bypassing zlib entirely.
+     Defaults to SVN_DEFAULT_COMPRESSION_LEVEL. */
   int compression_level;
 
-  /* Size of the in-memory cache (used by FSFS only). */
-  apr_uint64_t memory_cache_size;
-
   /* Number of handles kept open independently of there actual use
      (used by FSFS only). */
   apr_size_t open_file_count;

Modified: subversion/branches/performance/subversion/tests/cmdline/atomic-ra-revprop-change.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/atomic-ra-revprop-change.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/atomic-ra-revprop-change.c (original)
+++ subversion/branches/performance/subversion/tests/cmdline/atomic-ra-revprop-change.c Sun Feb 20 07:45:48 2011
@@ -119,7 +119,7 @@ construct_config(apr_hash_t **config_p,
   svn_config_t *servers;
 
   /* Populate SERVERS. */
-  SVN_ERR(svn_config_create(&servers, pool));
+  SVN_ERR(svn_config_create(&servers, FALSE,  pool));
   svn_config_set(servers, SVN_CONFIG_SECTION_GLOBAL,
                  SVN_CONFIG_OPTION_HTTP_LIBRARY, http_library);
 
@@ -152,7 +152,7 @@ change_rev_prop(const char *url,
   SVN_ERR(construct_auth_baton(&callbacks->auth_baton, pool));
   SVN_ERR(construct_config(&config, http_library, pool));
 
-  SVN_ERR(svn_ra_open3(&sess, url, NULL, callbacks, NULL /* baton */,
+  SVN_ERR(svn_ra_open4(&sess, NULL, url, NULL, callbacks, NULL /* baton */,
                        config, pool));
 
   SVN_ERR(svn_ra_has_capability(sess, &capable,

Modified: subversion/branches/performance/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/authz_tests.py?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/authz_tests.py Sun Feb 20 07:45:48 2011
@@ -1001,8 +1001,8 @@ def multiple_matches(sbox):
                        root_url, root_url + '/second')
 
 @Skip(svntest.main.is_ra_type_file)
-def wc_wc_copy(sbox):
-  "wc-to-wc copy with absent nodes"
+def wc_wc_copy_revert(sbox):
+  "wc-to-wc-copy with absent nodes and then revert"
 
   sbox.build(create_wc = False)
   local_dir = sbox.wc_dir
@@ -1042,12 +1042,6 @@ def wc_wc_copy(sbox):
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'st', '--verbose', sbox.ospath('A2'))
 
-@Skip(svntest.main.is_ra_type_file)
-def wc_wc_copy_revert(sbox):
-  "wc-to-wc-copy with absent nodes and then revert"
-
-  wc_wc_copy(sbox)
-
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'revert', '--recursive', sbox.ospath('A2'))
 
@@ -1090,6 +1084,100 @@ def authz_recursive_ls(sbox):
                                      [], 'ls', '-R',
                                      sbox.repo_url)
 
+@Issue(3781)
+@Skip(svntest.main.is_ra_type_file)
+def case_sensitive_authz(sbox):
+  "authz issue #3781, check case sensitiveness"
+
+  sbox.build()
+
+  wc_dir = sbox.wc_dir
+  write_restrictive_svnserve_conf(sbox.repo_dir)
+
+  mu_path = os.path.join(wc_dir, 'A', 'mu')
+  mu_url = sbox.repo_url + '/A/mu'
+  mu_repo_path = sbox.repo_dir + "/A/mu"
+  svntest.main.file_append(mu_path, "hi")
+
+  # Create expected output tree.
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/mu' : Item(verb='Sending'),
+    })
+
+  # error messages
+  expected_error_for_commit = "Commit failed"
+
+  if sbox.repo_url.startswith("http"):
+    expected_error_for_cat = ".*[Ff]orbidden.*"
+  else:
+    expected_error_for_cat = ".*svn: E170001: Authorization failed.*"
+
+  # test the case-sensitivity of the path inside the repo
+  write_authz_file(sbox, {"/": "jrandom = r",
+                          "/A/mu": "jrandom =", "/a/Mu": "jrandom = rw"})
+  svntest.actions.run_and_verify_svn2(None, None,
+                                      expected_error_for_cat,
+                                      1, 'cat', mu_url)
+
+  write_authz_file(sbox, {"/": "jrandom = r",
+                          "/A": "jrandom = r",
+                          "/a/Mu": "jrandom = rw"})
+  # Commit the file.
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        None,
+                                        None,
+                                        expected_error_for_commit,
+                                        mu_path)
+
+  def mixcases(repo_name):
+    mixed_repo_name = ''
+    for i in range(0, len(repo_name)):
+      if i % 2 == 0:
+        mixed_val = repo_name[i].upper()
+        mixed_repo_name = mixed_repo_name + mixed_val
+      else:
+        mixed_val = repo_name[i].lower()
+        mixed_repo_name = mixed_repo_name + mixed_val
+    return mixed_repo_name 
+
+  mixed_case_repo_dir = mixcases(os.path.basename(sbox.repo_dir))
+
+  # test the case-sensitivity of the repo name
+  sec_mixed_case = {mixed_case_repo_dir + ":/": "jrandom = r",
+                    mixed_case_repo_dir + ":/A": "jrandom = r",
+                    os.path.basename(sbox.repo_dir) + ":/A/mu": "jrandom =",
+                    mixed_case_repo_dir + ":/A/mu": "jrandom = rw"}
+  write_authz_file(sbox, {}, sec_mixed_case)
+  svntest.actions.run_and_verify_svn2(None, None,
+                                      expected_error_for_cat,
+                                      1, 'cat', mu_url)
+
+  write_authz_file(sbox, {},
+                   sections = {mixed_case_repo_dir + ":/": "jrandom = r",
+                               mixed_case_repo_dir + ":/A": "jrandom = r",
+                               mixed_case_repo_dir + ":/A/mu": "jrandom = rw"})
+
+  # Commit the file again.
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        None,
+                                        None,
+                                        expected_error_for_commit,
+                                        mu_path)
+
+  # test the case-sensitivity
+  write_authz_file(sbox, {"/": "jrandom = r",
+                          "/A": "jrandom = r", "/A/mu": "jrandom = rw"})
+
+  svntest.actions.run_and_verify_svn2('No error',
+                                      svntest.verify.AnyOutput, [],
+                                      0, 'cat', mu_url)
+  # Commit the file.
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        None,
+                                        None,
+                                        mu_path)
+
 ########################################################################
 # Run the tests
 
@@ -1112,9 +1200,9 @@ test_list = [ None,
               authz_access_required_at_repo_root,
               authz_access_required_at_repo_root2,
               multiple_matches,
-              wc_wc_copy,
               wc_wc_copy_revert,
               authz_recursive_ls,
+              case_sensitive_authz,
              ]
 serial_only = True