You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2013/01/09 00:46:03 UTC

svn commit: r1430634 [6/7] - in /subversion/branches/ev2-export: ./ build/win32/ doc/ subversion/bindings/cxxhl/src/ subversion/bindings/swig/ruby/test/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ ...

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h Tue Jan  8 23:46:00 2013
@@ -995,12 +995,10 @@ svn_wc__db_pristine_get_sha1(const svn_c
 
 
 /* If necessary transfers the PRISTINE file of SRC_LOCAL_ABSPATH to the
-   working copy identified by DST_WRI_ABSPATH. If CHECKSUM is not NULL, use
-   CHECKSUM to identify which pristine file to transfer. */
+   working copy identified by DST_WRI_ABSPATH. */
 svn_error_t *
 svn_wc__db_pristine_transfer(svn_wc__db_t *db,
                              const char *src_local_abspath,
-                             const svn_checksum_t *checksum,
                              const char *dst_wri_abspath,
                              svn_cancel_func_t cancel_func,
                              void *cancel_baton,

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_pristine.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_pristine.c Tue Jan  8 23:46:00 2013
@@ -143,43 +143,30 @@ svn_wc__db_pristine_get_future_path(cons
   return SVN_NO_ERROR;
 }
 
-/* Data for pristine_read_txn(). */
-typedef struct pristine_read_baton_t
-{
-  /* Where to put the result stream. */
-  svn_stream_t **contents;
-  /* The pristine text's SHA-1 checksum. */
-  const svn_checksum_t *sha1_checksum;
-  /* The path to the pristine file (within the pristine store). */
-  const char *pristine_abspath;
-
-  /* Pointer to where to place the size (if requested) */
-  svn_filesize_t *size;
-
-  /* The pool from which to allocate the result stream. */
-  apr_pool_t *result_pool;
-} pristine_read_baton_t;
-
-/* Set (*BATON->contents) to a readable stream from which the pristine text
- * identified by BATON->sha1_checksum can be read from the pristine store of
- * SDB.  If that text is not in the pristine store, return an error.
+/* Set *CONTENTS to a readable stream from which the pristine text
+ * identified by SHA1_CHECKSUM and PRISTINE_ABSPATH can be read from the
+ * pristine store of WCROOT.  If SIZE is not null, set *SIZE to the size
+ * in bytes of that text. If that text is not in the pristine store,
+ * return an error.
  *
  * Even if the pristine text is removed from the store while it is being
  * read, the stream will remain valid and readable until it is closed.
  *
- * Allocate the stream in BATON->result_pool.
+ * Allocate the stream in RESULT_POOL.
  *
  * This function expects to be executed inside a SQLite txn.
  *
  * Implements 'notes/wc-ng/pristine-store' section A-3(d).
- * Implements svn_sqlite__transaction_callback_t. */
+ */
 static svn_error_t *
-pristine_read_txn(void *baton,
+pristine_read_txn(svn_stream_t **contents,
+                  svn_filesize_t *size,
                   svn_wc__db_wcroot_t *wcroot,
-                  const char *local_relpath,
+                  const svn_checksum_t *sha1_checksum,
+                  const char *pristine_abspath,
+                  apr_pool_t *result_pool,
                   apr_pool_t *scratch_pool)
 {
-  pristine_read_baton_t *b = baton;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
 
@@ -187,11 +174,11 @@ pristine_read_txn(void *baton,
    * of the file is not sufficient.) */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_PRISTINE_SIZE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, b->sha1_checksum, scratch_pool));
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
-  if (b->size)
-    *b->size = svn_sqlite__column_int64(stmt, 0);
+  if (size)
+    *size = svn_sqlite__column_int64(stmt, 0);
 
   SVN_ERR(svn_sqlite__reset(stmt));
   if (! have_row)
@@ -199,14 +186,14 @@ pristine_read_txn(void *baton,
       return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                                _("Pristine text '%s' not present"),
                                svn_checksum_to_cstring_display(
-                                 b->sha1_checksum, scratch_pool));
+                                 sha1_checksum, scratch_pool));
     }
 
   /* Open the file as a readable stream.  It will remain readable even when
    * deleted from disk; APR guarantees that on Windows as well as Unix. */
-  if (b->contents)
-    SVN_ERR(svn_stream_open_readonly(b->contents, b->pristine_abspath,
-                                     b->result_pool, scratch_pool));
+  if (contents)
+    SVN_ERR(svn_stream_open_readonly(contents, pristine_abspath,
+                                     result_pool, scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -221,7 +208,7 @@ svn_wc__db_pristine_read(svn_stream_t **
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
-  pristine_read_baton_t b;
+  const char *pristine_abspath;
 
   SVN_ERR_ASSERT(contents != NULL);
   SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
@@ -240,15 +227,14 @@ svn_wc__db_pristine_read(svn_stream_t **
                               wri_abspath, scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  b.contents = contents;
-  b.sha1_checksum = sha1_checksum;
-  b.size = size;
-  b.result_pool = result_pool;
-  SVN_ERR(get_pristine_fname(&b.pristine_abspath, wcroot->abspath,
+  SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
                              sha1_checksum,
                              scratch_pool, scratch_pool));
-  SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, pristine_read_txn, &b,
-                              scratch_pool));
+  SVN_WC__DB_WITH_TXN(
+    pristine_read_txn(contents, size,
+                      wcroot, sha1_checksum, pristine_abspath,
+                      result_pool, scratch_pool),
+    wcroot);
 
   return SVN_NO_ERROR;
 }
@@ -296,7 +282,7 @@ svn_wc__db_pristine_get_tempdir(const ch
  * acquired a 'RESERVED' lock.
  *
  * Implements 'notes/wc-ng/pristine-store' section A-3(a).
- * Implements svn_sqlite__transaction_callback_t. */
+ */
 static svn_error_t *
 pristine_install_txn(svn_sqlite__db_t *sdb,
                      /* The path to the source file that is to be moved into place. */
@@ -514,82 +500,55 @@ svn_wc__db_pristine_get_sha1(const svn_c
   return svn_error_trace(svn_sqlite__reset(stmt));
 }
 
-/* Baton for pristine_transfer() */
-struct pristine_transfer_baton
-{
-  svn_wc__db_wcroot_t *src_wcroot;
-  svn_wc__db_wcroot_t *dst_wcroot;
-  svn_cancel_func_t cancel_func;
-  void * cancel_baton;
-
-  /* The following fields are filled in by pristine_transfer(). */
-  /* The path to the source file that is to be moved into place. */
-  const char *tempfile_abspath;
-  /* The target path for the file (within the pristine store). */
-  const char *pristine_abspath;
-  /* The pristine text's SHA-1 checksum. */
-  const svn_checksum_t *sha1_checksum;
-  /* The pristine text's MD-5 checksum. */
-  const svn_checksum_t *md5_checksum;
-};
-
 /* Transaction implementation of svn_wc__db_pristine_transfer().
-   Calls itself again to obtain locks in both working copies */
+   We have a lock on DST_WCROOT and a lock on SRC_WCROOT.
+
+   Outputs:
+   *TEMPFILE_ABSPATH is the path to the source file that is to be moved
+   into place.
+   *PRISTINE_ABSPATH is the target path for the file (within the pristine
+   store).
+   *SHA1_CHECKSUM is the pristine text's SHA-1 checksum.
+   *MD5_CHECKSUM is the pristine text's MD-5 checksum.
+
+   If there is nothing to transfer (it is not found in the source, or is
+   already in the destination), then set *TEMPFILE_ABSPATH_P to NULL.
+ */
 static svn_error_t *
-pristine_transfer(void *baton, svn_wc__db_wcroot_t *wcroot,
-                  const char *local_relpath, apr_pool_t *scratch_pool)
+pristine_transfer_txn2(const char **tempfile_abspath,
+                       const char **pristine_abspath,
+                       const svn_checksum_t **sha1_checksum,
+                       const svn_checksum_t **md5_checksum,
+                       svn_wc__db_wcroot_t *src_wcroot,
+                       svn_wc__db_wcroot_t *dst_wcroot,
+                       const char *src_relpath,
+                       svn_cancel_func_t cancel_func,
+                       void *cancel_baton,
+                       apr_pool_t *scratch_pool)
 {
-  struct pristine_transfer_baton *tb = baton;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
 
-  /* Is this the initial call or the recursive call? */
-  if (wcroot == tb->dst_wcroot)
-    {
-      /* The initial call: */
-
-      /* Get all the info within a src wcroot lock */
-      SVN_ERR(svn_wc__db_with_txn(tb->src_wcroot, local_relpath,
-                                  pristine_transfer, tb, scratch_pool));
-
-      /* And do the final install, while we still have the dst lock */
-      if (tb->tempfile_abspath)
-        SVN_ERR(pristine_install_txn(tb->dst_wcroot->sdb,
-                                     tb->tempfile_abspath,
-                                     tb->pristine_abspath,
-                                     tb->sha1_checksum,
-                                     tb->md5_checksum,
-                                     scratch_pool));
-      return SVN_NO_ERROR;
-    }
-
-  /* We have a lock on tb->dst_wcroot and tb->src_wcroot */
-
-  /* Get the right checksum if it wasn't passed */
-  if (!tb->sha1_checksum)
-    {
-      SVN_ERR(svn_sqlite__get_statement(&stmt, tb->src_wcroot->sdb,
-                                        STMT_SELECT_NODE_INFO));
-
-      SVN_ERR(svn_sqlite__bindf(stmt, "is",
-                                 tb->src_wcroot->wc_id, local_relpath));
-
-      SVN_ERR(svn_sqlite__step(&have_row, stmt));
-
-      if (have_row)
-        SVN_ERR(svn_sqlite__column_checksum(&(tb->sha1_checksum), stmt, 6,
-                                            scratch_pool));
+  *tempfile_abspath = NULL;
 
-      SVN_ERR(svn_sqlite__reset(stmt));
+  /* Get the SHA1 checksum */
+  SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
+                                    STMT_SELECT_NODE_INFO));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is",
+                            src_wcroot->wc_id, src_relpath));
+  SVN_ERR(svn_sqlite__step(&have_row, stmt));
+  if (have_row)
+    SVN_ERR(svn_sqlite__column_checksum(sha1_checksum, stmt, 6,
+                                        scratch_pool));
+  SVN_ERR(svn_sqlite__reset(stmt));
 
-      if (!tb->sha1_checksum)
-        return SVN_NO_ERROR; /* Nothing to transfer */
-    }
+  if (! *sha1_checksum)
+    return SVN_NO_ERROR; /* Nothing to transfer */
 
   /* Check if we have the pristine in the destination wcroot */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, tb->dst_wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, dst_wcroot->sdb,
                                     STMT_SELECT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->sha1_checksum,
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, *sha1_checksum,
                                     scratch_pool));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
@@ -599,9 +558,9 @@ pristine_transfer(void *baton, svn_wc__d
     return SVN_NO_ERROR;
 
   /* Verify if the pristine actually exists and get the MD5 in one query */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, tb->src_wcroot->sdb,
+  SVN_ERR(svn_sqlite__get_statement(&stmt, src_wcroot->sdb,
                                     STMT_SELECT_PRISTINE));
-  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->sha1_checksum,
+  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, *sha1_checksum,
                                     scratch_pool));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
@@ -611,13 +570,13 @@ pristine_transfer(void *baton, svn_wc__d
                                _("The pristine text with checksum '%s' was "
                                  "not found"),
                                svn_checksum_to_cstring_display(
-                                        tb->sha1_checksum, scratch_pool));
+                                        *sha1_checksum, scratch_pool));
     }
-  SVN_ERR(svn_sqlite__column_checksum(&(tb->md5_checksum), stmt, 0,
+  SVN_ERR(svn_sqlite__column_checksum(md5_checksum, stmt, 0,
                                       scratch_pool));
   SVN_ERR(svn_sqlite__reset(stmt));
 
-  /* We now have read locks in both working copies, so we can safely copy the
+  /* We have read locks in both working copies, so we can safely copy the
      file to the temp location of the destination working copy */
   {
     svn_stream_t *src_stream;
@@ -626,14 +585,14 @@ pristine_transfer(void *baton, svn_wc__d
     const char *src_abspath;
 
     SVN_ERR(svn_stream_open_unique(&dst_stream, &tmp_abspath,
-                                   pristine_get_tempdir(tb->dst_wcroot,
+                                   pristine_get_tempdir(dst_wcroot,
                                                         scratch_pool,
                                                         scratch_pool),
                                    svn_io_file_del_on_pool_cleanup,
                                    scratch_pool, scratch_pool));
 
-    SVN_ERR(get_pristine_fname(&src_abspath, tb->src_wcroot->abspath,
-                               tb->sha1_checksum,
+    SVN_ERR(get_pristine_fname(&src_abspath, src_wcroot->abspath,
+                               *sha1_checksum,
                                scratch_pool, scratch_pool));
 
     SVN_ERR(svn_stream_open_readonly(&src_stream, src_abspath,
@@ -641,56 +600,86 @@ pristine_transfer(void *baton, svn_wc__d
 
     /* ### Should we verify the SHA1 or MD5 here, or is that too expensive? */
     SVN_ERR(svn_stream_copy3(src_stream, dst_stream,
-                             tb->cancel_func, tb->cancel_baton,
+                             cancel_func, cancel_baton,
                              scratch_pool));
 
     /* And now set the right information to install once we leave the
        src transaction */
 
-    SVN_ERR(get_pristine_fname(&(tb->pristine_abspath),
-                               tb->dst_wcroot->abspath,
-                               tb->sha1_checksum,
+    SVN_ERR(get_pristine_fname(pristine_abspath,
+                               dst_wcroot->abspath,
+                               *sha1_checksum,
                                scratch_pool, scratch_pool));
-    tb->tempfile_abspath = tmp_abspath;
+    *tempfile_abspath = tmp_abspath;
   }
   return SVN_NO_ERROR;
 }
 
+/* Transaction implementation of svn_wc__db_pristine_transfer().
+   We have a lock on DST_WCROOT.
+ */
+static svn_error_t *
+pristine_transfer_txn1(svn_wc__db_wcroot_t *src_wcroot,
+                       svn_wc__db_wcroot_t *dst_wcroot,
+                       const char *src_relpath,
+                       svn_cancel_func_t cancel_func,
+                       void *cancel_baton,
+                       apr_pool_t *scratch_pool)
+{
+  const char *tempfile_abspath;
+  const char *pristine_abspath;
+  const svn_checksum_t *sha1_checksum;
+  const svn_checksum_t *md5_checksum;
+
+  /* Get all the info within a src wcroot lock */
+  SVN_WC__DB_WITH_TXN(
+    pristine_transfer_txn2(&tempfile_abspath, &pristine_abspath,
+                           &sha1_checksum, &md5_checksum,
+                           src_wcroot, dst_wcroot, src_relpath,
+                           cancel_func, cancel_baton, scratch_pool),
+    src_wcroot);
+
+  /* And do the final install, while we still have the dst lock */
+  if (tempfile_abspath)
+    SVN_ERR(pristine_install_txn(dst_wcroot->sdb,
+                                 tempfile_abspath, pristine_abspath,
+                                 sha1_checksum, md5_checksum,
+                                 scratch_pool));
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_wc__db_pristine_transfer(svn_wc__db_t *db,
                              const char *src_local_abspath,
-                             const svn_checksum_t *checksum,
                              const char *dst_wri_abspath,
                              svn_cancel_func_t cancel_func,
                              void *cancel_baton,
                              apr_pool_t *scratch_pool)
 {
-  const char *src_relpath;
-  const char *dst_relpath;
-  struct pristine_transfer_baton tb;
-  memset(&tb, 0, sizeof(tb));
+  svn_wc__db_wcroot_t *src_wcroot, *dst_wcroot;
+  const char *src_relpath, *dst_relpath;
 
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&tb.src_wcroot, &src_relpath,
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&src_wcroot, &src_relpath,
                                                 db, src_local_abspath,
                                                 scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(tb.src_wcroot);
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&tb.dst_wcroot, &dst_relpath,
+  VERIFY_USABLE_WCROOT(src_wcroot);
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&dst_wcroot, &dst_relpath,
                                                 db, dst_wri_abspath,
                                                 scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(tb.dst_wcroot);
+  VERIFY_USABLE_WCROOT(dst_wcroot);
 
-  if (tb.src_wcroot == tb.dst_wcroot
-      || tb.src_wcroot->sdb == tb.dst_wcroot->sdb)
+  if (src_wcroot == dst_wcroot
+      || src_wcroot->sdb == dst_wcroot->sdb)
     {
       return SVN_NO_ERROR; /* Nothing to transfer */
     }
 
-  tb.cancel_func = cancel_func;
-  tb.cancel_baton = cancel_baton;
+  SVN_WC__DB_WITH_TXN(
+    pristine_transfer_txn1(src_wcroot, dst_wcroot, src_relpath,
+                           cancel_func, cancel_baton, scratch_pool),
+    dst_wcroot);
 
-  return svn_error_trace(svn_wc__db_with_txn(tb.dst_wcroot, src_relpath,
-                                             pristine_transfer, &tb,
-                                             scratch_pool));
+  return SVN_NO_ERROR;
 }
 
 
@@ -738,8 +727,7 @@ remove_file(const char *file_abspath,
  *
  * This function expects to be executed inside a SQLite txn that has already
  * acquired a 'RESERVED' lock.
- *
- * Implements svn_sqlite__transaction_callback_t. */
+ */
 static svn_error_t *
 pristine_remove_if_unreferenced_txn(svn_sqlite__db_t *sdb,
                                     svn_wc__db_wcroot_t *wcroot,

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h Tue Jan  8 23:46:00 2013
@@ -332,6 +332,16 @@ svn_wc__db_with_txn(svn_wc__db_wcroot_t 
                     void *cb_baton,
                     apr_pool_t *scratch_pool);
 
+/* Evaluate the expression EXPR within a transaction.
+ *
+ * Begin a transaction in WCROOT's DB; evaluate the expression EXPR, which would
+ * typically be a function call that does some work in DB; finally commit
+ * the transaction if EXPR evaluated to SVN_NO_ERROR, otherwise roll back
+ * the transaction.
+ */
+#define SVN_WC__DB_WITH_TXN(expr, wcroot) \
+  SVN_SQLITE__WITH_LOCK(expr, (wcroot)->sdb)
+
 
 /* Return CHILDREN mapping const char * names to svn_kind_t * for the
    children of LOCAL_RELPATH at OP_DEPTH. */

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_update_move.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_update_move.c Tue Jan  8 23:46:00 2013
@@ -73,7 +73,6 @@
 
 #include "svn_checksum.h"
 #include "svn_dirent_uri.h"
-#include "svn_editor.h"
 #include "svn_error.h"
 #include "svn_hash.h"
 #include "svn_wc.h"
@@ -83,6 +82,7 @@
 #include "private/svn_skel.h"
 #include "private/svn_sqlite.h"
 #include "private/svn_wc_private.h"
+#include "private/svn_editor.h"
 
 #include "wc.h"
 #include "props.h"
@@ -95,16 +95,20 @@
  * Receiver code.
  *
  * The receiver is an editor that, when driven with a certain change, will
- * merge the edits into the 'actual' layer of a moved subtree.
+ * merge the edits into the working/actual state of the move destination
+ * at MOVE_ROOT_DST_RELPATH (in struct tc_editor_baton), perhaps raising
+ * conflicts if necessary.
+ *
+ * The receiver should not need to refer directly to the move source, as
+ * the driver should provide all relevant information about the change to
+ * be made at the move destination.
  */
 
 struct tc_editor_baton {
   svn_skel_t **work_items;
   svn_wc__db_t *db;
   svn_wc__db_wcroot_t *wcroot;
-  const char *move_root_src_relpath;
   const char *move_root_dst_relpath;
-  int src_op_depth;
   svn_wc_conflict_version_t *old_version;
   svn_wc_conflict_version_t *new_version;
   svn_wc_notify_func2_t notify_func;
@@ -113,7 +117,12 @@ struct tc_editor_baton {
 };
 
 /* If LOCAL_RELPATH is shadowed then raise a tree-conflict on the root
-   of the obstruction if such a tree-conflict does not already exist. */
+   of the obstruction if such a tree-conflict does not already exist.
+
+   KIND is the node kind of ... ### what?
+
+   Set *IS_CONFLICTED ... ### if/iff what?
+ */
 static svn_error_t *
 check_tree_conflict(svn_boolean_t *is_conflicted,
                     struct tc_editor_baton *b,
@@ -178,12 +187,13 @@ check_tree_conflict(svn_boolean_t *is_co
 
   version = svn_wc_conflict_version_create2(b->old_version->repos_url,
                                             b->old_version->repos_uuid,
-                                            local_relpath,
+                                            local_relpath /* ### need *repos* relpath */,
                                             b->old_version->peg_rev,
-                                            kind,
+                                            kind /* ### need *old* kind for this node */,
                                             scratch_pool);
 
-  SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict, version,
+  /* What about switch? */
+  SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict, version, NULL /* ### derive from b->new_version & new kind? */,
                                               scratch_pool, scratch_pool));
   SVN_ERR(svn_wc__db_mark_conflict_internal(b->wcroot, conflict_root_relpath,
                                             conflict, scratch_pool));
@@ -212,12 +222,14 @@ mark_unversioned_add_conflict(struct tc_
 
   version = svn_wc_conflict_version_create2(b->old_version->repos_url,
                                             b->old_version->repos_uuid,
-                                            relpath,
+                                            relpath /* ### need *repos* relpath */,
                                             b->old_version->peg_rev,
-                                            kind,
+                                            kind /* ### need *old* kind for this node */,
                                             scratch_pool);
 
+  /* ### How about switch? */
   SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict, version,
+                                              NULL /* ### derive from b->new_version & new kind? */,
                                               scratch_pool, scratch_pool));
   SVN_ERR(svn_wc__db_mark_conflict_internal(b->wcroot, relpath,
                                             conflict, scratch_pool));
@@ -360,6 +372,9 @@ typedef struct working_node_version_t
   const svn_checksum_t *checksum; /* for files only */
 } working_node_version_t;
 
+/* ### ...
+ * ### need to pass in the node kinds (before & after)?
+ */
 static svn_error_t *
 create_conflict_markers(svn_skel_t **work_items,
                         const char *local_abspath,
@@ -377,9 +392,10 @@ create_conflict_markers(svn_skel_t **wor
   original_version = svn_wc_conflict_version_dup(
                        old_version->location_and_kind, scratch_pool);
   original_version->path_in_repos = repos_relpath;
-  original_version->node_kind = svn_node_file;
+  original_version->node_kind = svn_node_file;  /* ### ? */
   SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict_skel,
                                               original_version,
+                                              NULL /* ### derive from new_version & new kind? */,
                                               scratch_pool,
                                               scratch_pool));
   /* According to this func's doc string, it is "Currently only used for
@@ -420,7 +436,7 @@ update_working_props(svn_wc_notify_state
   SVN_ERR(svn_prop_diffs(propchanges, new_version->props, old_version->props,
                          result_pool));
   SVN_ERR(svn_wc__merge_props(conflict_skel, prop_state,
-                              NULL, &new_actual_props,
+                              &new_actual_props,
                               db, local_abspath,
                               old_version->props, old_version->props,
                               *actual_props, *propchanges,
@@ -495,6 +511,7 @@ tc_editor_alter_directory(void *baton,
 
       if (conflict_skel)
         {
+          /* ### need to pass in the node kinds (before & after)? */
           SVN_ERR(create_conflict_markers(b->work_items, dst_abspath,
                                           b->db, move_dst_repos_relpath,
                                           conflict_skel,
@@ -572,6 +589,7 @@ update_working_file(svn_skel_t **work_it
    * too. */
   if (conflict_skel)
     {
+      /* ### need to pass in the node kinds (before & after)? */
       SVN_ERR(create_conflict_markers(work_items, local_abspath, db,
                                       repos_relpath, conflict_skel,
                                       old_version, new_version,
@@ -611,6 +629,7 @@ update_working_file(svn_skel_t **work_it
    * too. */
   if (conflict_skel)
     {
+      /* ### need to pass in the node kinds (before & after)? */
       SVN_ERR(create_conflict_markers(work_items, local_abspath, db,
                                       repos_relpath, conflict_skel,
                                       old_version, new_version,
@@ -819,13 +838,7 @@ tc_editor_abort(void *baton,
   return SVN_NO_ERROR;
 }
 
-/* An editor.
- *
- * This editor will merge the edits into the 'actual' tree at
- * MOVE_ROOT_DST_RELPATH (in struct tc_editor_baton),
- * perhaps raising conflicts if necessary.
- *
- */
+/* The editor callback table implementing the receiver. */
 static const svn_editor_cb_many_t editor_ops = {
   tc_editor_add_directory,
   tc_editor_add_file,
@@ -878,7 +891,6 @@ get_tc_info(svn_wc_operation_t *operatio
   const apr_array_header_t *locations;
   svn_boolean_t tree_conflicted;
   svn_skel_t *conflict_skel;
-  svn_kind_t kind;
 
   /* ### Check for mixed-rev src or dst? */
 
@@ -904,75 +916,11 @@ get_tc_info(svn_wc_operation_t *operatio
                                                     scratch_pool));
   if (locations)
     {
+      SVN_ERR_ASSERT(locations->nelts >= 2);
       *old_version = APR_ARRAY_IDX(locations, 0,
                                      svn_wc_conflict_version_t *);
-      if (locations->nelts > 1)
-        *new_version = APR_ARRAY_IDX(locations, 1,
-                                     svn_wc_conflict_version_t *);
-      else
-        {
-          const char *repos_root_url;
-          const char *repos_uuid;
-          const char *repos_relpath;
-          svn_revnum_t revision;
-          svn_node_kind_t node_kind;
-          svn_wc__db_status_t status;
-
-          /* The scan dance: read_info then scan_delete then base_get
-             or scan_addition.  Use the internal/relpath functions
-             here? */
-          SVN_ERR(svn_wc__db_read_info(&status, &kind, &revision,
-                                       &repos_relpath, &repos_root_url,
-                                       &repos_uuid, NULL, NULL, NULL, NULL,
-                                       NULL, NULL, NULL, NULL, NULL, NULL,
-                                       NULL, NULL, NULL, NULL, NULL, NULL,
-                                       NULL, NULL, NULL, NULL, NULL,
-                                       db, src_abspath, result_pool,
-                                       scratch_pool));
-          if (status == svn_wc__db_status_deleted)
-            {
-              const char *base_del_abspath, *work_del_abspath;
-              SVN_ERR(svn_wc__db_scan_deletion(&base_del_abspath, NULL,
-                                               &work_del_abspath,
-                                               NULL, db, src_abspath,
-                                               scratch_pool, scratch_pool));
-              SVN_ERR_ASSERT(base_del_abspath || work_del_abspath);
-              if (base_del_abspath)
-                {
-                  SVN_ERR(svn_wc__db_base_get_info(NULL, &kind, &revision,
-                                                   &repos_relpath,
-                                                   &repos_root_url,
-                                                   &repos_uuid,
-                                                   NULL, NULL, NULL, NULL, NULL,
-                                                   NULL, NULL, NULL, NULL, NULL,
-                                                   db, src_abspath, result_pool,
-                                                   scratch_pool));
-                }
-              else if (work_del_abspath)
-                {
-                  work_del_abspath = svn_dirent_dirname(work_del_abspath,
-                                                        scratch_pool);
-                  SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &repos_relpath,
-                                                   &repos_root_url, &repos_uuid,
-                                                   NULL, NULL, NULL,
-                                                   &revision, NULL, NULL,
-                                                   db, work_del_abspath,
-                                                   scratch_pool, scratch_pool));
-                  repos_relpath = svn_relpath_join(repos_relpath,
-                                     svn_dirent_skip_ancestor(work_del_abspath,
-                                                              src_abspath),
-                                                   scratch_pool);
-                }
-            }
-
-          node_kind = svn__node_kind_from_kind(kind);
-          *new_version = svn_wc_conflict_version_create2(repos_root_url,
-                                                         repos_uuid,
-                                                         repos_relpath,
-                                                         revision,
-                                                         node_kind,
-                                                         scratch_pool);
-        }
+      *new_version = APR_ARRAY_IDX(locations, 1,
+                                   svn_wc_conflict_version_t *);
     }
 
   SVN_ERR(svn_wc__conflict_read_tree_conflict(local_change,
@@ -1039,7 +987,6 @@ update_moved_away_dir(svn_editor_t *tc_e
                       apr_hash_t *children_hash,
                       const char *src_relpath,
                       const char *dst_relpath,
-                      int src_op_depth,
                       const char *move_root_dst_relpath,
                       svn_revnum_t move_root_dst_revision,
                       svn_wc__db_t *db,
@@ -1093,7 +1040,7 @@ update_moved_away_subtree(svn_editor_t *
 
   SVN_ERR(update_moved_away_dir(tc_editor, add, src_children,
                                 src_relpath, dst_relpath,
-                                src_op_depth, move_root_dst_relpath,
+                                move_root_dst_relpath,
                                 move_root_dst_revision,
                                 db, wcroot, scratch_pool));
 
@@ -1177,7 +1124,6 @@ static svn_error_t *
 replace_moved_layer(const char *src_relpath,
                     const char *dst_relpath,
                     int src_op_depth,
-                    svn_wc__db_t *db,
                     svn_wc__db_wcroot_t *wcroot,
                     apr_pool_t *scratch_pool)
 {
@@ -1279,45 +1225,40 @@ drive_tree_conflict_editor(svn_editor_t 
   SVN_ERR(svn_editor_complete(tc_editor));
 
   SVN_ERR(replace_moved_layer(src_relpath, dst_relpath, src_op_depth,
-                              db, wcroot, scratch_pool));
+                              wcroot, scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
-struct update_moved_away_conflict_victim_baton {
-  svn_skel_t **work_items;
-  svn_wc__db_t *db;
-  svn_wc_operation_t operation;
-  svn_wc_conflict_reason_t local_change;
-  svn_wc_conflict_action_t incoming_change;
-  svn_wc_conflict_version_t *old_version;
-  svn_wc_conflict_version_t *new_version;
-  svn_wc_notify_func2_t notify_func;
-  void *notify_baton;
-  svn_cancel_func_t cancel_func;
-  void *cancel_baton;
-  apr_pool_t *result_pool;
-};
-
 /* The body of svn_wc__db_update_moved_away_conflict_victim(), which see.
- * An implementation of svn_wc__db_txn_callback_t. */
+ */
 static svn_error_t *
-update_moved_away_conflict_victim(void *baton,
+update_moved_away_conflict_victim(svn_skel_t **work_items,
+                                  svn_wc__db_t *db,
                                   svn_wc__db_wcroot_t *wcroot,
                                   const char *victim_relpath,
+                                  svn_wc_operation_t operation,
+                                  svn_wc_conflict_reason_t local_change,
+                                  svn_wc_conflict_action_t incoming_change,
+                                  svn_wc_conflict_version_t *old_version,
+                                  svn_wc_conflict_version_t *new_version,
+                                  svn_wc_notify_func2_t notify_func,
+                                  void *notify_baton,
+                                  svn_cancel_func_t cancel_func,
+                                  void *cancel_baton,
+                                  apr_pool_t *result_pool,
                                   apr_pool_t *scratch_pool)
 {
-  struct update_moved_away_conflict_victim_baton *b = baton;
   svn_editor_t *tc_editor;
   struct tc_editor_baton *tc_editor_baton;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
+  int src_op_depth;
 
   /* ### assumes wc write lock already held */
 
   /* Construct editor baton. */
   tc_editor_baton = apr_pcalloc(scratch_pool, sizeof(*tc_editor_baton));
-  tc_editor_baton->move_root_src_relpath = victim_relpath;
   SVN_ERR(svn_wc__db_scan_deletion_internal(
             NULL, &tc_editor_baton->move_root_dst_relpath, NULL, NULL,
             wcroot, victim_relpath, scratch_pool, scratch_pool));
@@ -1328,14 +1269,14 @@ update_moved_away_conflict_victim(void *
                                svn_dirent_join(wcroot->abspath, victim_relpath,
                                                scratch_pool),
                                scratch_pool));
-  tc_editor_baton->old_version= b->old_version;
-  tc_editor_baton->new_version= b->new_version;
-  tc_editor_baton->db = b->db;
+  tc_editor_baton->old_version= old_version;
+  tc_editor_baton->new_version= new_version;
+  tc_editor_baton->db = db;
   tc_editor_baton->wcroot = wcroot;
-  tc_editor_baton->work_items = b->work_items;
-  tc_editor_baton->notify_func = b->notify_func;
-  tc_editor_baton->notify_baton = b->notify_baton;
-  tc_editor_baton->result_pool = b->result_pool;
+  tc_editor_baton->work_items = work_items;
+  tc_editor_baton->notify_func = notify_func;
+  tc_editor_baton->notify_baton = notify_baton;
+  tc_editor_baton->result_pool = result_pool;
 
   /* ### TODO get from svn_wc__db_scan_deletion_internal? */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -1345,7 +1286,7 @@ update_moved_away_conflict_victim(void *
   if (have_row)
     SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
-    tc_editor_baton->src_op_depth = svn_sqlite__column_int(stmt, 0);
+    src_op_depth = svn_sqlite__column_int(stmt, 0);
   SVN_ERR(svn_sqlite__reset(stmt));
   if (!have_row)
     return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
@@ -1356,21 +1297,21 @@ update_moved_away_conflict_victim(void *
                                scratch_pool));
   /* Create the editor... */
   SVN_ERR(svn_editor_create(&tc_editor, tc_editor_baton,
-                            b->cancel_func, b->cancel_baton,
+                            cancel_func, cancel_baton,
                             scratch_pool, scratch_pool));
   SVN_ERR(svn_editor_setcb_many(tc_editor, &editor_ops, scratch_pool));
 
   /* ... and drive it. */
   SVN_ERR(drive_tree_conflict_editor(tc_editor,
-                                     tc_editor_baton->move_root_src_relpath,
+                                     victim_relpath,
                                      tc_editor_baton->move_root_dst_relpath,
-                                     tc_editor_baton->src_op_depth,
-                                     b->operation,
-                                     b->local_change, b->incoming_change,
+                                     src_op_depth,
+                                     operation,
+                                     local_change, incoming_change,
                                      tc_editor_baton->old_version,
                                      tc_editor_baton->new_version,
-                                     b->db, wcroot,
-                                     b->cancel_func, b->cancel_baton,
+                                     db, wcroot,
+                                     cancel_func, cancel_baton,
                                      scratch_pool));
 
   return SVN_NO_ERROR;
@@ -1388,12 +1329,16 @@ svn_wc__db_update_moved_away_conflict_vi
                                              apr_pool_t *result_pool,
                                              apr_pool_t *scratch_pool)
 {
-  struct update_moved_away_conflict_victim_baton b;
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
+  svn_wc_operation_t operation;
+  svn_wc_conflict_reason_t local_change;
+  svn_wc_conflict_action_t incoming_change;
+  svn_wc_conflict_version_t *old_version;
+  svn_wc_conflict_version_t *new_version;
 
-  SVN_ERR(get_tc_info(&b.operation, &b.local_change, &b.incoming_change,
-                      &b.old_version, &b.new_version,
+  SVN_ERR(get_tc_info(&operation, &local_change, &incoming_change,
+                      &old_version, &new_version,
                       db, victim_abspath,
                       scratch_pool, scratch_pool));
 
@@ -1402,17 +1347,15 @@ svn_wc__db_update_moved_away_conflict_vi
                                                 scratch_pool, scratch_pool));
   VERIFY_USABLE_WCROOT(wcroot);
 
-  b.work_items = work_items;
-  b.db = db;
-  b.notify_func = notify_func;
-  b.notify_baton = notify_baton;
-  b.cancel_func = cancel_func;
-  b.cancel_baton = cancel_baton;
-  b.result_pool = result_pool;
-
-  SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath,
-                              update_moved_away_conflict_victim, &b,
-                              scratch_pool));
+  SVN_WC__DB_WITH_TXN(
+    update_moved_away_conflict_victim(
+      work_items, db, wcroot, local_relpath,
+      operation, local_change, incoming_change,
+      old_version, new_version,
+      notify_func, notify_baton,
+      cancel_func, cancel_baton,
+      result_pool, scratch_pool),
+    wcroot);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_wcroot.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_wcroot.c Tue Jan  8 23:46:00 2013
@@ -685,7 +685,54 @@ try_symlink_as_dir:
     }
   else
     {
-      /* We found a wc-1 working copy directory.  */
+      /* We found something that looks like a wc-1 working copy directory.
+         However, if the format version is 12 and the .svn/entries file
+         is only 3 bytes long, then it's a breadcrumb in a wc-ng working
+         copy that's missing an .svn/wc.db, or its .svn/wc.db is corrupt. */
+      if (wc_format == SVN_WC__WC_NG_VERSION /* 12 */)
+        {
+          apr_finfo_t info;
+
+          /* Check attributes of .svn/entries */
+          const char *admin_abspath = svn_wc__adm_child(
+              local_abspath, SVN_WC__ADM_ENTRIES, scratch_pool);
+          svn_error_t *err = svn_io_stat(&info, admin_abspath, APR_FINFO_SIZE,
+                                         scratch_pool);
+
+          /* If the former does not succeed, something is seriously wrong. */
+          if (err)
+            return svn_error_createf(
+                SVN_ERR_WC_CORRUPT, err,
+                _("The working copy at '%s' is corrupt."),
+                svn_dirent_local_style(local_abspath, scratch_pool));
+          svn_error_clear(err);
+
+          if (3 == info.size)
+            {
+              /* Check existence of .svn/wc.db */
+              admin_abspath = svn_wc__adm_child(local_abspath, SDB_FILE,
+                                                scratch_pool);
+              err = svn_io_stat(&info, admin_abspath, APR_FINFO_SIZE,
+                                scratch_pool);
+              if (err && APR_STATUS_IS_ENOENT(err->apr_err))
+                {
+                  svn_error_clear(err);
+                  return svn_error_createf(
+                      SVN_ERR_WC_CORRUPT, NULL,
+                      _("The working copy database at '%s' is missing."),
+                      svn_dirent_local_style(local_abspath, scratch_pool));
+                }
+              else
+                /* We should never have reached this point in the code
+                   if .svn/wc.db exists; therefore it's best to assume
+                   it's corrupt. */
+                return svn_error_createf(
+                    SVN_ERR_WC_CORRUPT, err,
+                    _("The working copy database at '%s' is corrupt."),
+                    svn_dirent_local_style(local_abspath, scratch_pool));
+            }
+        }
+
       SVN_ERR(svn_wc__db_pdh_create_wcroot(wcroot,
                             apr_pstrdup(db->state_pool, local_abspath),
                             NULL, UNKNOWN_WC_ID, wc_format,

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/workqueue.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/workqueue.c Tue Jan  8 23:46:00 2013
@@ -383,10 +383,6 @@ svn_wc__wq_build_file_commit(svn_skel_t 
   SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
                                 local_abspath, result_pool, scratch_pool));
 
-  /* This are currently ignored, they are here for compat. */
-  svn_skel__prepend_int(FALSE, *work_item, result_pool);
-  svn_skel__prepend_int(FALSE, *work_item, result_pool);
-
   svn_skel__prepend_str(local_relpath, *work_item, result_pool);
 
   svn_skel__prepend_str(OP_FILE_COMMIT, *work_item, result_pool);
@@ -1320,7 +1316,7 @@ run_set_text_conflict_markers(svn_wc__db
         /* No conflict exists, create a basic skel */
         conflicts = svn_wc__conflict_skel_create(scratch_pool);
 
-        SVN_ERR(svn_wc__conflict_skel_set_op_update(conflicts, NULL,
+        SVN_ERR(svn_wc__conflict_skel_set_op_update(conflicts, NULL, NULL,
                                                     scratch_pool,
                                                     scratch_pool));
       }
@@ -1385,7 +1381,7 @@ run_set_property_conflict_marker(svn_wc_
         /* No conflict exists, create a basic skel */
         conflicts = svn_wc__conflict_skel_create(scratch_pool);
 
-        SVN_ERR(svn_wc__conflict_skel_set_op_update(conflicts, NULL,
+        SVN_ERR(svn_wc__conflict_skel_set_op_update(conflicts, NULL, NULL,
                                                     scratch_pool,
                                                     scratch_pool));
       }

Modified: subversion/branches/ev2-export/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/mod_authz_svn/mod_authz_svn.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/ev2-export/subversion/mod_authz_svn/mod_authz_svn.c Tue Jan  8 23:46:00 2013
@@ -87,6 +87,34 @@ create_authz_svn_dir_config(apr_pool_t *
   return conf;
 }
 
+/* canonicalize ACCESS_FILE based on the type of argument.
+ * If SERVER_RELATIVE is true, ACCESS_FILE is a relative
+ * path then ACCESS_FILE is converted to an absolute
+ * path rooted at the server root. */
+static const char *
+canonicalize_access_file(const char *access_file,
+                         svn_boolean_t server_relative,
+                         apr_pool_t *pool)
+{
+  if (svn_path_is_url(access_file))
+    {
+      access_file = svn_uri_canonicalize(access_file, pool);
+    }
+  else if (!svn_path_is_repos_relative_url(access_file))
+    {
+      if (server_relative)
+        access_file = ap_server_root_relative(pool, access_file);
+
+      access_file = svn_dirent_internal_style(access_file, pool);
+    }
+
+  /* We don't canonicalize repos relative urls since they get
+   * canonicalized inside svn_repos_authz_read2() when they
+   * are resolved. */
+
+  return access_file;
+}
+
 static const char *
 AuthzSVNAccessFile_cmd(cmd_parms *cmd, void *config, const char *arg1)
 {
@@ -96,10 +124,7 @@ AuthzSVNAccessFile_cmd(cmd_parms *cmd, v
     return "AuthzSVNAccessFile and AuthzSVNReposRelativeAccessFile "
            "directives are mutually exclusive.";
 
-  if (svn_path_is_repos_relative_url(arg1) || svn_path_is_url(arg1))
-    conf->access_file = arg1;
-  else
-    conf->access_file = ap_server_root_relative(cmd->pool, arg1);
+  conf->access_file = canonicalize_access_file(arg1, TRUE, cmd->pool);
 
   return NULL;
 }
@@ -116,7 +141,8 @@ AuthzSVNReposRelativeAccessFile_cmd(cmd_
     return "AuthzSVNAccessFile and AuthzSVNReposRelativeAccessFile "
            "directives are mutually exclusive.";
 
-  conf->repo_relative_access_file = arg1;
+  conf->repo_relative_access_file = canonicalize_access_file(arg1, FALSE,
+                                                             cmd->pool);
 
   return NULL;
 }

Modified: subversion/branches/ev2-export/subversion/mod_dav_svn/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/mod_dav_svn/authz.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/mod_dav_svn/authz.c (original)
+++ subversion/branches/ev2-export/subversion/mod_dav_svn/authz.c Tue Jan  8 23:46:00 2013
@@ -105,7 +105,6 @@ dav_svn__allow_list_repos(request_rec *r
   const char *uri;
   request_rec *subreq;
   svn_boolean_t allowed = FALSE;
-  authz_svn__subreq_bypass_func_t allow_read_bypass = NULL;
 
   /* Easy out:  if the admin has explicitly set 'SVNPathAuthz Off',
      then this whole callback does nothing. */
@@ -114,19 +113,8 @@ dav_svn__allow_list_repos(request_rec *r
       return TRUE;
     }
 
-  /* If bypass is specified and authz has exported the provider.
-     Otherwise, we fall through to the full version.  This should be
-     safer than allowing or disallowing all accesses if there is a
-     configuration error.
-     XXX: Is this the proper thing to do in this case? */
-  allow_read_bypass = dav_svn__get_pathauthz_bypass(r);
-  if (allow_read_bypass != NULL)
-    {
-      if (allow_read_bypass(r, "/", repos_name) == OK)
-        return TRUE;
-      else
-        return FALSE;
-    }
+  /* Do not use short_circuit mode: bypass provider expects R to be request to
+     the repository to find repository relative authorization file. */
 
   /* Build a Public Resource uri representing repository root. */
   uri =  svn_urlpath__join(dav_svn__get_root_dir(r),

Modified: subversion/branches/ev2-export/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/mod_dav_svn/version.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/ev2-export/subversion/mod_dav_svn/version.c Tue Jan  8 23:46:00 2013
@@ -149,6 +149,7 @@ get_vsn_options(apr_pool_t *p, apr_text_
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INHERITED_PROPS);
+  apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INLINE_PROPS);
   /* Mergeinfo is a special case: here we merely say that the server
    * knows how to handle mergeinfo -- whether the repository does too
    * is a separate matter.

Modified: subversion/branches/ev2-export/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/diff-cmd.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/diff-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/diff-cmd.c Tue Jan  8 23:46:00 2013
@@ -77,6 +77,12 @@ kind_to_word(svn_client_diff_summarize_k
     }
 }
 
+/* Baton for summarize_xml and summarize_regular */
+struct summarize_baton_t
+{
+  const char *anchor;
+};
+
 /* Print summary information about a given change as XML, implements the
  * svn_client_diff_summarize_func_t interface. The @a baton is a 'char *'
  * representing the either the path to the working copy root or the url
@@ -86,9 +92,10 @@ summarize_xml(const svn_client_diff_summ
               void *baton,
               apr_pool_t *pool)
 {
+  struct summarize_baton_t *b = baton;
   /* Full path to the object being diffed.  This is created by taking the
    * baton, and appending the target's relative path. */
-  const char *path = *(const char **)baton;
+  const char *path = b->anchor;
   svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
 
   /* Tack on the target path, so we can differentiate between different parts
@@ -125,7 +132,8 @@ summarize_regular(const svn_client_diff_
                   void *baton,
                   apr_pool_t *pool)
 {
-  const char *path = *(const char **)baton;
+  struct summarize_baton_t *b = baton;
+  const char *path = b->anchor;
 
   /* Tack on the target path, so we can differentiate between different parts
    * of the output when we're given multiple targets. */
@@ -176,6 +184,7 @@ svn_cl__diff(apr_getopt_t *os,
   svn_boolean_t ignore_properties =
     opt_state->diff.patch_compatible || opt_state->diff.ignore_properties;
   int i;
+  struct summarize_baton_t summarize_baton;
   const svn_client_diff_summarize_func_t summarize_func =
     (opt_state->xml ? summarize_xml : summarize_regular);
 
@@ -266,6 +275,17 @@ svn_cl__diff(apr_getopt_t *os,
       if (new_rev.kind != svn_opt_revision_unspecified)
         opt_state->end_revision = new_rev;
 
+      if (opt_state->new_target
+          && opt_state->start_revision.kind == svn_opt_revision_unspecified
+          && opt_state->end_revision.kind == svn_opt_revision_unspecified
+          && ! svn_path_is_url(old_target)
+          && ! svn_path_is_url(new_target))
+        {
+          /* We want the arbitrary_nodes_diff instead of just working nodes */
+          opt_state->start_revision.kind = svn_opt_revision_working;
+          opt_state->end_revision.kind = svn_opt_revision_working;
+        }
+
       if (opt_state->start_revision.kind == svn_opt_revision_unspecified)
         opt_state->start_revision.kind = svn_path_is_url(old_target)
           ? svn_opt_revision_head : svn_opt_revision_base;
@@ -350,16 +370,20 @@ svn_cl__diff(apr_getopt_t *os,
             target2 = svn_dirent_join(new_target, path, iterpool);
 
           if (opt_state->diff.summarize)
-            SVN_ERR(svn_client_diff_summarize2
-                    (target1,
-                     &opt_state->start_revision,
-                     target2,
-                     &opt_state->end_revision,
-                     opt_state->depth,
-                     ! opt_state->diff.notice_ancestry,
-                     opt_state->changelists,
-                     summarize_func, &target1,
-                     ctx, iterpool));
+            {
+              summarize_baton.anchor = target1;
+
+              SVN_ERR(svn_client_diff_summarize2(
+                                target1,
+                                &opt_state->start_revision,
+                                target2,
+                                &opt_state->end_revision,
+                                opt_state->depth,
+                                ! opt_state->diff.notice_ancestry,
+                                opt_state->changelists,
+                                summarize_func, &summarize_baton,
+                                ctx, iterpool));
+            }
           else
             SVN_ERR(svn_client_diff6(
                      options,
@@ -397,16 +421,19 @@ svn_cl__diff(apr_getopt_t *os,
               ? svn_opt_revision_head : svn_opt_revision_working;
 
           if (opt_state->diff.summarize)
-            SVN_ERR(svn_client_diff_summarize_peg2
-                    (truepath,
-                     &peg_revision,
-                     &opt_state->start_revision,
-                     &opt_state->end_revision,
-                     opt_state->depth,
-                     ! opt_state->diff.notice_ancestry,
-                     opt_state->changelists,
-                     summarize_func, &truepath,
-                     ctx, iterpool));
+            {
+              summarize_baton.anchor = truepath;
+              SVN_ERR(svn_client_diff_summarize_peg2(
+                                truepath,
+                                &peg_revision,
+                                &opt_state->start_revision,
+                                &opt_state->end_revision,
+                                opt_state->depth,
+                                ! opt_state->diff.notice_ancestry,
+                                opt_state->changelists,
+                                summarize_func, &summarize_baton,
+                                ctx, iterpool));
+            }
           else
             SVN_ERR(svn_client_diff_peg6(
                      options,

Modified: subversion/branches/ev2-export/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/log-cmd.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/log-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/log-cmd.c Tue Jan  8 23:46:00 2013
@@ -21,9 +21,6 @@
  * ====================================================================
  */
 
-#define APR_WANT_STRFUNC
-#define APR_WANT_STDIO
-#include <apr_want.h>
 #include <apr_fnmatch.h>
 
 #include "svn_client.h"

Modified: subversion/branches/ev2-export/subversion/svn/move-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/move-cmd.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/move-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/move-cmd.c Tue Jan  8 23:46:00 2013
@@ -85,8 +85,10 @@ svn_cl__move(apr_getopt_t *os,
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
 
   err = svn_client_move7(targets, dst_path,
-                         TRUE, opt_state->parents,
-                         opt_state->allow_mixed_rev,
+                         TRUE /* move_as_child */,
+                         opt_state->parents /* make_parents */,
+                         opt_state->allow_mixed_rev /* allow_mixed_revisions*/,
+                         FALSE /* metadata_only */,
                          opt_state->revprop_table,
                          (opt_state->quiet ? NULL : svn_cl__print_commit_info),
                          NULL, ctx, pool);

Modified: subversion/branches/ev2-export/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/status.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/status.c (original)
+++ subversion/branches/ev2-export/subversion/svn/status.c Tue Jan  8 23:46:00 2013
@@ -377,7 +377,7 @@ print_status(const char *cwd_abspath, co
 
           SVN_ERR
             (svn_cmdline_printf(pool,
-                                "%c%c%c%c%c%c%c %c   %6s   %6s %-12s %s%s%s%s\n",
+                                "%c%c%c%c%c%c%c %c %8s %8s %-12s %s%s%s%s\n",
                                 generate_status_code(combined_status(status)),
                                 generate_status_code(prop_status),
                                 status->wc_is_locked ? 'L' : ' ',
@@ -396,7 +396,7 @@ print_status(const char *cwd_abspath, co
         }
       else
         SVN_ERR(
-           svn_cmdline_printf(pool, "%c%c%c%c%c%c%c %c   %6s   %s%s%s%s\n",
+           svn_cmdline_printf(pool, "%c%c%c%c%c%c%c %c %8s   %s%s%s%s\n",
                               generate_status_code(combined_status(status)),
                               generate_status_code(prop_status),
                               status->wc_is_locked ? 'L' : ' ',

Modified: subversion/branches/ev2-export/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/svn.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/svn.c (original)
+++ subversion/branches/ev2-export/subversion/svn/svn.c Tue Jan  8 23:46:00 2013
@@ -2096,6 +2096,12 @@ sub_main(int argc, const char *argv[], a
         break;
       case opt_changelist:
         opt_state.changelist = apr_pstrdup(pool, opt_arg);
+        if (opt_state.changelist[0] == '\0')
+          {
+            err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                   _("Changelist names must not be empty"));
+            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          }
         apr_hash_set(changelists, opt_state.changelist,
                      APR_HASH_KEY_STRING, (void *)1);
         break;

Modified: subversion/branches/ev2-export/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/switch-cmd.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/switch-cmd.c Tue Jan  8 23:46:00 2013
@@ -176,6 +176,12 @@ svn_cl__switch(apr_getopt_t *os,
                                    "disable this check."),
                                    svn_dirent_local_style(target,
                                                           scratch_pool));
+      if (err->apr_err == SVN_ERR_RA_UUID_MISMATCH
+          || err->apr_err == SVN_ERR_WC_INVALID_SWITCH)
+        return svn_error_quick_wrap(
+                 err,
+                 _("'svn switch' does not support switching a working copy to "
+                   "a different repository"));
       return err;
     }
 

Modified: subversion/branches/ev2-export/subversion/svn/tree-conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/tree-conflicts.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/tree-conflicts.c (original)
+++ subversion/branches/ev2-export/subversion/svn/tree-conflicts.c Tue Jan  8 23:46:00 2013
@@ -104,12 +104,39 @@ svn_cl__get_human_readable_tree_conflict
   apr_pool_t *pool)
 {
   const char *action, *reason, *operation;
+  svn_node_kind_t incoming_kind;
+
   reason = reason_str(conflict);
   action = action_str(conflict);
   operation = svn_cl__operation_str_human_readable(conflict->operation, pool);
+
+  /* Determine the node kind of the incoming change. */
+  incoming_kind = svn_node_unknown;
+  if (conflict->action == svn_wc_conflict_action_edit ||
+      conflict->action == svn_wc_conflict_action_delete)
+    {
+      /* Change is acting on 'src_left' version of the node. */
+      if (conflict->src_left_version)
+        incoming_kind = conflict->src_left_version->node_kind;
+    }
+  else if (conflict->action == svn_wc_conflict_action_add ||
+           conflict->action == svn_wc_conflict_action_replace)
+    {
+      /* Change is acting on 'src_right' version of the node.
+       *
+       * ### For 'replace', the node kind is ambiguous. However, src_left
+       * ### is NULL for replace, so we must use src_right. */
+      if (conflict->src_right_version)
+        incoming_kind = conflict->src_right_version->node_kind;
+    }
+
   SVN_ERR_ASSERT(action && reason);
-  *desc = apr_psprintf(pool, _("local %s, incoming %s upon %s"),
-                       reason, action, operation);
+  *desc = apr_psprintf(pool, _("local %s %s, incoming %s %s upon %s"),
+                       svn_node_kind_to_word(conflict->node_kind),
+                       reason,
+                       svn_node_kind_to_word(incoming_kind),
+                       action,
+                       operation);
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/ev2-export/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnrdump/dump_editor.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/ev2-export/subversion/svnrdump/dump_editor.c Tue Jan  8 23:46:00 2013
@@ -31,6 +31,7 @@
 #include "svn_dirent_uri.h"
 
 #include "private/svn_subr_private.h"
+#include "private/svn_editor.h"
 
 #include "svnrdump.h"
 #include <assert.h>

Modified: subversion/branches/ev2-export/subversion/svnrdump/svnrdump.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnrdump/svnrdump.h?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnrdump/svnrdump.h (original)
+++ subversion/branches/ev2-export/subversion/svnrdump/svnrdump.h Tue Jan  8 23:46:00 2013
@@ -32,6 +32,8 @@
 #include "svn_delta.h"
 #include "svn_ra.h"
 
+#include "private/svn_editor.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */

Modified: subversion/branches/ev2-export/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svnserve/serve.c?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svnserve/serve.c (original)
+++ subversion/branches/ev2-export/subversion/svnserve/serve.c Tue Jan  8 23:46:00 2013
@@ -284,11 +284,15 @@ svn_error_t *load_authz_config(server_ba
     {
       const char *case_force_val;
 
-      if (!svn_path_is_repos_relative_url(authzdb_path) &&
-          !svn_path_is_url(authzdb_path))
+      /* Canonicalize and add the base onto the authzdb_path (if needed).
+       * We don't canonicalize repos relative urls since they are
+       * canonicalized when they are resolved in svn_repos_authz_read2(). */
+      if (svn_path_is_url(authzdb_path))
+        {
+          authzdb_path = svn_uri_canonicalize(authzdb_path, pool);
+        }
+      else if (!svn_path_is_repos_relative_url(authzdb_path))
         {
-          /* Canonicalize and add the base onto authzdb_path (if needed)
-           * when authzdb_path is not a URL (repos relative or absolute). */
           authzdb_path = svn_dirent_canonicalize(authzdb_path, pool);
           authzdb_path = svn_dirent_join(server->base, authzdb_path, pool);
         }

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/changelist_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/changelist_tests.py?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/changelist_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/changelist_tests.py Tue Jan  8 23:46:00 2013
@@ -1189,57 +1189,6 @@ def readd_after_revert(sbox):
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'add', dummy)
 
-def empty_pseudo_changelist(sbox):
-  "the empty pseudo-changelist"
-
-  # Boilerplate.
-  sbox.build(read_only = True)
-  wc_dir = sbox.wc_dir
-
-  # Helper functions.
-
-  def found_nodes(*args):
-    # Extract the Greek-tree-relative paths.
-    return set(map(lambda info: info['Path'][len(wc_dir)+1:],
-                    svntest.actions.run_and_parse_info(*args)))
-
-  def find_nodes(nodeset, *args):
-    assert isinstance(nodeset, set)
-    foundset = found_nodes(*args)
-    nodeset = set(map(lambda path: path.replace('/', os.path.sep), nodeset))
-    if nodeset != foundset:
-      raise svntest.Failure("Expected nodeset %s but found %s"
-                            % (nodeset, foundset))
-
-  # Convenience variables.
-  E_path = sbox.ospath('A/B/E')
-  alpha_path = sbox.ospath('A/B/E/alpha')
-  beta_path = sbox.ospath('A/B/E/beta')
-  iota_path = sbox.ospath('iota')
-
-  # Can't add an item to the empty changelist.
-  expected_err = 'svn: E125014: .*'
-  svntest.actions.run_and_verify_svn(None, [], expected_err,
-                                     'changelist', '', iota_path)
-
-  # Modify alpha and beta
-  svntest.main.file_append(alpha_path, "More stuff in alpha\n")
-  svntest.main.file_append(beta_path, "More stuff in beta\n")
-
-  # Add beta to 'testlist'.
-  svntest.actions.run_and_verify_svn(None, None, [],
-                                     'changelist', 'testlist', beta_path)
-
-  # Convenience variables.
-  changelist = {
-    'testlist' : set(['A/B/E/beta']),
-    '' : set(['A/B/E', 'A/B/E/alpha']),
-  }
-
-  # Some basic validations.
-  find_nodes(changelist['testlist'] | changelist[''], '-R', E_path)
-  find_nodes(changelist['testlist'], '--cl', 'testlist', '-R', E_path)
-  find_nodes(changelist[''], '--cl', '', '-R', E_path)
 
 ########################################################################
 # Run the tests
@@ -1263,7 +1212,6 @@ test_list = [ None,
               add_remove_non_existent_target,
               add_remove_unversioned_target,
               readd_after_revert,
-              empty_pseudo_changelist,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/diff_tests.py?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/diff_tests.py Tue Jan  8 23:46:00 2013
@@ -3343,6 +3343,12 @@ def diff_url_against_local_mods(sbox):
   # In A2, do the same changes but leave uncommitted.
   make_file_edit_del_add(A2)
 
+  # Diff Path of A against working copy of A2.
+  # Output using arbritrary diff handling should be empty.
+  expected_output = []
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'diff', '--old', A, '--new', A2)
+
   # Diff URL of A against working copy of A2. Output should be empty.
   expected_output = []
   svntest.actions.run_and_verify_svn(None, expected_output, [],
@@ -3767,24 +3773,31 @@ def diff_git_with_props_on_dir(sbox):
   # Now commit the local mod, creating rev 2.
   expected_output = svntest.wc.State(wc_dir, {
     '.' : Item(verb='Sending'),
+    'A' : Item(verb='Sending'),
     })
 
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.add({
     '' : Item(status='  ', wc_rev=2),
     })
+  expected_status.tweak('A', wc_rev=2)
 
-  svntest.main.run_svn(None, 'ps', 'a','b', wc_dir)
+  sbox.simple_propset('k','v', '', 'A')
   svntest.actions.run_and_verify_commit(wc_dir, expected_output,
                                         expected_status, None, wc_dir)
 
   was_cwd = os.getcwd()
   os.chdir(wc_dir)
-  expected_output = make_git_diff_header(".", "", "revision 1",
+  expected_output = make_git_diff_header("A", "A", "revision 1",
+                                         "revision 2",
+                                         add=False, text_changes=False) + \
+                    make_diff_prop_header("A") + \
+                    make_diff_prop_added("k", "v") + \
+                    make_git_diff_header(".", "", "revision 1",
                                          "revision 2",
                                          add=False, text_changes=False) + \
                     make_diff_prop_header("") + \
-                    make_diff_prop_added("a", "b")
+                    make_diff_prop_added("k", "v")
 
   svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
                                      '-c2', '--git')
@@ -3979,7 +3992,7 @@ def diff_arbitrary_files_and_dirs(sbox):
   wc_dir = sbox.wc_dir
 
   # diff iota with A/mu
-  expected_output = make_diff_header("mu", "working copy", "working copy",
+  expected_output = make_diff_header("iota", "working copy", "working copy",
                                      "iota", "A/mu") + [
                       "@@ -1 +1 @@\n",
                       "-This is the file 'iota'.\n",
@@ -4116,6 +4129,28 @@ def diff_properties_no_newline(sbox):
 
   os.chdir(old_cwd)
 
+def diff_arbitrary_same(sbox):
+  "diff arbitrary files and dirs but same"
+
+  sbox.build(read_only = True)
+
+  sbox.simple_propset('k', 'v', 'A', 'A/mu', 'A/D/G/pi')
+
+  svntest.main.file_write(sbox.ospath('A/mu'), "new mu")
+
+  sbox.simple_copy('A', 'A2')
+
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'diff',
+                                     '--old', sbox.ospath('A'),
+                                     '--new', sbox.ospath('A2'))
+
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'diff', '--summarize',
+                                     '--old', sbox.ospath('A'),
+                                     '--new', sbox.ospath('A2'))
+
+
 ########################################################################
 #Run the tests
 
@@ -4188,6 +4223,7 @@ test_list = [ None,
               diff_arbitrary_files_and_dirs,
               diff_properties_only,
               diff_properties_no_newline,
+              diff_arbitrary_same,
               ]
 
 if __name__ == '__main__':

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/export_tests.py?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/export_tests.py Tue Jan  8 23:46:00 2013
@@ -370,9 +370,12 @@ def export_working_copy_at_base_revision
   gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
   E_path = os.path.join(wc_dir, 'A', 'B', 'E')
   rho_path = os.path.join(wc_dir, 'A', 'D', 'G', 'rho')
+  H_path = os.path.join(wc_dir, 'A', 'D', 'H')
+  phi_path = os.path.join(wc_dir, 'A', 'D', 'H', 'phi')
+  chi_path = os.path.join(wc_dir, 'A', 'D', 'H', 'chi')
 
   # Make some local modifications: modify mu and C, add kappa and K, delete
-  # gamma and E, and replace rho.  (Directories can't yet be replaced.)
+  # gamma and E, and replace rho and H.
   # These modifications should *not* get exported at the base revision.
   svntest.main.file_append(mu_path, 'Appended text')
   svntest.main.run_svn(None, 'propset', 'p', 'v', mu_path, C_path)
@@ -383,6 +386,12 @@ def export_working_copy_at_base_revision
   svntest.main.run_svn(None, 'rm', rho_path)
   svntest.main.file_append(rho_path, "Replacement file 'rho'.")
   svntest.main.run_svn(None, 'add', rho_path)
+  svntest.main.run_svn(None, 'rm', H_path)
+  svntest.main.run_svn(None, 'mkdir', H_path)
+  svntest.main.file_append(phi_path, "This is the file 'phi'.")
+  svntest.main.run_svn(None, 'add', phi_path)
+  svntest.main.file_append(chi_path, "Replacement file 'chi'.")
+  svntest.main.run_svn(None, 'add', chi_path)
 
   # Note that we don't tweak the expected disk tree at all,
   # since the modifications should not be present.

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/info_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/info_tests.py?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/info_tests.py Tue Jan  8 23:46:00 2013
@@ -173,7 +173,7 @@ def info_with_tree_conflicts(sbox):
     path = os.path.join(G, fname)
 
     # check plain info
-    expected_str1 = ".*local %s, incoming %s.*" % (reason, action)
+    expected_str1 = ".*local file %s, incoming file %s.*" % (reason, action)
     expected_info = { 'Tree conflict' : expected_str1 }
     svntest.actions.run_and_verify_info([expected_info], path)
 
@@ -197,7 +197,7 @@ def info_with_tree_conflicts(sbox):
   expected_infos = [{ 'Path' : re.escape(G) }]
   for fname, action, reason in scenarios:
     path = os.path.join(G, fname)
-    tree_conflict_re = ".*local %s, incoming %s.*" % (reason, action)
+    tree_conflict_re = ".*local file %s, incoming file %s.*" % (reason, action)
     expected_infos.append({ 'Path' : re.escape(path),
                             'Tree conflict' : tree_conflict_re })
   expected_infos.sort(key=lambda info: info['Path'])

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/merge_authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_authz_tests.py?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/merge_authz_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/merge_authz_tests.py Tue Jan  8 23:46:00 2013
@@ -184,7 +184,7 @@ def mergeinfo_and_skipped_paths(sbox):
     'C'         : Item(),
     })
   expected_skip = wc.State(A_COPY_path, {
-    'B/E'       : Item(),
+    'B/E'       : Item(verb='Skipped missing target'),
     })
   svntest.actions.run_and_verify_merge(A_COPY_path, '4', '8',
                                        sbox.repo_url + '/A', None,
@@ -256,9 +256,9 @@ def mergeinfo_and_skipped_paths(sbox):
     'C'         : Item(),
     })
   expected_skip = wc.State(A_COPY_2_path, {
-    'B/E'              : Item(),
-    'D/G/rho'          : Item(),
-    'D/H/psi'          : Item(),
+    'B/E'     : Item(verb='Skipped missing target'),
+    'D/G/rho' : Item(verb='Skipped'),
+    'D/H/psi' : Item(verb='Skipped missing target'),
     })
   svntest.actions.run_and_verify_merge(A_COPY_2_path, '4', '8',
                                        sbox.repo_url + '/A', None,
@@ -323,7 +323,8 @@ def mergeinfo_and_skipped_paths(sbox):
     'mu'        : Item("This is the file 'mu'.\n"),
     'C'         : Item(),
     })
-  expected_skip = wc.State(A_COPY_3_path, {'B/E' : Item()})
+  expected_skip = wc.State(A_COPY_3_path,
+                           {'B/E' : Item(verb='Skipped missing target')})
   svntest.actions.run_and_verify_merge(A_COPY_3_path, '5', '7',
                                        sbox.repo_url + '/A', None,
                                        expected_output,
@@ -361,7 +362,7 @@ def mergeinfo_and_skipped_paths(sbox):
     'chi'   : Item("This is the file 'chi'.\n"),
     })
   expected_skip = wc.State(A_COPY_2_H_path, {
-    'psi'   : Item(),
+    'psi'   : Item(verb='Skipped missing target'),
     })
   # Note we don't bother checking expected mergeinfo output because the
   # multiple merges being performed here, -c5 and -c8, will result in
@@ -470,7 +471,7 @@ def mergeinfo_and_skipped_paths(sbox):
                    props={SVN_PROP_MERGEINFO : '/A/D/H/zeta:9'}),
     })
   expected_skip = wc.State(A_COPY_2_H_path, {
-    'psi' : Item(),
+    'psi' : Item(verb='Skipped missing target'),
     })
   svntest.actions.run_and_verify_merge(A_COPY_2_H_path, '4', '9',
                                        sbox.repo_url + '/A/D/H', None,

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/merge_reintegrate_tests.py Tue Jan  8 23:46:00 2013
@@ -832,7 +832,7 @@ def reintegrate_on_shallow_wc(sbox):
   expected_A_disk.tweak('D', props={SVN_PROP_MERGEINFO : '/A_COPY/D:2-4*'})
   # ... a depth-restricted item is skipped ...
   expected_A_skip.add({
-      'D/H/psi' : Item()
+      'D/H/psi' : Item(verb='Skipped')
   })
   # Currently this fails due to r1424469.  For a full explanation see
   # http://svn.haxx.se/dev/archive-2012-12/0472.shtml
@@ -1267,8 +1267,7 @@ def reintegrate_with_subtree_mergeinfo(s
   #      rev N+3.  The renamed subtree on 'branch' now has additional explicit
   #      mergeinfo decribing the synch merge from trunk@N+1 to trunk@N+2.
   #
-  #   E) Reintegrate 'branch' to 'trunk'.  This fails as it appears not all
-  #      of 'trunk' was previously merged to 'branch'
+  #   E) Reintegrate 'branch' to 'trunk'.
   #
   #                                       Step:   A   B    C   D    E
   #   A_COPY_3    ---[9]--

Modified: subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py?rev=1430634&r1=1430633&r2=1430634&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py Tue Jan  8 23:46:00 2013
@@ -1490,7 +1490,7 @@ def merge_skips_obstructions(sbox):
     'Q/bar'  : Item(status='  ', wc_rev='-', copied='+'),
     })
   expected_skip = wc.State(C_path, {
-    'foo' : Item(),
+    'foo' : Item(verb='Skipped'),
     })
   # Unversioned:
   svntest.main.file_append(os.path.join(C_path, "foo"), "foo")
@@ -1534,8 +1534,8 @@ def merge_skips_obstructions(sbox):
     'foo'  : Item(status='A ', wc_rev='-', copied='+'),
     })
   expected_skip = wc.State(C_path, {
-    'Q'     : Item(),
-    'Q/bar' : Item(),
+    'Q'     : Item(verb='Skipped'),
+    'Q/bar' : Item(verb='Skipped'),
     })
 
   svntest.actions.run_and_verify_merge(C_path, '1', '2', F_url, None,
@@ -1595,8 +1595,8 @@ def merge_skips_obstructions(sbox):
   # No-op merge still sets mergeinfo
   expected_status.tweak('', status=' M')
   expected_skip = wc.State(wc_dir, {
-    'iota'   : Item(),
-    'A/D/G'  : Item(),
+    'iota'  : Item(verb='Skipped'),
+    'A/D/G' : Item(verb='Skipped'),
     })
   svntest.actions.run_and_verify_merge(wc_dir, '2', '3',
                                        sbox.repo_url, None,
@@ -1657,7 +1657,7 @@ def merge_skips_obstructions(sbox):
   expected_disk.remove('A/D/G')
   expected_disk.tweak('', props={SVN_PROP_MERGEINFO : '/:4'})
   expected_skip = wc.State(wc_dir, {
-    'A/B/lambda'  : Item(),
+    'A/B/lambda' : Item(verb='Skipped'),
     })
   # No-op merge still sets mergeinfo.
   expected_status_short = expected_status.copy(wc_dir)
@@ -1705,6 +1705,9 @@ def merge_skips_obstructions(sbox):
   expected_disk.remove('A/B/lambda')
   expected_status.tweak('A/B/lambda', status='! ')
   expected_status.tweak('', status='  ')
+  expected_skip = wc.State(wc_dir, {
+    'A/B/lambda' : Item(verb='Skipped missing target'),
+    })
   # Why do we need to --ignore-ancestry?  Because the previous merge of r4,
   # despite being inoperative, set mergeinfo for r4 on the WC.  With the
   # advent of merge tracking this repeat merge attempt would not be attempted.
@@ -1803,10 +1806,9 @@ def merge_into_missing(sbox):
     'Q/baz'    : Item(status='! ', wc_rev=3),
   })
   expected_skip = wc.State(F_path, {
-    'Q'   : Item(),
-    'foo' : Item(),
+    'Q'   : Item(verb='Skipped missing target'),
+    'foo' : Item(verb='Skipped missing target'),
     })
-
   # Use --ignore-ancestry because merge tracking aware merges raise an
   # error when the merge target is missing subtrees due to OS-level
   # deletes.
@@ -7822,8 +7824,8 @@ def merge_to_sparse_directories(sbox):
                               "prop:name" : "propval"}),
     })
   expected_skip = svntest.wc.State(immediates_dir, {
-    'D/H/omega'         : Item(),
-    'B/E/beta'          : Item(),
+    'D/H/omega' : Item(verb="Skipped"),
+    'B/E/beta'  : Item(verb="Skipped"),
     })
   svntest.actions.run_and_verify_merge(immediates_dir, '4', '9',
                                        sbox.repo_url + '/A', None,
@@ -7876,8 +7878,9 @@ def merge_to_sparse_directories(sbox):
                        props={SVN_PROP_MERGEINFO : '/A/mu:5-9'}),
     })
   expected_skip = svntest.wc.State(files_dir, {
-    'D/H/omega'       : Item(),
-    'B/E/beta'        : Item(),
+    'D'         : Item(verb="Skipped"),
+    'D/H/omega' : Item(verb="Skipped"),
+    'B/E/beta'  : Item(verb="Skipped"),
     })
   svntest.actions.run_and_verify_merge(files_dir, '4', '9',
                                        sbox.repo_url + '/A', None,
@@ -7919,9 +7922,10 @@ def merge_to_sparse_directories(sbox):
                               "prop:name" : "propval"}),
     })
   expected_skip = svntest.wc.State(empty_dir, {
-    'mu'               : Item(),
-    'D/H/omega'        : Item(),
-    'B/E/beta'         : Item(),
+    'mu'        : Item(verb="Skipped missing target"),
+    'D'         : Item(verb="Skipped"),
+    'D/H/omega' : Item(verb="Skipped"),
+    'B/E/beta'  : Item(verb="Skipped"),
     })
   svntest.actions.run_and_verify_merge(empty_dir, '4', '9',
                                        sbox.repo_url + '/A', None,
@@ -15408,9 +15412,10 @@ def skipped_files_get_correct_mergeinfo(
     'D/gamma'   : Item("This is the file 'gamma'.\n"),
     'D/H'       : Item(props={SVN_PROP_MERGEINFO : '/A/D/H:2*,3,4-8*'}),
     })
-  expected_skip = wc.State(A_COPY_path,
-                           {'D/H/psi'   : Item(),
-                            'D/H/omega' : Item()})
+  expected_skip = wc.State(
+    A_COPY_path,
+    {'D/H/psi'   : Item(verb='Skipped missing target'),
+     'D/H/omega' : Item(verb='Skipped missing target')})
   expected_output = wc.State(A_COPY_path,
                              {'B/E/beta'  : Item(status='U '),
                               'D/G/rho'   : Item(status='U ')})
@@ -17860,6 +17865,96 @@ def merge_with_externals_with_mergeinfo(
     [], 'merge', '--reintegrate', sbox.repo_url + '/A_COPY',
     A_path)
 
+#----------------------------------------------------------------------
+# Test for issue #4221 'Trivial merge of a binary file with svn:keywords
+# raises a conflict'.
+@SkipUnless(server_has_mergeinfo)
+@Issue(4221)
+@XFail()
+def merge_binary_file_with_keywords(sbox):
+  "merge binary file with keywords"
+
+  sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
+
+  # make a 'binary' file with keyword expansion enabled
+  svntest.main.file_write('foo', "Line 1 with $Revision: $ keyword.\n")
+  sbox.simple_add('foo')
+  sbox.simple_propset('svn:mime-type', 'application/octet-stream', 'foo')
+  sbox.simple_propset('svn:keywords', 'Revision', 'foo')
+  sbox.simple_commit()
+
+  # branch the file
+  sbox.simple_copy('foo', 'bar')
+  sbox.simple_commit()
+
+  # modify the branched version (although the bug shows even if we modify
+  # just the original version -- or neither, which is a completely
+  # degenerate 'merge' case)
+  # ### Perhaps a dir merge would behave differently from a single-file merge?
+  svntest.main.file_append('bar', "Line 2.\n")
+  sbox.simple_commit()
+
+  # merge back
+  svntest.actions.run_and_verify_svn(
+    None,
+    expected_merge_output([[3,4]],
+                          ['U    foo\n',
+                           ' U   foo\n'],
+                          target='foo'),
+    [], 'merge', '^/bar', 'foo')
+
+#----------------------------------------------------------------------
+# Test for issue #4155 'Merge conflict text of expanded keyword incorrect
+# when svn:keyword property value removed'. Failed in 1.7.0 through 1.7.8.
+@SkipUnless(server_has_mergeinfo)
+@Issue(4155)
+def merge_conflict_when_keywords_removed(sbox):
+  "merge conflict when keywords removed"
+
+  sbox.build()
+  os.chdir(sbox.wc_dir)
+  sbox.wc_dir = ''
+
+  # make a file with keyword expansion enabled
+  svntest.main.file_write('A/keyfile', "$Date$ $Revision$\n")
+  sbox.simple_add('A/keyfile')
+  sbox.simple_propset('svn:keywords', 'Date Revision', 'A/keyfile')
+  sbox.simple_commit()
+  sbox.simple_update()
+
+  # branch the file
+  sbox.simple_repo_copy('A', 'A2')
+  sbox.simple_update()
+
+  #
+  svntest.main.file_append('A/keyfile', " some changes\n")
+  sbox.simple_commit()
+
+  # sync merge
+  svntest.actions.run_and_verify_svn(
+    None,
+    expected_merge_output([[3,4]],
+                          ['U    '+ sbox.ospath('A2/keyfile') + '\n',
+                           ' U   A2\n']),
+    [], 'merge', '^/A', 'A2')
+  sbox.simple_commit()
+  sbox.simple_update()
+
+  # modify the original version: disable those KW & enable 'Id'
+  sbox.simple_propset('svn:keywords', 'Id', 'A/keyfile')
+  svntest.main.file_append('A/keyfile', "$Id$\n")
+  sbox.simple_commit()
+
+  # sync merge again
+  svntest.actions.run_and_verify_svn(
+    None,
+    expected_merge_output([[5,6]],
+                          ['UU   ' + sbox.ospath('A2/keyfile') + '\n',
+                           ' U   A2\n']),
+    [], 'merge', '--accept=postpone', '^/A', 'A2')
+
 ########################################################################
 # Run the tests
 
@@ -17996,6 +18091,8 @@ test_list = [ None,
               merge_adds_then_deletes_subtree,
               merge_with_added_subtrees_with_mergeinfo,
               merge_with_externals_with_mergeinfo,
+              merge_binary_file_with_keywords,
+              merge_conflict_when_keywords_removed,
              ]
 
 if __name__ == '__main__':