subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1334177 - in /subversion/branches/ev2-export: ./ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsvn_ra_serf/ subversion/libsvn_subr/ subversion/libsvn_wc/ subversion/tests/c...
Date Fri, 04 May 2012 20:46:55 GMT
Author: hwright
Date: Fri May  4 20:46:54 2012
New Revision: 1334177

URL: http://svn.apache.org/viewvc?rev=1334177&view=rev
Log:
On the ev2-export branch:
The daily merge from trunk.

Modified:
    subversion/branches/ev2-export/   (props changed)
    subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h
    subversion/branches/ev2-export/subversion/include/svn_ra.h
    subversion/branches/ev2-export/subversion/libsvn_client/ra.c
    subversion/branches/ev2-export/subversion/libsvn_delta/editor.c
    subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c
    subversion/branches/ev2-export/subversion/libsvn_subr/hash.c
    subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c
    subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql
    subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c
    subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py
    subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/branches/ev2-export/tools/dist/nightly.sh
    subversion/branches/ev2-export/tools/server-side/svnpubsub/svnwcsub.py

Propchange: subversion/branches/ev2-export/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1333596-1334155

Modified: subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h Fri May  4 20:46:54 2012
@@ -1087,6 +1087,19 @@ svn_wc__node_pristine_install(svn_wc_con
                               const svn_checksum_t *md5_checksum,
                               apr_pool_t *scratch_pool);
 
+/* Like svn_wc_get_pristine_contents2(), but keyed on the
+   SHA1_CHECKSUM rather than on the local absolute path of the working
+   file.  WCROOT_ABSPATH is the absolute path of the root of the
+   working copy in whose pristine database we'll be looking for these
+   contents.  */
+svn_error_t *
+svn_wc__get_pristine_contents_by_checksum(svn_stream_t **contents,
+                                          svn_wc_context_t *wc_ctx,
+                                          const char *wcroot_abspath,
+                                          const svn_checksum_t *sha1_checksum,
+                                          apr_pool_t *result_pool,
+                                          apr_pool_t *scratch_pool);
+
 /* If requested set *CONTENTS to a readable stream that will yield the pristine
    text identified by SHA1_CHECKSUM (must be a SHA-1 checksum) within the WC
    identified by WRI_ABSPATH in DB.

Modified: subversion/branches/ev2-export/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/svn_ra.h?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/include/svn_ra.h (original)
+++ subversion/branches/ev2-export/subversion/include/svn_ra.h Fri May  4 20:46:54 2012
@@ -120,6 +120,16 @@ typedef svn_error_t *(*svn_ra_invalidate
                                                           const char *name,
                                                           apr_pool_t *pool);
 
+/** This is a function type which allows the RA layer to fetch the
+ * cached pristine file contents whose SHA1 checksum is @a
+ * sha1_checksum, if any.  @a *contents will be a read stream
+ * containing those contents if they are found; NULL otherwise.
+ */
+typedef svn_error_t *(*svn_ra_get_wc_contents_func_t)(void *baton,
+                                                      svn_stream_t **contents,
+                                                      svn_checksum_t *sha1_checksum,
+                                                      apr_pool_t *pool);
+
 
 /** A function type for retrieving the youngest revision from a repos. */
 typedef svn_error_t *(*svn_ra_get_latest_revnum_func_t)(
@@ -138,6 +148,7 @@ typedef svn_error_t *(*svn_ra_get_client
                                                         apr_pool_t *pool);
 
 
+
 /**
  * A callback function type for use in @c get_file_revs.
  * @a baton is provided by the caller, @a path is the pathname of the file
@@ -516,6 +527,11 @@ typedef struct svn_ra_callbacks2_t
    */
   svn_ra_get_client_string_func_t get_client_string;
 
+  /** Working copy file content fetching function.
+   * @since New in 1.8.
+   */
+  svn_ra_get_wc_contents_func_t get_wc_contents;
+
 } svn_ra_callbacks2_t;
 
 /** Similar to svn_ra_callbacks2_t, except that the progress

Modified: subversion/branches/ev2-export/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/ra.c?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/ra.c Fri May  4 20:46:54 2012
@@ -52,6 +52,10 @@ typedef struct callback_baton_t
      this base directory. */
   const char *base_dir_abspath;
 
+  /* Holds the absolute path of the working copy root for the working
+     copy in which BASE_DIR_ABSPATH is found. */
+  const char *wcroot_abspath;
+
   /* An array of svn_client_commit_item3_t * structures, present only
      during working copy commits. */
   const apr_array_header_t *commit_items;
@@ -234,6 +238,30 @@ invalidate_wc_props(void *baton,
 }
 
 
+/* This implements the `svn_ra_get_wc_contents_func_t' interface. */
+static svn_error_t *
+get_wc_contents(void *baton,
+                svn_stream_t **contents,
+                svn_checksum_t *sha1_checksum,
+                apr_pool_t *pool)
+{
+  callback_baton_t *cb = baton;
+
+  if (! cb->wcroot_abspath)
+    {
+      *contents = NULL;
+      return SVN_NO_ERROR;
+    }
+
+  return svn_error_trace(
+             svn_wc__get_pristine_contents_by_checksum(contents,
+                                                       cb->ctx->wc_ctx,
+                                                       cb->wcroot_abspath,
+                                                       sha1_checksum,
+                                                       pool, pool));
+}
+
+
 static svn_error_t *
 cancel_callback(void *baton)
 {
@@ -284,6 +312,7 @@ svn_client__open_ra_session_internal(svn
   cbtable->progress_baton = ctx->progress_baton;
   cbtable->cancel_func = ctx->cancel_func ? cancel_callback : NULL;
   cbtable->get_client_string = get_client_string;
+  cbtable->get_wc_contents = get_wc_contents;
 
   cb->base_dir_abspath = base_dir_abspath;
   cb->commit_items = commit_items;
@@ -291,6 +320,7 @@ svn_client__open_ra_session_internal(svn
 
   if (base_dir_abspath)
     {
+      const char *wcroot_abspath;
       svn_error_t *err = svn_wc__node_get_repos_info(NULL, &uuid, ctx->wc_ctx,
                                                      base_dir_abspath,
                                                      pool, pool);
@@ -303,7 +333,28 @@ svn_client__open_ra_session_internal(svn
           uuid = NULL;
         }
       else
-        SVN_ERR(err);
+        {
+          SVN_ERR(err);
+        }
+
+      err = svn_wc__get_wc_root(&wcroot_abspath, ctx->wc_ctx,
+                                base_dir_abspath, pool, pool);
+      if (err)
+        {
+          if (err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY)
+            {
+              svn_error_clear(err);
+              err = SVN_NO_ERROR;
+            }
+          else
+            {
+              return err;
+            }
+        }
+      else
+        {
+          cb->wcroot_abspath = wcroot_abspath;
+        }
     }
 
   /* If the caller allows for auto-following redirections, and the

Modified: subversion/branches/ev2-export/subversion/libsvn_delta/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_delta/editor.c?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_delta/editor.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_delta/editor.c Fri May  4 20:46:54 2012
@@ -61,7 +61,7 @@ struct svn_editor_t
   apr_hash_t *completed_nodes;
   svn_boolean_t finished;
 
-  apr_pool_t *result_pool;
+  apr_pool_t *state_pool;
 #endif
 };
 
@@ -105,7 +105,7 @@ static const int marker_added_dir;
 
 #define MARK_RELPATH(editor, relpath, value) \
   apr_hash_set((editor)->completed_nodes, \
-               apr_pstrdup((editor)->result_pool, relpath), \
+               apr_pstrdup((editor)->state_pool, relpath), \
                APR_HASH_KEY_STRING, value)
 
 #define MARK_COMPLETED(editor, relpath) \
@@ -129,6 +129,36 @@ static const int marker_added_dir;
 #define CHECK_UNKNOWN_CHILD(editor, relpath) \
   SVN_ERR_ASSERT(check_unknown_child(editor, relpath))
 
+/* When a child is changed in some way, mark the parent directory as needing
+   to be "stable" (no future structural changes). IOW, only allow "alter" on
+   the parent. Prevents parent-add/delete/move after any child operation.  */
+#define MARK_PARENT_STABLE(editor, relpath) \
+  mark_parent_stable(editor, relpath)
+
+/* If the parent is MARKER_ALLOW_ADD, then it has been moved-away, and we
+   know it does not exist. All other cases: it might exist.  */
+#define VERIFY_PARENT_MAY_EXIST(editor, relpath) \
+  SVN_ERR_ASSERT(apr_hash_get((editor)->completed_nodes, \
+                              svn_relpath_dirname(relpath, \
+                                                  (editor)->scratch_pool), \
+                              APR_HASH_KEY_STRING) != MARKER_ALLOW_ADD)
+
+/* If the parent is MARKER_ADDED_DIR, then we should not be deleting
+   children(*). If the parent is MARKER_ALLOW_ADD, then it has been
+   moved-away, so children cannot exist. That leaves MARKER_DONE,
+   MARKER_ALLOW_ALTER, and NULL as possible values. Just assert that
+   we didn't get either of the bad ones.
+
+   (*) if the child as added via add_*(), then it would have been marked
+   as completed and delete/move-away already test against completed nodes.
+   This test is to beware of trying to delete "children" that are not
+   actually (and can't possibly be) present.  */
+#define CHILD_DELETIONS_ALLOWED(editor, relpath) \
+  SVN_ERR_ASSERT(!allow_either(editor, \
+                               svn_relpath_dirname(relpath, \
+                                                   (editor)->scratch_pool), \
+                               MARKER_ADDED_DIR, MARKER_ALLOW_ADD))
+
 static svn_boolean_t
 allow_either(const svn_editor_t *editor,
              const char *relpath,
@@ -166,6 +196,30 @@ check_unknown_child(const svn_editor_t *
   return TRUE;
 }
 
+static void
+mark_parent_stable(const svn_editor_t *editor,
+                   const char *relpath)
+{
+  const char *parent = svn_relpath_dirname(relpath, editor->scratch_pool);
+  const void *marker = apr_hash_get(editor->completed_nodes,
+                                    parent, APR_HASH_KEY_STRING);
+
+  /* If RELPATH has already been marked (to disallow adds, or that it
+     has been fully-completed), then do nothing.  */
+  if (marker == MARKER_ALLOW_ALTER
+      || marker == MARKER_DONE
+      || marker == MARKER_ADDED_DIR)
+    return;
+
+  /* If the marker is MARKER_ALLOW_ADD, then that means the parent was
+     moved away. There is no way to work on a child. That should have
+     been tested before we got here by VERIFY_PARENT_MAY_EXIST().  */
+  SVN_ERR_ASSERT_NO_RETURN(marker != MARKER_ALLOW_ADD);
+
+  /* MARKER is NULL. Upgrade it to MARKER_ALLOW_ALTER.  */
+  MARK_RELPATH(editor, parent, MARKER_ALLOW_ALTER);
+}
+
 #else
 
 /* Be wary with the definition of these macros so that we don't
@@ -192,6 +246,10 @@ check_unknown_child(const svn_editor_t *
 #define MARK_ADDED_DIR(editor, relpath)  /* empty */
 #define CHECK_UNKNOWN_CHILD(editor, relpath)  /* empty */
 
+#define MARK_PARENT_STABLE(editor, relpath)  /* empty */
+#define VERIFY_PARENT_MAY_EXIST(editor, relpath)  /* empty */
+#define CHILD_DELETIONS_ALLOWED(editor, relpath)  /* empty */
+
 #endif /* ENABLE_ORDERING_CHECK */
 
 
@@ -214,7 +272,7 @@ svn_editor_create(svn_editor_t **editor,
   (*editor)->pending_incomplete_children = apr_hash_make(result_pool);
   (*editor)->completed_nodes = apr_hash_make(result_pool);
   (*editor)->finished = FALSE;
-  (*editor)->result_pool = result_pool;
+  (*editor)->state_pool = result_pool;
 #endif
 
   return SVN_NO_ERROR;
@@ -416,6 +474,7 @@ svn_editor_add_directory(svn_editor_t *e
   /* ### validate children are just basenames?  */
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_ALLOW_ADD(editor, relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, relpath);
   CHECK_UNKNOWN_CHILD(editor, relpath);
 
   SVN_ERR(check_cancel(editor));
@@ -430,6 +489,7 @@ svn_editor_add_directory(svn_editor_t *e
     }
 
   MARK_ADDED_DIR(editor, relpath);
+  MARK_PARENT_STABLE(editor, relpath);
   CLEAR_INCOMPLETE(editor, relpath);
 
 #ifdef ENABLE_ORDERING_CHECK
@@ -439,7 +499,7 @@ svn_editor_add_directory(svn_editor_t *e
       {
         const char *child_basename = APR_ARRAY_IDX(children, i, const char *);
         const char *child = svn_relpath_join(relpath, child_basename,
-                                             editor->result_pool);
+                                             editor->state_pool);
 
         apr_hash_set(editor->pending_incomplete_children, child,
                      APR_HASH_KEY_STRING, "");
@@ -469,6 +529,7 @@ svn_editor_add_file(svn_editor_t *editor
   SVN_ERR_ASSERT(props != NULL);
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_ALLOW_ADD(editor, relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, relpath);
   CHECK_UNKNOWN_CHILD(editor, relpath);
 
   SVN_ERR(check_cancel(editor));
@@ -483,6 +544,7 @@ svn_editor_add_file(svn_editor_t *editor
     }
 
   MARK_COMPLETED(editor, relpath);
+  MARK_PARENT_STABLE(editor, relpath);
   CLEAR_INCOMPLETE(editor, relpath);
 
   svn_pool_clear(editor->scratch_pool);
@@ -503,6 +565,7 @@ svn_editor_add_symlink(svn_editor_t *edi
   SVN_ERR_ASSERT(props != NULL);
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_ALLOW_ADD(editor, relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, relpath);
   CHECK_UNKNOWN_CHILD(editor, relpath);
 
   SVN_ERR(check_cancel(editor));
@@ -516,6 +579,7 @@ svn_editor_add_symlink(svn_editor_t *edi
     }
 
   MARK_COMPLETED(editor, relpath);
+  MARK_PARENT_STABLE(editor, relpath);
   CLEAR_INCOMPLETE(editor, relpath);
 
   svn_pool_clear(editor->scratch_pool);
@@ -534,6 +598,7 @@ svn_editor_add_absent(svn_editor_t *edit
   SVN_ERR_ASSERT(svn_relpath_is_canonical(relpath));
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_ALLOW_ADD(editor, relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, relpath);
   CHECK_UNKNOWN_CHILD(editor, relpath);
 
   SVN_ERR(check_cancel(editor));
@@ -547,6 +612,7 @@ svn_editor_add_absent(svn_editor_t *edit
     }
 
   MARK_COMPLETED(editor, relpath);
+  MARK_PARENT_STABLE(editor, relpath);
   CLEAR_INCOMPLETE(editor, relpath);
 
   svn_pool_clear(editor->scratch_pool);
@@ -566,6 +632,7 @@ svn_editor_alter_directory(svn_editor_t 
   SVN_ERR_ASSERT(props != NULL);
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_ALLOW_ALTER(editor, relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, relpath);
 
   SVN_ERR(check_cancel(editor));
 
@@ -579,6 +646,7 @@ svn_editor_alter_directory(svn_editor_t 
     }
 
   MARK_COMPLETED(editor, relpath);
+  MARK_PARENT_STABLE(editor, relpath);
 
   svn_pool_clear(editor->scratch_pool);
   return svn_error_trace(err);
@@ -603,6 +671,7 @@ svn_editor_alter_file(svn_editor_t *edit
     SVN_ERR_ASSERT(checksum->kind == SVN_EDITOR_CHECKSUM_KIND);
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_ALLOW_ALTER(editor, relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, relpath);
 
   SVN_ERR(check_cancel(editor));
 
@@ -617,6 +686,7 @@ svn_editor_alter_file(svn_editor_t *edit
     }
 
   MARK_COMPLETED(editor, relpath);
+  MARK_PARENT_STABLE(editor, relpath);
 
   svn_pool_clear(editor->scratch_pool);
   return svn_error_trace(err);
@@ -636,6 +706,7 @@ svn_editor_alter_symlink(svn_editor_t *e
   SVN_ERR_ASSERT(props != NULL || target != NULL);
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_ALLOW_ALTER(editor, relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, relpath);
 
   SVN_ERR(check_cancel(editor));
 
@@ -650,6 +721,7 @@ svn_editor_alter_symlink(svn_editor_t *e
     }
 
   MARK_COMPLETED(editor, relpath);
+  MARK_PARENT_STABLE(editor, relpath);
 
   svn_pool_clear(editor->scratch_pool);
   return svn_error_trace(err);
@@ -666,6 +738,8 @@ svn_editor_delete(svn_editor_t *editor,
   SVN_ERR_ASSERT(svn_relpath_is_canonical(relpath));
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_NOT_BE_COMPLETED(editor, relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, relpath);
+  CHILD_DELETIONS_ALLOWED(editor, relpath);
 
   SVN_ERR(check_cancel(editor));
 
@@ -678,6 +752,7 @@ svn_editor_delete(svn_editor_t *editor,
     }
 
   MARK_COMPLETED(editor, relpath);
+  MARK_PARENT_STABLE(editor, relpath);
 
   svn_pool_clear(editor->scratch_pool);
   return svn_error_trace(err);
@@ -697,6 +772,8 @@ svn_editor_copy(svn_editor_t *editor,
   SVN_ERR_ASSERT(svn_relpath_is_canonical(dst_relpath));
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_ALLOW_ADD(editor, dst_relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, src_relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, dst_relpath);
 
   SVN_ERR(check_cancel(editor));
 
@@ -710,6 +787,7 @@ svn_editor_copy(svn_editor_t *editor,
     }
 
   MARK_ALLOW_ALTER(editor, dst_relpath);
+  MARK_PARENT_STABLE(editor, dst_relpath);
   CLEAR_INCOMPLETE(editor, dst_relpath);
 
   svn_pool_clear(editor->scratch_pool);
@@ -731,6 +809,9 @@ svn_editor_move(svn_editor_t *editor,
   SHOULD_NOT_BE_FINISHED(editor);
   SHOULD_NOT_BE_COMPLETED(editor, src_relpath);
   SHOULD_ALLOW_ADD(editor, dst_relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, src_relpath);
+  CHILD_DELETIONS_ALLOWED(editor, src_relpath);
+  VERIFY_PARENT_MAY_EXIST(editor, dst_relpath);
 
   SVN_ERR(check_cancel(editor));
 
@@ -744,7 +825,9 @@ svn_editor_move(svn_editor_t *editor,
     }
 
   MARK_ALLOW_ADD(editor, src_relpath);
+  MARK_PARENT_STABLE(editor, src_relpath);
   MARK_ALLOW_ALTER(editor, dst_relpath);
+  MARK_PARENT_STABLE(editor, dst_relpath);
   CLEAR_INCOMPLETE(editor, dst_relpath);
 
   svn_pool_clear(editor->scratch_pool);
@@ -769,6 +852,8 @@ svn_editor_rotate(svn_editor_t *editor,
 
         SVN_ERR_ASSERT(svn_relpath_is_canonical(relpath));
         SHOULD_NOT_BE_COMPLETED(editor, relpath);
+        VERIFY_PARENT_MAY_EXIST(editor, relpath);
+        CHILD_DELETIONS_ALLOWED(editor, relpath);
       }
   }
 #endif
@@ -790,6 +875,7 @@ svn_editor_rotate(svn_editor_t *editor,
       {
         const char *relpath = APR_ARRAY_IDX(relpaths, i, const char *);
         MARK_ALLOW_ALTER(editor, relpath);
+        MARK_PARENT_STABLE(editor, relpath);
       }
   }
 #endif

Modified: subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_ra_serf/update.c Fri May  4 20:46:54 2012
@@ -237,6 +237,10 @@ typedef struct report_info_t
   /* Checksum for close_file */
   const char *final_checksum;
 
+  /* Stream containing file contents already cached in the working
+     copy (which may be used to avoid a GET request for the same). */
+  svn_stream_t *cached_contents;
+
   /* temporary property for this file which is currently being parsed
    * It will eventually be stored in our parent directory's property hash.
    */
@@ -349,7 +353,7 @@ struct report_context_t {
   /* number of pending PROPFIND requests */
   unsigned int active_propfinds;
 
-  /* completed PROPFIND requests (contains propfind_context_t) */
+  /* completed PROPFIND requests (contains svn_ra_serf__propfind_context_t) */
   svn_ra_serf__list_t *done_propfinds;
 
   /* list of files that only have prop changes (contains report_info_t) */
@@ -1229,6 +1233,179 @@ handle_propchange_only(report_info_t *in
   return SVN_NO_ERROR;
 }
 
+/* "Fetch" a file whose contents were made available via the
+   get_wc_contents() callback (as opposed to requiring a GET to the
+   server), and feed the information through the associated update
+   editor. */
+static svn_error_t *
+local_fetch(report_info_t *info)
+{
+  const svn_delta_editor_t *update_editor = info->dir->update_editor;
+  svn_txdelta_window_t delta_window = { 0 };
+  svn_txdelta_op_t delta_op;
+  svn_string_t window_data;
+  char read_buf[SVN__STREAM_CHUNK_SIZE + 1];
+
+  SVN_ERR(open_dir(info->dir));
+  info->editor_pool = svn_pool_create(info->dir->dir_baton_pool);
+
+  /* Expand our full name now if we haven't done so yet. */
+  if (!info->name)
+    {
+      info->name = svn_relpath_join(info->dir->name, info->base_name,
+                                    info->editor_pool);
+    }
+
+  if (SVN_IS_VALID_REVNUM(info->base_rev))
+    {
+      SVN_ERR(update_editor->open_file(info->name,
+                                       info->dir->dir_baton,
+                                       info->base_rev,
+                                       info->editor_pool,
+                                       &info->file_baton));
+    }
+  else
+    {
+      SVN_ERR(update_editor->add_file(info->name,
+                                      info->dir->dir_baton,
+                                      info->copyfrom_path,
+                                      info->copyfrom_rev,
+                                      info->editor_pool,
+                                      &info->file_baton));
+    }
+  
+  SVN_ERR(update_editor->apply_textdelta(info->file_baton,
+                                         info->base_checksum,
+                                         info->editor_pool,
+                                         &info->textdelta,
+                                         &info->textdelta_baton));
+  
+  while (1)
+    {
+      apr_size_t read_len = SVN__STREAM_CHUNK_SIZE;
+      
+      SVN_ERR(svn_stream_read(info->cached_contents, read_buf, &read_len));
+      if (read_len == 0)
+        break;
+      
+      window_data.data = read_buf;
+      window_data.len = read_len;
+      
+      delta_op.action_code = svn_txdelta_new;
+      delta_op.offset = 0;
+      delta_op.length = read_len;
+      
+      delta_window.tview_len = read_len;
+      delta_window.num_ops = 1;
+      delta_window.ops = &delta_op;
+      delta_window.new_data = &window_data;
+      
+      SVN_ERR(info->textdelta(&delta_window, info->textdelta_baton));
+      
+      if (read_len < SVN__STREAM_CHUNK_SIZE)
+        break;
+    }
+  
+  SVN_ERR(info->textdelta(NULL, info->textdelta_baton));
+
+  SVN_ERR(svn_stream_close(info->cached_contents));
+  info->cached_contents = NULL;
+
+  if (info->lock_token)
+    check_lock(info);
+
+  /* set all of the properties we received */
+  SVN_ERR(svn_ra_serf__walk_all_props(info->props,
+                                      info->base_name,
+                                      info->base_rev,
+                                      set_file_props, info,
+                                      info->pool));
+  
+  SVN_ERR(svn_ra_serf__walk_all_props(info->dir->removed_props,
+                                      info->base_name,
+                                      info->base_rev,
+                                      remove_file_props, info,
+                                      info->pool));
+  if (info->fetch_props)
+    {
+      SVN_ERR(svn_ra_serf__walk_all_props(info->props,
+                                          info->url,
+                                          info->target_rev,
+                                          set_file_props, info,
+                                          info->pool));
+    }
+  
+  SVN_ERR(info->dir->update_editor->close_file(info->file_baton,
+                                               info->final_checksum,
+                                               info->pool));
+  
+  /* We're done with our pools. */
+  svn_pool_destroy(info->editor_pool);
+  svn_pool_destroy(info->pool);
+
+  return SVN_NO_ERROR;
+}
+
+/* Implements svn_ra_serf__response_handler_t */
+static svn_error_t *
+handle_local_fetch(serf_request_t *request,
+                   serf_bucket_t *response,
+                   void *handler_baton,
+                   apr_pool_t *pool)
+{
+  report_fetch_t *fetch_ctx = handler_baton;
+  apr_status_t status;
+  serf_status_line sl;
+  svn_error_t *err;
+  const char *data;
+  apr_size_t len;
+
+  /* If the error code wasn't 200, something went wrong. Don't use the returned
+     data as its probably an error message. Just bail out instead. */
+  status = serf_bucket_response_status(response, &sl);
+  if (SERF_BUCKET_READ_ERROR(status))
+    {
+      return svn_error_wrap_apr(status, NULL);
+    }
+  if (sl.code != 200)
+    {
+      err = svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+                              _("GET request failed: %d %s"),
+                              sl.code, sl.reason);
+      return error_fetch(request, fetch_ctx, err);
+    }
+
+  while (1)
+    {
+      status = serf_bucket_read(response, 8000, &data, &len);
+      if (SERF_BUCKET_READ_ERROR(status))
+        {
+          return svn_error_wrap_apr(status, NULL);
+        }
+      if (APR_STATUS_IS_EOF(status))
+        {
+          err = local_fetch(fetch_ctx->info);
+          if (err)
+            {
+              return error_fetch(request, fetch_ctx, err);
+            }
+
+          fetch_ctx->done = TRUE;
+          fetch_ctx->done_item.data = fetch_ctx;
+          fetch_ctx->done_item.next = *fetch_ctx->done_list;
+          *fetch_ctx->done_list = &fetch_ctx->done_item;
+          return svn_error_wrap_apr(status, NULL);
+        }
+      if (APR_STATUS_IS_EAGAIN(status))
+        {
+          return svn_error_wrap_apr(status, NULL);
+        }
+    }
+  /* not reached */
+}
+
+/* --------------------------------------------------------- */
+
 static svn_error_t *
 fetch_file(report_context_t *ctx, report_info_t *info)
 {
@@ -1239,9 +1416,8 @@ fetch_file(report_context_t *ctx, report
   conn = ctx->sess->conns[ctx->sess->cur_conn];
 
   /* go fetch info->name from DAV:checked-in */
-  info->url =
-      svn_ra_serf__get_ver_prop(info->props, info->base_name,
-                                info->base_rev, "DAV:", "checked-in");
+  info->url = svn_ra_serf__get_ver_prop(info->props, info->base_name,
+                                        info->base_rev, "DAV:", "checked-in");
 
   if (!info->url)
     {
@@ -1269,34 +1445,98 @@ fetch_file(report_context_t *ctx, report
    */
   if (info->fetch_file && ctx->text_deltas)
     {
-      report_fetch_t *fetch_ctx;
+      svn_stream_t *contents = NULL;
 
-      fetch_ctx = apr_pcalloc(info->dir->pool, sizeof(*fetch_ctx));
-      fetch_ctx->info = info;
-      fetch_ctx->done_list = &ctx->done_fetches;
-      fetch_ctx->sess = ctx->sess;
-      fetch_ctx->conn = conn;
+      if (ctx->sess->wc_callbacks->get_wc_contents
+          && info->final_sha1_checksum)
+        {
+          svn_error_t *err;
+          svn_checksum_t *sha1_checksum;
 
-      handler = apr_pcalloc(info->dir->pool, sizeof(*handler));
+          err = svn_checksum_parse_hex(&sha1_checksum, svn_checksum_sha1,
+                                       info->final_sha1_checksum, info->pool);
+          if (!err)
+            {
+              err = ctx->sess->wc_callbacks->get_wc_contents(
+                        ctx->sess->wc_callback_baton, &contents,
+                        sha1_checksum, info->pool);
+            }
 
-      handler->method = "GET";
-      handler->path = fetch_ctx->info->url;
+          if (err)
+            {
+              /* Meh.  Maybe we'll care one day why we're in an
+                 errorful state, but this codepath is optional.  */
+              svn_error_clear(err);
+            }
+          else
+            {
+              info->cached_contents = contents;
+            }
+        }          
 
-      handler->conn = conn;
-      handler->session = ctx->sess;
+      /* If the working copy can provided cached contents for this
+         file, we'll send a simple HEAD request (which I'll claim is
+         to verify readability, but really is just so I can provide a
+         Serf-queued-request-compliant way of processing the contents
+         after the PROPFIND for the file's properties ... ugh).
 
-      handler->header_delegate = headers_fetch;
-      handler->header_delegate_baton = fetch_ctx;
+         Otherwise, we use a GET request for the file's contents. */
+      if (info->cached_contents)
+        {
+          report_fetch_t *fetch_ctx;
 
-      handler->response_handler = handle_fetch;
-      handler->response_baton = fetch_ctx;
+          fetch_ctx = apr_pcalloc(info->dir->pool, sizeof(*fetch_ctx));
+          fetch_ctx->info = info;
+          fetch_ctx->done_list = &ctx->done_fetches;
+          fetch_ctx->sess = ctx->sess;
+          fetch_ctx->conn = conn;
 
-      handler->response_error = cancel_fetch;
-      handler->response_error_baton = fetch_ctx;
+          handler = apr_pcalloc(info->dir->pool, sizeof(*handler));
 
-      svn_ra_serf__request_create(handler);
+          handler->method = "HEAD";
+          handler->path = fetch_ctx->info->url;
 
-      ctx->active_fetches++;
+          handler->conn = conn;
+          handler->session = ctx->sess;
+
+          handler->response_handler = handle_local_fetch;
+          handler->response_baton = fetch_ctx;
+
+          svn_ra_serf__request_create(handler);
+
+          ctx->active_fetches++;
+        }
+      else
+        {
+          report_fetch_t *fetch_ctx;
+
+          fetch_ctx = apr_pcalloc(info->dir->pool, sizeof(*fetch_ctx));
+          fetch_ctx->info = info;
+          fetch_ctx->done_list = &ctx->done_fetches;
+          fetch_ctx->sess = ctx->sess;
+          fetch_ctx->conn = conn;
+
+          handler = apr_pcalloc(info->dir->pool, sizeof(*handler));
+
+          handler->method = "GET";
+          handler->path = fetch_ctx->info->url;
+
+          handler->conn = conn;
+          handler->session = ctx->sess;
+
+          handler->header_delegate = headers_fetch;
+          handler->header_delegate_baton = fetch_ctx;
+
+          handler->response_handler = handle_fetch;
+          handler->response_baton = fetch_ctx;
+
+          handler->response_error = cancel_fetch;
+          handler->response_error_baton = fetch_ctx;
+
+          svn_ra_serf__request_create(handler);
+
+          ctx->active_fetches++;
+        }
     }
   else if (info->propfind)
     {

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/hash.c?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/hash.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/hash.c Fri May  4 20:46:54 2012
@@ -656,7 +656,7 @@ hashfunc_fast(const char *char_key, apr_
 
             hash = (hash + chunk) * 0xd1f3da69;
           }
-        for (; i; i--, p++)
+        for (; *p; p++)
             hash = hash * 33 + *p;
 
         *klen = p - key;

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c Fri May  4 20:46:54 2012
@@ -2250,6 +2250,18 @@ svn_wc_get_pristine_contents2(svn_stream
                                                        scratch_pool));
 }
 
+svn_error_t *
+svn_wc__get_pristine_contents_by_checksum(svn_stream_t **contents,
+                                          svn_wc_context_t *wc_ctx,
+                                          const char *wcroot_abspath,
+                                          const svn_checksum_t *sha1_checksum,
+                                          apr_pool_t *result_pool,
+                                          apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(svn_wc__db_pristine_read(contents, NULL, wc_ctx->db,
+                                                  wcroot_abspath, sha1_checksum,
+                                                  result_pool, scratch_pool));
+}
 
 svn_error_t *
 svn_wc__internal_remove_from_revision_control(svn_wc__db_t *db,

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql Fri May  4 20:46:54 2012
@@ -299,16 +299,23 @@ WHERE nodes_work.wc_id = ?1 AND nodes_wo
                                               AND op_depth > 0)
 
 -- STMT_SELECT_OP_DEPTH_MOVED_TO
-SELECT op_depth, moved_to
+SELECT op_depth, moved_to, repos_path, revision
 FROM nodes
-WHERE nodes.wc_id = ?1 AND nodes.local_relpath = ?2
- AND op_depth = (SELECT MIN(op_depth) FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2
+ AND op_depth <= (SELECT MIN(op_depth) FROM nodes
                   WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3)
+ORDER BY op_depth DESC
 
 -- STMT_SELECT_MOVED_TO
 SELECT moved_to
 FROM nodes
-WHERE nodes.wc_id = ?1 AND nodes.local_relpath = ?2 AND op_depth = ?3
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
+
+-- STMT_SELECT_MOVED_HERE
+SELECT moved_here, presence, repos_path, revision
+FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth >= ?3
+ORDER BY op_depth
                   
 -- STMT_DELETE_LOCK
 DELETE FROM lock

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c Fri May  4 20:46:54 2012
@@ -10183,6 +10183,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat
 static svn_error_t *
 follow_moved_to(apr_array_header_t **moved_tos,
                 int op_depth,
+                const char *repos_path,
+                svn_revnum_t revision,
                 svn_wc__db_wcroot_t *wcroot,
                 const char *local_relpath,
                 apr_pool_t *result_pool,
@@ -10191,9 +10193,11 @@ follow_moved_to(apr_array_header_t **mov
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
   int working_op_depth;
-  const char *node_relpath, *node_moved_to = NULL;
+  const char *ancestor_relpath, *node_moved_to = NULL;
   int i;
 
+  SVN_ERR_ASSERT((!op_depth && !repos_path) || (op_depth && repos_path));
+
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_OP_DEPTH_MOVED_TO));
   SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, local_relpath,
@@ -10203,58 +10207,112 @@ follow_moved_to(apr_array_header_t **mov
     {
       working_op_depth = svn_sqlite__column_int(stmt, 0);
       node_moved_to = svn_sqlite__column_text(stmt, 1, result_pool);
-      /* ### verify moved_here? */
-
-      if (node_moved_to)
+      if (!repos_path)
         {
-          struct svn_wc__db_moved_to_t *moved_to;
-
-          moved_to = apr_palloc(result_pool, sizeof(*moved_to));
-          moved_to->op_depth = working_op_depth;
-          moved_to->local_relpath = node_moved_to;
-          APR_ARRAY_PUSH(*moved_tos, struct svn_wc__db_moved_to_t *) = moved_to;
+          SVN_ERR(svn_sqlite__step(&have_row, stmt));
+          if (!have_row || svn_sqlite__column_revnum(stmt, 0))
+            return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND,
+                                     svn_sqlite__reset(stmt),
+                                     _("The base node '%s' was not found."),
+                                     path_for_error_message(wcroot,
+                                                            local_relpath,
+                                                            scratch_pool));
+          repos_path = svn_sqlite__column_text(stmt, 2, scratch_pool);
+          revision = svn_sqlite__column_revnum(stmt, 3);
         }
     }
   SVN_ERR(svn_sqlite__reset(stmt));
 
+  if (node_moved_to)
+    {
+      svn_boolean_t have_row2;
+
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                        STMT_SELECT_MOVED_HERE));
+      SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, node_moved_to,
+                                relpath_depth(node_moved_to)));
+      SVN_ERR(svn_sqlite__step(&have_row2, stmt));
+      if (!have_row2 || !svn_sqlite__column_int(stmt, 0)
+          || revision != svn_sqlite__column_revnum(stmt, 3)
+          || strcmp(repos_path, svn_sqlite__column_text(stmt, 2, NULL)))
+        node_moved_to = NULL;
+      SVN_ERR(svn_sqlite__reset(stmt));
+    }
+
+  if (node_moved_to)
+    {
+      struct svn_wc__db_moved_to_t *moved_to;
+
+      moved_to = apr_palloc(result_pool, sizeof(*moved_to));
+      moved_to->op_depth = working_op_depth;
+      moved_to->local_relpath = node_moved_to;
+      APR_ARRAY_PUSH(*moved_tos, struct svn_wc__db_moved_to_t *) = moved_to;
+    }
+
   /* A working row with moved_to, or no working row, and we are done. */
   if (node_moved_to || !have_row)
     return SVN_NO_ERROR;
 
   /* Need to handle being moved via an ancestor. */
-  node_relpath = local_relpath;
+  ancestor_relpath = local_relpath;
   for (i = relpath_depth(local_relpath); i > working_op_depth; --i)
     {
-      const char *node_moved_to_relpath;
+      const char *ancestor_moved_to;
 
-      node_relpath = svn_relpath_dirname(node_relpath, scratch_pool);
+      ancestor_relpath = svn_relpath_dirname(ancestor_relpath, scratch_pool);
 
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_SELECT_MOVED_TO));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, node_relpath,
+      SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, ancestor_relpath,
                                 working_op_depth));
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
       SVN_ERR_ASSERT(have_row);
-      node_moved_to_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool);
-      /* ### verify moved_here? */
+      ancestor_moved_to = svn_sqlite__column_text(stmt, 0, scratch_pool);
       SVN_ERR(svn_sqlite__reset(stmt));
-      if (node_moved_to_relpath)
+      if (ancestor_moved_to)
         {
-          struct svn_wc__db_moved_to_t *moved_to;
-          const char *moved_to_relpath
-            = svn_relpath_join(node_moved_to_relpath,
-                               svn_relpath_skip_ancestor(node_relpath,
+          node_moved_to
+            = svn_relpath_join(ancestor_moved_to,
+                               svn_relpath_skip_ancestor(ancestor_relpath,
                                                          local_relpath),
                                result_pool);
 
+          SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                            STMT_SELECT_MOVED_HERE));
+          SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, node_moved_to,
+                                    relpath_depth(ancestor_moved_to)));
+          SVN_ERR(svn_sqlite__step(&have_row, stmt));
+          if (!have_row)
+            ancestor_moved_to = NULL;
+          else if (!svn_sqlite__column_int(stmt, 0))
+            {
+              svn_wc__db_status_t presence
+                = svn_sqlite__column_token(stmt, 1, presence_map);
+              if (presence != svn_wc__db_status_not_present)
+                ancestor_moved_to = NULL;
+              else
+                {
+                  SVN_ERR(svn_sqlite__step(&have_row, stmt));
+                  if (!have_row && !svn_sqlite__column_int(stmt, 0))
+                    ancestor_moved_to = NULL;
+                }
+            }
+          SVN_ERR(svn_sqlite__reset(stmt));
+          if (!ancestor_moved_to)
+            break;
+          /* verify repos_path points back? */
+        }
+      if (ancestor_moved_to)
+        {
+          struct svn_wc__db_moved_to_t *moved_to;
+
           moved_to = apr_palloc(result_pool, sizeof(*moved_to));
           moved_to->op_depth = working_op_depth;
-          moved_to->local_relpath = moved_to_relpath;
+          moved_to->local_relpath = node_moved_to;
           APR_ARRAY_PUSH(*moved_tos, struct svn_wc__db_moved_to_t *) = moved_to;
 
-          SVN_ERR(follow_moved_to(moved_tos,
-                                  relpath_depth(node_moved_to_relpath),
-                                  wcroot, moved_to_relpath,
+          SVN_ERR(follow_moved_to(moved_tos, relpath_depth(ancestor_moved_to),
+                                  repos_path, revision, wcroot, node_moved_to,
                                   result_pool, scratch_pool));
           break;
         }
@@ -10283,7 +10341,8 @@ svn_wc__db_follow_moved_to(apr_array_hea
                               sizeof(struct svn_wc__db_moved_to_t *));
 
   /* ### Wrap in a transaction */
-  SVN_ERR(follow_moved_to(moved_tos, 0, wcroot, local_relpath,
+  SVN_ERR(follow_moved_to(moved_tos, 0, NULL, SVN_INVALID_REVNUM,
+                          wcroot, local_relpath,
                           result_pool, scratch_pool));
 
   /* ### Convert moved_to to abspath */

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svntest/main.py Fri May  4 20:46:54 2012
@@ -78,12 +78,8 @@ SVN_VER_MINOR = 8
 
 default_num_threads = 5
 
-# Set up logging
-logger = logging.getLogger()
-handler = logging.StreamHandler(sys.stdout)
-formatter = logging.Formatter('%(message)s')
-handler.setFormatter(formatter)
-logger.addHandler(handler)
+# Don't try to use this before calling execute_tests()
+logger = None
 
 
 class SVNProcessTerminatedBySignal(Failure):
@@ -1651,6 +1647,28 @@ def get_target_milestones_for_issues(iss
 
   return issue_dict
 
+
+class AbbreviatedFormatter(logging.Formatter):
+  """A formatter with abbreviated loglevel indicators in the output.
+
+  Use %(levelshort)s in the format string to get a single character
+  representing the loglevel..
+  """
+
+  _level_short = {
+    logging.CRITICAL : 'C',
+    logging.ERROR : 'E',
+    logging.WARNING : 'W',
+    logging.INFO : 'I',
+    logging.DEBUG : 'D',
+    logging.NOTSET : '-',
+    }
+
+  def format(self, record):
+    record.levelshort = self._level_short[record.levelno]
+    return logging.Formatter.format(self, record)
+
+
 # Main func.  This is the "entry point" that all the test scripts call
 # to run their list of tests.
 #
@@ -1661,6 +1679,7 @@ def execute_tests(test_list, serial_only
   exiting the process.  This function can be used when a caller doesn't
   want the process to die."""
 
+  global logger
   global pristine_url
   global pristine_greek_repos_url
   global svn_binary
@@ -1677,6 +1696,19 @@ def execute_tests(test_list, serial_only
 
   testnums = []
 
+  # Initialize the LOGGER global variable so the option parsing can set
+  # its loglevel, as appropriate.
+  logger = logging.getLogger()
+
+  # Did some chucklehead log something before we configured it? If they
+  # did, then a default handler/formatter would get installed. We want
+  # to be the one to install the first (and only) handler.
+  for handler in logger.handlers:
+    if not isinstance(handler.formatter, AbbreviatedFormatter):
+      raise Exception('Logging occurred before configuration. Some code'
+                      ' path needs to be fixed. Examine the log output'
+                      ' to find what/where logged something.')
+
   if not options:
     # Override which tests to run from the commandline
     (parser, args) = _parse_options()
@@ -1684,10 +1716,21 @@ def execute_tests(test_list, serial_only
   else:
     parser = _create_parser()
 
-  if options.log_with_timestamps:
-    formatter = logging.Formatter('[%(asctime)s] %(message)s',
-                                  '%Y-%m-%d %H:%M:%S')
+  # If there are no handlers registered yet, then install our own with
+  # our custom formatter. (anything currently installed *is* our handler
+  # as tested above)
+  if not logger.handlers:
+    # Now that we have some options, let's get the logger configured before
+    # doing anything more
+    if options.log_with_timestamps:
+      formatter = AbbreviatedFormatter('%(levelshort)s:'
+                                       ' [%(asctime)s] %(message)s',
+                                       datefmt='%Y-%m-%d %H:%M:%S')
+    else:
+      formatter = AbbreviatedFormatter('%(levelshort)s: %(message)s')
+    handler = logging.StreamHandler(sys.stdout)
     handler.setFormatter(formatter)
+    logger.addHandler(handler)
 
   # parse the positional arguments (test nums, names)
   for arg in test_selection:

Modified: subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_wc/op-depth-test.c Fri May  4 20:46:54 2012
@@ -4951,15 +4951,17 @@ mixed_rev_move(const svn_test_opts_t *op
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
 
-  /* ### These values are unchanged, is that right? */
   SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
                                      wc_path(&b, "A/B/C"), pool, pool));
-  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B/C"));
-  SVN_TEST_ASSERT(moved_tos->nelts == 1);
+  SVN_TEST_ASSERT(moved_tos->nelts == 0);
 
   SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
                                      wc_path(&b, "A/B"), pool, pool));
-  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X/B"));
+  SVN_TEST_ASSERT(moved_tos->nelts == 0);
+
+  SVN_ERR(svn_wc__db_follow_moved_to(&moved_tos, b.wc_ctx->db,
+                                     wc_path(&b, "A"), pool, pool));
+  SVN_ERR(check_moved_to(moved_tos, 0, 1, "X"));
   SVN_TEST_ASSERT(moved_tos->nelts == 1);
 
   return SVN_NO_ERROR;

Modified: subversion/branches/ev2-export/tools/dist/nightly.sh
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/dist/nightly.sh?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/dist/nightly.sh (original)
+++ subversion/branches/ev2-export/tools/dist/nightly.sh Fri May  4 20:46:54 2012
@@ -72,8 +72,8 @@ cd ..
 
 # Create the information page
 echo '-------------------moving results---------------------'
-./release.py --base-dir ${abscwd}/roll post-candidates trunk-nightly $head \
-    --target $target
+# ./release.py --base-dir ${abscwd}/roll post-candidates trunk-nightly $head \
+#     --target $target
 if [ ! -d "$target/dist" ]; then mkdir "$target/dist"; fi
 if [ -d "$target/dist/r$head" ]; then rm -r "$target/dist/r$head"; fi
 mv roll/deploy $target/dist/r$head

Modified: subversion/branches/ev2-export/tools/server-side/svnpubsub/svnwcsub.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/tools/server-side/svnpubsub/svnwcsub.py?rev=1334177&r1=1334176&r2=1334177&view=diff
==============================================================================
--- subversion/branches/ev2-export/tools/server-side/svnpubsub/svnwcsub.py (original)
+++ subversion/branches/ev2-export/tools/server-side/svnpubsub/svnwcsub.py Fri May  4 20:46:54 2012
@@ -110,6 +110,8 @@ class WorkingCopy(object):
             logging.info("autopopulate %s from %s" % (self.path, self.url))
             subprocess.check_call([svnbin, 'co', '-q',
                                    '--non-interactive',
+                                   '--config-option',
+                                   'config:miscellany:use-commit-times=on',
                                    '--', self.url, self.path],
                                   env=env)
 
@@ -242,6 +244,8 @@ class BackgroundWorker(threading.Thread)
                 '--non-interactive',
                 '--trust-server-cert',
                 '--ignore-externals',
+                '--config-option',
+                'config:miscellany:use-commit-times=on',
                 wc.path]
         subprocess.check_call(args, env=self.env)
 
@@ -257,6 +261,8 @@ class BackgroundWorker(threading.Thread)
         args = [self.svnbin, 'cleanup',
                 '--non-interactive',
                 '--trust-server-cert',
+                '--config-option',
+                'config:miscellany:use-commit-times=on',
                 wc.path]
         subprocess.check_call(args, env=self.env)
 



Mime
View raw message