You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/01/26 22:52:10 UTC

svn commit: r1063881 [2/3] - in /subversion/branches/diff-optimizations-bytes: ./ build/ build/ac-macros/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversio...

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc_db.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc_db.c Wed Jan 26 21:52:08 2011
@@ -61,8 +61,6 @@
 #define SDB_FILE  "wc.db"
 #define SDB_FILE_UPGRADE "wc.db.upgrade"
 
-#define PRISTINE_STORAGE_RELPATH "pristine"
-#define PRISTINE_TEMPDIR_RELPATH ""
 #define WCROOT_TEMPDIR_RELPATH   "tmp"
 
 
@@ -421,77 +419,6 @@ static const char *construct_like_arg(co
 
 
 
-/* Returns in PRISTINE_ABSPATH a new string allocated from RESULT_POOL,
-   holding the local absolute path to the file location that is dedicated
-   to hold CHECKSUM's pristine file, relating to the pristine store
-   configured for the working copy indicated by PDH. The returned path
-   does not necessarily currently exist.
-
-   Iff CREATE_SUBDIR is TRUE, then this function will make sure that the
-   parent directory of PRISTINE_ABSPATH exists. This is only useful when
-   about to create a new pristine.
-
-   Any other allocations are made in SCRATCH_POOL. */
-static svn_error_t *
-get_pristine_fname(const char **pristine_abspath,
-                   const char *wcroot_abspath,
-                   const svn_checksum_t *sha1_checksum,
-                   svn_boolean_t create_subdir,
-                   apr_pool_t *result_pool,
-                   apr_pool_t *scratch_pool)
-{
-  const char *base_dir_abspath;
-  const char *hexdigest = svn_checksum_to_cstring(sha1_checksum, scratch_pool);
-  char subdir[3];
-
-  /* ### code is in transition. make sure we have the proper data.  */
-  SVN_ERR_ASSERT(pristine_abspath != NULL);
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(wcroot_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
-
-  /* ### need to fix this to use a symbol for ".svn". we don't need
-     ### to use join_many since we know "/" is the separator for
-     ### internal canonical paths */
-  base_dir_abspath = svn_dirent_join_many(scratch_pool,
-                                          wcroot_abspath,
-                                          svn_wc_get_adm_dir(scratch_pool),
-                                          PRISTINE_STORAGE_RELPATH,
-                                          NULL);
-
-  /* We should have a valid checksum and (thus) a valid digest. */
-  SVN_ERR_ASSERT(hexdigest != NULL);
-
-  /* Get the first two characters of the digest, for the subdir. */
-  subdir[0] = hexdigest[0];
-  subdir[1] = hexdigest[1];
-  subdir[2] = '\0';
-
-  if (create_subdir)
-    {
-      const char *subdir_abspath = svn_dirent_join(base_dir_abspath, subdir,
-                                                   scratch_pool);
-      svn_error_t *err;
-
-      err = svn_io_dir_make(subdir_abspath, APR_OS_DEFAULT, scratch_pool);
-
-      /* Whatever error may have occurred... ignore it. Typically, this
-         will be "directory already exists", but if it is something
-         *different*, then presumably another error will follow when we
-         try to access the file within this (missing?) pristine subdir. */
-      svn_error_clear(err);
-    }
-
-  /* The file is located at DIR/.svn/pristine/XX/XXYYZZ... */
-  *pristine_abspath = svn_dirent_join_many(result_pool,
-                                           base_dir_abspath,
-                                           subdir,
-                                           hexdigest,
-                                           NULL);
-  return SVN_NO_ERROR;
-}
-
-
 /* Look up REPOS_ID in SDB and set *REPOS_ROOT_URL and/or *REPOS_UUID to
  * its root URL and UUID respectively.  If REPOS_ID is INVALID_REPOS_ID,
  * use NULL for both URL and UUID.  Either or both output parameters may be
@@ -2217,461 +2144,6 @@ svn_wc__db_base_clear_dav_cache_recursiv
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_wc__db_pristine_get_path(const char **pristine_abspath,
-                             svn_wc__db_t *db,
-                             const char *wri_abspath,
-                             const svn_checksum_t *sha1_checksum,
-                             apr_pool_t *result_pool,
-                             apr_pool_t *scratch_pool)
-{
-  svn_wc__db_pdh_t *pdh;
-  const char *local_relpath;
-  svn_boolean_t present;
-
-  SVN_ERR_ASSERT(pristine_abspath != NULL);
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  /* ### Transitional: accept MD-5 and look up the SHA-1.  Return an error
-   * if the pristine text is not in the store. */
-  if (sha1_checksum->kind != svn_checksum_sha1)
-    SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db, wri_abspath,
-                                         sha1_checksum,
-                                         scratch_pool, scratch_pool));
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
-
-  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);
-
-  SVN_ERR(svn_wc__db_pristine_check(&present, db, wri_abspath, sha1_checksum,
-                                    scratch_pool));
-  if (! present)
-    return svn_error_createf(SVN_ERR_WC_DB_ERROR, NULL,
-                             _("Pristine text not found"));
-
-  SVN_ERR(get_pristine_fname(pristine_abspath, pdh->wcroot->abspath,
-                             sha1_checksum,
-                             FALSE /* create_subdir */,
-                             result_pool, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__db_pristine_get_future_path(const char **pristine_abspath,
-                                    const char *wcroot_abspath,
-                                    svn_checksum_t *sha1_checksum,
-                                    apr_pool_t *result_pool,
-                                    apr_pool_t *scratch_pool)
-{
-  SVN_ERR(get_pristine_fname(pristine_abspath, wcroot_abspath,
-                             sha1_checksum,
-                             FALSE /* create_subdir */,
-                             result_pool, scratch_pool));
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__db_pristine_read(svn_stream_t **contents,
-                         svn_wc__db_t *db,
-                         const char *wri_abspath,
-                         const svn_checksum_t *sha1_checksum,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
-{
-  svn_wc__db_pdh_t *pdh;
-  const char *local_relpath;
-  const char *pristine_abspath;
-
-  SVN_ERR_ASSERT(contents != NULL);
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  /* ### Transitional: accept MD-5 and look up the SHA-1.  Return an error
-   * if the pristine text is not in the store. */
-  if (sha1_checksum->kind != svn_checksum_sha1)
-    SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db, wri_abspath,
-                                         sha1_checksum,
-                                         scratch_pool, scratch_pool));
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
-
-  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);
-
-  /* ### should we look in the PRISTINE table for anything?  */
-
-  SVN_ERR(get_pristine_fname(&pristine_abspath, pdh->wcroot->abspath,
-                             sha1_checksum,
-                             FALSE /* create_subdir */,
-                             scratch_pool, scratch_pool));
-  return svn_error_return(svn_stream_open_readonly(
-                            contents, pristine_abspath,
-                            result_pool, scratch_pool));
-}
-
-
-svn_error_t *
-svn_wc__db_pristine_get_tempdir(const char **temp_dir_abspath,
-                                svn_wc__db_t *db,
-                                const char *wri_abspath,
-                                apr_pool_t *result_pool,
-                                apr_pool_t *scratch_pool)
-{
-  svn_wc__db_pdh_t *pdh;
-  const char *local_relpath;
-
-  SVN_ERR_ASSERT(temp_dir_abspath != NULL);
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-
-  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);
-
-  *temp_dir_abspath = svn_dirent_join_many(result_pool,
-                                           pdh->wcroot->abspath,
-                                           svn_wc_get_adm_dir(scratch_pool),
-                                           PRISTINE_TEMPDIR_RELPATH,
-                                           NULL);
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__db_pristine_install(svn_wc__db_t *db,
-                            const char *tempfile_abspath,
-                            const svn_checksum_t *sha1_checksum,
-                            const svn_checksum_t *md5_checksum,
-                            apr_pool_t *scratch_pool)
-{
-  svn_wc__db_pdh_t *pdh;
-  const char *local_relpath;
-  const char *wri_abspath;
-  const char *pristine_abspath;
-  apr_finfo_t finfo;
-  svn_sqlite__stmt_t *stmt;
-  svn_node_kind_t kind;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(tempfile_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
-  SVN_ERR_ASSERT(md5_checksum != NULL);
-  SVN_ERR_ASSERT(md5_checksum->kind == svn_checksum_md5);
-
-  /* ### this logic assumes that TEMPFILE_ABSPATH follows this pattern:
-     ###   WCROOT_ABSPATH/COMPONENT/TEMPFNAME
-     ### if we change this (see PRISTINE_TEMPDIR_RELPATH), then this
-     ### logic should change.  */
-  wri_abspath = svn_dirent_dirname(svn_dirent_dirname(tempfile_abspath,
-                                                      scratch_pool),
-                                   scratch_pool);
-
-  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);
-
-  SVN_ERR(get_pristine_fname(&pristine_abspath, pdh->wcroot->abspath,
-                             sha1_checksum,
-                             TRUE /* create_subdir */,
-                             scratch_pool, scratch_pool));
-
-
-  SVN_ERR(svn_io_check_path(pristine_abspath, &kind, scratch_pool));
-
-  if (kind == svn_node_file)
-    {
-      /* Remove the tempfile, it's already there */
-      return svn_error_return(
-                  svn_io_remove_file2(tempfile_abspath,
-                                      FALSE, scratch_pool));
-    }
-
-  /* Put the file into its target location.  */
-    SVN_ERR(svn_io_file_rename(tempfile_abspath, pristine_abspath,
-                               scratch_pool));
-
-  SVN_ERR(svn_io_stat(&finfo, pristine_abspath, APR_FINFO_SIZE,
-                      scratch_pool));
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
-                                    STMT_INSERT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 2, md5_checksum, scratch_pool));
-  SVN_ERR(svn_sqlite__bind_int64(stmt, 3, finfo.size));
-  SVN_ERR(svn_sqlite__insert(NULL, stmt));
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__db_pristine_get_md5(const svn_checksum_t **md5_checksum,
-                            svn_wc__db_t *db,
-                            const char *wri_abspath,
-                            const svn_checksum_t *sha1_checksum,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool)
-{
-  svn_wc__db_pdh_t *pdh;
-  const char *local_relpath;
-  svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
-
-  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);
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
-                                    STMT_SELECT_PRISTINE_MD5_CHECKSUM));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  if (!have_row)
-    return svn_error_createf(SVN_ERR_WC_DB_ERROR, svn_sqlite__reset(stmt),
-                             _("The pristine text with checksum '%s' was "
-                               "not found"),
-                             svn_checksum_to_cstring_display(sha1_checksum,
-                                                             scratch_pool));
-
-  SVN_ERR(svn_sqlite__column_checksum(md5_checksum, stmt, 0, result_pool));
-  SVN_ERR_ASSERT((*md5_checksum)->kind == svn_checksum_md5);
-
-  return svn_error_return(svn_sqlite__reset(stmt));
-}
-
-
-svn_error_t *
-svn_wc__db_pristine_get_sha1(const svn_checksum_t **sha1_checksum,
-                             svn_wc__db_t *db,
-                             const char *wri_abspath,
-                             const svn_checksum_t *md5_checksum,
-                             apr_pool_t *result_pool,
-                             apr_pool_t *scratch_pool)
-{
-  svn_wc__db_pdh_t *pdh;
-  const char *local_relpath;
-  svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  SVN_ERR_ASSERT(md5_checksum->kind == svn_checksum_md5);
-
-  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);
-
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
-                                    STMT_SELECT_PRISTINE_SHA1_CHECKSUM));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, md5_checksum, scratch_pool));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  if (!have_row)
-    return svn_error_createf(SVN_ERR_WC_DB_ERROR, svn_sqlite__reset(stmt),
-                             _("The pristine text with MD5 checksum '%s' was "
-                               "not found"),
-                             svn_checksum_to_cstring_display(md5_checksum,
-                                                             scratch_pool));
-
-  SVN_ERR(svn_sqlite__column_checksum(sha1_checksum, stmt, 0, result_pool));
-  SVN_ERR_ASSERT((*sha1_checksum)->kind == svn_checksum_sha1);
-
-  return svn_error_return(svn_sqlite__reset(stmt));
-}
-
-
-/* If the pristine text referenced by SHA1_CHECKSUM has a reference count
- * of zero, delete it from the pristine store of WCROOT.  Delete both the
- * database row and the file on disk. */
-static svn_error_t *
-pristine_remove_if_unreferenced(svn_wc__db_wcroot_t *wcroot,
-                const svn_checksum_t *sha1_checksum,
-                apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-  const char *pristine_abspath;
-  int affected_rows;
-
-  /* Remove the DB row, if refcount is 0. */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_DELETE_PRISTINE_IF_UNREFERENCED));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
-  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
-
-  if (affected_rows > 0)
-    {
-      /* Remove the file. */
-      SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
-                                 sha1_checksum, TRUE /* create_subdir */,
-                                 scratch_pool, scratch_pool));
-      SVN_ERR(svn_io_remove_file2(pristine_abspath, TRUE /* ignore_enoent */,
-                                  scratch_pool));
-    }
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__db_pristine_remove(svn_wc__db_t *db,
-                           const char *wri_abspath,
-                           const svn_checksum_t *sha1_checksum,
-                           apr_pool_t *scratch_pool)
-{
-  svn_wc__db_pdh_t *pdh;
-  const char *local_relpath;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  /* ### Transitional: accept MD-5 and look up the SHA-1.  Return an error
-   * if the pristine text is not in the store. */
-  if (sha1_checksum->kind != svn_checksum_sha1)
-    SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db, wri_abspath,
-                                         sha1_checksum,
-                                         scratch_pool, scratch_pool));
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
-
-  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);
-
-  /* If the work queue is not empty, don't delete any pristine text because
-   * the work queue may contain a reference to it. */
-  {
-    svn_sqlite__stmt_t *stmt;
-    svn_boolean_t have_row;
-
-    SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
-                                      STMT_LOOK_FOR_WORK));
-    SVN_ERR(svn_sqlite__step(&have_row, stmt));
-    SVN_ERR(svn_sqlite__reset(stmt));
-
-    if (have_row)
-      return SVN_NO_ERROR;
-  }
-
-  /* If not referenced, remove the PRISTINE table row and the file. */
-  SVN_ERR(pristine_remove_if_unreferenced(pdh->wcroot, sha1_checksum,
-                                          scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
-pristine_cleanup_wcroot(svn_wc__db_wcroot_t *wcroot,
-                        apr_pool_t *scratch_pool)
-{
-  svn_sqlite__stmt_t *stmt;
-
-  /* Find each unreferenced pristine in the DB and remove it. */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_SELECT_UNREFERENCED_PRISTINES));
-  while (1)
-    {
-      svn_boolean_t have_row;
-      const svn_checksum_t *sha1_checksum;
-
-      SVN_ERR(svn_sqlite__step(&have_row, stmt));
-      if (! have_row)
-        break;
-
-      SVN_ERR(svn_sqlite__column_checksum(&sha1_checksum, stmt, 0,
-                                          scratch_pool));
-      SVN_ERR(pristine_remove_if_unreferenced(wcroot, sha1_checksum, scratch_pool));
-    }
-  SVN_ERR(svn_sqlite__reset(stmt));
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__db_pristine_cleanup(svn_wc__db_t *db,
-                            const char *wri_abspath,
-                            apr_pool_t *scratch_pool)
-{
-  svn_wc__db_pdh_t *pdh;
-  const char *local_relpath;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-
-  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);
-
-  SVN_ERR(pristine_cleanup_wcroot(pdh->wcroot, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__db_pristine_check(svn_boolean_t *present,
-                          svn_wc__db_t *db,
-                          const char *wri_abspath,
-                          const svn_checksum_t *sha1_checksum,
-                          apr_pool_t *scratch_pool)
-{
-  svn_wc__db_pdh_t *pdh;
-  const char *local_relpath;
-  const char *pristine_abspath;
-  svn_sqlite__stmt_t *stmt;
-  svn_boolean_t have_row;
-  svn_node_kind_t kind_on_disk;
-
-  SVN_ERR_ASSERT(present != NULL);
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
-  SVN_ERR_ASSERT(sha1_checksum != NULL);
-  /* ### Transitional: accept MD-5 and look up the SHA-1.  Return an error
-   * if the pristine text is not in the store. */
-  if (sha1_checksum->kind != svn_checksum_sha1)
-    SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db, wri_abspath,
-                                         sha1_checksum,
-                                         scratch_pool, scratch_pool));
-  SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
-
-  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);
-
-  /* Check that there is an entry in the PRISTINE table. */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
-                                    STMT_SELECT_PRISTINE_MD5_CHECKSUM));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  SVN_ERR(svn_sqlite__reset(stmt));
-
-  /* Check that the pristine text file exists. */
-  SVN_ERR(get_pristine_fname(&pristine_abspath, pdh->wcroot->abspath,
-                             sha1_checksum,
-                             FALSE /* create_subdir */,
-                             scratch_pool, scratch_pool));
-  SVN_ERR(svn_io_check_path(pristine_abspath, &kind_on_disk, scratch_pool));
-
-  if (kind_on_disk != (have_row ? svn_node_file : svn_node_none))
-    return svn_error_createf(SVN_ERR_WC_DB_ERROR, svn_sqlite__reset(stmt),
-                             _("The pristine text with checksum '%s' was "
-                               "found in the DB or on disk but not both"),
-                             svn_checksum_to_cstring_display(sha1_checksum,
-                                                             scratch_pool));
-
-  *present = have_row;
-  return SVN_NO_ERROR;
-}
-
-
 /* Helper for svn_wc__db_op_copy to handle copying from one db to
    another */
 static svn_error_t *

Modified: subversion/branches/diff-optimizations-bytes/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/mod_dav_svn/reports/update.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/mod_dav_svn/reports/update.c Wed Jan 26 21:52:08 2011
@@ -98,14 +98,8 @@ typedef struct item_baton_t {
   svn_boolean_t text_changed;        /* Did the file's contents change? */
   svn_boolean_t added;               /* File added? (Implies text_changed.) */
   svn_boolean_t copyfrom;            /* File copied? */
-  apr_array_header_t *changed_props; /* array of const char * prop names */
   apr_array_header_t *removed_props; /* array of const char * prop names */
 
-  /* "entry props" */
-  const char *committed_rev;
-  const char *committed_date;
-  const char *last_author;
-
 } item_baton_t;
 
 
@@ -414,7 +408,7 @@ close_helper(svn_boolean_t is_dir, item_
 
   /* ### ack!  binary names won't float here! */
   /* If this is a copied file/dir, we can have removed props. */
-  if (baton->removed_props && (! baton->added || baton->copyfrom))
+  if (baton->removed_props && baton->copyfrom)
     {
       const char *qname;
       int i;
@@ -429,61 +423,15 @@ close_helper(svn_boolean_t is_dir, item_
         }
     }
 
-  if ((! baton->uc->send_all) && baton->changed_props && (! baton->added))
-    {
-      /* Tell the client to fetch all the props */
-      SVN_ERR(dav_svn__brigade_puts(baton->uc->bb, baton->uc->output,
-                                    "<S:fetch-props/>" DEBUG_CR));
-    }
-
-  SVN_ERR(dav_svn__brigade_puts(baton->uc->bb, baton->uc->output, "<S:prop>"));
-
-  /* Both modern and non-modern clients need the checksum... */
   if (baton->text_checksum)
     {
       SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
-                                      "<V:md5-checksum>%s</V:md5-checksum>",
+                                      "<S:prop>"
+                                      "<V:md5-checksum>%s</V:md5-checksum>"
+                                      "</S:prop>",
                                       baton->text_checksum));
     }
 
-  /* ...but only non-modern clients want the 3 CR-related properties
-     sent like here, because they can't handle receiving these special
-     props inline like any other prop.
-     ### later on, compress via the 'scattered table' solution as
-     discussed with gstein.  -bmcs */
-  if (! baton->uc->send_all)
-    {
-      /* ### grrr, these DAV: property names are already #defined in
-         ra_dav.h, and statically defined in liveprops.c.  And now
-         they're hardcoded here.  Isn't there some header file that both
-         sides of the network can share?? */
-
-      /* ### special knowledge: svn_repos_dir_delta2 will never send
-       *removals* of the commit-info "entry props". */
-      if (baton->committed_rev)
-        SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
-                                        "<D:version-name>%s</D:version-name>",
-                                        baton->committed_rev));
-
-      if (baton->committed_date)
-        SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
-                                        "<D:creationdate>%s</D:creationdate>",
-                                        baton->committed_date));
-
-      if (baton->last_author)
-        SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
-                                        "<D:creator-displayname>%s"
-                                        "</D:creator-displayname>",
-                                        apr_xml_quote_string(baton->pool,
-                                                             baton->last_author,
-                                                             1)));
-
-    }
-
-  /* Close unconditionally, because we sent checksum unconditionally. */
-  SVN_ERR(dav_svn__brigade_puts(baton->uc->bb, baton->uc->output,
-                                "</S:prop>" DEBUG_CR));
-
   if (baton->added)
     SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
                                     "</S:add-%s>" DEBUG_CR,
@@ -646,8 +594,10 @@ upd_change_xxx_prop(void *baton,
   if (qname == name)
     qname = apr_pstrdup(b->pool, name);
 
-
-  if (b->uc->send_all)
+  /* Even if we are not in send-all mode we have the prop changes already,
+     so send them to the client now instead of telling the client to fetch
+     them later. */
+  if (b->uc->send_all || !b->added)
     {
       if (value)
         {
@@ -683,56 +633,16 @@ upd_change_xxx_prop(void *baton,
                                           qname));
         }
     }
-  else  /* don't do inline response, just cache prop names for close_helper */
+  else if (!value) /* This is an addition in 'skelta' mode so there is no
+                      need for an inline response since property fetching
+                      is implied in addition.  We still need to cache
+                      property removals because a copied path might
+                      have removed properties. */
     {
-      /* For now, store certain entry props, because we'll need to send
-         them later as standard DAV ("D:") props.  ### this should go
-         away and we should just tunnel those props on through for the
-         client to deal with. */
-#define NSLEN (sizeof(SVN_PROP_ENTRY_PREFIX) - 1)
-      if (! strncmp(name, SVN_PROP_ENTRY_PREFIX, NSLEN))
-        {
-          if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
-            {
-              b->committed_rev = value ?
-                apr_pstrdup(b->pool, value->data) : NULL;
-            }
-          else if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
-            {
-              b->committed_date = value ?
-                apr_pstrdup(b->pool, value->data) : NULL;
-            }
-          else if (strcmp(name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
-            {
-              b->last_author = value ?
-                apr_pstrdup(b->pool, value->data) : NULL;
-            }
-          else if ((strcmp(name, SVN_PROP_ENTRY_LOCK_TOKEN) == 0)
-                   && (! value))
-            {
-              /* We only support delete of lock tokens, not add/modify. */
-              if (! b->removed_props)
-                b->removed_props = apr_array_make(b->pool, 1, sizeof(name));
-              APR_ARRAY_PUSH(b->removed_props, const char *) = qname;
-            }
-          return SVN_NO_ERROR;
-        }
-#undef NSLEN
-
-      if (value)
-        {
-          if (! b->changed_props)
-            b->changed_props = apr_array_make(b->pool, 1, sizeof(name));
+      if (! b->removed_props)
+        b->removed_props = apr_array_make(b->pool, 1, sizeof(name));
 
-          APR_ARRAY_PUSH(b->changed_props, const char *) = qname;
-        }
-      else
-        {
-          if (! b->removed_props)
-            b->removed_props = apr_array_make(b->pool, 1, sizeof(name));
-
-          APR_ARRAY_PUSH(b->removed_props, const char *) = qname;
-        }
+      APR_ARRAY_PUSH(b->removed_props, const char *) = qname;
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c Wed Jan 26 21:52:08 2011
@@ -74,7 +74,7 @@ get_comment(const char **comment, svn_cl
   /* Translate to UTF8/LF. */
   SVN_ERR(svn_subst_translate_string2(&comment_string, NULL, NULL,
                                       comment_string, opt_state->encoding,
-                                      pool, pool));
+                                      FALSE, pool, pool));
   *comment = comment_string->data;
 
   return SVN_NO_ERROR;

Modified: subversion/branches/diff-optimizations-bytes/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svn/main.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svn/main.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svn/main.c Wed Jan 26 21:52:08 2011
@@ -125,7 +125,6 @@ typedef enum svn_cl__longopt_t {
   opt_allow_mixed_revisions,
 } svn_cl__longopt_t;
 
-#define SVN_CL__OPTION_CONTINUATION_INDENT "                             "
 
 /* Option codes and descriptions for the command line client.
  *
@@ -144,23 +143,23 @@ const apr_getopt_option_t svn_cl__option
   {"non-recursive", 'N', 0, N_("obsolete; try --depth=files or --depth=immediates")},
   {"change",        'c', 1,
                     N_("the change made by revision ARG (like -r ARG-1:ARG)\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "If ARG is negative this is like -r ARG:ARG-1")},
   {"revision",      'r', 1,
                     N_("ARG (some commands also take ARG1:ARG2 range)\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "A revision argument can be one of:\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   NUMBER       revision number\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   '{' DATE '}' revision at start of the date\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   'HEAD'       latest in repository\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   'BASE'       base rev of item's working copy\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   'COMMITTED'  last commit at or before BASE\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   'PREV'       revision just before COMMITTED")},
   {"file",          'F', 1, N_("read log message from file ARG")},
   {"incremental",   opt_incremental, 0,
@@ -174,45 +173,45 @@ const apr_getopt_option_t svn_cl__option
   {"password",      opt_auth_password, 1, N_("specify a password ARG")},
   {"extensions",    'x', 1,
                     N_("Default: '-u'. When Subversion is invoking an\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "external diff program, ARG is simply passed along\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "to the program. But when Subversion is using its\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "default internal diff implementation, or when\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "Subversion is displaying blame annotations, ARG\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "could be any of the following:\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   -u (--unified):\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "      Output 3 lines of unified context.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   -b (--ignore-space-change):\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "      Ignore changes in the amount of white space.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   -w (--ignore-all-space):\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "      Ignore all white space.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   --ignore-eol-style:\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "      Ignore changes in EOL style.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "   -p (--show-c-function):\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "      Show C function name in diff output.")},
   {"targets",       opt_targets, 1,
                     N_("pass contents of file ARG as additional args")},
   {"depth",         opt_depth, 1,
                     N_("limit operation by depth ARG ('empty', 'files',\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "'immediates', or 'infinity')")},
   {"set-depth",     opt_set_depth, 1,
                     N_("set new working copy depth to ARG ('exclude',\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "'empty', 'files', 'immediates', or 'infinity')")},
   {"xml",           opt_xml, 0, N_("output in XML")},
   {"strict",        opt_strict, 0, N_("use strict semantics")},
@@ -224,7 +223,7 @@ const apr_getopt_option_t svn_cl__option
                     N_("do not cache authentication tokens")},
   {"trust-server-cert", opt_trust_server_cert, 0,
                     N_("accept unknown SSL server certificates without\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "prompting (but only with '--non-interactive')")},
   {"non-interactive", opt_non_interactive, 0,
                     N_("do no interactive prompting")},
@@ -252,21 +251,21 @@ const apr_getopt_option_t svn_cl__option
                     N_("read user configuration files from directory ARG")},
   {"config-option", opt_config_options, 1,
                     N_("set user configuration option in the format:\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "    FILE:SECTION:OPTION=[VALUE]\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "For example:\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "    servers:global:http-library=serf")},
   {"auto-props",    opt_autoprops, 0, N_("enable automatic properties")},
   {"no-auto-props", opt_no_autoprops, 0, N_("disable automatic properties")},
   {"native-eol",    opt_native_eol, 1,
                     N_("use a different EOL marker than the standard\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "system marker for files with the svn:eol-style\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "property set to 'native'.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "ARG may be one of 'LF', 'CR', 'CRLF'")},
   {"limit",         'l', 1, N_("maximum number of log entries")},
   {"no-unlock",     opt_no_unlock, 0, N_("don't unlock the targets")},
@@ -283,42 +282,42 @@ const apr_getopt_option_t svn_cl__option
                     N_("retrieve no revision properties")},
   {"with-revprop",  opt_with_revprop, 1,
                     N_("set revision property ARG in new revision\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "using the name[=value] format")},
   {"parents",       opt_parents, 0, N_("make intermediate directories")},
   {"use-merge-history", 'g', 0,
                     N_("use/display additional information from merge\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "history")},
   {"accept",        opt_accept, 1,
                     N_("specify automatic conflict resolution action\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "('postpone', 'base', 'mine-conflict',\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "'theirs-conflict', 'mine-full', 'theirs-full',\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "'edit', 'launch')")},
   {"show-revs",     opt_show_revs, 1,
                     N_("specify which collection of revisions to display\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "('merged', 'eligible')")},
   {"reintegrate",   opt_reintegrate, 0,
                     N_("merge a branch back into its parent branch")},
   {"strip",         opt_strip, 1,
                     N_("number of leading path components to strip from\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "paths parsed from the patch file. --strip 0\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "is the default and leaves paths unmodified.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "--strip 1 would change the path\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "'doc/fudge/crunchy.html' to 'fudge/crunchy.html'.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "--strip 2 would leave just 'crunchy.html'\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "The expected component separator is '/' on all\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "platforms. A leading '/' counts as one component.")},
   {"show-copies-as-adds", opt_show_copies_as_adds, 0,
                     N_("don't diff copied or moved files with their source")},
@@ -335,9 +334,9 @@ const apr_getopt_option_t svn_cl__option
                        N_("use git's extended diff format")},
   {"allow-mixed-revisions", opt_allow_mixed_revisions, 0,
                        N_("Allow merge into mixed-revision working copy.\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "Use of this option is not recommended!\n"
-                       SVN_CL__OPTION_CONTINUATION_INDENT
+                       "                             "
                        "Please run 'svn update' instead.")},
 
   /* Long-opt Aliases
@@ -710,7 +709,6 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "    U  Updated\n"
      "    C  Conflict\n"
      "    G  Merged\n"
-     "    E  Existed\n"
      "    R  Replaced\n"
      "\n"
      "  Characters in the first column report about the item itself.\n"
@@ -974,9 +972,9 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "  Note:  the --accept option is currently required.\n"),
     {opt_targets, 'R', opt_depth, 'q', opt_accept},
     {{opt_accept, N_("specify automatic conflict resolution source\n"
-                     SVN_CL__OPTION_CONTINUATION_INDENT
+                     "                             "
                      "('base', 'working', 'mine-conflict',\n"
-                     SVN_CL__OPTION_CONTINUATION_INDENT
+                     "                             "
                      "'theirs-conflict', 'mine-full', 'theirs-full')")}} },
 
   { "resolved", svn_cl__resolved, {0}, N_

Modified: subversion/branches/diff-optimizations-bytes/subversion/svn/patch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svn/patch-cmd.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svn/patch-cmd.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svn/patch-cmd.c Wed Jan 26 21:52:08 2011
@@ -62,6 +62,9 @@ svn_cl__patch(apr_getopt_t *os,
                                                       ctx, pool));
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
 
+  if (targets->nelts < 1)
+    return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
+
   if (targets->nelts > 2)
     return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0, NULL);
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svn/propset-cmd.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svn/propset-cmd.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svn/propset-cmd.c Wed Jan 26 21:52:08 2011
@@ -86,8 +86,8 @@ svn_cl__propset(apr_getopt_t *os,
      and LF line endings.  All other propvals are taken literally. */
   if (svn_prop_needs_translation(pname_utf8))
     SVN_ERR(svn_subst_translate_string2(&propval, NULL, NULL, propval,
-                                        opt_state->encoding, scratch_pool,
-                                        scratch_pool));
+                                        opt_state->encoding, FALSE,
+                                        scratch_pool, scratch_pool));
   else if (opt_state->encoding)
     return svn_error_create
       (SVN_ERR_UNSUPPORTED_FEATURE, NULL,

Modified: subversion/branches/diff-optimizations-bytes/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svn/util.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svn/util.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svn/util.c Wed Jan 26 21:52:08 2011
@@ -485,8 +485,8 @@ svn_cl__edit_string_externally(svn_strin
       if (as_text)
         {
           err = svn_subst_translate_string2(edited_contents, FALSE, FALSE,
-                                            *edited_contents, encoding, pool,
-                                            pool);
+                                            *edited_contents, encoding, FALSE,
+                                            pool, pool);
           if (err)
             {
               err = svn_error_quick_wrap
@@ -713,7 +713,7 @@ svn_cl__get_log_message(const char **log
       log_msg_str->len = log_msg_buf->len;
       SVN_ERR_W(svn_subst_translate_string2(&log_msg_str, FALSE, FALSE,
                                             log_msg_str, lmb->message_encoding,
-                                            pool, pool),
+                                            FALSE, pool, pool),
                 _("Error normalizing log message to internal format"));
 
       *log_msg = log_msg_str->data;

Modified: subversion/branches/diff-optimizations-bytes/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svnadmin/main.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svnadmin/main.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svnadmin/main.c Wed Jan 26 21:52:08 2011
@@ -1184,7 +1184,7 @@ set_revprop(const char *prop_name, const
   prop_value->len = file_contents->len;
 
   SVN_ERR(svn_subst_translate_string2(&prop_value, NULL, NULL, prop_value,
-                                      NULL, pool, pool));
+                                      NULL, FALSE, pool, pool));
 
   /* Open the filesystem  */
   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));

Modified: subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c Wed Jan 26 21:52:08 2011
@@ -52,6 +52,7 @@
 #include "svn_xml.h"
 
 #include "private/svn_cmdline_private.h"
+#include "private/svn_fspath.h"
 
 #include "svn_private_config.h"
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svnrdump/load_editor.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svnrdump/load_editor.c Wed Jan 26 21:52:08 2011
@@ -106,9 +106,9 @@ get_lock(const svn_string_t **lock_strin
 
 static svn_error_t *
 new_revision_record(void **revision_baton,
-		    apr_hash_t *headers,
-		    void *parse_baton,
-		    apr_pool_t *pool)
+                    apr_hash_t *headers,
+                    void *parse_baton,
+                    apr_pool_t *pool)
 {
   struct revision_baton *rb;
   struct parse_baton *pb;
@@ -312,6 +312,15 @@ new_node_record(void **node_baton,
 
   switch (nb->action)
     {
+    case svn_node_action_delete:
+    case svn_node_action_replace:
+      LDR_DBG(("Deleting entry %s in %p\n", nb->path, rb->db->baton));
+      SVN_ERR(commit_editor->delete_entry(nb->path, rb->rev,
+                                          rb->db->baton, rb->pool));
+      if (nb->action == svn_node_action_delete)
+        break;
+      else
+        /* FALL THROUGH */;
     case svn_node_action_add:
       switch (nb->kind)
         {
@@ -354,14 +363,6 @@ new_node_record(void **node_baton,
           break;
         }
       break;
-    case svn_node_action_delete:
-      LDR_DBG(("Deleting entry %s in %p\n", nb->path, rb->db->baton));
-      SVN_ERR(commit_editor->delete_entry(nb->path, rb->rev,
-                                          rb->db->baton, rb->pool));
-      break;
-    case svn_node_action_replace:
-      /* Absent in dumpstream; represented as a delete + add */
-      break;
     }
 
   *node_baton = nb;

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/davautocheck.sh?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/davautocheck.sh Wed Jan 26 21:52:08 2011
@@ -190,7 +190,7 @@ $LDD "$CLIENT_CMD" | grep -q 'not found'
   || fail "Subversion client couldn't find and/or load ra_dav library"
 
 httpd="$($APXS -q PROGNAME)"
-HTTPD=$(get_prog_name $httpd) || fail "HTTPD not found"
+HTTPD=$(get_prog_name $httpd) || fail "HTTPD '$HTTPD' not found"
 [ -x $HTTPD ] || fail "HTTPD '$HTTPD' not executable"
 
 "$HTTPD" -v 1>/dev/null 2>&1 \

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_tests.py?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_tests.py Wed Jan 26 21:52:08 2011
@@ -11103,7 +11103,7 @@ def set_up_renamed_subtree(sbox):
   expected_status.remove('A/D/H/psi')
 
   # Replicate old WC-to-WC move behavior where empty mergeinfo was set on
-  # the move desination.  Pre 1.6 repositories might have mergeinfo like
+  # the move destination.  Pre 1.6 repositories might have mergeinfo like
   # this so we still want to test that the issue #3067 fixes tested by
   # merge_chokes_on_renamed_subtrees and subtrees_with_empty_mergeinfo
   # still work.
@@ -16316,6 +16316,92 @@ def subtree_merges_inherit_invalid_worki
     "Subtree merge under working merge produced the wrong mergeinfo",
     '/A/C/nu:9', [], 'pg', SVN_PROP_MERGEINFO, nu_COPY_path)
 
+
+#----------------------------------------------------------------------
+# Test for issue #3686 'executable flag not correctly set on merge'
+# See http://subversion.tigris.org/issues/show_bug.cgi?id=3686
+def merge_change_to_file_with_executable(sbox):
+  "executable flag is maintained during binary merge"
+
+  # Scenario: When merging a change to a binary file with the 'svn:executable'
+  # property set, the file is not marked as 'executable'. After commit, the 
+  # executable bit is set correctly.
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  trunk_url = sbox.repo_url + '/A/B/E'
+
+  alpha_path = os.path.join(wc_dir, "A", "B", "E", "alpha")
+  beta_path = os.path.join(wc_dir, "A", "B", "E", "beta")
+
+  # Force one of the files to be a binary type
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'propset', 'svn:mime-type',
+                                     'application/octet-stream',
+                                     alpha_path)
+
+  # Set the 'svn:executable' property on both files
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'propset', 'svn:executable', 'ON',
+                                     beta_path)
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'propset', 'svn:executable', 'ON',
+                                     alpha_path)
+
+  # Verify the executable bit has been set before committing
+  if not os.access(alpha_path, os.X_OK):
+    raise svntest.Failure("alpha not marked as executable before commit")
+  if not os.access(beta_path, os.X_OK):
+    raise svntest.Failure("beta is not marked as executable before commit")
+
+  # Commit change (r2)
+  sbox.simple_commit()
+
+  # Verify the executable bit has remained after committing
+  if not os.access(alpha_path, os.X_OK):
+    raise svntest.Failure("alpha not marked as executable before commit")
+  if not os.access(beta_path, os.X_OK):
+    raise svntest.Failure("beta is not marked as executable before commit")
+
+  # Create the branch
+  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+                                     trunk_url,
+                                     sbox.repo_url + '/branch',
+                                     '-m', "Creating the Branch")   
+
+  # Modify the files + commit (r3)
+  svntest.main.file_append(alpha_path, 'appended alpha text')
+  svntest.main.file_append(beta_path, 'appended beta text')
+  sbox.simple_commit()
+
+  # Switch the WC to the branch
+  svntest.actions.run_and_verify_svn(None, None, [], 'switch',
+                                     sbox.repo_url + '/branch',
+                                     wc_dir)
+  
+  # Recalculate the paths
+  alpha_path = os.path.join(wc_dir, "alpha")
+  beta_path = os.path.join(wc_dir, "beta")
+
+  # Merge the changes across
+  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
+                                     trunk_url, wc_dir)
+
+  # Verify the executable bit has been set
+  if not os.access(alpha_path, os.X_OK):
+    raise svntest.Failure("alpha is not marked as executable after merge")
+  if not os.access(beta_path, os.X_OK):
+    raise svntest.Failure("beta is not marked as executable after merge")
+
+  # Commit (r4)
+  sbox.simple_commit()
+
+  # Verify the executable bit has been set
+  if not os.access(alpha_path, os.X_OK):
+    raise svntest.Failure("alpha is not marked as executable after commit")
+  if not os.access(beta_path, os.X_OK):
+    raise svntest.Failure("beta is not marked as executable after commit")
+
 ########################################################################
 # Run the tests
 
@@ -16507,6 +16593,8 @@ test_list = [ None,
               merge_with_os_deleted_subtrees,
               no_self_referential_or_nonexistent_inherited_mergeinfo,
               XFail(subtree_merges_inherit_invalid_working_mergeinfo),
+              XFail(SkipUnless(merge_change_to_file_with_executable,
+              	               svntest.main.is_posix_os)),
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests.py?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests.py Wed Jan 26 21:52:08 2011
@@ -26,6 +26,7 @@
 
 # General modules
 import sys, os
+import re
 
 # Our testing module
 import svntest
@@ -49,9 +50,10 @@ Wimp = svntest.testcase.Wimp
 # /dev/null). This is really harmless, but `svnadmin dump` contains
 # the logic for differentiating between these two cases.
 
-mismatched_headers_re = \
-    "Prop-delta: |Text-content-sha1: |Text-copy-source-md5: |" \
-    "Text-copy-source-sha1: |Text-delta-base-sha1: .*"
+mismatched_headers_re = re.compile(
+    "Prop-delta: .*|Text-content-sha1: .*|Text-copy-source-md5: .*|" 
+    "Text-copy-source-sha1: .*|Text-delta-base-sha1: .*"
+)
 
 ######################################################################
 # Helper routines
@@ -102,6 +104,7 @@ def run_dump_test(sbox, dumpfile_name, e
     svnadmin_dumpfile = open(os.path.join(svnrdump_tests_dir,
                                           expected_dumpfile_name),
                              'rb').readlines()
+    svnadmin_dumpfile = svntest.verify.UnorderedOutput(svnadmin_dumpfile)
 
   # Compare the output from stdout
   svntest.verify.compare_and_display_lines(
@@ -318,6 +321,10 @@ def descend_into_replace_dump(sbox):
   run_dump_test(sbox, "descend-into-replace.dump", subdir='/trunk/H',
                 expected_dumpfile_name = "descend-into-replace.expected.dump")
 
+def descend_into_replace_load(sbox):
+  "load: descending into replaced dir looks in src"
+  run_load_test(sbox, "descend-into-replace.dump")
+
 ########################################################################
 # Run the tests
 
@@ -358,7 +365,8 @@ test_list = [ None,
               copy_bad_line_endings_dump,
               commit_a_copy_of_root_dump,
               commit_a_copy_of_root_load,
-              XFail(descend_into_replace_dump, svntest.main.is_fs_type_bdb),
+              descend_into_replace_dump,
+              descend_into_replace_load,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.dump
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.dump?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
Files subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.dump (original) and subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.dump Wed Jan 26 21:52:08 2011 differ

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.expected.dump
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.expected.dump?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
Files subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.expected.dump (original) and subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.expected.dump Wed Jan 26 21:52:08 2011 differ

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py Wed Jan 26 21:52:08 2011
@@ -278,7 +278,7 @@ def tag_with_modified_file(sbox):
 
 def dir_prop_change(sbox):
   "directory property changes"
-  run_test(sbox, "dir_prop_change.dump")
+  run_test(sbox, "dir-prop-change.dump")
 
 #----------------------------------------------------------------------
 
@@ -794,7 +794,7 @@ def delete_svn_props(sbox):
 def commit_a_copy_of_root(sbox):
   "commit a copy of root causes sync to fail"
   #Testcase for issue 3438.
-  run_test(sbox, "repo_with_copy_of_root_dir.dump")
+  run_test(sbox, "repo-with-copy-of-root-dir.dump")
 
 # issue #3641 'svnsync fails to partially copy a repository'.
 # This currently fails because while replacements with history
@@ -834,8 +834,8 @@ def commit_a_copy_of_root(sbox):
 #                 mkdir %ROOT_URL%/trunk/H/Z/B
 def descend_into_replace(sbox):
   "descending into replaced dir looks in src"
-  run_test(sbox, "descend_into_replace.dump", subdir='/trunk/H',
-           exp_dump_file_name = "descend_into_replace.expected.dump")
+  run_test(sbox, "descend-into-replace.dump", subdir='/trunk/H',
+           exp_dump_file_name = "descend-into-replace.expected.dump")
 
 # issue #3728
 def delete_revprops(sbox):
@@ -906,7 +906,7 @@ test_list = [ None,
               copy_bad_line_endings,
               delete_svn_props,
               commit_a_copy_of_root,
-              XFail(descend_into_replace),
+              descend_into_replace,
               delete_revprops,
              ]
 serial_only = True

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/main.py?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/main.py Wed Jan 26 21:52:08 2011
@@ -1130,6 +1130,8 @@ class TestSpawningThread(threading.Threa
       args.append('--http-library=' + options.http_library)
     if options.server_minor_version:
       args.append('--server-minor-version=' + str(options.server_minor_version))
+    if options.mode_filter:
+      args.append('--mode-filter=' + options.mode_filter)
 
     result, stdout_lines, stderr_lines = spawn_process(command, 0, 0, None,
                                                        *args)
@@ -1151,17 +1153,24 @@ class TestRunner:
     self.index = index
 
   def list(self):
-    if options.verbose and self.pred.inprogress:
-      print(" %2d     %-5s  %s [[%s]]" % (self.index,
-                                        self.pred.list_mode(),
-                                        self.pred.description,
-                                        self.pred.inprogress))
-    else:
-      print(" %2d     %-5s  %s" % (self.index,
-                                   self.pred.list_mode(),
-                                   self.pred.description))
+    if options.mode_filter.upper() == 'ALL' \
+       or options.mode_filter.upper() == self.pred.list_mode().upper() \
+       or (options.mode_filter.upper() == 'PASS' \
+           and self.pred.list_mode() == ''):
+      if options.verbose and self.pred.inprogress:
+        print(" %3d    %-5s  %s [[%s]]" % (self.index,
+                                           self.pred.list_mode(),
+                                           self.pred.description,
+                                           self.pred.inprogress))
+      else:
+        print(" %3d    %-5s  %s" % (self.index,
+                                    self.pred.list_mode(),
+                                    self.pred.description))
     sys.stdout.flush()
 
+  def get_mode(self):
+    return self.pred.list_mode()
+
   def get_function_name(self):
     return self.pred.get_function_name()
 
@@ -1276,9 +1285,15 @@ def run_one_test(n, test_list, finished_
   if n < 0:
     n += 1+num_tests
 
-  # Run the test.
-  exit_code = TestRunner(test_list[n], n).run()
-  return exit_code
+  test_mode = TestRunner(test_list[n], n).get_mode().upper()
+  if options.mode_filter.upper() == 'ALL' \
+     or options.mode_filter.upper() == test_mode \
+     or (options.mode_filter.upper() == 'PASS' and test_mode == ''):
+    # Run the test.
+    exit_code = TestRunner(test_list[n], n).run()
+    return exit_code
+  else:
+    return 0
 
 def _internal_run_tests(test_list, testnums, parallel, srcdir, progress_func):
   """Run the tests from TEST_LIST whose indices are listed in TESTNUMS.
@@ -1300,6 +1315,7 @@ def _internal_run_tests(test_list, testn
 
   if not parallel:
     for i, testnum in enumerate(testnums):
+      
       if run_one_test(testnum, test_list) == 1:
           exit_code = 1
       # signal progress
@@ -1369,6 +1385,9 @@ def _create_parser():
   parser.add_option('-c', action='store_true', dest='is_child_process',
                     help='Flag if we are running this python test as a ' +
                          'child process')
+  parser.add_option('--mode-filter', action='store', dest='mode_filter',
+                    default='ALL',
+                    help='Limit tests to those with type specified (e.g. XFAIL)')
   parser.add_option('--url', action='store',
                     help='Base url to the repos (e.g. svn://localhost)')
   parser.add_option('--fs-type', action='store',
@@ -1565,13 +1584,20 @@ def execute_tests(test_list, serial_only
     testnums = list(range(1, len(test_list)))
 
   if options.list_tests:
-    print("Test #  Mode   Test Description")
-    print("------  -----  ----------------")
+    header = "Test #  Mode   Test Description\n" \
+             "------  -----  ----------------"
+    printed_header = False
     for testnum in testnums:
-      TestRunner(test_list[testnum], testnum).list()
-
-    # done. just exit with success.
-    sys.exit(0)
+      test_mode = TestRunner(test_list[testnum], testnum).get_mode().upper()
+      if options.mode_filter.upper() == 'ALL' \
+         or options.mode_filter.upper() == test_mode \
+         or (options.mode_filter.upper() == 'PASS' and test_mode == ''):
+        if not printed_header:
+          print header
+          printed_header = True
+        TestRunner(test_list[testnum], testnum).list()
+    # We are simply listing the tests so always exit with success.
+    return 0
 
   # don't run tests in parallel when the tests don't support it or there
   # are only a few tests to run.

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/verify.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/verify.py?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/verify.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/verify.py Wed Jan 26 21:52:08 2011
@@ -238,6 +238,11 @@ class UnorderedOutput(ExpectedOutput):
   def __cmp__(self, other):
     raise Exception('badness')
 
+  def matches_except(self, expected, actual, except_re):
+    assert type(actual) == type([]) # ### if this trips: fix it!
+    return self.is_equivalent_list([l for l in expected if not except_re.match(l)],
+                                   [l for l in actual if not except_re.match(l)])
+
   def is_equivalent_list(self, expected, actual):
     "Disregard the order of ACTUAL lines during comparison."
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/switch_tests.py?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/switch_tests.py Wed Jan 26 21:52:08 2011
@@ -1072,7 +1072,7 @@ def relocate_beyond_repos_root(sbox):
   # A relocate that changes the repo path part of the URL shouldn't work.
   # This tests for issue #2380.
   svntest.actions.run_and_verify_svn(None, None,
-                                     ".*Invalid destination URL.*",
+                                     ".*Invalid relocation destination.*",
                                      'switch', '--relocate',
                                      A_url, other_B_url, A_wc_dir)
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/dirent_uri-test.c Wed Jan 26 21:52:08 2011
@@ -36,6 +36,7 @@
 
 #include "svn_pools.h"
 #include "svn_dirent_uri.h"
+#include "private/svn_fspath.h"
 
 #include "../svn_test.h"
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/subst_translate-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/subst_translate-test.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/subst_translate-test.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/subst_translate-test.c Wed Jan 26 21:52:08 2011
@@ -66,7 +66,7 @@ test_svn_subst_translate_string2(apr_poo
 
     SVN_ERR(svn_subst_translate_string2(&new_value,
                                         NULL, &translated_line_endings,
-                                        source_string, "ISO-8859-1",
+                                        source_string, "ISO-8859-1", FALSE,
                                         pool, pool));
     SVN_TEST_STRING_ASSERT(new_value->data, t->expected_str);
     SVN_TEST_ASSERT(translated_line_endings == t->translated_line_endings);
@@ -76,13 +76,42 @@ test_svn_subst_translate_string2(apr_poo
     translated_line_endings = ! t->translated_line_endings;
     SVN_ERR(svn_subst_translate_string2(&new_value, &translated_to_utf8,
                                         &translated_line_endings,
-                                        source_string, "ISO-8859-1",
+                                        source_string, "ISO-8859-1", FALSE,
                                         pool, pool));
     SVN_TEST_STRING_ASSERT(new_value->data, t->expected_str);
     SVN_TEST_ASSERT(translated_to_utf8 == t->translated_to_utf8);
     SVN_TEST_ASSERT(translated_line_endings == t->translated_line_endings);
   }
 
+  /* Test that when REPAIR is FALSE, SVN_ERR_IO_INCONSISTENT_EOL is returned. */
+    {
+      svn_string_t *source_string = svn_string_create("  \r   \r\n  \n ", pool);
+      svn_string_t *new_value = NULL;
+      svn_error_t *err = svn_subst_translate_string2(&new_value, NULL, NULL,
+                                                     source_string,
+                                                     "ISO-8859-1", FALSE, pool,
+                                                     pool);
+      SVN_TEST_ASSERT(err != SVN_NO_ERROR);
+      SVN_TEST_ASSERT(err->apr_err == SVN_ERR_IO_INCONSISTENT_EOL);
+      svn_error_clear(err);
+    }
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+test_repairing_svn_subst_translate_string2(apr_pool_t *pool)
+{
+    {
+      svn_string_t *source_string = svn_string_create("  \r   \r\n  \n ", pool);
+      svn_string_t *new_value = NULL;
+      SVN_ERR(svn_subst_translate_string2(&new_value, NULL, NULL, source_string,
+                                          "ISO-8859-1", TRUE, pool, pool));
+      SVN_TEST_ASSERT(new_value != NULL);
+      SVN_TEST_ASSERT(new_value->data != NULL);
+      SVN_TEST_STRING_ASSERT(new_value->data, "  \n   \n  \n ");
+    }
+
   return SVN_NO_ERROR;
 }
 
@@ -142,6 +171,8 @@ struct svn_test_descriptor_t test_funcs[
     SVN_TEST_NULL,
     SVN_TEST_PASS2(test_svn_subst_translate_string2,
                    "test svn_subst_translate_string2()"),
+    SVN_TEST_PASS2(test_repairing_svn_subst_translate_string2,
+                   "test repairing svn_subst_translate_string2()"),
     SVN_TEST_PASS2(test_svn_subst_translate_cstring2,
                    "test svn_subst_translate_cstring2()"),
     SVN_TEST_NULL

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test.h?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test.h Wed Jan 26 21:52:08 2011
@@ -95,7 +95,8 @@ enum svn_test_mode_t
   {
     svn_test_pass,
     svn_test_xfail,
-    svn_test_skip
+    svn_test_skip,
+    svn_test_all
   };
 
 /* Each test gets a test descriptor, holding the function and other

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test_main.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test_main.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test_main.c Wed Jan 26 21:52:08 2011
@@ -68,6 +68,10 @@ static svn_boolean_t cleanup_mode = FALS
 /* Test option: Allow segfaults */
 static svn_boolean_t allow_segfaults = FALSE;
 
+/* Test option: Limit testing to a given mode (i.e. XFail, Skip,
+   Pass, All). */
+enum svn_test_mode_t mode_filter = svn_test_all;
+
 /* Option parsing enums and structures */
 enum {
   cleanup_opt = SVN_OPT_FIRST_LONGOPT_ID,
@@ -78,7 +82,9 @@ enum {
   quiet_opt,
   config_opt,
   server_minor_version_opt,
-  allow_segfault_opt
+  allow_segfault_opt,
+  srcdir_opt,
+  mode_filter_opt
 };
 
 static const apr_getopt_option_t cl_options[] =
@@ -91,6 +97,9 @@ static const apr_getopt_option_t cl_opti
                     N_("specify a filesystem backend type ARG")},
   {"list",          list_opt, 0,
                     N_("lists all the tests with their short description")},
+  {"mode-filter",   mode_filter_opt, 1,
+                    N_("only run/list tests with expected mode ARG = PASS, "
+                       "XFAIL, SKIP, or ALL (default)\n")},
   {"verbose",       verbose_opt, 0,
                     N_("print extra information")},
   {"server-minor-version", server_minor_version_opt, 1,
@@ -102,6 +111,8 @@ static const apr_getopt_option_t cl_opti
                     N_("print only unexpected results")},
   {"allow-segfaults", allow_segfault_opt, 0,
                     N_("don't trap seg faults (useful for debugging)")},
+  {"srcdir",        srcdir_opt, 1,
+                    N_("source directory")},
   {0,               0, 0, 0}
 };
 
@@ -196,12 +207,15 @@ crash_handler(int signum)
 
 
 /* Execute a test number TEST_NUM.  Pretty-print test name and dots
-   according to our test-suite spec, and return the result code. */
+   according to our test-suite spec, and return the result code.
+   If HEADER_MSG and *HEADER_MSG are not NULL, print *HEADER_MSG prior
+   to pretty-printing the test information, then set *HEADER_MSG to NULL. */
 static svn_boolean_t
 do_test_num(const char *progname,
             int test_num,
             svn_boolean_t msg_only,
             svn_test_opts_t *opts,
+            const char **header_msg,
             apr_pool_t *pool)
 {
   svn_boolean_t skip, xfail, wimp;
@@ -210,12 +224,15 @@ do_test_num(const char *progname,
   const char *msg = NULL;  /* the message this individual test prints out */
   const struct svn_test_descriptor_t *desc;
   const int array_size = get_array_size();
+  svn_boolean_t run_this_test; /* This test's mode matches DESC->MODE. */
 
   /* Check our array bounds! */
   if (test_num < 0)
     test_num += array_size + 1;
   if ((test_num > array_size) || (test_num <= 0))
     {
+      if (header_msg && *header_msg)
+        printf("%s", *header_msg);
       printf("FAIL: %s: THERE IS NO TEST NUMBER %2d\n", progname, test_num);
       skip_cleanup = TRUE;
       return TRUE;  /* BAIL, this test number doesn't exist. */
@@ -226,6 +243,13 @@ do_test_num(const char *progname,
   xfail = desc->mode == svn_test_xfail;
   wimp = xfail && desc->wip;
   msg = desc->msg;
+  run_this_test = mode_filter == svn_test_all || mode_filter == desc->mode;
+
+  if (run_this_test && header_msg && *header_msg)
+    {
+      printf("%s", *header_msg);
+      *header_msg = NULL;
+    }
 
   if (!allow_segfaults)
     {
@@ -242,7 +266,7 @@ do_test_num(const char *progname,
   if (setjmp(jump_buffer) == 0)
     {
       /* Do test */
-      if (msg_only || skip)
+      if (msg_only || skip || !run_this_test)
         ; /* pass */
       else if (desc->func2)
         err = (*desc->func2)(pool);
@@ -279,15 +303,16 @@ do_test_num(const char *progname,
 
   if (msg_only)
     {
-      printf(" %2d     %-5s  %s%s%s%s\n",
-             test_num,
-             (xfail ? "XFAIL" : (skip ? "SKIP" : "")),
-             msg ? msg : "(test did not provide name)",
-             (wimp && verbose_mode) ? " [[" : "",
-             (wimp && verbose_mode) ? desc->wip : "",
-             (wimp && verbose_mode) ? "]]" : "");
+      if (run_this_test)
+        printf(" %3d    %-5s  %s%s%s%s\n",
+               test_num,
+               (xfail ? "XFAIL" : (skip ? "SKIP" : "")),
+               msg ? msg : "(test did not provide name)",
+               (wimp && verbose_mode) ? " [[" : "",
+               (wimp && verbose_mode) ? desc->wip : "",
+               (wimp && verbose_mode) ? "]]" : "");
     }
-  else if ((! quiet_mode) || test_failed)
+  else if (run_this_test && ((! quiet_mode) || test_failed))
     {
       printf("%s %s %d: %s%s%s%s\n",
              (err
@@ -404,6 +429,22 @@ main(int argc, const char *argv[])
         case list_opt:
           list_mode = TRUE;
           break;
+        case mode_filter_opt:
+          if (svn_cstring_casecmp(opt_arg, "PASS") == 0)
+            mode_filter = svn_test_pass;
+          else if (svn_cstring_casecmp(opt_arg, "XFAIL") == 0)
+            mode_filter = svn_test_xfail;
+          else if (svn_cstring_casecmp(opt_arg, "SKIP") == 0)
+            mode_filter = svn_test_skip;
+          else if (svn_cstring_casecmp(opt_arg, "ALL") == 0)
+            mode_filter = svn_test_all;
+          else
+            {
+              fprintf(stderr, "FAIL: Invalid --mode-filter option.  Try ");
+              fprintf(stderr, " PASS, XFAIL, SKIP or ALL.\n");
+              exit(1);
+            }
+          break;
         case verbose_opt:
           verbose_mode = TRUE;
           break;
@@ -453,15 +494,16 @@ main(int argc, const char *argv[])
     {
       if (! strcmp(argv[1], "list") || list_mode)
         {
+          const char *header_msg;
           ran_a_test = TRUE;
 
           /* run all tests with MSG_ONLY set to TRUE */
-
-          printf("Test #  Mode   Test Description\n"
-                 "------  -----  ----------------\n");
+          header_msg = "Test #  Mode   Test Description\n"
+                       "------  -----  ----------------\n";
           for (i = 1; i <= array_size; i++)
             {
-              if (do_test_num(prog_name, i, TRUE, &opts, test_pool))
+              if (do_test_num(prog_name, i, TRUE, &opts, &header_msg,
+                              test_pool))
                 got_error = TRUE;
 
               /* Clear the per-function pool */
@@ -481,7 +523,8 @@ main(int argc, const char *argv[])
                     continue;
 
                   ran_a_test = TRUE;
-                  if (do_test_num(prog_name, test_num, FALSE, &opts, test_pool))
+                  if (do_test_num(prog_name, test_num, FALSE, &opts, NULL,
+                                  test_pool))
                     got_error = TRUE;
 
                   /* Clear the per-function pool */
@@ -497,7 +540,7 @@ main(int argc, const char *argv[])
       /* just run all tests */
       for (i = 1; i <= array_size; i++)
         {
-          if (do_test_num(prog_name, i, FALSE, &opts, test_pool))
+          if (do_test_num(prog_name, i, FALSE, &opts, NULL, test_pool))
             got_error = TRUE;
 
           /* Clear the per-function pool */

Modified: subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnbuild.sh
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnbuild.sh?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnbuild.sh (original)
+++ subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnbuild.sh Wed Jan 26 21:52:08 2011
@@ -19,6 +19,7 @@
 #
 #
 
+set -e
 set -x
 
 branch="$(basename $(svn info . | grep ^URL  | cut -d' ' -f2))"

Modified: subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck-bindings.sh
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck-bindings.sh?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck-bindings.sh (original)
+++ subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck-bindings.sh Wed Jan 26 21:52:08 2011
@@ -19,6 +19,7 @@
 #
 #
 
+set -e
 set -x
 
 branch="$(basename $(svn info . | grep ^URL  | cut -d' ' -f2))"

Modified: subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck.sh?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck.sh (original)
+++ subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck.sh Wed Jan 26 21:52:08 2011
@@ -19,6 +19,7 @@
 #
 #
 
+set -e
 set -x
 
 branch="$(basename $(svn info . | grep ^URL  | cut -d' ' -f2))"

Modified: subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnclean.sh
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnclean.sh?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnclean.sh (original)
+++ subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnclean.sh Wed Jan 26 21:52:08 2011
@@ -19,6 +19,7 @@
 #
 #
 
+set -e
 set -x
 
 branch="$(basename $(svn info . | grep ^URL  | cut -d' ' -f2))"
@@ -26,5 +27,6 @@ branch="$(basename $(svn info . | grep ^
 for i in 3 4 5 6 7; do
   (test -h ../svn-1.${i}.x || ln -s build ../svn-1.${i}.x)
 done
+svn update ../../unix-build
 (test -h ../GNUmakefile || ln -s ../unix-build/Makefile.svn ../GNUmakefile)
 (cd .. && gmake BRANCH="$branch" reset clean)

Modified: subversion/branches/diff-optimizations-bytes/tools/client-side/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/tools/client-side/svnmucc/svnmucc.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/tools/client-side/svnmucc/svnmucc.c (original)
+++ subversion/branches/diff-optimizations-bytes/tools/client-side/svnmucc/svnmucc.c Wed Jan 26 21:52:08 2011
@@ -365,7 +365,7 @@ subtract_anchor(const char *anchor, cons
   if (! strcmp(url, anchor))
     return "";
   else
-    return svn_path_uri_decode(svn_path_is_child(anchor, url, pool), pool);
+    return svn_path_uri_decode(svn_uri_is_child(anchor, url, pool), pool);
 }
 
 /* Add PATH to the operations tree rooted at OPERATION, creating any

Modified: subversion/branches/diff-optimizations-bytes/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/tools/dev/unix-build/Makefile.svn?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/diff-optimizations-bytes/tools/dev/unix-build/Makefile.svn Wed Jan 26 21:52:08 2011
@@ -2,6 +2,11 @@
 #
 # WARNING: This may or may not work on your system. This Makefile is
 # an example, rather than a ready-made universal solution.
+#
+# Note to Subversion committers:
+# This Makefile is used by the svn-openbsd-i386 buildbot
+# (http://ci.apache.org/builders/svn-openbsd-i386).
+# Please check the bot's health after making changes to this file.
 
 ENABLE_PYTHON_BINDINGS ?= yes
 ENABLE_RUBY_BINDINGS ?= yes
@@ -1050,7 +1055,8 @@ SVNSERVE_START_CMD = $(SVN_PREFIX)/bin/s
 			--listen-host 127.0.0.1 \
 			--pid-file $(PWD)/svnserve-$(WC).pid \
 			-d -r $(svn_builddir)/subversion/tests/cmdline
-SVNSERVE_STOP_CMD = kill `cat $(PWD)/svnserve-$(WC).pid`
+SVNSERVE_STOP_CMD = kill `cat $(PWD)/svnserve-$(WC).pid`; sleep 3; \
+			rm -f $(PWD)/svnserve-$(WC).pid
 
 start-httpd: httpd-conf
 	$(HTTPD_START_CMD)
@@ -1063,6 +1069,10 @@ stop-httpd:
 	$(HTTPD_STOP_CMD)
 
 start-svnserve: $(SVN_OBJDIR)/.compiled
+	-ls $(PWD)/svnserve-*.pid | while read pidfile; do \
+		kill `cat "$$pidfile"`; sleep 3; \
+		rm -f $$pidfile; \
+	done
 	$(SVNSERVE_START_CMD)
 
 stop-svnserve: