You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/04/08 17:52:54 UTC

svn commit: r931980 [2/3] - in /subversion/branches/svn-patch-improvements: ./ build/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_diff/ subversion/libsvn_fs_base/ subversion/libsvn_fs_fs/ subversion/libsv...

Modified: subversion/branches/svn-patch-improvements/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/libsvn_wc/update_editor.c?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/libsvn_wc/update_editor.c Thu Apr  8 15:52:53 2010
@@ -372,15 +372,15 @@ struct handler_baton
   struct file_baton *fb;
 
   /* Where we are assembling the new file. */
-  const char *work_abspath;
+  const char *new_text_base_tmp_abspath;
 #ifdef SVN_EXPERIMENTAL
-  /* Where the pristine is before we can copy it into the correct location. */
-  const char *temp_pristine_abspath;
+  /* The WC-NG equivalent of NEW_TEXT_BASE_TMP_ABSPATH. */
+  const char *new_pristine_tmp_abspath;
 #endif
 
-    /* The expected checksum of the text source or NULL if no base
+    /* The expected MD5 checksum of the text source or NULL if no base
      checksum is available */
-  svn_checksum_t *expected_source_checksum;
+  svn_checksum_t *expected_source_md5_checksum;
 
   /* Why two checksums?
      The editor currently provides an md5 which we use to detect corruption
@@ -391,20 +391,21 @@ struct handler_baton
 
   /* The calculated checksum of the text source or NULL if the acual
      checksum is not being calculated */
-  svn_checksum_t *md5_actual_source_checksum;
-
-  /* A calculated SHA-1, which we'll use for eventually writing the
-     pristine. */
-  svn_checksum_t *sha1_actual_checksum;
+  svn_checksum_t *actual_source_md5_checksum;
 
   /* The stream used to calculate the source checksums */
   svn_stream_t *source_checksum_stream;
 
-  /* This is initialized to all zeroes when the baton is created, then
+  /* A calculated MD5 digest of NEW_TEXT_BASE_TMP_ABSPATH.
+     This is initialized to all zeroes when the baton is created, then
      populated with the MD5 digest of the resultant fulltext after the
      last window is handled by the handler returned from
      apply_textdelta(). */
-  unsigned char digest[APR_MD5_DIGESTSIZE];
+  unsigned char new_text_base_md5_digest[APR_MD5_DIGESTSIZE];
+
+  /* A calculated SHA-1 of NEW_PRISTINE_TMP_ABSPATH, which we'll use for
+     eventually writing the pristine. */
+  svn_checksum_t * new_text_base_sha1_checksum;
 };
 
 
@@ -939,34 +940,34 @@ struct file_baton
 
   /* The path to the current text base, if any.
      This gets set if there are file content changes. */
-  const char *text_base_path;
+  const char *text_base_abspath;
 
   /* The path to the incoming text base (that is, to a text-base-file-
      in-progress in the tmp area).  This gets set if there are file
      content changes. */
-  const char *new_text_base_abspath;
+  const char *new_text_base_tmp_abspath;
 #ifdef SVN_EXPERIMENTAL
-  /* Where the pristine is before we can copy it into the correct location. */
-  const char *temp_pristine_abspath;
+  /* The WC-NG equivalent of NEW_TEXT_BASE_TMP_ABSPATH. */
+  const char *new_pristine_tmp_abspath;
 #endif
 
-  /* The checksum for the file located at NEW_TEXT_BASE_PATH. */
-  svn_checksum_t *md5_actual_checksum;
+  /* The MD5 checksum of the incoming text base (pristine text). */
+  svn_checksum_t *new_text_base_md5_checksum;
 
-  /* The sha1 checksum of the pristine. */
-  svn_checksum_t *sha1_actual_checksum;
+  /* The SHA1 checksum of the incoming text base (pristine text). */
+  svn_checksum_t *new_text_base_sha1_checksum;
 
   /* If this file was added with history, this is the path to a copy
      of the text base of the copyfrom file (in the temporary area). */
-  const char *copied_text_base;
+  const char *copied_text_base_abspath;
 
   /* If this file was added with history, this is the MD5 checksum of the
-     text base (see copied_text_base). May be NULL if unknown. */
-  svn_checksum_t *md5_copied_base_checksum;
+     text base (see copied_text_base_abspath). May be NULL if unknown. */
+  svn_checksum_t *copied_text_base_md5_checksum;
 
-  /* If this file was added with history, this is the SHA-1 checksum of
-     the text base (see copied_text_base). May be NULL if unknown. */
-  svn_checksum_t *sha1_copied_base_checksum;
+  /* If this file was added with history, this is the SHA-1 checksum of the
+     text base (see copied_text_base_abspath). May be NULL if unknown. */
+  svn_checksum_t *copied_text_base_sha1_checksum;
 
   /* If this file was added with history, and the copyfrom had local
      mods, this is the path to a copy of the user's version with local
@@ -1038,8 +1039,6 @@ make_file_baton(struct file_baton **f_p,
   f->deleted           = FALSE;
   f->dir_baton         = pb;
 
-  /* No need to initialize f->digest, since we used pcalloc(). */
-
   /* the directory's bump info has one more referer now */
   ++f->bump_info->ref_count;
 
@@ -1061,23 +1060,22 @@ window_handler(svn_txdelta_window_t *win
   if (window != NULL && !err)
     return SVN_NO_ERROR;
 
-  if (hb->expected_source_checksum)
+  if (hb->expected_source_md5_checksum)
     {
-      /* Close the stream to calculate the final checksum
-         (This also calculates the md5 as well.) */
+      /* Close the stream to calculate HB->actual_source_md5_checksum. */
       svn_error_t *err2 = svn_stream_close(hb->source_checksum_stream);
 
-      if (!err2 && !svn_checksum_match(hb->expected_source_checksum,
-                                       hb->md5_actual_source_checksum))
+      if (!err2 && !svn_checksum_match(hb->expected_source_md5_checksum,
+                                       hb->actual_source_md5_checksum))
         {
           err = svn_error_createf(SVN_ERR_WC_CORRUPT_TEXT_BASE, err,
                     _("Checksum mismatch while updating '%s':\n"
                       "   expected:  %s\n"
                       "     actual:  %s\n"),
                     svn_dirent_local_style(fb->local_abspath, hb->pool),
-                    svn_checksum_to_cstring(hb->expected_source_checksum,
+                    svn_checksum_to_cstring(hb->expected_source_md5_checksum,
                                             hb->pool),
-                    svn_checksum_to_cstring(hb->md5_actual_source_checksum,
+                    svn_checksum_to_cstring(hb->actual_source_md5_checksum,
                                             hb->pool));
         }
 
@@ -1087,26 +1085,29 @@ window_handler(svn_txdelta_window_t *win
   if (err)
     {
       /* We failed to apply the delta; clean up the temporary file.  */
-      svn_error_clear(svn_io_remove_file2(hb->work_abspath, TRUE, hb->pool));
+      svn_error_clear(svn_io_remove_file2(hb->new_text_base_tmp_abspath, TRUE,
+                                          hb->pool));
 #ifdef SVN_EXPERIMENTAL
-      svn_error_clear(svn_io_remove_file2(hb->temp_pristine_abspath, TRUE,
+      svn_error_clear(svn_io_remove_file2(hb->new_pristine_tmp_abspath, TRUE,
                                           hb->pool));
 #endif
     }
   else
     {
       /* Tell the file baton about the new text base. */
-      fb->new_text_base_abspath = apr_pstrdup(fb->pool, hb->work_abspath);
+      fb->new_text_base_tmp_abspath = apr_pstrdup(fb->pool,
+                                              hb->new_text_base_tmp_abspath);
 #ifdef SVN_EXPERIMENTAL
-      fb->temp_pristine_abspath = apr_pstrdup(fb->pool,
-                                              hb->temp_pristine_abspath);
+      fb->new_pristine_tmp_abspath = apr_pstrdup(fb->pool,
+                                              hb->new_pristine_tmp_abspath);
 #endif
 
       /* ... and its checksums. */
-      fb->md5_actual_checksum =
-        svn_checksum__from_digest(hb->digest, svn_checksum_md5, fb->pool);
-      fb->sha1_actual_checksum =
-        svn_checksum_dup(hb->sha1_actual_checksum, fb->pool);
+      fb->new_text_base_md5_checksum =
+        svn_checksum__from_digest(hb->new_text_base_md5_digest,
+                                  svn_checksum_md5, fb->pool);
+      fb->new_text_base_sha1_checksum =
+        svn_checksum_dup(hb->new_text_base_sha1_checksum, fb->pool);
     }
 
   svn_pool_destroy(hb->pool);
@@ -3147,14 +3148,11 @@ absent_directory(const char *path,
 #ifdef SVN_EXPERIMENTAL
 /* Set *TEE_OUTPUT_STREAM to a writable stream that copies its data to both
    OUTPUT_STREAM and a new WC-NG pristine temp file corresponding to (DB,
-   LOCAL_ABSPATH). Set *TEMP_PRISTINE_ABSPATH to the path of that file.
-   Arrange that, on stream closure, *ACTUAL_CHECKSUM will be set to the SHA-1
-   checksum of that file.
+   LOCAL_ABSPATH). Set *NEW_PRISTINE_TMP_ABSPATH to the path of that file.
  */
 static svn_error_t *
 get_pristine_tee_stream(svn_stream_t **tee_output_stream,
-                        const char **temp_pristine_abspath,
-                        svn_checksum_t **actual_checksum,
+                        const char **new_pristine_tmp_abspath,
                         svn_wc__db_t *db,
                         const char *local_abspath,
                         svn_stream_t *output_stream,
@@ -3167,13 +3165,9 @@ get_pristine_tee_stream(svn_stream_t **t
   SVN_ERR(svn_wc__db_pristine_get_tempdir(&pristine_tempdir, db,
                                           local_abspath, scratch_pool,
                                           scratch_pool));
-  SVN_ERR(svn_stream_open_unique(&pristine_temp, temp_pristine_abspath,
+  SVN_ERR(svn_stream_open_unique(&pristine_temp, new_pristine_tmp_abspath,
                                  pristine_tempdir, svn_io_file_del_none,
                                  result_pool, scratch_pool));
-  pristine_temp = svn_stream_checksummed2(pristine_temp, NULL,
-                                          actual_checksum,
-                                          svn_checksum_sha1, TRUE,
-                                          result_pool);
 
   *tee_output_stream = svn_stream_tee(output_stream, pristine_temp,
                                       result_pool);
@@ -3433,25 +3427,22 @@ add_file_with_history(const char *path,
     SVN_ERR(err);
 
   /* Open the text base for writing (this will get us a temporary file).  */
-  SVN_ERR(svn_wc__open_writable_base(&copied_stream, &tfb->copied_text_base,
+  SVN_ERR(svn_wc__open_writable_base(&copied_stream,
+                                     &tfb->copied_text_base_abspath,
+  /* Compute an MD5 checksum for the stream as we write stuff into it.
+     ### this is temporary. in many cases, we already *know* the checksum
+     ### since it is a copy. */
+                                     &tfb->copied_text_base_md5_checksum,
+                                     &tfb->copied_text_base_sha1_checksum,
                                      db, pb->local_abspath,
                                      pool, pool));
 #ifdef SVN_EXPERIMENTAL
   /* Copy the 'copied_stream' into a WC-NG pristine temp file as well. */
-  SVN_ERR(get_pristine_tee_stream(&copied_stream, &tfb->temp_pristine_abspath,
-                                  &tfb->sha1_copied_base_checksum, db,
-                                  tfb->local_abspath, copied_stream,
+  SVN_ERR(get_pristine_tee_stream(&copied_stream, &tfb->new_pristine_tmp_abspath,
+                                  db, tfb->local_abspath, copied_stream,
                                   pool, subpool));
 #endif
 
-  /* Compute a checksum for the stream as we write stuff into it.
-     ### this is temporary. in many cases, we already *know* the checksum
-     ### since it is a copy. */
-  copied_stream = svn_stream_checksummed2(
-                                copied_stream,
-                                NULL, &tfb->md5_copied_base_checksum,
-                                svn_checksum_md5, FALSE, pool);
-
   if (src_local_abspath != NULL) /* Found a file to copy */
     {
       /* Copy the existing file's text-base over to the (temporary)
@@ -3857,7 +3848,7 @@ open_file(const char *path,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL,
-                               eb->db, fb->local_abspath, FALSE, subpool));
+                               eb->db, fb->local_abspath, subpool, subpool));
 
   /* Is this path a conflict victim? */
   SVN_ERR(node_already_conflicted(&already_conflicted, eb->db,
@@ -3991,7 +3982,7 @@ apply_textdelta(void *file_baton,
      text base hasn't been corrupted, and that its checksum
      matches the expected base checksum. */
 
-  SVN_ERR(choose_base_paths(&fb->text_base_path,
+  SVN_ERR(choose_base_paths(&fb->text_base_abspath,
                             &checksum, &replaced,
                             fb->edit_baton->db, fb->local_abspath,
                             fb->pool, pool));
@@ -4042,8 +4033,8 @@ apply_textdelta(void *file_baton,
     }
   else
     {
-      if (fb->copied_text_base)
-        SVN_ERR(svn_stream_open_readonly(&source, fb->copied_text_base,
+      if (fb->copied_text_base_abspath)
+        SVN_ERR(svn_stream_open_readonly(&source, fb->copied_text_base_abspath,
                                          handler_pool, handler_pool));
       else
         source = svn_stream_empty(handler_pool);
@@ -4056,21 +4047,21 @@ apply_textdelta(void *file_baton,
   /* Checksum the text base while applying deltas */
   if (checksum)
     {
-      SVN_ERR(svn_checksum_parse_hex(&hb->expected_source_checksum,
+      SVN_ERR(svn_checksum_parse_hex(&hb->expected_source_md5_checksum,
                                      svn_checksum_md5, checksum,
                                      handler_pool));
 
       /* Wrap stream and store reference to allow calculating the md5 */
-      hb->source_checksum_stream =
-                 source = svn_stream_checksummed2(
-                                            source,
-                                            &hb->md5_actual_source_checksum,
-                                            NULL, svn_checksum_md5,
-                                            TRUE, handler_pool);
+      source = svn_stream_checksummed2(source,
+                                       &hb->actual_source_md5_checksum,
+                                       NULL, svn_checksum_md5,
+                                       TRUE, handler_pool);
+      hb->source_checksum_stream = source;
     }
 
   /* Open the text base for writing (this will get us a temporary file).  */
-  err = svn_wc__open_writable_base(&target, &hb->work_abspath,
+  err = svn_wc__open_writable_base(&target, &hb->new_text_base_tmp_abspath,
+                                   NULL, &hb->new_text_base_sha1_checksum,
                                    fb->edit_baton->db, fb->local_abspath,
                                    handler_pool, pool);
   if (err)
@@ -4082,15 +4073,15 @@ apply_textdelta(void *file_baton,
 #ifdef SVN_EXPERIMENTAL
   /* Copy the 'target' stream into a WC-NG pristine temp file as well.
      ###: This is currently tee'd for compat. */
-  SVN_ERR(get_pristine_tee_stream(&target, &hb->temp_pristine_abspath,
-                                  &hb->sha1_actual_checksum,
+  SVN_ERR(get_pristine_tee_stream(&target, &hb->new_pristine_tmp_abspath,
                                   fb->edit_baton->db, fb->local_abspath,
                                   target, handler_pool, pool));
 #endif
 
   /* Prepare to apply the delta.  */
   svn_txdelta_apply(source, target,
-                    hb->digest, hb->work_abspath /* error_info */,
+                    hb->new_text_base_md5_digest,
+                    hb->new_text_base_tmp_abspath /* error_info */,
                     handler_pool,
                     &hb->apply_handler, &hb->apply_baton);
 
@@ -4229,6 +4220,9 @@ install_text_base(svn_stringbuf_t **log_
  * prepared (see below) to join version control, fully install a
  * new revision of the file.
  *
+ * ### transitional: installation of the working file will be handled
+ * ### by the *INSTALL_PRISTINE flag.
+ *
  * By "install", we mean: create a new text-base and prop-base, merge
  * any textual and property changes into the working file, and finally
  * update all metadata so that the working copy believes it has a new
@@ -4236,14 +4230,13 @@ install_text_base(svn_stringbuf_t **log_
  * sensitive to eol translation, keyword substitution, and performing
  * all actions accumulated the parent directory's work queue.
  *
- * If there's a new text base, NEW_TEXT_BASE_ABSPATH must be the full
+ * If there's a new text base, NEW_TEXT_BASE_TMP_ABSPATH must be the full
  * pathname of the new text base, somewhere in the administrative area
  * of the working file.  It will be installed as the new text base for
  * this file, and removed after a successful run of the generated log
  * commands.
  *
- * Set *CONTENT_STATE, *PROP_STATE and *LOCK_STATE to the state of the
- * contents, properties and repository lock, respectively, after the
+ * Set *CONTENT_STATE to the state of the contents after the
  * installation.  If an error is returned, the value of these three
  * variables is undefined.
  *
@@ -4255,10 +4248,12 @@ install_text_base(svn_stringbuf_t **log_
  */
 static svn_error_t *
 merge_file(svn_stringbuf_t **log_accum,
+           svn_boolean_t *install_pristine,
+           const char **install_from,
            svn_wc_notify_state_t *content_state,
            const svn_wc_entry_t *entry,
            struct file_baton *fb,
-           const char *new_text_base_abspath,
+           const char *new_text_base_tmp_abspath,
            const svn_checksum_t *actual_checksum,
            apr_pool_t *pool)
 {
@@ -4276,7 +4271,7 @@ merge_file(svn_stringbuf_t **log_accum,
      things are true:
 
          - The new pristine text of F, if any, is present at
-           NEW_TEXT_BASE_ABSPATH
+           NEW_TEXT_BASE_TMP_ABSPATH
 
          - The .svn/entries file still reflects the old version of F.
 
@@ -4294,6 +4289,9 @@ merge_file(svn_stringbuf_t **log_accum,
   SVN_WC__FLUSH_LOG_ACCUM(eb->db, pb->local_abspath, *log_accum, pool);
 #endif
 
+  *install_pristine = FALSE;
+  *install_from = NULL;
+
   /* Start by splitting the file path, getting an access baton for the parent,
      and an entry for the file if any. */
 
@@ -4325,8 +4323,8 @@ merge_file(svn_stringbuf_t **log_accum,
          and a working file. Presumably, the working file is modified
          relative to the new pristine.
 
-         The new pristine is in NEW_TEXT_BASE_ABSPATH, which should also
-         be FB->COPIED_TEXT_BASE.  */
+         The new pristine is in NEW_TEXT_BASE_TMP_ABSPATH, which should also
+         be FB->COPIED_TEXT_BASE_ABSPATH.  */
       is_locally_modified = TRUE;
     }
   else if (entry && entry->file_external_path
@@ -4344,14 +4342,14 @@ merge_file(svn_stringbuf_t **log_accum,
                                                FALSE /* compare_textbases */,
                                                pool));
     }
-  else if (new_text_base_abspath)
+  else if (new_text_base_tmp_abspath)
     {
       /* We have a new pristine to install. Is the file modified relative
          to this new pristine?  */
       SVN_ERR(svn_wc__internal_versioned_file_modcheck(&is_locally_modified,
                                                        eb->db,
                                                        fb->local_abspath,
-                                                       new_text_base_abspath,
+                                                       new_text_base_tmp_abspath,
                                                        FALSE, pool));
     }
   else
@@ -4397,7 +4395,7 @@ merge_file(svn_stringbuf_t **log_accum,
    So the first thing we do is figure out where we are in the
    matrix. */
 
-  if (new_text_base_abspath)
+  if (new_text_base_tmp_abspath)
     {
       if (is_replaced)
         {
@@ -4417,12 +4415,25 @@ merge_file(svn_stringbuf_t **log_accum,
                  For replaced files, though, we want to merge in the changes
                  even if the file is not modified compared to the (non-revert)
                  text-base. */
-              SVN_ERR(svn_wc__loggy_copy(log_accum,
-                                         pb->local_abspath,
-                                         new_text_base_abspath,
-                                         fb->local_abspath, pool, pool));
-              SVN_WC__FLUSH_LOG_ACCUM(eb->db, pb->local_abspath, *log_accum,
-                                      pool);
+
+              *install_pristine = TRUE;
+
+              /* ### sheesh. for file externals, there is a WORKING_NODE
+                 ### row (during this transitional state), which means the
+                 ### node is reported as "replaced". further, this means
+                 ### that the text base will be dropped into the "revert
+                 ### base". even after everything stabilizes, the file
+                 ### external's base will continue to reside in the revert
+                 ### base, but the rest of libsvn_wc appears to compensate
+                 ### for this fact (even tho it is schedule_normal!!).
+                 ### in any case, let's do the working copy file install
+                 ### from the revert base for file externals.  */
+              if (entry && entry->file_external_path)
+                {
+                  SVN_ERR_ASSERT(entry->schedule == svn_wc_schedule_replace);
+                  SVN_ERR(svn_wc__text_revert_path(install_from, eb->db,
+                                                   fb->local_abspath, pool));
+                }
             }
         }
       else   /* working file or obstruction is locally modified... */
@@ -4434,12 +4445,7 @@ merge_file(svn_stringbuf_t **log_accum,
             {
               /* working file is missing?!
                  Just copy the new text-base to the file. */
-              SVN_ERR(svn_wc__loggy_copy(log_accum,
-                                         pb->local_abspath,
-                                         new_text_base_abspath,
-                                         fb->local_abspath, pool, pool));
-              SVN_WC__FLUSH_LOG_ACCUM(eb->db, pb->local_abspath, *log_accum,
-                                      pool);
+              *install_pristine = TRUE;
             }
           else if (! fb->obstruction_found)
             /* Working file exists and has local mods
@@ -4495,10 +4501,10 @@ merge_file(svn_stringbuf_t **log_accum,
                                              pool, pool));
                   delete_left = TRUE;
                 }
-              else if (fb->copied_text_base)
-                merge_left = fb->copied_text_base;
+              else if (fb->copied_text_base_abspath)
+                merge_left = fb->copied_text_base_abspath;
               else
-                merge_left = fb->text_base_path;
+                merge_left = fb->text_base_abspath;
 
               /* Merge the changes from the old textbase to the new
                  textbase into the file we're updating.
@@ -4513,7 +4519,7 @@ merge_file(svn_stringbuf_t **log_accum,
                         log_accum, &merge_outcome,
                         eb->db,
                         merge_left, NULL,
-                        new_text_base_abspath, NULL,
+                        new_text_base_tmp_abspath, NULL,
                         fb->local_abspath,
                         fb->copied_working_text,
                         oldrev_str, newrev_str, mine_str,
@@ -4603,10 +4609,10 @@ merge_file(svn_stringbuf_t **log_accum,
     }
 
   /* Deal with installation of the new textbase, if appropriate. */
-  if (new_text_base_abspath)
+  if (new_text_base_tmp_abspath)
     {
       SVN_ERR(install_text_base(log_accum, pb->local_abspath,
-                                new_text_base_abspath, fb->text_base_path,
+                                new_text_base_tmp_abspath, fb->text_base_abspath,
                                 pool, pool));
       tmp_entry.checksum = svn_checksum_to_cstring(actual_checksum, pool);
       flags |= SVN_WC__ENTRY_MODIFY_CHECKSUM;
@@ -4628,8 +4634,9 @@ merge_file(svn_stringbuf_t **log_accum,
 
   /* Log commands to handle text-timestamp and working-size,
      if the file is - or will be - unmodified and schedule-normal */
-  if (!is_locally_modified &&
-      (fb->adding_file || entry->schedule == svn_wc_schedule_normal))
+  if (!*install_pristine
+      && !is_locally_modified
+      && (fb->adding_file || entry->schedule == svn_wc_schedule_normal))
     {
       /* Adjust working copy file unless this file is an allowed
          obstruction. */
@@ -4639,7 +4646,7 @@ merge_file(svn_stringbuf_t **log_accum,
                   fb->local_abspath, fb->last_changed_date,
                   pool, pool));
 
-      if ((new_text_base_abspath || magic_props_changed)
+      if ((new_text_base_tmp_abspath || magic_props_changed)
           && !fb->deleted)
         {
           /* Adjust entries file to match working file */
@@ -4657,7 +4664,7 @@ merge_file(svn_stringbuf_t **log_accum,
   /* Set the returned content state. */
 
   /* This is kind of interesting.  Even if no new text was
-     installed (i.e., new_text_path was null), we could still
+     installed (i.e., NEW_TEXT_ABSPATH was null), we could still
      report a pre-existing conflict state.  Say a file, already
      in a state of textual conflict, receives prop mods during an
      update.  Then we'll notify that it has text conflicts.  This
@@ -4665,7 +4672,7 @@ merge_file(svn_stringbuf_t **log_accum,
 
   if (merge_outcome == svn_wc_merge_conflict)
     *content_state = svn_wc_notify_state_conflicted;
-  else if (new_text_base_abspath)
+  else if (new_text_base_tmp_abspath)
     {
       if (is_locally_modified)
         *content_state = svn_wc_notify_state_merged;
@@ -4769,6 +4776,8 @@ close_file(void *file_baton,
   apr_array_header_t *wc_props;
   apr_array_header_t *regular_props;
   const svn_wc_entry_t *entry;
+  svn_boolean_t install_pristine;
+  const char *install_from;
 
   if (fb->skip_this)
     {
@@ -4784,29 +4793,27 @@ close_file(void *file_baton,
   /* Was this an add-with-history, with no apply_textdelta? */
   if (fb->added_with_history && ! fb->received_textdelta)
     {
-      SVN_ERR_ASSERT(! fb->text_base_path && ! fb->new_text_base_abspath
-                     && fb->copied_text_base);
+      SVN_ERR_ASSERT(! fb->text_base_abspath && ! fb->new_text_base_tmp_abspath
+                     && fb->copied_text_base_abspath);
 
       /* Set up the base paths like apply_textdelta does. */
-      SVN_ERR(choose_base_paths(&fb->text_base_path,
+      SVN_ERR(choose_base_paths(&fb->text_base_abspath,
                                 NULL, NULL,
                                 eb->db, fb->local_abspath,
                                 fb->pool, pool));
 
-      md5_actual_checksum = fb->md5_copied_base_checksum;
-      sha1_actual_checksum = fb->sha1_copied_base_checksum;
-      new_base_abspath = fb->copied_text_base;
-      if (new_base_abspath)
-        SVN_ERR(svn_dirent_get_absolute(&new_base_abspath, new_base_abspath,
-                                        pool));
+      md5_actual_checksum = fb->copied_text_base_md5_checksum;
+      sha1_actual_checksum = fb->copied_text_base_sha1_checksum;
+      new_base_abspath = fb->copied_text_base_abspath;
+      SVN_ERR_ASSERT(! new_base_abspath || svn_dirent_is_absolute(new_base_abspath));
     }
   else
     {
       /* Pull the actual checksum from the file_baton, computed during
          the application of a text delta. */
-      md5_actual_checksum = fb->md5_actual_checksum;
-      sha1_actual_checksum = fb->sha1_actual_checksum;
-      new_base_abspath = fb->new_text_base_abspath;
+      md5_actual_checksum = fb->new_text_base_md5_checksum;
+      sha1_actual_checksum = fb->new_text_base_sha1_checksum;
+      new_base_abspath = fb->new_text_base_tmp_abspath;
     }
 
   /* window-handler assembles new pristine text in .svn/tmp/text-base/  */
@@ -4829,8 +4836,8 @@ close_file(void *file_baton,
      update all the BASE_NODE info to switch the file over and install a wq
      item to update the in-wc file. So in a few cases it is logical that the
      file operations are not side by side. */
-  if (fb->temp_pristine_abspath)
-    SVN_ERR(svn_wc__db_pristine_install(eb->db, fb->temp_pristine_abspath,
+  if (fb->new_pristine_tmp_abspath)
+    SVN_ERR(svn_wc__db_pristine_install(eb->db, fb->new_pristine_tmp_abspath,
                                         sha1_actual_checksum,
                                         md5_actual_checksum, pool));
 #endif
@@ -4886,7 +4893,7 @@ close_file(void *file_baton,
      which case we want the new entryprops to be in place. */
 
   /* Write log commands to merge REGULAR_PROPS into the existing
-     properties of FB->LOCAL_PATH.  Update *PROP_STATE to reflect
+     properties of FB->LOCAL_ABSPATH.  Update *PROP_STATE to reflect
      the result of the regular prop merge.
 
      BASE_PROPS and WORKING_PROPS are hashes of the base and
@@ -4944,7 +4951,7 @@ close_file(void *file_baton,
                                         pool));
 
   /* Do the hard work. This will queue some additional work.  */
-  SVN_ERR(merge_file(&delayed_log_accum,
+  SVN_ERR(merge_file(&delayed_log_accum, &install_pristine, &install_from,
                      &content_state, entry,
                      fb, new_base_abspath, md5_actual_checksum,
                      pool));
@@ -4966,13 +4973,43 @@ close_file(void *file_baton,
                                                fb->local_abspath, pool));
     }
 
+  if (install_pristine)
+    {
+      const svn_skel_t *work_item;
+
+      SVN_ERR(svn_wc__wq_build_file_install(&work_item,
+                                            eb->db,
+                                            fb->local_abspath,
+                                            install_from,
+                                            eb->use_commit_times,
+                                            TRUE /* record_fileinfo */,
+                                            pool, pool));
+      SVN_ERR(svn_wc__db_wq_add(eb->db, fb->dir_baton->local_abspath,
+                                work_item, pool));
+    }
+
   /* Clean up any temporary files.  */
-  if (fb->copied_text_base)
+#if 0
+  /* ### can't really use this now. INSTALL_FROM might refer to the
+     ### revert-base for file externals. (sigh)  once that is fixed,
+     ### then this will be handy for other cases.  */
+  if (install_from != NULL)
+    {
+      const svn_skel_t *work_item;
+
+      SVN_ERR(svn_wc__wq_build_file_remove(&work_item, eb->db,
+                                           install_from,
+                                           pool, pool));
+      SVN_ERR(svn_wc__db_wq_add(eb->db, fb->dir_baton->local_abspath,
+                                work_item, pool));
+    }
+#endif
+  if (fb->copied_text_base_abspath)
     {
       const svn_skel_t *work_item;
 
-      SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
-                                           eb->db, fb->copied_text_base,
+      SVN_ERR(svn_wc__wq_build_file_remove(&work_item, eb->db,
+                                           fb->copied_text_base_abspath,
                                            pool, pool));
       SVN_ERR(svn_wc__db_wq_add(eb->db, fb->dir_baton->local_abspath,
                                 work_item, pool));
@@ -5883,11 +5920,9 @@ svn_wc_add_repos_file4(svn_wc_context_t 
      can refer to it. Compute its checksum as we copy. */
   SVN_ERR(svn_wc__open_writable_base(&tmp_base_contents,
                                      &tmp_text_base_abspath,
+                                     &base_checksum, NULL,
                                      wc_ctx->db, local_abspath,
                                      pool, pool));
-  new_base_contents = svn_stream_checksummed2(new_base_contents,
-                                              &base_checksum, NULL,
-                                              svn_checksum_md5, TRUE, pool);
   SVN_ERR(svn_stream_copy3(new_base_contents, tmp_base_contents,
                            cancel_func, cancel_baton,
                            pool));

Modified: subversion/branches/svn-patch-improvements/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/libsvn_wc/workqueue.c?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/libsvn_wc/workqueue.c Thu Apr  8 15:52:53 2010
@@ -63,6 +63,10 @@
 #define OP_FILE_REMOVE "file-remove"
 
 
+/* For work queue debugging. Generates output about its operation.  */
+/* #define DEBUG_WORK_QUEUE */
+
+
 struct work_item_dispatch {
   const char *name;
   svn_error_t *(*func)(svn_wc__db_t *db,
@@ -2179,6 +2183,10 @@ svn_wc__wq_run(svn_wc__db_t *db,
 {
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
+#ifdef DEBUG_WORK_QUEUE
+  SVN_DBG(("wq_run: wri='%s'\n", wri_abspath));
+#endif
+
   while (TRUE)
     {
       svn_wc__db_kind_t kind;
@@ -2211,6 +2219,10 @@ svn_wc__wq_run(svn_wc__db_t *db,
         {
           if (svn_skel__matches_atom(work_item->children, scan->name))
             {
+
+#ifdef DEBUG_WORK_QUEUE
+              SVN_DBG(("wq_run:   operation='%s'\n", scan->name));
+#endif
               SVN_ERR((*scan->func)(db, work_item,
                                     cancel_func, cancel_baton,
                                     iterpool));

Modified: subversion/branches/svn-patch-improvements/subversion/mod_dav_svn/mirror.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/mod_dav_svn/mirror.c?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/mod_dav_svn/mirror.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/mod_dav_svn/mirror.c Thu Apr  8 15:52:53 2010
@@ -163,9 +163,8 @@ apr_status_t dav_svn__location_in_filter
 
     /* We are url encoding the current url and the master url
        as incoming(from client) request body has it encoded already. */
-    canonicalized_uri = (char *) svn_path_uri_encode(canonicalized_uri,
-                                                     r->pool);
-    root_dir = (char *) svn_path_uri_encode(root_dir, r->pool);
+    canonicalized_uri = svn_path_uri_encode(canonicalized_uri, r->pool);
+    root_dir = svn_path_uri_encode(root_dir, r->pool);
     if (!f->ctx) {
         ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx));
         ctx->remotepath = canonicalized_uri;
@@ -224,7 +223,7 @@ apr_status_t dav_svn__location_header_fi
     /* Don't filter if we're in a subrequest or we aren't setup to
        proxy anything. */
     master_uri = dav_svn__get_master_uri(r);
-    master_uri = (char *) svn_path_uri_encode(master_uri, r->pool);
+    master_uri = svn_path_uri_encode(master_uri, r->pool);
     if (r->main || !master_uri) {
         ap_remove_output_filter(f);
         return ap_pass_brigade(f->next, bb);
@@ -242,7 +241,7 @@ apr_status_t dav_svn__location_header_fi
                                                dav_svn__get_root_dir(r), "/",
                                                start_foo, NULL),
                                    r);
-        new_uri = (char *) svn_path_uri_encode(new_uri, r->pool);
+        new_uri = svn_path_uri_encode(new_uri, r->pool);
         apr_table_set(r->headers_out, "Location", new_uri);
     }
     return ap_pass_brigade(f->next, bb);
@@ -286,9 +285,8 @@ apr_status_t dav_svn__location_body_filt
 
     /* We are url encoding the current url and the master url
        as incoming(from master) request body has it encoded already. */
-    canonicalized_uri = (char *) svn_path_uri_encode(canonicalized_uri,
-                                                     r->pool);
-    root_dir = (char *) svn_path_uri_encode(root_dir, r->pool);
+    canonicalized_uri = svn_path_uri_encode(canonicalized_uri, r->pool);
+    root_dir = svn_path_uri_encode(root_dir, r->pool);
     if (!f->ctx) {
         ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx));
         ctx->remotepath = canonicalized_uri;

Modified: subversion/branches/svn-patch-improvements/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svnadmin/main.c?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svnadmin/main.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svnadmin/main.c Thu Apr  8 15:52:53 2010
@@ -230,7 +230,8 @@ enum
     svnadmin__wait,
     svnadmin__pre_1_4_compatible,
     svnadmin__pre_1_5_compatible,
-    svnadmin__pre_1_6_compatible
+    svnadmin__pre_1_6_compatible,
+    svnadmin__pre_1_7_compatible
   };
 
 /* Option codes and descriptions.
@@ -316,6 +317,10 @@ static const apr_getopt_option_t options
      N_("use format compatible with Subversion versions\n"
         "                             earlier than 1.6")},
 
+    {"pre-1.7-compatible",     svnadmin__pre_1_7_compatible, 0,
+     N_("use format compatible with Subversion versions\n"
+        "                             earlier than 1.7")},
+
     {NULL}
   };
 
@@ -336,7 +341,8 @@ static const svn_opt_subcommand_desc2_t 
     "Create a new, empty repository at REPOS_PATH.\n"),
    {svnadmin__bdb_txn_nosync, svnadmin__bdb_log_keep,
     svnadmin__config_dir, svnadmin__fs_type, svnadmin__pre_1_4_compatible,
-    svnadmin__pre_1_5_compatible, svnadmin__pre_1_6_compatible } },
+    svnadmin__pre_1_5_compatible, svnadmin__pre_1_6_compatible,
+    svnadmin__pre_1_7_compatible} },
 
   {"deltify", subcommand_deltify, {0}, N_
    ("usage: svnadmin deltify [-r LOWER[:UPPER]] REPOS_PATH\n\n"
@@ -488,6 +494,7 @@ struct svnadmin_opt_state
   svn_boolean_t pre_1_4_compatible;                 /* --pre-1.4-compatible */
   svn_boolean_t pre_1_5_compatible;                 /* --pre-1.5-compatible */
   svn_boolean_t pre_1_6_compatible;                 /* --pre-1.6-compatible */
+  svn_boolean_t pre_1_7_compatible;                 /* --pre-1.7-compatible */
   svn_opt_revision_t start_revision, end_revision;  /* -r X[:Y] */
   svn_boolean_t help;                               /* --help or -? */
   svn_boolean_t version;                            /* --version */
@@ -578,6 +585,11 @@ subcommand_create(apr_getopt_t *os, void
                  APR_HASH_KEY_STRING,
                  "1");
 
+  if (opt_state->pre_1_7_compatible)
+    apr_hash_set(fs_config, SVN_FS_CONFIG_PRE_1_7_COMPATIBLE,
+                 APR_HASH_KEY_STRING,
+                 "1");
+
   SVN_ERR(svn_config_get_config(&config, opt_state->config_dir, pool));
   SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
                            NULL, NULL,
@@ -1572,6 +1584,9 @@ main(int argc, const char *argv[])
       case svnadmin__pre_1_6_compatible:
         opt_state.pre_1_6_compatible = TRUE;
         break;
+      case svnadmin__pre_1_7_compatible:
+        opt_state.pre_1_7_compatible = TRUE;
+        break;
       case svnadmin__fs_type:
         err = svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool);
         if (err)

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/commit_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/commit_tests.py Thu Apr  8 15:52:53 2010
@@ -1961,7 +1961,7 @@ def mods_in_schedule_delete(sbox):
                                         None, wc_dir)
 
   # Unversioned file still exists
-  actual_contents = svntest.main.file_read(foo_path)
+  actual_contents = open(foo_path).read()
   if actual_contents != foo_contents:
     raise svntest.Failure
 

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/diff_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/diff_tests.py Thu Apr  8 15:52:53 2010
@@ -698,8 +698,7 @@ def dont_diff_binary_file(sbox):
   wc_dir = sbox.wc_dir
 
   # Add a binary file to the project.
-  theta_contents = svntest.main.file_read(
-    os.path.join(sys.path[0], "theta.bin"), 'rb')
+  theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
   # Write PNG file data into 'A/theta'.
   theta_path = os.path.join(wc_dir, 'A', 'theta')
   svntest.main.file_write(theta_path, theta_contents, 'wb')
@@ -2604,6 +2603,9 @@ def diff_in_renamed_folder(sbox):
       'A/D/C' : Item(verb='Adding'),
       'A/D/C/kappa' : Item(verb='Adding'),
   })
+  ### right now, we cannot denote that kappa is a local-add rather than a
+  ### child of the A/D/C copy. thus, it appears in the status output as a
+  ### (M)odified child.
   svntest.actions.run_and_verify_commit(wc_dir, expected_output,
                                         None, None, wc_dir)
 
@@ -3134,7 +3136,7 @@ test_list = [ None,
               diff_weird_author,
               diff_ignore_whitespace,
               diff_ignore_eolstyle,
-              diff_in_renamed_folder,
+              XFail(diff_in_renamed_folder),
               diff_with_depth,
               diff_ignore_eolstyle_empty_lines,
               diff_backward_repos_wc_copy,

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/externals_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/externals_tests.py Thu Apr  8 15:52:53 2010
@@ -303,9 +303,7 @@ def checkout_with_externals(sbox):
                           "This is the file 'omega'.\n"),
                          (os.path.join(wc_dir, "A", "B", "gamma"),
                           "This is the file 'gamma'.\n")):
-    fp = open(path, 'r')
-    lines = fp.readlines()
-    if not ((len(lines) == 1) and (lines[0] == contents)):
+    if open(path).read() != contents:
       raise svntest.Failure("Unexpected contents for rev 1 of " + path)
 
 #----------------------------------------------------------------------
@@ -566,14 +564,11 @@ def update_receive_change_under_external
   svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
   external_gamma_path = os.path.join(wc_dir, 'A', 'D', 'exdir_A', 'D', 'gamma')
-  fp = open(external_gamma_path, 'r')
-  lines = fp.readlines()
-  if not ((len(lines) == 2)
-          and (lines[0] == "This is the file 'gamma'.\n")
-          and (lines[1] == "New text in other gamma.\n")):
+  contents = open(external_gamma_path).read()
+  if contents != ("This is the file 'gamma'.\n"
+                  "New text in other gamma.\n"):
     raise svntest.Failure("Unexpected contents for externally modified " +
                           external_gamma_path)
-  fp.close()
 
   # Commit more modifications
   other_rho_path = os.path.join(other_wc_dir, 'A', 'D', 'G', 'rho')
@@ -594,14 +589,11 @@ def update_receive_change_under_external
                                      'up', os.path.join(wc_dir, "A", "C"))
 
   external_rho_path = os.path.join(wc_dir, 'A', 'C', 'exdir_G', 'rho')
-  fp = open(external_rho_path, 'r')
-  lines = fp.readlines()
-  if not ((len(lines) == 2)
-          and (lines[0] == "This is the file 'rho'.\n")
-          and (lines[1] == "New text in other rho.\n")):
+  contents = open(external_rho_path).read()
+  if contents != ("This is the file 'rho'.\n"
+                  "New text in other rho.\n"):
     raise svntest.Failure("Unexpected contents for externally modified " +
                           external_rho_path)
-  fp.close()
 
 #----------------------------------------------------------------------
 
@@ -745,18 +737,15 @@ def export_with_externals(sbox):
 
   # Pick some files, make sure their contents are as expected.
   exdir_G_pi_path = os.path.join(wc_dir, "A", "C", "exdir_G", "pi")
-  fp = open(exdir_G_pi_path, 'r')
-  lines = fp.readlines()
-  if not ((len(lines) == 2) \
-          and (lines[0] == "This is the file 'pi'.\n") \
-          and (lines[1] == "Added to pi in revision 3.\n")):
+  contents = open(exdir_G_pi_path).read()
+  if contents != ("This is the file 'pi'.\n"
+                  "Added to pi in revision 3.\n"):
     raise svntest.Failure("Unexpected contents for rev 1 of " +
                           exdir_G_pi_path)
 
   exdir_H_omega_path = os.path.join(wc_dir, "A", "C", "exdir_H", "omega")
-  fp = open(exdir_H_omega_path, 'r')
-  lines = fp.readlines()
-  if not ((len(lines) == 1) and (lines[0] == "This is the file 'omega'.\n")):
+  contents = open(exdir_H_omega_path).read()
+  if contents != "This is the file 'omega'.\n":
     raise svntest.Failure("Unexpected contents for rev 1 of " +
                           exdir_H_omega_path)
 
@@ -842,13 +831,10 @@ def external_with_peg_and_op_revision(sb
                                      'up', wc_dir)
 
   external_chi_path = os.path.join(wc_dir, 'A', 'D', 'exdir_A', 'H', 'chi')
-  fp = open(external_chi_path, 'r')
-  lines = fp.readlines()
-  if not ((len(lines) == 1)
-          and (lines[0] == "This is the file 'chi'.\n")):
+  contents = open(external_chi_path).read()
+  if contents != "This is the file 'chi'.\n":
     raise svntest.Failure("Unexpected contents for externally modified " +
                           external_chi_path)
-  fp.close()
 
 #----------------------------------------------------------------------
 
@@ -882,9 +868,8 @@ def new_style_externals(sbox):
 
   for dir_name in ["exdir_H", "exdir_I"]:
     exdir_X_omega_path = os.path.join(wc_dir, "A", "C", dir_name, "omega")
-    fp = open(exdir_X_omega_path, 'r')
-    lines = fp.readlines()
-    if not ((len(lines) == 1) and (lines[0] == "This is the file 'omega'.\n")):
+    contents = open(exdir_X_omega_path).read()
+    if contents != "This is the file 'omega'.\n":
       raise svntest.Failure("Unexpected contents for rev 1 of " +
                             exdir_X_omega_path)
 
@@ -1114,14 +1099,10 @@ def can_place_file_external_into_dir_ext
                                      repo_url, wc_dir)
 
   beta1_path = os.path.join(wc_dir, 'A', 'B', 'E', 'beta')
-  f = open(beta1_path)
-  beta1_contents = f.read()
-  f.close()
+  beta1_contents = open(beta1_path).read()
 
   beta2_path = os.path.join(wc_dir, 'A', 'D-copy', 'G', 'beta')
-  f = open(beta2_path)
-  beta2_contents = f.read()
-  f.close()
+  beta2_contents = open(beta2_path).read()
 
   if beta1_contents != beta2_contents:
       raise svntest.Failure("Contents of '%s' and '%s' do not match" %
@@ -1177,8 +1158,7 @@ def binary_file_externals(sbox):
   wc_dir = sbox.wc_dir
 
   # Add a binary file A/theta, write PNG file data into it.
-  theta_contents = svntest.main.file_read(
-    os.path.join(sys.path[0], "theta.bin"), 'rb')
+  theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
   theta_path = os.path.join(wc_dir, 'A', 'theta')
   svntest.main.file_write(theta_path, theta_contents, 'wb')
 

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_tests.py Thu Apr  8 15:52:53 2010
@@ -334,7 +334,7 @@ def textual_merges_galore(sbox):
   other_rho_text = ""
   for x in range(1,10):
     other_rho_text = other_rho_text + 'Unobtrusive line ' + repr(x) + ' in rho\n'
-  current_other_rho_text = svntest.main.file_read(other_rho_path)
+  current_other_rho_text = open(other_rho_path).read()
   svntest.main.file_write(other_rho_path,
                           other_rho_text + current_other_rho_text)
 
@@ -897,6 +897,9 @@ def merge_catches_nonexistent_target(sbo
     'A/D/Q/tau'     : Item(status='  ', wc_rev=2),
     'A/D/Q/newfile' : Item(status='  ', wc_rev=2),
     })
+  ### right now, we cannot denote that Q/newfile is a local-add rather than
+  ### a child of the A/D/Q copy. thus, it appears in the status output as a
+  ### (M)odified child.
   svntest.actions.run_and_verify_commit(wc_dir,
                                         expected_output,
                                         expected_status,
@@ -1547,8 +1550,7 @@ def merge_binary_file(sbox):
   wc_dir = sbox.wc_dir
 
   # Add a binary file to the project
-  theta_contents = svntest.main.file_read(
-    os.path.join(sys.path[0], "theta.bin"), 'rb')
+  theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
   # Write PNG file data into 'A/theta'.
   theta_path = os.path.join(wc_dir, 'A', 'theta')
   svntest.main.file_write(theta_path, theta_contents, 'wb')
@@ -1639,8 +1641,7 @@ def three_way_merge_add_of_existing_bina
                                      "-m", "Creating copy-of-A")
 
   # Add a binary file to the WC.
-  theta_contents = svntest.main.file_read(
-    os.path.join(sys.path[0], "theta.bin"), 'rb')
+  theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
   # Write PNG file data into 'A/theta'.
   A_path = os.path.join(wc_dir, 'A')
   theta_path = os.path.join(wc_dir, 'A', 'theta')
@@ -2292,8 +2293,7 @@ def merge_binary_with_common_ancestry(sb
   svntest.main.run_svn(None, 'mkdir', I_path)
 
   # Add a binary file to the common ancestry path
-  theta_contents = svntest.main.file_read(
-    os.path.join(sys.path[0], "theta.bin"), 'rb')
+  theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
   theta_I_path = os.path.join(I_path, 'theta')
   svntest.main.file_write(theta_I_path, theta_contents)
   svntest.main.run_svn(None, 'add', theta_I_path)
@@ -18820,7 +18820,7 @@ test_list = [ None,
               merge_with_implicit_target_using_r,
               merge_with_implicit_target_using_c,
               merge_with_implicit_target_and_revs,
-              SkipUnless(merge_catches_nonexistent_target,
+              SkipUnless(XFail(merge_catches_nonexistent_target),
                          server_has_mergeinfo),
               SkipUnless(merge_tree_deleted_in_target,
                          server_has_mergeinfo),

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/mergeinfo_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/mergeinfo_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/mergeinfo_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/mergeinfo_tests.py Thu Apr  8 15:52:53 2010
@@ -221,6 +221,10 @@ def non_inheritable_mergeinfo(sbox):
                                            D_COPY_path,
                                            '--show-revs', 'eligible')
 
+# Test for -R option with svn mergeinfo subcommand.
+#
+# Test for issue #3242 'Subversion demands unnecessary access to parent
+# directories of operations'
 def recursive_mergeinfo(sbox):
   "test svn mergeinfo -R"
 
@@ -357,6 +361,21 @@ def recursive_mergeinfo(sbox):
                                            '--show-revs', 'merged',
                                            '--depth', 'infinity')
 
+  # A couple tests of problems found with initial issue #3242 fixes.
+  # We should be able to check for the merged revs from a URL to a URL
+  # when the latter has explicit mergeinfo...
+  svntest.actions.run_and_verify_mergeinfo(
+    adjust_error_for_server_version(''), ['6'],
+    sbox.repo_url + '/A2/D/H',
+    sbox.repo_url + '/A_COPY/D/H',
+    '--show-revs', 'merged')
+  # ...and when the latter has inherited mergeinfo.
+  svntest.actions.run_and_verify_mergeinfo(
+    adjust_error_for_server_version(''), ['6'],
+    sbox.repo_url + '/A2/D/H/omega',
+    sbox.repo_url + '/A_COPY/D/H/omega',
+    '--show-revs', 'merged')
+  
 # Test for issue #3180 'svn mergeinfo ignores peg rev for WC target'.
 def mergeinfo_on_pegged_wc_path(sbox):
   "svn mergeinfo on pegged working copy target"

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/patch_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/patch_tests.py Thu Apr  8 15:52:53 2010
@@ -55,7 +55,8 @@ def patch(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
   mu_contents = [
@@ -226,7 +227,8 @@ def patch_absolute_paths(sbox):
   wc_dir = sbox.wc_dir
 
   dir = os.path.abspath(svntest.main.temp_dir)
-  patch_file_path = tempfile.mkstemp(dir=dir)[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=dir)
+  os.close(fd)
 
   os.chdir(wc_dir)
 
@@ -289,7 +291,8 @@ def patch_offset(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
   iota_path = os.path.join(wc_dir, 'iota')
 
@@ -502,7 +505,8 @@ def patch_chopped_leading_spaces(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
   mu_contents = [
@@ -672,7 +676,8 @@ def patch_strip1(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
   mu_contents = [
@@ -928,7 +933,8 @@ def patch_add_new_dir(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
 
   # The first diff is adding 'new' with two missing dirs. The second is
   # adding 'new' with one missing dir to a 'A' that is locally deleted
@@ -1117,7 +1123,8 @@ def patch_reject(sbox):
   svntest.actions.run_and_verify_commit(wc_dir, expected_output,
                                         expected_status, None, wc_dir)
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
 
   # Apply patch
 
@@ -1190,7 +1197,8 @@ def patch_keywords(sbox):
   svntest.actions.run_and_verify_commit(wc_dir, expected_output,
                                         expected_status, None, wc_dir)
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
 
   # Apply patch
 
@@ -1235,7 +1243,8 @@ def patch_with_fuzz(sbox):
 
   sbox.build()
   wc_dir = sbox.wc_dir
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
 
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
@@ -1375,7 +1384,8 @@ def patch_reverse(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
   mu_contents = [
@@ -1545,7 +1555,8 @@ def patch_no_svn_eol_style(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
   if os.name == 'nt':
@@ -1648,7 +1659,8 @@ def patch_with_svn_eol_style(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
 
@@ -1762,7 +1774,8 @@ def patch_with_svn_eol_style_uncommitted
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
 
@@ -1870,7 +1883,8 @@ def patch_with_include_patterns(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
   mu_contents = [
@@ -2028,7 +2042,8 @@ def patch_with_exclude_patterns(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
   mu_contents = [
@@ -2188,7 +2203,8 @@ def patch_with_include_exclude_patterns(
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+  (fd, patch_file_path) = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))
+  os.close(fd)
   mu_path = os.path.join(wc_dir, 'A', 'mu')
 
   mu_contents = [

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svnadmin_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svnadmin_tests.py Thu Apr  8 15:52:53 2010
@@ -625,7 +625,7 @@ def recover_fsfs(sbox):
   svntest.main.run_svn(None, 'ci', sbox.wc_dir, '--quiet', '-m', 'log msg')
 
   # Remember the contents of the db/current file.
-  expected_current_contents = svntest.main.file_read(current_path)
+  expected_current_contents = open(current_path).read()
 
   # Move aside the current file for r3.
   os.rename(os.path.join(sbox.repo_dir, 'db','current'),
@@ -637,7 +637,7 @@ def recover_fsfs(sbox):
   if errput:
     raise SVNUnexpectedStderr(errput)
 
-  actual_current_contents = svntest.main.file_read(current_path)
+  actual_current_contents = open(current_path).read()
   svntest.verify.compare_and_display_lines(
     "Contents of db/current is unexpected.",
     'db/current', expected_current_contents, actual_current_contents)
@@ -651,7 +651,7 @@ def recover_fsfs(sbox):
   if errput:
     raise SVNUnexpectedStderr(errput)
 
-  actual_current_contents = svntest.main.file_read(current_path)
+  actual_current_contents = open(current_path).read()
   svntest.verify.compare_and_display_lines(
     "Contents of db/current is unexpected.",
     'db/current', expected_current_contents, actual_current_contents)
@@ -665,7 +665,7 @@ def recover_fsfs(sbox):
   if errput:
     raise SVNUnexpectedStderr(errput)
 
-  actual_current_contents = svntest.main.file_read(current_path)
+  actual_current_contents = open(current_path).read()
   svntest.verify.compare_and_display_lines(
     "Contents of db/current is unexpected.",
     'db/current', expected_current_contents, actual_current_contents)
@@ -684,7 +684,7 @@ def recover_fsfs(sbox):
   if errput:
     raise SVNUnexpectedStderr(errput)
 
-  actual_current_contents = svntest.main.file_read(current_path)
+  actual_current_contents = open(current_path).read()
   svntest.verify.compare_and_display_lines(
     "Contents of db/current is unexpected.",
     'db/current', expected_current_contents, actual_current_contents)
@@ -700,7 +700,7 @@ def load_with_parent_dir(sbox):
   dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
                                    'svnadmin_tests_data',
                                    'mergeinfo_included.dump')
-  dumpfile = svntest.main.file_read(dumpfile_location)
+  dumpfile = open(dumpfile_location).read()
 
   # Create 'sample' dir in sbox.repo_url, and load the dump stream there.
   svntest.actions.run_and_verify_svn(None,
@@ -798,7 +798,7 @@ def reflect_dropped_renumbered_revs(sbox
   dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
                                    'svndumpfilter_tests_data',
                                    'with_merges.dump')
-  dumpfile = svntest.main.file_read(dumpfile_location)
+  dumpfile = open(dumpfile_location).read()
 
   # Create 'toplevel' dir in sbox.repo_url
   svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 1.\n'],
@@ -1069,17 +1069,15 @@ def drop_mergeinfo_outside_of_dump_strea
   #       /Projects/Project-X/trunk:10
 
   # Load the skeleton dump:
-  dumpfile1 = svntest.main.file_read(
-    os.path.join(os.path.dirname(sys.argv[0]),
-                 'svnadmin_tests_data',
-                 'skeleton_repos.dump'))
+  dumpfile1 = open(os.path.join(os.path.dirname(sys.argv[0]),
+                                'svnadmin_tests_data',
+                                'skeleton_repos.dump')).read()
   load_and_verify_dumpstream(sbox, [], [], None, dumpfile1, '--ignore-uuid')
 
   # Load the partial repository with mergeinfo dump:
-  dumpfile2 = svntest.main.file_read(
-    os.path.join(os.path.dirname(sys.argv[0]),
-                 'svnadmin_tests_data',
-                 'mergeinfo_included_partial.dump'))
+  dumpfile2 = open(os.path.join(os.path.dirname(sys.argv[0]),
+                                'svnadmin_tests_data',
+                                'mergeinfo_included_partial.dump')).read()
   load_and_verify_dumpstream(sbox, [], [], None, dumpfile2, '--ignore-uuid',
                              '--parent-dir', '/Projects/Project-X')
 
@@ -1131,10 +1129,9 @@ def dont_drop_valid_mergeinfo_during_inc
   #
   # Note: The test repository 'mergeinfo_included_full.dump' is the full
   # repos diagramed in the test drop_mergeinfo_outside_of_dump_stream.
-  dumpfile1 = svntest.main.file_read(
-    os.path.join(os.path.dirname(sys.argv[0]),
-                 'svnadmin_tests_data',
-                 'mergeinfo_included_full.dump'))
+  dumpfile1 = open(os.path.join(os.path.dirname(sys.argv[0]),
+                                'svnadmin_tests_data',
+                                'mergeinfo_included_full.dump')).read()
   load_and_verify_dumpstream(sbox, [], [], None, dumpfile1, '--ignore-uuid')
 
   # Check that the mergeinfo is as expected.
@@ -1176,13 +1173,13 @@ def dont_drop_valid_mergeinfo_during_inc
 
   # Load the three incremental dump files in sequence.
   load_and_verify_dumpstream(sbox, [], [], None,
-                             svntest.main.file_read(dump_file_r1_10),
+                             open(dump_file_r1_10).read(),
                              '--ignore-uuid')
   load_and_verify_dumpstream(sbox, [], [], None,
-                             svntest.main.file_read(dump_file_r11_13),
+                             open(dump_file_r11_13).read(),
                              '--ignore-uuid')
   load_and_verify_dumpstream(sbox, [], [], None,
-                             svntest.main.file_read(dump_file_r14_15),
+                             open(dump_file_r14_15).read(),
                              '--ignore-uuid')
 
   # Check the mergeinfo, we use the same expected output as before,

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svndumpfilter_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svndumpfilter_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svndumpfilter_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svndumpfilter_tests.py Thu Apr  8 15:52:53 2010
@@ -74,7 +74,7 @@ def reflect_dropped_renumbered_revs(sbox
   dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
                                    'svndumpfilter_tests_data',
                                    'with_merges.dump')
-  dumpfile = svntest.main.file_read(dumpfile_location)
+  dumpfile = open(dumpfile_location).read()
 
   filtered_out = filter_and_return_output(dumpfile, "include",
                                           "trunk", "branch1",
@@ -124,7 +124,7 @@ def svndumpfilter_loses_mergeinfo(sbox):
   dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
                                    'svndumpfilter_tests_data',
                                    'with_merges.dump')
-  dumpfile = svntest.main.file_read(dumpfile_location)
+  dumpfile = open(dumpfile_location).read()
 
   filtered_out = filter_and_return_output(dumpfile, "include",
                                           "trunk", "branch1", "--quiet")
@@ -203,7 +203,7 @@ def dumpfilter_with_targets(sbox):
   dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
                                    'svndumpfilter_tests_data',
                                    'greek_tree.dump')
-  dumpfile = svntest.main.file_read(dumpfile_location)
+  dumpfile = open(dumpfile_location).read()
 
   (fd, targets_file) = tempfile.mkstemp(dir=svntest.main.temp_dir)
   try:
@@ -226,7 +226,7 @@ def dumpfilter_with_patterns(sbox):
   dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]),
                                    'svndumpfilter_tests_data',
                                    'greek_tree.dump')
-  dumpfile = svntest.main.file_read(dumpfile_location)
+  dumpfile = open(dumpfile_location).read()
   _simple_dumpfilter_test(sbox, dumpfile,
                           'exclude', '--pattern', '/A/D/[GH]*', '/A/[B]/E*')
 

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svntest/actions.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svntest/actions.py Thu Apr  8 15:52:53 2010
@@ -287,7 +287,7 @@ def run_and_verify_dump(repo_dir):
 def load_repo(sbox, dumpfile_path = None, dump_str = None):
   "Loads the dumpfile into sbox"
   if not dump_str:
-    dump_str = main.file_read(dumpfile_path, "rb")
+    dump_str = open(dumpfile_path, "rb").read()
 
   # Create a virgin repos and working copy
   main.safe_rmtree(sbox.repo_dir, 1)

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svntest/main.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/svntest/main.py Thu Apr  8 15:52:53 2010
@@ -693,25 +693,11 @@ def file_write(path, contents, mode='w')
   which is (w)rite by default."""
   open(path, mode).write(contents)
 
-# For reading the contents of a file
-def file_read(path, mode = 'r'):
-  """Return the contents of the file at PATH, opening file using MODE,
-  which is (r)ead by default."""
-  fp = open(path, mode)
-  contents = fp.read()
-  fp.close()
-  return contents
-
 # For replacing parts of contents in an existing file, with new content.
 def file_substitute(path, contents, new_contents):
   """Replace the CONTENTS in the file at PATH using the NEW_CONTENTS"""
-  fp = open(path, 'r')
-  fcontent = fp.read()
-  fp.close()
-  fcontent = fcontent.replace(contents, new_contents)
-  fp = open(path, 'w')
-  fp.write(fcontent)
-  fp.close()
+  fcontent = open(path, 'r').read().replace(contents, new_contents)
+  open(path, 'w').write(fcontent)
 
 # For creating blank new repositories
 def create_repos(path):
@@ -726,6 +712,8 @@ def create_repos(path):
     opts += ("--pre-1.5-compatible",)
   elif server_minor_version < 6:
     opts += ("--pre-1.6-compatible",)
+  elif server_minor_version < 7:
+    opts += ("--pre-1.7-compatible",)
   if fs_type is not None:
     opts += ("--fs-type=" + fs_type,)
   exit_code, stdout, stderr = run_command(svnadmin_binary, 1, 0, "create",
@@ -768,7 +756,7 @@ def create_repos(path):
 
       # read it
       format_file_path = get_fsfs_format_file_path(path)
-      contents = file_read(format_file_path, 'rb')
+      contents = open(format_file_path, 'rb').read()
 
       # tweak it
       new_contents = "".join([transform_line(line) + "\n"
@@ -876,7 +864,7 @@ def canonicalize_url(input):
     return input
 
 
-def create_python_hook_script (hook_path, hook_script_code):
+def create_python_hook_script(hook_path, hook_script_code):
   """Create a Python hook script at HOOK_PATH with the specified
      HOOK_SCRIPT_CODE."""
 
@@ -884,14 +872,14 @@ def create_python_hook_script (hook_path
     # Use an absolute path since the working directory is not guaranteed
     hook_path = os.path.abspath(hook_path)
     # Fill the python file.
-    file_write ("%s.py" % hook_path, hook_script_code)
+    file_write("%s.py" % hook_path, hook_script_code)
     # Fill the batch wrapper file.
-    file_append ("%s.bat" % hook_path,
-                 "@\"%s\" %s.py %%*\n" % (sys.executable, hook_path))
+    file_append("%s.bat" % hook_path,
+                "@\"%s\" %s.py %%*\n" % (sys.executable, hook_path))
   else:
     # For all other platforms
-    file_write (hook_path, "#!%s\n%s" % (sys.executable, hook_script_code))
-    os.chmod (hook_path, 0755)
+    file_write(hook_path, "#!%s\n%s" % (sys.executable, hook_script_code))
+    os.chmod(hook_path, 0755)
 
 def write_restrictive_svnserve_conf(repo_dir, anon_access="none"):
   "Create a restrictive authz file ( no anynomous access )."
@@ -1345,8 +1333,8 @@ def usage():
         "                 output and ignores all exceptions in the \n"
         "                 run_and_verify* functions. This option is only \n"
         "                 useful during test development!")
-  print(" --server-minor-version  Set the minor version for the server.\n"
-        "                 Supports version 4 or 5.")
+  print(" --server-minor-version  Set the minor version for the server ('4',\n"
+        "                 '5', or '6').")
   print(" --fsfs-sharding Default shard size (for fsfs)\n"
         " --fsfs-packing  Run 'svnadmin pack' automatically")
   print(" --config-file   Configuration file for tests.")

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/switch_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/switch_tests.py Thu Apr  8 15:52:53 2010
@@ -2545,6 +2545,11 @@ def tree_conflicts_on_switch_2_1(sbox):
     },
   }
 
+  ### D/D1/delta is locally-added during leaf_edit. when tree_del executes,
+  ### it will delete D/D1, and the switch reschedules local D/D1 for
+  ### local-copy from its original revision. however, right now, we cannot
+  ### denote that delta is a local-add rather than a child of that D/D1 copy.
+  ### thus, it appears in the status output as a (M)odified child.
   svntest.actions.deep_trees_run_tests_scheme_for_switch(sbox,
     [ DeepTreesTestCase("local_leaf_edit_incoming_tree_del",
                         leaf_edit,
@@ -2939,7 +2944,7 @@ test_list = [ None,
               tolerate_local_mods,
               tree_conflicts_on_switch_1_1,
               tree_conflicts_on_switch_1_2,
-              tree_conflicts_on_switch_2_1,
+              XFail(tree_conflicts_on_switch_2_1),
               tree_conflicts_on_switch_2_2,
               tree_conflicts_on_switch_3,
               single_file_relocate,

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/trans_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/trans_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/trans_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/trans_tests.py Thu Apr  8 15:52:53 2010
@@ -573,7 +573,7 @@ def eol_change_is_text_mod(sbox):
                                      'ci', '-m', 'log msg', foo_path)
 
   # check 2: do the files have the right contents now?
-  contents = svntest.main.file_read(foo_path, 'rb')
+  contents = open(foo_path, 'rb').read()
   if svntest.main.windows:
     if contents != "1\n2\n3\n4\n5\n6\n7\n8\n9\n":
       raise svntest.Failure
@@ -583,7 +583,7 @@ def eol_change_is_text_mod(sbox):
 
   foo_base_path = os.path.join(wc_dir, svntest.main.get_admin_name(),
                                'text-base', 'foo.svn-base')
-  base_contents = svntest.main.file_read(foo_base_path, 'rb')
+  base_contents = open(foo_base_path, 'rb').read()
   if contents != base_contents:
     raise svntest.Failure
 
@@ -759,7 +759,7 @@ def propset_commit_checkout_nocrash(sbox
                                      sbox.repo_url,
                                      other_wc_dir)
 
-  mu_other_contents = svntest.main.file_read(mu_other_path)
+  mu_other_contents = open(mu_other_path).read()
   if mu_other_contents != "This is the file 'mu'.\n$Rev: 3 $":
     print("'%s' does not have the expected contents" % mu_other_path)
     raise svntest.Failure

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/update_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/update_tests.py Thu Apr  8 15:52:53 2010
@@ -83,7 +83,7 @@ def detect_extra_files(node, extra_files
                                 len(os.sep) :]
         real_path = os.path.join(wc_dir, real_path)
 
-        real_contents = svntest.main.file_read(real_path)
+        real_contents = open(real_path).read()
         if real_contents == contents:
           extra_files.pop(extra_files.index(fdata)) # delete pattern from list
           return
@@ -100,8 +100,7 @@ def update_binary_file(sbox):
   wc_dir = sbox.wc_dir
 
   # Add a binary file to the project.
-  theta_contents = svntest.main.file_read(
-    os.path.join(sys.path[0], "theta.bin"), 'rb')
+  theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
   # Write PNG file data into 'A/theta'.
   theta_path = os.path.join(wc_dir, 'A', 'theta')
   svntest.main.file_write(theta_path, theta_contents, 'wb')
@@ -207,8 +206,7 @@ def update_binary_file_2(sbox):
   wc_dir = sbox.wc_dir
 
   # Suck up contents of a test .png file.
-  theta_contents = svntest.main.file_read(
-    os.path.join(sys.path[0], "theta.bin"), 'rb')
+  theta_contents = open(os.path.join(sys.path[0], "theta.bin"), 'rb').read()
 
   # 102400 is svn_txdelta_window_size.  We're going to make sure we
   # have at least 102401 bytes of data in our second binary file (for
@@ -4544,6 +4542,11 @@ def tree_conflicts_on_update_2_1(sbox):
     },
   }
 
+  ### D/D1/delta is locally-added during leaf_edit. when tree_del executes,
+  ### it will delete D/D1, and the update reschedules local D/D1 for
+  ### local-copy from its original revision. however, right now, we cannot
+  ### denote that delta is a local-add rather than a child of that D/D1 copy.
+  ### thus, it appears in the status output as a (M)odified child.
   svntest.actions.deep_trees_run_tests_scheme_for_update(sbox,
     [ DeepTreesTestCase("local_leaf_edit_incoming_tree_del",
                         leaf_edit,
@@ -5152,6 +5155,10 @@ def tree_conflict_uc2_schedule_re_add(sb
 
   # The status of the new and old scenarios should be identical...
   expected_status = get_status(wc2)
+  ### The following fails, as of Apr 6, 2010. The problem is that A/new_file
+  ### has been *added* within a copy, yet the wc_db datastore cannot
+  ### differentiate this from a copied-child. As a result, new_file is
+  ### reported as a (M)odified node, rather than (A)dded.
   svntest.actions.run_and_verify_status(wc2, expected_status)
 
   # ...except for the revision of the root of the WC and iota, because
@@ -5516,13 +5523,13 @@ test_list = [ None,
               restarted_update_should_delete_dir_prop,
               tree_conflicts_on_update_1_1,
               tree_conflicts_on_update_1_2,
-              tree_conflicts_on_update_2_1,
+              XFail(tree_conflicts_on_update_2_1),
               tree_conflicts_on_update_2_2,
               XFail(tree_conflicts_on_update_2_3),
               tree_conflicts_on_update_3,
               update_moves_and_modifies_an_edited_file,
               tree_conflict_uc1_update_deleted_tree,
-              tree_conflict_uc2_schedule_re_add,
+              XFail(tree_conflict_uc2_schedule_re_add),
               set_deep_depth_on_target_with_shallow_children,
               update_wc_of_dir_to_rev_not_containing_this_dir,
               XFail(update_deleted_locked_files),

Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/upgrade_tests.py?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/upgrade_tests.py Thu Apr  8 15:52:53 2010
@@ -233,10 +233,9 @@ def upgrade_wcprops(sbox):
 def xml_entries_relocate(path, from_url, to_url):
   adm_name = svntest.main.get_admin_name()
   entries = os.path.join(path, adm_name, 'entries')
-  txt = svntest.main.file_read(entries)
-  txt = txt.replace('url="' + from_url, 'url="' + to_url)
+  txt = open(entries).read().replace('url="' + from_url, 'url="' + to_url)
   os.chmod(entries, 0777)
-  svntest.main.file_write(entries, txt)
+  open(entries, 'w').write(txt)
 
   print('Relocated %s' % path)
 

Modified: subversion/branches/svn-patch-improvements/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/libsvn_client/client-test.c?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/libsvn_client/client-test.c Thu Apr  8 15:52:53 2010
@@ -206,10 +206,10 @@ test_args_to_target_array(apr_pool_t *po
 
 
 /* A helper function for test_patch().
- * It compares a patched or reject file against expected content.
- * It also deletes the file if the check was successful. */
+ * It compares a patched or reject file against expected content using the
+ *  specified EOL. It also deletes the file if the check was successful. */
 static svn_error_t *
-check_patch_result(const char *path, const char **expected_lines,
+check_patch_result(const char *path, const char **expected_lines, const char *eol,
                    int num_expected_lines, apr_pool_t *pool)
 {
   svn_stream_t *stream;
@@ -226,7 +226,7 @@ check_patch_result(const char *path, con
 
       svn_pool_clear(iterpool);
 
-      SVN_ERR(svn_stream_readline(stream, &line, APR_EOL_STR, &eof, pool));
+      SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool));
       if (i < num_expected_lines)
         if (strcmp(expected_lines[i++], line->data) != 0)
           return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
@@ -357,14 +357,14 @@ test_patch(const svn_test_opts_t *opts,
   key = "A/D/gamma";
   patched_tempfile_path = apr_hash_get(patched_tempfiles, key,
                                        APR_HASH_KEY_STRING);
-  SVN_ERR(check_patch_result(patched_tempfile_path, expected_gamma,
+  SVN_ERR(check_patch_result(patched_tempfile_path, expected_gamma, "\n",
                              EXPECTED_GAMMA_LINES, pool));
   SVN_ERR_ASSERT(apr_hash_count(reject_tempfiles) == 1);
   key = "A/D/gamma";
   reject_tempfile_path = apr_hash_get(reject_tempfiles, key,
                                      APR_HASH_KEY_STRING);
   SVN_ERR(check_patch_result(reject_tempfile_path, expected_gamma_reject,
-                             EXPECTED_GAMMA_REJECT_LINES, pool));
+                             APR_EOL_STR, EXPECTED_GAMMA_REJECT_LINES, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/svn-patch-improvements/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=931980&r1=931979&r2=931980&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/libsvn_subr/dirent_uri-test.c Thu Apr  8 15:52:53 2010
@@ -2314,6 +2314,9 @@ test_dirent_get_absolute_from_lc_drive(a
   char current_dir_on_C[1024];
   char *dir_on_c;
   svn_error_t *err;
+  apr_hash_t *dirents;
+  apr_hash_index_t *hi;
+  const char *some_dir_on_C = NULL;
 
   if (! getcwd(current_dir, sizeof(current_dir)))
     return svn_error_create(SVN_ERR_BASE, NULL, "getcwd() failed");
@@ -2322,8 +2325,36 @@ test_dirent_get_absolute_from_lc_drive(a
   if (! getdcwd(3, current_dir_on_C, sizeof(current_dir_on_C)))
     return svn_error_create(SVN_ERR_BASE, NULL, "getdcwd() failed");
 
-  /* Use the same path, but now with a lower case driveletter */
-  dir_on_c = apr_pstrdup(pool, current_dir_on_C);
+  SVN_ERR(svn_io_get_dirents2(&dirents, "C:\\", pool));
+
+  /* We need a directory on 'C:\' to switch to lower case and back.
+     We use the first directory we can find that is not the CWD and
+     where we can chdir to */
+
+  for (hi = apr_hash_first(pool, dirents); hi; hi = apr_hash_next(hi))
+    {
+      const char *dir = svn__apr_hash_index_key(hi);
+      svn_io_dirent_t *de = svn__apr_hash_index_val(hi);
+
+      if (de->kind == svn_node_dir &&
+          strcmp(dir, current_dir_on_C))
+        {
+          dir = svn_dirent_join("C:/", dir, pool);
+          if (!chdir(dir))
+            {
+              chdir(current_dir_on_C); /* Switch back to old CWD */
+              some_dir_on_C = dir;
+              break;
+            }
+        }
+    }
+
+  if (!some_dir_on_C)
+    return svn_error_create(SVN_ERR_BASE, NULL, 
+                            "No usable test directory found in C:\\");
+
+  /* Use the test path, but now with a lower case driveletter */
+  dir_on_c = apr_pstrdup(pool, some_dir_on_C);
   dir_on_c[0] = (char)tolower(dir_on_c[0]);
 
   chdir(dir_on_c);