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 2012/06/06 15:03:50 UTC

svn commit: r1346869 [2/3] - in /subversion/branches/ev2-export: ./ build/generator/ notes/ notes/directory-index/ subversion/bindings/javahl/native/ subversion/include/private/ subversion/libsvn_auth_kwallet/ subversion/libsvn_client/ subversion/libsv...

Modified: subversion/branches/ev2-export/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra_svn/client.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_ra_svn/client.c Wed Jun  6 13:03:48 2012
@@ -1582,7 +1582,7 @@ static svn_error_t *handle_unsupported_c
 {
   if (err && err->apr_err == SVN_ERR_RA_SVN_UNKNOWN_CMD)
     return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err,
-                            msg);
+                            _(msg));
   return err;
 }
 
@@ -1599,8 +1599,7 @@ static svn_error_t *ra_svn_stat(svn_ra_s
   SVN_ERR(svn_ra_svn_write_cmd(conn, pool, "stat", "c(?r)", path, rev));
 
   SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess_baton, pool),
-                                 _("'stat' not implemented")));
-
+                                 N_("'stat' not implemented")));
   SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "(?l)", &list));
 
   if (! list)
@@ -1659,7 +1658,7 @@ static svn_error_t *ra_svn_get_locations
 
   /* Servers before 1.1 don't support this command. Check for this here. */
   SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess_baton, pool),
-                                 _("'get-locations' not implemented")));
+                                 N_("'get-locations' not implemented")));
 
   /* Read the hash items. */
   is_done = FALSE;
@@ -1713,7 +1712,8 @@ ra_svn_get_location_segments(svn_ra_sess
 
   /* Servers before 1.5 don't support this command. Check for this here. */
   SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess_baton, pool),
-                                 _("'get-location-segments' not implemented")));
+                                 N_("'get-location-segments'"
+                                    " not implemented")));
 
   /* Parse the response. */
   is_done = FALSE;
@@ -1780,7 +1780,7 @@ static svn_error_t *ra_svn_get_file_revs
 
   /* Servers before 1.1 don't support this command.  Check for this here. */
   SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess_baton, pool),
-                                 _("'get-file-revs' not implemented")));
+                                 N_("'get-file-revs' not implemented")));
 
   while (1)
     {
@@ -1911,8 +1911,8 @@ static svn_error_t *ra_svn_lock_compat(s
 
       /* Servers before 1.2 doesn't support locking.  Check this here. */
       SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess, pool),
-                                     _("Server doesn't support "
-                                       "the lock command")));
+                                     N_("Server doesn't support "
+                                        "the lock command")));
 
       err = svn_ra_svn_read_cmd_response(conn, iterpool, "l", &list);
 
@@ -1975,8 +1975,8 @@ static svn_error_t *ra_svn_unlock_compat
 
       /* Servers before 1.2 don't support locking.  Check this here. */
       SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess, iterpool),
-                                     _("Server doesn't support the unlock "
-                                       "command")));
+                                     N_("Server doesn't support the unlock "
+                                        "command")));
 
       err = svn_ra_svn_read_cmd_response(conn, iterpool, "");
 
@@ -2262,8 +2262,8 @@ static svn_error_t *ra_svn_get_lock(svn_
 
   /* Servers before 1.2 doesn't support locking.  Check this here. */
   SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess, pool),
-                                 _("Server doesn't support the get-lock "
-                                   "command")));
+                                 N_("Server doesn't support the get-lock "
+                                    "command")));
 
   SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "(?l)", &list));
   if (list)
@@ -2315,8 +2315,8 @@ static svn_error_t *ra_svn_get_locks(svn
 
   /* Servers before 1.2 doesn't support locking.  Check this here. */
   SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess, pool),
-                                 _("Server doesn't support the get-lock "
-                                   "command")));
+                                 N_("Server doesn't support the get-lock "
+                                    "command")));
 
   SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "l", &list));
 
@@ -2372,8 +2372,8 @@ static svn_error_t *ra_svn_replay(svn_ra
                                low_water_mark, send_deltas));
 
   SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess, pool),
-                                 _("Server doesn't support the replay "
-                                   "command")));
+                                 N_("Server doesn't support the replay "
+                                    "command")));
 
   SVN_ERR(svn_ra_svn_drive_editor2(sess->conn, pool, editor, edit_baton,
                                    NULL, TRUE));
@@ -2403,8 +2403,8 @@ ra_svn_replay_range(svn_ra_session_t *se
                                low_water_mark, send_deltas));
 
   SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess, pool),
-                                 _("Server doesn't support the replay-range "
-                                   "command")));
+                                 N_("Server doesn't support the "
+                                    "replay-range command")));
 
   iterpool = svn_pool_create(pool);
   for (rev = start_revision; rev <= end_revision; rev++)
@@ -2502,7 +2502,7 @@ ra_svn_get_deleted_rev(svn_ra_session_t 
 
   /* Servers before 1.6 don't support this command.  Check for this here. */
   SVN_ERR(handle_unsupported_cmd(handle_auth_request(sess_baton, pool),
-                                 _("'get-deleted-rev' not implemented")));
+                                 N_("'get-deleted-rev' not implemented")));
 
   return svn_ra_svn_read_cmd_response(conn, pool, "r", revision_deleted);
 }

Modified: subversion/branches/ev2-export/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra_svn/editorp.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_ra_svn/editorp.c Wed Jun  6 13:03:48 2012
@@ -844,25 +844,25 @@ static const struct {
                           const apr_array_header_t *params,
                           ra_svn_driver_state_t *ds);
 } ra_svn_edit_cmds[] = {
-  { "target-rev",       ra_svn_handle_target_rev },
-  { "open-root",        ra_svn_handle_open_root },
-  { "delete-entry",     ra_svn_handle_delete_entry },
+  { "change-file-prop", ra_svn_handle_change_file_prop },
+  { "open-file",        ra_svn_handle_open_file },
+  { "apply-textdelta",  ra_svn_handle_apply_textdelta },
+  { "textdelta-chunk",  ra_svn_handle_textdelta_chunk },
+  { "close-file",       ra_svn_handle_close_file },
   { "add-dir",          ra_svn_handle_add_dir },
   { "open-dir",         ra_svn_handle_open_dir },
   { "change-dir-prop",  ra_svn_handle_change_dir_prop },
+  { "delete-entry",     ra_svn_handle_delete_entry },
   { "close-dir",        ra_svn_handle_close_dir },
   { "absent-dir",       ra_svn_handle_absent_dir },
   { "add-file",         ra_svn_handle_add_file },
-  { "open-file",        ra_svn_handle_open_file },
-  { "apply-textdelta",  ra_svn_handle_apply_textdelta },
-  { "textdelta-chunk",  ra_svn_handle_textdelta_chunk },
   { "textdelta-end",    ra_svn_handle_textdelta_end },
-  { "change-file-prop", ra_svn_handle_change_file_prop },
-  { "close-file",       ra_svn_handle_close_file },
   { "absent-file",      ra_svn_handle_absent_file },
-  { "close-edit",       ra_svn_handle_close_edit },
   { "abort-edit",       ra_svn_handle_abort_edit },
   { "finish-replay",    ra_svn_handle_finish_replay },
+  { "target-rev",       ra_svn_handle_target_rev },
+  { "open-root",        ra_svn_handle_open_root },
+  { "close-edit",       ra_svn_handle_close_edit },
   { NULL }
 };
 

Modified: subversion/branches/ev2-export/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_ra_svn/marshal.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_ra_svn/marshal.c Wed Jun  6 13:03:48 2012
@@ -1150,10 +1150,7 @@ svn_error_t *svn_ra_svn_write_cmd(svn_ra
   va_start(ap, fmt);
   err = vwrite_tuple(conn, pool, fmt, ap);
   va_end(ap);
-  if (err)
-    return err;
-  SVN_ERR(svn_ra_svn_end_list(conn, pool));
-  return SVN_NO_ERROR;
+  return err ? err : svn_ra_svn_end_list(conn, pool);
 }
 
 svn_error_t *svn_ra_svn_write_cmd_response(svn_ra_svn_conn_t *conn,
@@ -1163,24 +1160,18 @@ svn_error_t *svn_ra_svn_write_cmd_respon
   va_list ap;
   svn_error_t *err;
 
-  SVN_ERR(svn_ra_svn_start_list(conn, pool));
-  SVN_ERR(svn_ra_svn_write_word(conn, pool, "success"));
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( success ", 10));
   va_start(ap, fmt);
   err = vwrite_tuple(conn, pool, fmt, ap);
   va_end(ap);
-  if (err)
-    return err;
-  SVN_ERR(svn_ra_svn_end_list(conn, pool));
-  return SVN_NO_ERROR;
+  return err ? err : svn_ra_svn_end_list(conn, pool);
 }
 
 svn_error_t *svn_ra_svn_write_cmd_failure(svn_ra_svn_conn_t *conn,
                                           apr_pool_t *pool, svn_error_t *err)
 {
   char buffer[128];
-  SVN_ERR(svn_ra_svn_start_list(conn, pool));
-  SVN_ERR(svn_ra_svn_write_word(conn, pool, "failure"));
-  SVN_ERR(svn_ra_svn_start_list(conn, pool));
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( failure ( ", 12));
   for (; err; err = err->child)
     {
       const char *msg;
@@ -1200,7 +1191,5 @@ svn_error_t *svn_ra_svn_write_cmd_failur
                                      err->file ? err->file : "",
                                      (apr_uint64_t) err->line));
     }
-  SVN_ERR(svn_ra_svn_end_list(conn, pool));
-  SVN_ERR(svn_ra_svn_end_list(conn, pool));
-  return SVN_NO_ERROR;
+  return writebuf_write_short_string(conn, pool, ") ) ", 4);
 }

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/cache-membuffer.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/cache-membuffer.c Wed Jun  6 13:03:48 2012
@@ -23,6 +23,8 @@
 
 #include <assert.h>
 #include <apr_md5.h>
+#include <apr_thread_rwlock.h>
+
 #include "svn_pools.h"
 #include "svn_checksum.h"
 #include "md5.h"
@@ -436,11 +438,13 @@ struct svn_membuffer_t
    */
   apr_uint64_t total_hits;
 
+#if APR_HAS_THREADS
   /* A lock for intra-process synchronization to the cache, or NULL if
    * the cache's creator doesn't feel the cache needs to be
    * thread-safe.
    */
-  svn_mutex__t *mutex;
+  apr_thread_rwlock_t *lock;
+#endif
 };
 
 /* Align integer VALUE to the next ITEM_ALIGNMENT boundary.
@@ -451,6 +455,76 @@ struct svn_membuffer_t
  */
 #define ALIGN_POINTER(pointer) ((void*)ALIGN_VALUE((apr_size_t)(char*)(pointer)))
 
+/* If locking is supported for CACHE, aquire a read lock for it.
+ */
+static svn_error_t *
+read_lock_cache(svn_membuffer_t *cache)
+{
+#if APR_HAS_THREADS
+  if (cache->lock)
+  {
+    apr_status_t status = apr_thread_rwlock_rdlock(cache->lock);
+    if (status)
+      return svn_error_wrap_apr(status, _("Can't lock cache mutex"));
+  }
+#endif
+  return SVN_NO_ERROR;
+}
+
+/* If locking is supported for CACHE, aquire a write lock for it.
+ */
+static svn_error_t *
+write_lock_cache(svn_membuffer_t *cache)
+{
+#if APR_HAS_THREADS
+  if (cache->lock)
+  {
+    apr_status_t status = apr_thread_rwlock_wrlock(cache->lock);
+    if (status)
+      return svn_error_wrap_apr(status, _("Can't write-lock cache mutex"));
+  }
+#endif
+  return SVN_NO_ERROR;
+}
+
+/* If locking is supported for CACHE, release the current lock
+ * (read or write).
+ */
+static svn_error_t *
+unlock_cache(svn_membuffer_t *cache, svn_error_t *err)
+{
+#if APR_HAS_THREADS
+  if (cache->lock)
+  {
+    apr_status_t status = apr_thread_rwlock_unlock(cache->lock);
+    if (err)
+      return err;
+
+    if (status)
+      return svn_error_wrap_apr(status, _("Can't unlock cache mutex"));
+  }
+#endif
+  return err;
+}
+
+/* If supported, guard the execution of EXPR with a read lock to cache.
+ * Macro has been modelled after SVN_MUTEX__WITH_LOCK.
+ */
+#define WITH_READ_LOCK(cache, expr)         \
+do {                                        \
+  SVN_ERR(read_lock_cache(cache));          \
+  SVN_ERR(unlock_cache(cache, (expr)));     \
+} while (0)
+
+/* If supported, guard the execution of EXPR with a write lock to cache.
+ * Macro has been modelled after SVN_MUTEX__WITH_LOCK.
+ */
+#define WITH_WRITE_LOCK(cache, expr)        \
+do {                                        \
+  SVN_ERR(write_lock_cache(cache));         \
+  SVN_ERR(unlock_cache(cache, (expr)));     \
+} while (0)
+
 /* Resolve a dictionary entry reference, i.e. return the entry
  * for the given IDX.
  */
@@ -1048,10 +1122,20 @@ svn_cache__membuffer_cache_create(svn_me
           return svn_error_wrap_apr(APR_ENOMEM, _("OOM"));
         }
 
+#if APR_HAS_THREADS
       /* A lock for intra-process synchronization to the cache, or NULL if
        * the cache's creator doesn't feel the cache needs to be
-       * thread-safe. */
-      SVN_ERR(svn_mutex__init(&c[seg].mutex, thread_safe, pool));
+       * thread-safe.
+       */
+      c[seg].lock = NULL;
+      if (thread_safe)
+        {
+          apr_status_t status =
+              apr_thread_rwlock_create(&(c[seg].lock), pool);
+          if (status)
+            return svn_error_wrap_apr(status, _("Can't create cache mutex"));
+        }
+#endif
     }
 
   /* done here
@@ -1156,14 +1240,14 @@ membuffer_cache_set(svn_membuffer_t *cac
 
   /* The actual cache data access needs to sync'ed
    */
-  SVN_MUTEX__WITH_LOCK(cache->mutex,
-                       membuffer_cache_set_internal(cache,
-                                                    key,
-                                                    group_index,
-                                                    buffer,
-                                                    size,
-                                                    DEBUG_CACHE_MEMBUFFER_TAG
-                                                    scratch_pool));
+  WITH_WRITE_LOCK(cache,
+                  membuffer_cache_set_internal(cache,
+                                               key,
+                                               group_index,
+                                               buffer,
+                                               size,
+                                               DEBUG_CACHE_MEMBUFFER_TAG
+                                               scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -1252,14 +1336,14 @@ membuffer_cache_get(svn_membuffer_t *cac
   /* find the entry group that will hold the key.
    */
   group_index = get_group_index(&cache, key);
-  SVN_MUTEX__WITH_LOCK(cache->mutex,
-                       membuffer_cache_get_internal(cache,
-                                                    group_index,
-                                                    key,
-                                                    &buffer,
-                                                    &size,
-                                                    DEBUG_CACHE_MEMBUFFER_TAG
-                                                    result_pool));
+  WITH_READ_LOCK(cache,
+                 membuffer_cache_get_internal(cache,
+                                              group_index,
+                                              key,
+                                              &buffer,
+                                              &size,
+                                              DEBUG_CACHE_MEMBUFFER_TAG
+                                              result_pool));
 
   /* re-construct the original data object from its serialized form.
    */
@@ -1355,11 +1439,11 @@ membuffer_cache_get_partial(svn_membuffe
 {
   apr_uint32_t group_index = get_group_index(&cache, key);
 
-  SVN_MUTEX__WITH_LOCK(cache->mutex,
-                       membuffer_cache_get_partial_internal
-                           (cache, group_index, key, item, found,
-                            deserializer, baton, DEBUG_CACHE_MEMBUFFER_TAG
-                            result_pool));
+  WITH_READ_LOCK(cache,
+                 membuffer_cache_get_partial_internal
+                     (cache, group_index, key, item, found,
+                      deserializer, baton, DEBUG_CACHE_MEMBUFFER_TAG
+                      result_pool));
 
   return SVN_NO_ERROR;
 }
@@ -1486,11 +1570,11 @@ membuffer_cache_set_partial(svn_membuffe
   /* cache item lookup
    */
   apr_uint32_t group_index = get_group_index(&cache, key);
-  SVN_MUTEX__WITH_LOCK(cache->mutex,
-                       membuffer_cache_set_partial_internal
-                           (cache, group_index, key, func, baton,
-                            DEBUG_CACHE_MEMBUFFER_TAG_ARG
-                            scratch_pool));
+  WITH_WRITE_LOCK(cache,
+                  membuffer_cache_set_partial_internal
+                     (cache, group_index, key, func, baton,
+                      DEBUG_CACHE_MEMBUFFER_TAG_ARG
+                      scratch_pool));
 
   /* done here -> unlock the cache
    */
@@ -1825,8 +1909,8 @@ svn_membuffer_cache_get_info(void *cache
   for (i = 0; i < cache->membuffer->segment_count; ++i)
     {
       svn_membuffer_t *segment = cache->membuffer + i;
-      SVN_MUTEX__WITH_LOCK(segment->mutex,
-                           svn_membuffer_get_segment_info(segment, info));
+      WITH_READ_LOCK(segment,
+                     svn_membuffer_get_segment_info(segment, info));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/config_file.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/config_file.c Wed Jun  6 13:03:48 2012
@@ -120,6 +120,27 @@ parser_getc(parse_context_t *ctx, int *c
   return SVN_NO_ERROR;
 }
 
+/* Simplified version of parser_getc() to be used inside skipping loops.
+ * It will not check for 'ungotton' chars and may or may not ignore '\r'.
+ *
+ * In a 'while(cond) getc();' loop, the first iteration must call
+ * parser_getc to handle all the special cases.  Later iterations should
+ * use parser_getc_plain for maximum performance.
+ */
+static APR_INLINE svn_error_t *
+parser_getc_plain(parse_context_t *ctx, int *c)
+{
+  if (ctx->buffer_pos < ctx->buffer_size)
+    {
+      *c = ctx->parser_buffer[ctx->buffer_pos];
+      ctx->buffer_pos++;
+
+      return SVN_NO_ERROR;
+    }
+
+  return parser_getc(ctx, c);
+}
+
 /* Emulate ungetc() because streams don't support it.
  *
  * Use CTX to store the ungotten character C.
@@ -143,10 +164,10 @@ skip_whitespace(parse_context_t *ctx, in
   int count = 0;
 
   SVN_ERR(parser_getc(ctx, &ch));
-  while (ch != EOF && ch != '\n' && svn_ctype_isspace(ch))
+  while (svn_ctype_isspace(ch) && ch != '\n' && ch != EOF)
     {
       ++count;
-      SVN_ERR(parser_getc(ctx, &ch));
+      SVN_ERR(parser_getc_plain(ctx, &ch));
     }
   *pcount = count;
   *c = ch;
@@ -162,8 +183,8 @@ skip_to_eoln(parse_context_t *ctx, int *
   int ch;
 
   SVN_ERR(parser_getc(ctx, &ch));
-  while (ch != EOF && ch != '\n')
-    SVN_ERR(parser_getc(ctx, &ch));
+  while (ch != '\n' && ch != EOF)
+    SVN_ERR(parser_getc_plain(ctx, &ch));
 
   *c = ch;
   return SVN_NO_ERROR;

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/io.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/io.c Wed Jun  6 13:03:48 2012
@@ -3181,33 +3181,30 @@ do_io_file_wrapper_cleanup(apr_file_t *f
 svn_error_t *
 svn_io_file_close(apr_file_t *file, apr_pool_t *pool)
 {
-  return do_io_file_wrapper_cleanup
-    (file, apr_file_close(file),
-     N_("Can't close file '%s'"),
-     N_("Can't close stream"),
-      pool);
+  return do_io_file_wrapper_cleanup(file, apr_file_close(file),
+                                    N_("Can't close file '%s'"),
+                                    N_("Can't close stream"),
+                                    pool);
 }
 
 
 svn_error_t *
 svn_io_file_getc(char *ch, apr_file_t *file, apr_pool_t *pool)
 {
-  return do_io_file_wrapper_cleanup
-    (file, apr_file_getc(ch, file),
-     N_("Can't read file '%s'"),
-     N_("Can't read stream"),
-     pool);
+  return do_io_file_wrapper_cleanup(file, apr_file_getc(ch, file),
+                                    N_("Can't read file '%s'"),
+                                    N_("Can't read stream"),
+                                    pool);
 }
 
 
 svn_error_t *
 svn_io_file_putc(char ch, apr_file_t *file, apr_pool_t *pool)
 {
-  return do_io_file_wrapper_cleanup
-    (file, apr_file_putc(ch, file),
-     N_("Can't write file '%s'"),
-     N_("Can't write stream"),
-     pool);
+  return do_io_file_wrapper_cleanup(file, apr_file_putc(ch, file),
+                                    N_("Can't write file '%s'"),
+                                    N_("Can't write stream"),
+                                    pool);
 }
 
 
@@ -3218,11 +3215,11 @@ svn_io_file_info_get(apr_finfo_t *finfo,
   /* Quoting APR: On NT this request is incredibly expensive, but accurate. */
   wanted &= ~SVN__APR_FINFO_MASK_OUT;
 
-  return do_io_file_wrapper_cleanup
-    (file, apr_file_info_get(finfo, wanted, file),
-     N_("Can't get attribute information from file '%s'"),
-     N_("Can't get attribute information from stream"),
-     pool);
+  return do_io_file_wrapper_cleanup(
+             file, apr_file_info_get(finfo, wanted, file),
+             N_("Can't get attribute information from file '%s'"),
+             N_("Can't get attribute information from stream"),
+             pool);
 }
 
 
@@ -3230,11 +3227,10 @@ svn_error_t *
 svn_io_file_read(apr_file_t *file, void *buf,
                  apr_size_t *nbytes, apr_pool_t *pool)
 {
-  return do_io_file_wrapper_cleanup
-    (file, apr_file_read(file, buf, nbytes),
-     N_("Can't read file '%s'"),
-     N_("Can't read stream"),
-     pool);
+  return do_io_file_wrapper_cleanup(file, apr_file_read(file, buf, nbytes),
+                                    N_("Can't read file '%s'"),
+                                    N_("Can't read stream"),
+                                    pool);
 }
 
 
@@ -3256,11 +3252,10 @@ svn_io_file_read_full2(apr_file_t *file,
         *hit_eof = FALSE;
     }
 
-  return do_io_file_wrapper_cleanup
-    (file, status,
-     N_("Can't read file '%s'"),
-     N_("Can't read stream"),
-     pool);
+  return do_io_file_wrapper_cleanup(file, status,
+                                    N_("Can't read file '%s'"),
+                                    N_("Can't read stream"),
+                                    pool);
 }
 
 
@@ -3268,11 +3263,11 @@ svn_error_t *
 svn_io_file_seek(apr_file_t *file, apr_seek_where_t where,
                  apr_off_t *offset, apr_pool_t *pool)
 {
-  return do_io_file_wrapper_cleanup
-    (file, apr_file_seek(file, where, offset),
-     N_("Can't set position pointer in file '%s'"),
-     N_("Can't set position pointer in stream"),
-     pool);
+  return do_io_file_wrapper_cleanup(
+             file, apr_file_seek(file, where, offset),
+             N_("Can't set position pointer in file '%s'"),
+             N_("Can't set position pointer in stream"),
+             pool);
 }
 
 
@@ -3375,17 +3370,15 @@ svn_io_file_trunc(apr_file_t *file, apr_
   /* This is a work-around. APR would flush the write buffer
      _after_ truncating the file causing now invalid buffered
      data to be written behind OFFSET. */
-  SVN_ERR(do_io_file_wrapper_cleanup
-    (file, apr_file_flush(file),
-     N_("Can't flush file '%s'"),
-     N_("Can't flush stream"),
-     pool));
-
-  return do_io_file_wrapper_cleanup
-    (file, apr_file_trunc(file, offset),
-     N_("Can't truncate file '%s'"),
-     N_("Can't truncate stream"),
-     pool);
+  SVN_ERR(do_io_file_wrapper_cleanup(file, apr_file_flush(file),
+                                     N_("Can't flush file '%s'"),
+                                     N_("Can't flush stream"),
+                                     pool));
+
+  return do_io_file_wrapper_cleanup(file, apr_file_trunc(file, offset),
+                                    N_("Can't truncate file '%s'"),
+                                    N_("Can't truncate stream"),
+                                    pool);
 }
 
 

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/opt.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/opt.c Wed Jun  6 13:03:48 2012
@@ -1041,6 +1041,20 @@ svn_opt__arg_canonicalize_url(const char
   /* Auto-escape some ASCII characters. */
   target = svn_path_uri_autoescape(target, pool);
 
+#if '/' != SVN_PATH_LOCAL_SEPARATOR
+  /* Allow using file:///C:\users\me/repos on Windows, like we did in 1.6 */
+  if (strchr(target, SVN_PATH_LOCAL_SEPARATOR))
+    {
+      char *p = apr_pstrdup(pool, target);
+      target = p;
+
+      /* Convert all local-style separators to the canonical ones. */
+      for (; *p != '\0'; ++p)
+        if (*p == SVN_PATH_LOCAL_SEPARATOR)
+          *p = '/';
+    }
+#endif
+
   /* Verify that no backpaths are present in the URL. */
   if (svn_path_is_backpath_present(target))
     return svn_error_createf(SVN_ERR_BAD_URL, 0,

Modified: subversion/branches/ev2-export/subversion/libsvn_subr/string.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/string.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/string.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/string.c Wed Jun  6 13:03:48 2012
@@ -937,16 +937,8 @@ static const char decimal_table[100][4]
       , "90", "91", "92", "93", "94", "95", "96", "97", "98", "99"};
 
 /* Copy the two bytes at SOURCE[0] and SOURCE[1] to DEST[0] and DEST[1] */
-#if SVN_UNALIGNED_ACCESS_IS_OK
-#  define COPY_TWO_BYTES(dest,source)\
-      *(apr_uint16_t*)(dest) = *(apr_uint16_t*)(source);
-#else
-#  define COPY_TWO_BYTES(dest,source) \
-    do { \
-      (dest)[0] = (source)[0]; \
-      (dest)[1] = (source)[1]; \
-    } while (0)
-#endif
+#define COPY_TWO_BYTES(dest,source)\
+  memcpy((dest), (source), 2)
 
 apr_size_t
 svn__ui64toa(char * dest, apr_uint64_t number)

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/adm_crawler.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/adm_crawler.c Wed Jun  6 13:03:48 2012
@@ -1206,7 +1206,10 @@ svn_wc__internal_transmit_prop_deltas(sv
   apr_array_header_t *propmods;
   svn_kind_t kind;
 
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE, iterpool));
+  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath,
+                               FALSE /* allow_missing */,
+                               FALSE /* show_hidden */,
+                               iterpool));
 
   /* Get an array of local changes by comparing the hashes. */
   SVN_ERR(svn_wc__internal_propdiff(&propmods, NULL, db, local_abspath,

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=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/adm_ops.c Wed Jun  6 13:03:48 2012
@@ -264,7 +264,10 @@ svn_wc__process_committed_internal(svn_w
 
   /* Only check kind after processing the node itself. The node might
      have been deleted */
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, TRUE, scratch_pool));
+  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath,
+                               TRUE /* allow_missing */,
+                               TRUE /* show_hidden */,
+                               scratch_pool));
 
   if (recurse && kind == svn_kind_dir)
     {
@@ -2124,7 +2127,9 @@ revert_partial(svn_wc__db_t *db,
         {
           svn_kind_t kind;
 
-          SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, TRUE,
+          SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath,
+                                       FALSE /* allow_missing */,
+                                       FALSE /* show_hidden */,
                                        iterpool));
           if (kind != svn_kind_file)
             continue;

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/conflicts.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/conflicts.c Wed Jun  6 13:03:48 2012
@@ -146,16 +146,13 @@ resolve_conflict_on_node(svn_boolean_t *
   const char *conflict_new = NULL;
   const char *conflict_working = NULL;
   const char *prop_reject_file = NULL;
-  svn_kind_t kind;
   int i;
   const apr_array_header_t *conflicts;
-  const char *conflict_dir_abspath;
   svn_skel_t *work_items = NULL;
   svn_skel_t *work_item;
 
   *did_resolve = FALSE;
 
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, TRUE, pool));
   SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, local_abspath,
                                     pool, pool));
 
@@ -176,11 +173,6 @@ resolve_conflict_on_node(svn_boolean_t *
         prop_reject_file = desc->their_abspath;
     }
 
-  if (kind == svn_kind_dir)
-    conflict_dir_abspath = local_abspath;
-  else
-    conflict_dir_abspath = svn_dirent_dirname(local_abspath, pool);
-
   if (resolve_text)
     {
       const char *auto_resolve_src;
@@ -215,7 +207,7 @@ resolve_conflict_on_node(svn_boolean_t *
                   : svn_diff_conflict_display_modified;
 
                 SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&temp_dir, db,
-                                                       conflict_dir_abspath,
+                                                       local_abspath,
                                                        pool, pool));
                 SVN_ERR(svn_stream_open_unique(&tmp_stream,
                                                &auto_resolve_src,
@@ -252,9 +244,7 @@ resolve_conflict_on_node(svn_boolean_t *
         {
           SVN_ERR(svn_wc__wq_build_file_copy_translated(
                     &work_item, db, local_abspath,
-                    svn_dirent_join(conflict_dir_abspath,
-                                    auto_resolve_src, pool),
-                    local_abspath, pool, pool));
+                    auto_resolve_src, local_abspath, pool, pool));
           work_items = svn_wc__wq_merge(work_items, work_item, pool);
         }
     }

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/copy.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/copy.c Wed Jun  6 13:03:48 2012
@@ -35,10 +35,7 @@
 
 #include "wc.h"
 #include "workqueue.h"
-#include "adm_files.h"
 #include "props.h"
-#include "translate.h"
-#include "entries.h"
 
 #include "svn_private_config.h"
 #include "private/svn_wc_private.h"
@@ -53,23 +50,32 @@
    SRC_ABSPATH doesn't exist then set *DST_ABSPATH to NULL to indicate
    that no copy was made. */
 static svn_error_t *
-copy_to_tmpdir(const char **dst_abspath,
+copy_to_tmpdir(svn_skel_t **work_item,
                svn_node_kind_t *kind,
+               svn_wc__db_t *db,
                const char *src_abspath,
+               const char *dst_abspath,
                const char *tmpdir_abspath,
-               svn_boolean_t recursive,
+               svn_boolean_t file_copy,
+               svn_boolean_t unversioned,
                svn_cancel_func_t cancel_func,
                void *cancel_baton,
+               apr_pool_t *result_pool,
                apr_pool_t *scratch_pool)
 {
   svn_boolean_t is_special;
   svn_io_file_del_t delete_when;
+  const char *dst_tmp_abspath;
+  svn_node_kind_t dsk_kind;
+  if (!kind)
+    kind = &dsk_kind;
+
+  *work_item = NULL;
 
   SVN_ERR(svn_io_check_special_path(src_abspath, kind, &is_special,
                                     scratch_pool));
   if (*kind == svn_node_none)
     {
-      *dst_abspath = NULL;
       return SVN_NO_ERROR;
     }
   else if (*kind == svn_node_unknown)
@@ -89,87 +95,68 @@ copy_to_tmpdir(const char **dst_abspath,
      ### handle the directory case and b) we need to be able to remove
      ### the cleanup before queueing the move work item. */
 
-  /* Set DST_ABSPATH to a temporary unique path.  If *KIND is file, leave a
-     file there and then overwrite it; otherwise leave no node on disk at
+  if (file_copy && !unversioned)
+    {
+      svn_boolean_t modified;
+      /* It's faster to look for mods on the source now, as
+         the timestamp might match, than to examine the
+         destination later as the destination timestamp will
+         never match. */
+      SVN_ERR(svn_wc__internal_file_modified_p(&modified,
+                                               db, src_abspath,
+                                               FALSE, scratch_pool));
+      if (!modified)
+        {
+          /* Why create a temp copy if we can just reinstall from pristine? */
+          SVN_ERR(svn_wc__wq_build_file_install(work_item,
+                                                db, dst_abspath, NULL, FALSE,
+                                                TRUE,
+                                                result_pool, scratch_pool));
+          return SVN_NO_ERROR;
+        }
+    }
+
+  /* Set DST_TMP_ABSPATH to a temporary unique path.  If *KIND is file, leave
+     a file there and then overwrite it; otherwise leave no node on disk at
      that path.  In the latter case, something else might use that path
      before we get around to using it a moment later, but never mind. */
-  SVN_ERR(svn_io_open_unique_file3(NULL, dst_abspath, tmpdir_abspath,
+  SVN_ERR(svn_io_open_unique_file3(NULL, &dst_tmp_abspath, tmpdir_abspath,
                                    delete_when, scratch_pool, scratch_pool));
 
   if (*kind == svn_node_dir)
     {
-      if (recursive)
-        SVN_ERR(svn_io_copy_dir_recursively(src_abspath,
-                                            tmpdir_abspath,
-                                            svn_dirent_basename(*dst_abspath,
-                                                                scratch_pool),
-                                            TRUE, /* copy_perms */
-                                            cancel_func, cancel_baton,
-                                            scratch_pool));
+      if (file_copy)
+        SVN_ERR(svn_io_copy_dir_recursively(
+                           src_abspath,
+                           tmpdir_abspath,
+                           svn_dirent_basename(dst_tmp_abspath, scratch_pool),
+                           TRUE, /* copy_perms */
+                           cancel_func, cancel_baton,
+                           scratch_pool));
       else
-        SVN_ERR(svn_io_dir_make(*dst_abspath, APR_OS_DEFAULT, scratch_pool));
+        SVN_ERR(svn_io_dir_make(dst_tmp_abspath, APR_OS_DEFAULT, scratch_pool));
     }
   else if (!is_special)
-    SVN_ERR(svn_io_copy_file(src_abspath, *dst_abspath, TRUE, /* copy_perms */
+    SVN_ERR(svn_io_copy_file(src_abspath, dst_tmp_abspath,
+                             TRUE /* copy_perms */,
                              scratch_pool));
   else
-    SVN_ERR(svn_io_copy_link(src_abspath, *dst_abspath, scratch_pool));
-
-
-  return SVN_NO_ERROR;
-}
-
+    SVN_ERR(svn_io_copy_link(src_abspath, dst_tmp_abspath, scratch_pool));
 
-/* If SRC_ABSPATH and DST_ABSPATH use different pristine stores, copy the
-   pristine text of SRC_ABSPATH (if there is one) into the pristine text
-   store connected to DST_ABSPATH.  This will only happen when copying into
-   a separate WC such as an external directory.
- */
-static svn_error_t *
-copy_pristine_text_if_necessary(svn_wc__db_t *db,
-                                const char *src_abspath,
-                                const char *dst_abspath,
-                                const char *tmpdir_abspath,
-                                const svn_checksum_t *checksum,
-                                svn_cancel_func_t cancel_func,
-                                void *cancel_baton,
-                                apr_pool_t *scratch_pool)
-{
-  svn_boolean_t present;
-  svn_stream_t *src_pristine, *tmp_pristine;
-  const char *tmp_pristine_abspath;
-  const svn_checksum_t *sha1_checksum, *md5_checksum;
-
-  SVN_ERR_ASSERT(checksum->kind == svn_checksum_sha1);
-
-  /* If it's already in DST_ABSPATH's pristine store, we're done. */
-  SVN_ERR(svn_wc__db_pristine_check(&present, db, dst_abspath, checksum,
-                                    scratch_pool));
-  if (present)
-    return SVN_NO_ERROR;
+  if (file_copy)
+    {
+      /* Remove 'read-only' from the destination file; it's a local add now. */
+      SVN_ERR(svn_io_set_file_read_write(dst_tmp_abspath,
+                                         FALSE, scratch_pool));
+    }
 
-  sha1_checksum = checksum;
-  SVN_ERR(svn_wc__db_pristine_get_md5(&md5_checksum, db,
-                                      src_abspath, checksum,
-                                      scratch_pool, scratch_pool));
-
-  SVN_ERR(svn_wc__db_pristine_read(&src_pristine, NULL, db,
-                                   src_abspath, sha1_checksum,
-                                   scratch_pool, scratch_pool));
-  SVN_ERR(svn_stream_open_unique(&tmp_pristine, &tmp_pristine_abspath,
-                                 tmpdir_abspath, svn_io_file_del_none,
-                                 scratch_pool, scratch_pool));
-  SVN_ERR(svn_stream_copy3(src_pristine, tmp_pristine,
-                           cancel_func, cancel_baton,
-                           scratch_pool));
-  SVN_ERR(svn_wc__db_pristine_install(db, tmp_pristine_abspath,
-                                      sha1_checksum, md5_checksum,
-                                      scratch_pool));
+  SVN_ERR(svn_wc__wq_build_file_move(work_item, db, dst_abspath,
+                                     dst_tmp_abspath, dst_abspath,
+                                     result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
-
 /* Copy the versioned file SRC_ABSPATH in DB to the path DST_ABSPATH in DB.
    If METADATA_ONLY is true, copy only the versioned metadata,
    otherwise copy both the versioned metadata and the filesystem node (even
@@ -178,6 +165,9 @@ copy_pristine_text_if_necessary(svn_wc__
    If IS_MOVE is true, record move information in working copy meta
    data in addition to copying the file.
 
+   If COPY_PRISTINE_FILE is true, make sure the necessary pristine files are
+   available in the destination working copy.
+
    If the versioned file has a text conflict, and the .mine file exists in
    the filesystem, copy the .mine file to DST_ABSPATH.  Otherwise, copy the
    versioned file itself.
@@ -190,7 +180,7 @@ copy_versioned_file(svn_wc__db_t *db,
                     const char *dst_abspath,
                     const char *dst_op_root_abspath,
                     const char *tmpdir_abspath,
-                    const svn_checksum_t *checksum,
+                    svn_boolean_t copy_pristine_file,
                     svn_boolean_t metadata_only,
                     svn_boolean_t conflicted,
                     svn_boolean_t is_move,
@@ -201,26 +191,23 @@ copy_versioned_file(svn_wc__db_t *db,
                     apr_pool_t *scratch_pool)
 {
   svn_skel_t *work_items = NULL;
-  const char *dir_abspath = svn_dirent_dirname(dst_abspath, scratch_pool);
 
   /* In case we are copying from one WC to another (e.g. an external dir),
      ensure the destination WC has a copy of the pristine text. */
 
-  /* Checksum is NULL for local additions */
-  if (checksum != NULL)
-    SVN_ERR(copy_pristine_text_if_necessary(db, src_abspath, dst_abspath,
-                                            tmpdir_abspath, checksum,
-                                            cancel_func, cancel_baton,
-                                            scratch_pool));
+  if (copy_pristine_file)
+    SVN_ERR(svn_wc__db_pristine_transfer(db, src_abspath, NULL,
+                                         dst_op_root_abspath,
+                                         cancel_func, cancel_baton,
+                                         scratch_pool));
 
   /* Prepare a temp copy of the filesystem node.  It is usually a file, but
      copy recursively if it's a dir. */
   if (!metadata_only)
     {
-      const char *tmp_dst_abspath;
-      svn_node_kind_t disk_kind;
       const char *my_src_abspath = NULL;
       int i;
+      svn_boolean_t handle_as_unversioned = FALSE;
 
       /* By default, take the copy source as given. */
       my_src_abspath = src_abspath;
@@ -257,57 +244,20 @@ copy_versioned_file(svn_wc__db_t *db,
                                         scratch_pool));
 
               if (working_kind == svn_node_file)
-                my_src_abspath = conflict_working;
-            }
-        }
-
-      SVN_ERR(copy_to_tmpdir(&tmp_dst_abspath, &disk_kind, my_src_abspath,
-                             tmpdir_abspath,
-                             TRUE, /* recursive */
-                             cancel_func, cancel_baton, scratch_pool));
-
-      if (tmp_dst_abspath)
-        {
-          svn_skel_t *work_item;
-
-          /* Remove 'read-only' from the destination file; it's a local add. */
-            {
-              const svn_string_t *needs_lock;
-              SVN_ERR(svn_wc__internal_propget(&needs_lock, db, src_abspath,
-                                               SVN_PROP_NEEDS_LOCK,
-                                               scratch_pool, scratch_pool));
-              if (needs_lock)
-                SVN_ERR(svn_io_set_file_read_write(tmp_dst_abspath,
-                                                   FALSE, scratch_pool));
-            }
-
-          SVN_ERR(svn_wc__wq_build_file_move(&work_item, db, dir_abspath,
-                                             tmp_dst_abspath, dst_abspath,
-                                             scratch_pool, scratch_pool));
-          work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
-
-          if (disk_kind == svn_node_file)
-            {
-              svn_boolean_t modified;
-
-              /* It's faster to look for mods on the source now, as
-                 the timestamp might match, than to examine the
-                 destination later as the destination timestamp will
-                 never match. */
-              SVN_ERR(svn_wc__internal_file_modified_p(&modified,
-                                                       db, src_abspath,
-                                                       FALSE, scratch_pool));
-              if (!modified)
                 {
-                  SVN_ERR(svn_wc__wq_build_record_fileinfo(&work_item,
-                                                           db, dst_abspath, 0,
-                                                           scratch_pool,
-                                                           scratch_pool));
-                  work_items = svn_wc__wq_merge(work_items, work_item,
-                                                scratch_pool);
+                   /* Don't perform unmodified/pristine optimization */
+                  handle_as_unversioned = TRUE;
+                  my_src_abspath = conflict_working;
                 }
             }
         }
+
+      SVN_ERR(copy_to_tmpdir(&work_items, NULL, db, my_src_abspath,
+                             dst_abspath, tmpdir_abspath,
+                             TRUE /* file_copy */,
+                             handle_as_unversioned /* unversioned */,
+                             cancel_func, cancel_baton,
+                             scratch_pool, scratch_pool));
     }
 
   /* Copy the (single) node's metadata, and move the new filesystem node
@@ -315,8 +265,6 @@ copy_versioned_file(svn_wc__db_t *db,
   SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
                              dst_op_root_abspath, is_move, work_items,
                              scratch_pool));
-  SVN_ERR(svn_wc__wq_run(db, dir_abspath,
-                         cancel_func, cancel_baton, scratch_pool));
 
   if (notify_func)
     {
@@ -324,6 +272,11 @@ copy_versioned_file(svn_wc__db_t *db,
         = svn_wc_create_notify(dst_abspath, svn_wc_notify_add,
                                scratch_pool);
       notify->kind = svn_node_file;
+
+      /* When we notify that we performed a copy, make sure we already did */
+      if (work_items != NULL)
+        SVN_ERR(svn_wc__wq_run(db, dst_abspath,
+                               cancel_func, cancel_baton, scratch_pool));
       (*notify_func)(notify_baton, notify, scratch_pool);
     }
   return SVN_NO_ERROR;
@@ -334,7 +287,10 @@ copy_versioned_file(svn_wc__db_t *db,
    otherwise copy both the versioned metadata and the filesystem nodes (even
    if they are the wrong kind, and including unversioned children).
    If IS_MOVE is true, record move information in working copy meta
-   data in addition to copying the directory. */
+   data in addition to copying the directory.
+
+   WITHIN_ONE_WC is TRUE if the copy/move is within a single working copy (root)
+ */
 static svn_error_t *
 copy_versioned_dir(svn_wc__db_t *db,
                    const char *src_abspath,
@@ -343,6 +299,7 @@ copy_versioned_dir(svn_wc__db_t *db,
                    const char *tmpdir_abspath,
                    svn_boolean_t metadata_only,
                    svn_boolean_t is_move,
+                   svn_boolean_t within_one_wc,
                    svn_cancel_func_t cancel_func,
                    void *cancel_baton,
                    svn_wc_notify_func2_t notify_func,
@@ -351,29 +308,23 @@ copy_versioned_dir(svn_wc__db_t *db,
 {
   svn_skel_t *work_items = NULL;
   const char *dir_abspath = svn_dirent_dirname(dst_abspath, scratch_pool);
-  const apr_array_header_t *versioned_children;
+  apr_hash_t *versioned_children;
+  apr_hash_t *conflicted_children;
   apr_hash_t *disk_children;
+  apr_hash_index_t *hi;
   svn_node_kind_t disk_kind;
   apr_pool_t *iterpool;
-  int i;
 
   /* Prepare a temp copy of the single filesystem node (usually a dir). */
   if (!metadata_only)
     {
-      const char *tmp_dst_abspath;
-
-      SVN_ERR(copy_to_tmpdir(&tmp_dst_abspath, &disk_kind, src_abspath,
-                             tmpdir_abspath, FALSE, /* recursive */
-                             cancel_func, cancel_baton, scratch_pool));
-      if (tmp_dst_abspath)
-        {
-          svn_skel_t *work_item;
-
-          SVN_ERR(svn_wc__wq_build_file_move(&work_item, db, dir_abspath,
-                                             tmp_dst_abspath, dst_abspath,
-                                             scratch_pool, scratch_pool));
-          work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
-        }
+      SVN_ERR(copy_to_tmpdir(&work_items, &disk_kind,
+                             db, src_abspath, dst_abspath,
+                             tmpdir_abspath,
+                             FALSE /* file_copy */,
+                             FALSE /* unversioned */,
+                             cancel_func, cancel_baton,
+                             scratch_pool, scratch_pool));
     }
 
   /* Copy the (single) node's metadata, and move the new filesystem node
@@ -381,8 +332,6 @@ copy_versioned_dir(svn_wc__db_t *db,
   SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
                              dst_op_root_abspath, is_move, work_items,
                              scratch_pool));
-  SVN_ERR(svn_wc__wq_run(db, dir_abspath,
-                         cancel_func, cancel_baton, scratch_pool));
 
   if (notify_func)
     {
@@ -390,6 +339,12 @@ copy_versioned_dir(svn_wc__db_t *db,
         = svn_wc_create_notify(dst_abspath, svn_wc_notify_add,
                                scratch_pool);
       notify->kind = svn_node_dir;
+
+      /* When we notify that we performed a copy, make sure we already did */
+      if (work_items != NULL)
+        SVN_ERR(svn_wc__wq_run(db, dir_abspath,
+                               cancel_func, cancel_baton, scratch_pool));
+
       (*notify_func)(notify_baton, notify, scratch_pool);
     }
 
@@ -403,79 +358,61 @@ copy_versioned_dir(svn_wc__db_t *db,
     disk_children = NULL;
 
   /* Copy all the versioned children */
-  SVN_ERR(svn_wc__db_read_children(&versioned_children, db, src_abspath,
-                                   scratch_pool, scratch_pool));
   iterpool = svn_pool_create(scratch_pool);
-  for (i = 0; i < versioned_children->nelts; ++i)
+  SVN_ERR(svn_wc__db_read_children_info(&versioned_children,
+                                        &conflicted_children,
+                                        db, src_abspath,
+                                        scratch_pool, iterpool));
+  for (hi = apr_hash_first(scratch_pool, versioned_children);
+       hi;
+       hi = apr_hash_next(hi))
     {
       const char *child_name, *child_src_abspath, *child_dst_abspath;
-      svn_wc__db_status_t child_status;
-      svn_kind_t child_kind;
-      svn_boolean_t op_root;
-      svn_boolean_t conflicted;
-      const svn_checksum_t *checksum;
+      struct svn_wc__db_info_t *info;
 
       svn_pool_clear(iterpool);
+
       if (cancel_func)
         SVN_ERR(cancel_func(cancel_baton));
 
-      child_name = APR_ARRAY_IDX(versioned_children, i, const char *);
+      child_name = svn__apr_hash_index_key(hi);
+      info = svn__apr_hash_index_val(hi);
       child_src_abspath = svn_dirent_join(src_abspath, child_name, iterpool);
       child_dst_abspath = svn_dirent_join(dst_abspath, child_name, iterpool);
 
-      SVN_ERR(svn_wc__db_read_info(&child_status, &child_kind, NULL, NULL,
-                                   NULL, NULL, NULL, NULL, NULL, NULL,
-                                   &checksum, NULL, NULL, NULL, NULL, NULL,
-                                   NULL, NULL, NULL, NULL, &conflicted,
-                                   &op_root, NULL, NULL, NULL, NULL, NULL,
-                                   db, child_src_abspath,
-                                   iterpool, iterpool));
-
-      if (op_root)
+      if (info->op_root)
         SVN_ERR(svn_wc__db_op_copy_shadowed_layer(db,
                                                   child_src_abspath,
                                                   child_dst_abspath,
                                                   is_move,
                                                   scratch_pool));
 
-      if (child_status == svn_wc__db_status_normal
-          || child_status == svn_wc__db_status_added)
+      if (info->status == svn_wc__db_status_normal
+          || info->status == svn_wc__db_status_added)
         {
           /* We have more work to do than just changing the DB */
-          if (child_kind == svn_kind_file)
+          if (info->kind == svn_kind_file)
             {
-              svn_boolean_t skip = FALSE;
-
               /* We should skip this node if this child is a file external
                  (issues #3589, #4000) */
-              if (child_status == svn_wc__db_status_normal)
-                {
-                  SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, NULL, NULL,
-                                                   NULL, NULL, NULL, NULL,
-                                                   NULL, NULL, NULL, NULL,
-                                                   NULL, NULL, &skip,
-                                                   db, child_src_abspath,
-                                                   scratch_pool,
-                                                   scratch_pool));
-                }
-
-              if (!skip)
+              if (!info->file_external)
                 SVN_ERR(copy_versioned_file(db,
                                             child_src_abspath,
                                             child_dst_abspath,
                                             dst_op_root_abspath,
-                                            tmpdir_abspath, checksum,
-                                            metadata_only, conflicted,
+                                            tmpdir_abspath,
+                                            !within_one_wc && info->has_checksum,
+                                            metadata_only, info->conflicted,
                                             is_move,
                                             cancel_func, cancel_baton,
                                             NULL, NULL,
                                             iterpool));
             }
-          else if (child_kind == svn_kind_dir)
+          else if (info->kind == svn_kind_dir)
             SVN_ERR(copy_versioned_dir(db,
                                        child_src_abspath, child_dst_abspath,
                                        dst_op_root_abspath, tmpdir_abspath,
-                                       metadata_only, is_move,
+                                       metadata_only, is_move, within_one_wc,
                                        cancel_func, cancel_baton, NULL, NULL,
                                        iterpool));
           else
@@ -484,9 +421,9 @@ copy_versioned_dir(svn_wc__db_t *db,
                                      svn_dirent_local_style(child_src_abspath,
                                                             scratch_pool));
         }
-      else if (child_status == svn_wc__db_status_deleted
-          || child_status == svn_wc__db_status_not_present
-          || child_status == svn_wc__db_status_excluded)
+      else if (info->status == svn_wc__db_status_deleted
+          || info->status == svn_wc__db_status_not_present
+          || info->status == svn_wc__db_status_excluded)
         {
           /* This will be copied as some kind of deletion. Don't touch
              any actual files */
@@ -497,7 +434,7 @@ copy_versioned_dir(svn_wc__db_t *db,
           /* Don't recurse on children while all we do is creating not-present
              children */
         }
-      else if (child_status == svn_wc__db_status_incomplete)
+      else if (info->status == svn_wc__db_status_incomplete)
         {
           /* Should go ahead and copy incomplete to incomplete? Try to
              copy as much as possible, or give up early? */
@@ -508,7 +445,7 @@ copy_versioned_dir(svn_wc__db_t *db,
         }
       else
         {
-          SVN_ERR_ASSERT(child_status == svn_wc__db_status_server_excluded);
+          SVN_ERR_ASSERT(info->status == svn_wc__db_status_server_excluded);
 
           return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
                                    _("Cannot copy '%s' excluded by server"),
@@ -517,8 +454,8 @@ copy_versioned_dir(svn_wc__db_t *db,
         }
 
       if (disk_children
-          && (child_status == svn_wc__db_status_normal
-              || child_status == svn_wc__db_status_added))
+          && (info->status == svn_wc__db_status_normal
+              || info->status == svn_wc__db_status_added))
         {
           /* Remove versioned child as it has been handled */
           apr_hash_set(disk_children, child_name, APR_HASH_KEY_STRING, NULL);
@@ -527,7 +464,7 @@ copy_versioned_dir(svn_wc__db_t *db,
 
   /* Copy the remaining filesystem children, which are unversioned, skipping
      any conflict-marker files. */
-  if (disk_children)
+  if (disk_children && apr_hash_count(disk_children))
     {
       apr_hash_index_t *hi;
       apr_hash_t *marker_files;
@@ -536,12 +473,14 @@ copy_versioned_dir(svn_wc__db_t *db,
                                                    src_abspath, scratch_pool,
                                                    scratch_pool));
 
+      work_items = NULL;
+
       for (hi = apr_hash_first(scratch_pool, disk_children); hi;
            hi = apr_hash_next(hi))
         {
           const char *name = svn__apr_hash_index_key(hi);
           const char *unver_src_abspath, *unver_dst_abspath;
-          const char *tmp_dst_abspath;
+          svn_skel_t *work_item;
 
           if (svn_wc_is_adm_dir(name, iterpool))
             continue;
@@ -550,31 +489,23 @@ copy_versioned_dir(svn_wc__db_t *db,
               apr_hash_get(marker_files, name, APR_HASH_KEY_STRING))
             continue;
 
-          svn_pool_clear(iterpool);
           if (cancel_func)
             SVN_ERR(cancel_func(cancel_baton));
 
+          svn_pool_clear(iterpool);
           unver_src_abspath = svn_dirent_join(src_abspath, name, iterpool);
           unver_dst_abspath = svn_dirent_join(dst_abspath, name, iterpool);
 
-          SVN_ERR(copy_to_tmpdir(&tmp_dst_abspath, &disk_kind,
-                                 unver_src_abspath, tmpdir_abspath,
-                                 TRUE, /* recursive */
-                                 cancel_func, cancel_baton, iterpool));
-          if (tmp_dst_abspath)
-            {
-              svn_skel_t *work_item;
-              SVN_ERR(svn_wc__wq_build_file_move(&work_item, db, dir_abspath,
-                                                 tmp_dst_abspath,
-                                                 unver_dst_abspath,
-                                                 iterpool, iterpool));
-              SVN_ERR(svn_wc__db_wq_add(db, dst_abspath, work_item,
-                                        iterpool));
-            }
+          SVN_ERR(copy_to_tmpdir(&work_item, NULL, db, unver_src_abspath,
+                                 unver_dst_abspath, tmpdir_abspath,
+                                 TRUE /* recursive */, TRUE /* unversioned */,
+                                 cancel_func, cancel_baton,
+                                 scratch_pool, iterpool));
 
+          if (work_item)
+            work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
         }
-      SVN_ERR(svn_wc__wq_run(db, dst_abspath, cancel_func, cancel_baton,
-                             scratch_pool));
+      SVN_ERR(svn_wc__db_wq_add(db, dst_abspath, work_items, iterpool));
     }
 
   svn_pool_destroy(iterpool);
@@ -604,6 +535,10 @@ copy_or_move(svn_wc_context_t *wc_ctx,
   svn_boolean_t conflicted;
   const svn_checksum_t *checksum;
   const char *tmpdir_abspath;
+  const char *src_wcroot_abspath;
+  const char *dst_wcroot_abspath;
+  svn_boolean_t within_one_wc;
+  svn_error_t *err;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
@@ -637,6 +572,10 @@ copy_or_move(svn_wc_context_t *wc_ctx,
     else
       SVN_ERR(err);
 
+    /* Do this now, as we know the right data is cached */
+    SVN_ERR(svn_wc__db_get_wcroot(&src_wcroot_abspath, db, src_abspath,
+                                  scratch_pool, scratch_pool));
+
     switch (src_status)
       {
         case svn_wc__db_status_deleted:
@@ -665,6 +604,10 @@ copy_or_move(svn_wc_context_t *wc_ctx,
                                  db, dstdir_abspath,
                                  scratch_pool, scratch_pool));
 
+    /* Do this now, as we know the right data is cached */
+    SVN_ERR(svn_wc__db_get_wcroot(&dst_wcroot_abspath, db, dstdir_abspath,
+                                  scratch_pool, scratch_pool));
+
     if (!src_repos_root_url)
       {
         if (src_status == svn_wc__db_status_added)
@@ -777,29 +720,42 @@ copy_or_move(svn_wc_context_t *wc_ctx,
     }
 
   SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&tmpdir_abspath, db,
-                                         dst_abspath,
+                                         dstdir_abspath,
                                          scratch_pool, scratch_pool));
 
+  within_one_wc = (strcmp(src_wcroot_abspath, dst_wcroot_abspath) == 0);
+
   if (src_db_kind == svn_kind_file
       || src_db_kind == svn_kind_symlink)
     {
-      SVN_ERR(copy_versioned_file(db, src_abspath, dst_abspath, dst_abspath,
-                                  tmpdir_abspath, checksum,
-                                  metadata_only, conflicted, is_move,
-                                  cancel_func, cancel_baton,
-                                  notify_func, notify_baton,
-                                  scratch_pool));
+      err = copy_versioned_file(db, src_abspath, dst_abspath, dst_abspath,
+                                tmpdir_abspath,
+                                !within_one_wc && (checksum != NULL),
+                                metadata_only, conflicted, is_move,
+                                cancel_func, cancel_baton,
+                                notify_func, notify_baton,
+                                scratch_pool);
     }
   else
     {
-      SVN_ERR(copy_versioned_dir(db, src_abspath, dst_abspath, dst_abspath,
-                                 tmpdir_abspath,
-                                 metadata_only, is_move,
-                                 cancel_func, cancel_baton,
-                                 notify_func, notify_baton,
-                                 scratch_pool));
+      err = copy_versioned_dir(db, src_abspath, dst_abspath, dst_abspath,
+                               tmpdir_abspath,
+                               metadata_only, is_move, within_one_wc,
+                               cancel_func, cancel_baton,
+                               notify_func, notify_baton,
+                               scratch_pool);
     }
 
+  if (err && svn_error_find_cause(err, SVN_ERR_CANCELLED))
+    return svn_error_trace(err);
+
+  /* Run the work queue with the remaining work */
+  SVN_ERR(svn_error_compose_create(
+                                err,
+                                svn_wc__wq_run(db, dst_abspath,
+                                                   cancel_func, cancel_baton,
+                                                   scratch_pool)));
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/deprecated.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/deprecated.c Wed Jun  6 13:03:48 2012
@@ -932,7 +932,9 @@ svn_wc_add3(const char *path,
     {
       svn_kind_t kind;
 
-      SVN_ERR(svn_wc__db_read_kind(&kind, wc_db, local_abspath, FALSE, pool));
+      SVN_ERR(svn_wc__db_read_kind(&kind, wc_db, local_abspath,
+                                   FALSE /* allow_missing */,
+                                   FALSE /* show_hidden */, pool));
       if (kind == svn_kind_dir)
         {
           svn_wc_adm_access_t *adm_access;

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/diff_local.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/diff_local.c Wed Jun  6 13:03:48 2012
@@ -564,7 +564,9 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
   svn_boolean_t get_all;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-  SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath, FALSE,
+  SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath,
+                               FALSE /* allow_missing */,
+                               FALSE /* show_hidden */,
                                scratch_pool));
 
   if (kind == svn_kind_dir)

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/lock.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/lock.c Wed Jun  6 13:03:48 2012
@@ -920,7 +920,9 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
   if (associated)
     {
       err = svn_wc__db_read_kind(&kind, svn_wc__adm_get_db(associated),
-                                 local_abspath, TRUE, pool);
+                                 local_abspath,
+                                 TRUE /* allow_missing */,
+                                 FALSE /* show_hidden */, pool);
 
       if (err)
         {
@@ -980,7 +982,9 @@ svn_wc_adm_probe_retrieve(svn_wc_adm_acc
   SVN_ERR_ASSERT(associated != NULL);
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
-  SVN_ERR(svn_wc__db_read_kind(&kind, associated->db, local_abspath, TRUE, pool));
+  SVN_ERR(svn_wc__db_read_kind(&kind, associated->db, local_abspath,
+                               TRUE /* allow_missing */, FALSE /* show_hidden*/,
+                               pool));
 
   if (kind == svn_kind_dir)
     dir = path;
@@ -1515,7 +1519,8 @@ svn_wc__acquire_write_lock(const char **
   svn_error_t *err;
 
   SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath,
-                               (lock_root_abspath != NULL),
+                               (lock_root_abspath != NULL) /* allow_missing*/,
+                               FALSE /* show_hidden */,
                                scratch_pool));
 
   if (!lock_root_abspath && kind != svn_kind_dir)
@@ -1532,7 +1537,9 @@ svn_wc__acquire_write_lock(const char **
       SVN_ERR_ASSERT(lock_root_abspath != NULL);
 
       parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
-      err = svn_wc__db_read_kind(&parent_kind, db, parent_abspath, TRUE,
+      err = svn_wc__db_read_kind(&parent_kind, db, parent_abspath,
+                                 TRUE /* allow_missing */,
+                                 FALSE /* show_missing */,
                                  scratch_pool);
       if (err && SVN_WC__ERR_IS_NOT_CURRENT_WC(err))
         {
@@ -1565,7 +1572,9 @@ svn_wc__acquire_write_lock(const char **
       /* Can't lock parents that don't exist */
       if (kind == svn_kind_unknown)
         {
-          SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE,
+          SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath,
+                                       FALSE /* allow_missing */,
+                                       FALSE /* show_hidden */,
                                        scratch_pool));
 
           if (kind != svn_kind_dir)

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/node.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/node.c Wed Jun  6 13:03:48 2012
@@ -288,27 +288,18 @@ svn_wc_read_kind(svn_node_kind_t *kind,
                  svn_boolean_t show_hidden,
                  apr_pool_t *scratch_pool)
 {
-  svn_wc__db_status_t db_status;
   svn_kind_t db_kind;
-  svn_error_t *err;
 
-  err = svn_wc__db_read_info(&db_status, &db_kind, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL, NULL, NULL, NULL,
-                             wc_ctx->db, local_abspath,
-                             scratch_pool, scratch_pool);
+  SVN_ERR(svn_wc__db_read_kind(&db_kind,
+                             wc_ctx->db, local_abspath, TRUE, show_hidden,
+                             scratch_pool));
 
-  if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-    {
-      svn_error_clear(err);
-      *kind = svn_node_none;
-      return SVN_NO_ERROR;
-    }
+  if (db_kind == svn_kind_dir)
+    *kind = svn_node_dir;
+  else if (db_kind == svn_kind_file || db_kind == svn_kind_symlink)
+    *kind = svn_node_file;
   else
-    SVN_ERR(err);
-
-  SVN_ERR(convert_db_kind_to_node_kind(kind, db_kind, db_status, show_hidden));
+    *kind = svn_node_none;
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/props.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/props.c Wed Jun  6 13:03:48 2012
@@ -2223,32 +2223,11 @@ do_propset(svn_wc__db_t *db,
 {
   apr_hash_t *prophash;
   svn_wc_notify_action_t notify_action;
-  svn_wc__db_status_t status;
   svn_skel_t *work_item = NULL;
   svn_boolean_t clear_recorded_info = FALSE;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  /* Get the node status for this path. */
-  SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL,
-                               db, local_abspath,
-                               scratch_pool, scratch_pool));
-
-  if (status != svn_wc__db_status_normal
-      && status != svn_wc__db_status_added
-      && status != svn_wc__db_status_incomplete)
-    return svn_error_createf(SVN_ERR_WC_INVALID_SCHEDULE, NULL,
-                             _("Can't set properties on '%s':"
-                               " invalid status for updating properties."),
-                             svn_dirent_local_style(local_abspath,
-                                                    scratch_pool));
-
-  /* Else, handle a regular property: */
-
-
   /* Setting an inappropriate property is not allowed (unless
      overridden by 'skip_checks', in some circumstances).  Deleting an
      inappropriate property is allowed, however, since older clients
@@ -2443,6 +2422,7 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
                  apr_pool_t *scratch_pool)
 {
   enum svn_prop_kind prop_kind = svn_property_kind2(name);
+  svn_wc__db_status_t status;
   svn_kind_t kind;
   const char *dir_abspath;
 
@@ -2464,8 +2444,22 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
      backward we never call this API with depth > empty, so we only need
      to do the write check once per call, here (and not for every node in
      the node walker). */
-  SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath, TRUE,
-                               scratch_pool));
+    /* Get the node status for this path. */
+  SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               wc_ctx->db, local_abspath,
+                               scratch_pool, scratch_pool));
+
+  if (status != svn_wc__db_status_normal
+      && status != svn_wc__db_status_added
+      && status != svn_wc__db_status_incomplete)
+    return svn_error_createf(SVN_ERR_WC_INVALID_SCHEDULE, NULL,
+                             _("Can't set properties on '%s':"
+                               " invalid status for updating properties."),
+                             svn_dirent_local_style(local_abspath,
+                                                    scratch_pool));
 
   if (kind == svn_kind_dir)
     dir_abspath = local_abspath;
@@ -2474,7 +2468,7 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
 
   SVN_ERR(svn_wc__write_check(wc_ctx->db, dir_abspath, scratch_pool));
 
-  if (depth == svn_depth_empty)
+  if (depth == svn_depth_empty || kind != svn_kind_dir)
     {
       apr_hash_t *changelist_hash = NULL;
 

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/status.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/status.c Wed Jun  6 13:03:48 2012
@@ -1583,7 +1583,6 @@ tweak_statushash(void *baton,
                  svn_boolean_t is_dir_baton,
                  svn_wc__db_t *db,
                  const char *local_abspath,
-                 svn_boolean_t is_dir,
                  enum svn_wc_status_kind repos_node_status,
                  enum svn_wc_status_kind repos_text_status,
                  enum svn_wc_status_kind repos_prop_status,
@@ -1672,7 +1671,7 @@ tweak_statushash(void *baton,
          isn't available. */
       if (statstruct->repos_node_status == svn_wc_status_deleted)
         {
-          statstruct->ood_kind = is_dir ? svn_node_dir : svn_node_file;
+          statstruct->ood_kind = statstruct->kind;
 
           /* Pre 1.5 servers don't provide the revision a path was deleted.
              So we punt and use the last committed revision of the path's
@@ -2068,16 +2067,13 @@ delete_entry(const char *path,
   struct dir_baton *db = parent_baton;
   struct edit_baton *eb = db->edit_baton;
   const char *local_abspath = svn_dirent_join(eb->anchor_abspath, path, pool);
-  svn_kind_t kind;
 
   /* Note:  when something is deleted, it's okay to tweak the
      statushash immediately.  No need to wait until close_file or
      close_dir, because there's no risk of having to honor the 'added'
      flag.  We already know this item exists in the working copy. */
-
-  SVN_ERR(svn_wc__db_read_kind(&kind, eb->db, local_abspath, FALSE, pool));
   SVN_ERR(tweak_statushash(db, db, TRUE, eb->db,
-                           local_abspath, kind == svn_kind_dir,
+                           local_abspath,
                            svn_wc_status_deleted, 0, 0, revision, NULL, pool));
 
   /* Mark the parent dir -- it lost an entry (unless that parent dir
@@ -2086,7 +2082,6 @@ delete_entry(const char *path,
   if (db->parent_baton && (! *eb->target_basename))
     SVN_ERR(tweak_statushash(db->parent_baton, db, TRUE,eb->db,
                              db->local_abspath,
-                             kind == svn_kind_dir,
                              svn_wc_status_modified, svn_wc_status_modified,
                              0, SVN_INVALID_REVNUM, NULL, pool));
 
@@ -2209,7 +2204,7 @@ close_directory(void *dir_baton,
           /* ### When we add directory locking, we need to find a
              ### directory lock here. */
           SVN_ERR(tweak_statushash(pb, db, TRUE, eb->db, db->local_abspath,
-                                   TRUE, repos_node_status, repos_text_status,
+                                   repos_node_status, repos_text_status,
                                    repos_prop_status, SVN_INVALID_REVNUM, NULL,
                                    pool));
         }
@@ -2454,7 +2449,7 @@ close_file(void *file_baton,
     }
 
   return tweak_statushash(fb, NULL, FALSE, fb->edit_baton->db,
-                          fb->local_abspath, FALSE, repos_node_status,
+                          fb->local_abspath, repos_node_status,
                           repos_text_status, repos_prop_status,
                           SVN_INVALID_REVNUM, repos_lock, pool);
 }
@@ -2649,9 +2644,6 @@ svn_wc__internal_walk_status(svn_wc__db_
   wb.repos_root = NULL;
   wb.repos_locks = NULL;
 
-  SVN_ERR(svn_wc__db_externals_defined_below(&wb.externals, db, local_abspath,
-                                             scratch_pool, scratch_pool));
-
   /* Use the caller-provided ignore patterns if provided; the build-time
      configured defaults otherwise. */
   if (!ignore_patterns)
@@ -2673,7 +2665,12 @@ svn_wc__internal_walk_status(svn_wc__db_
         }
       else
         return svn_error_trace(err);
+
+      wb.externals = apr_hash_make(scratch_pool);
     }
+  else
+    SVN_ERR(svn_wc__db_externals_defined_below(&wb.externals, db, local_abspath,
+                                               scratch_pool, scratch_pool));
 
   SVN_ERR(svn_io_stat_dirent(&dirent, local_abspath, TRUE,
                              scratch_pool, scratch_pool));
@@ -2703,15 +2700,27 @@ svn_wc__internal_walk_status(svn_wc__db_
       /* It may be a file or an unversioned item. And this is an explicit
        * target, so no ignoring. An unversioned item (file or dir) shows a
        * status like '?', and can yield a tree conflicted path. */
-      SVN_ERR(get_child_status(&wb,
-                               local_abspath,
-                               info,
-                               dirent,
-                               ignore_patterns,
-                               get_all,
-                               status_func, status_baton,
-                               cancel_func, cancel_baton,
-                               scratch_pool));
+      err = get_child_status(&wb,
+                             local_abspath,
+                             info,
+                             dirent,
+                             ignore_patterns,
+                             get_all,
+                             status_func, status_baton,
+                             cancel_func, cancel_baton,
+                             scratch_pool);
+
+      if (!info && err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+        {
+          /* The parent is also not versioned, but it is not nice to show
+             an error about a path a user didn't intend to touch. */
+          svn_error_clear(err);
+          return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                                   _("The node '%s' was not found."),
+                                   svn_dirent_local_style(local_abspath,
+                                                          scratch_pool));
+        }
+      SVN_ERR(err);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/tree_conflicts.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/tree_conflicts.c Wed Jun  6 13:03:48 2012
@@ -158,15 +158,18 @@ read_node_version_info(const svn_wc_conf
                             _("Invalid version info in tree conflict "
                               "description"));
 
-  repos_root = apr_pstrmemdup(result_pool,
-                                           skel->children->next->data,
-                                           skel->children->next->len);
+  repos_root = apr_pstrmemdup(scratch_pool,
+                              skel->children->next->data,
+                              skel->children->next->len);
   if (*repos_root == '\0')
     {
       *version_info = NULL;
       return SVN_NO_ERROR;
     }
 
+  /* Apply the Subversion 1.7+ url canonicalization rules to a pre 1.7 url */
+  repos_root = svn_uri_canonicalize(repos_root, result_pool);
+
   peg_rev = SVN_STR_TO_REV(apr_pstrmemdup(scratch_pool,
                                           skel->children->next->next->data,
                                           skel->children->next->next->len));

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c Wed Jun  6 13:03:48 2012
@@ -3888,7 +3888,6 @@ merge_file(svn_skel_t **work_items,
   struct dir_baton *pb = fb->dir_baton;
   svn_boolean_t is_locally_modified;
   enum svn_wc_merge_outcome_t merge_outcome = svn_wc_merge_unchanged;
-  svn_skel_t *work_item;
   const char *working_abspath = fb->moved_to_abspath ? fb->moved_to_abspath
                                                      : fb->local_abspath;
 
@@ -4059,26 +4058,6 @@ merge_file(svn_skel_t **work_items,
         }
     }
 
-  /* Installing from a pristine will handle timestamps and recording.
-     However, if we are NOT creating a new working copy file, then create
-     work items to handle the recording of the timestamp and working-size. */
-  if (!*install_pristine
-      && !is_locally_modified)
-    {
-      apr_time_t set_date = 0;
-
-      if (eb->use_commit_times && last_changed_date != 0)
-        {
-          set_date = last_changed_date;
-        }
-
-      SVN_ERR(svn_wc__wq_build_record_fileinfo(&work_item,
-                                               eb->db, working_abspath,
-                                               set_date,
-                                               result_pool, scratch_pool));
-      *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
-    }
-
   /* Set the returned content state. */
 
   /* This is kind of interesting.  Even if no new text was

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/util.c?rev=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/util.c Wed Jun  6 13:03:48 2012
@@ -546,7 +546,9 @@ svn_wc__fetch_kind_func(svn_kind_t *kind
   const char *local_abspath = svn_dirent_join(sfb->base_abspath, path,
                                               scratch_pool);
 
-  SVN_ERR(svn_wc__db_read_kind(kind, sfb->db, local_abspath, FALSE,
+  SVN_ERR(svn_wc__db_read_kind(kind, sfb->db, local_abspath,
+                               FALSE /* allow_missing */,
+                               FALSE /* show_hidden */,
                                scratch_pool));
 
   return SVN_NO_ERROR;

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=1346869&r1=1346868&r2=1346869&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql Wed Jun  6 13:03:48 2012
@@ -279,22 +279,27 @@ WHERE wc_id = ?1 AND local_relpath = ?2 
 SELECT dav_cache FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
 
+-- STMT_SELECT_DELETION_INFO
+SELECT (SELECT b.presence FROM nodes AS b
+         WHERE b.wc_id = ?1 AND b.local_relpath = ?2 AND b.op_depth = 0),
+       work.presence, work.op_depth
+FROM nodes_current AS work
+WHERE work.wc_id = ?1 AND work.local_relpath = ?2 AND work.op_depth > 0
+LIMIT 1
+
+-- STMT_SELECT_DELETION_INFO_SCAN
 /* ### FIXME.  modes_move.moved_to IS NOT NULL works when there is
  only one move but we need something else when there are several. */
--- STMT_SELECT_DELETION_INFO
-SELECT nodes_base.presence, nodes_work.presence, nodes_move.moved_to,
-       nodes_work.op_depth
-FROM nodes AS nodes_work
-LEFT OUTER JOIN nodes nodes_move ON nodes_move.wc_id = nodes_work.wc_id
-  AND nodes_move.local_relpath = nodes_work.local_relpath
-  AND nodes_move.moved_to IS NOT NULL
-LEFT OUTER JOIN nodes nodes_base ON nodes_base.wc_id = nodes_work.wc_id
- AND nodes_base.local_relpath = nodes_work.local_relpath
- AND nodes_base.op_depth = 0
-WHERE nodes_work.wc_id = ?1 AND nodes_work.local_relpath = ?2
-  AND nodes_work.op_depth = (SELECT MAX(op_depth) FROM nodes
-                             WHERE wc_id = ?1 AND local_relpath = ?2
-                                              AND op_depth > 0)
+SELECT (SELECT b.presence FROM nodes AS b
+         WHERE b.wc_id = ?1 AND b.local_relpath = ?2 AND b.op_depth = 0),
+       work.presence, work.op_depth, moved.moved_to
+FROM nodes_current AS work
+LEFT OUTER JOIN nodes AS moved 
+  ON moved.wc_id = work.wc_id
+ AND moved.local_relpath = work.local_relpath
+ AND moved.moved_to IS NOT NULL
+WHERE work.wc_id = ?1 AND work.local_relpath = ?2 AND work.op_depth > 0
+LIMIT 1
 
 -- STMT_SELECT_OP_DEPTH_MOVED_TO
 SELECT op_depth, moved_to, repos_path, revision
@@ -347,6 +352,10 @@ WHERE wc_id = ?1 AND local_relpath = ?2
   AND op_depth = (SELECT MAX(op_depth) FROM nodes
                   WHERE wc_id = ?1 AND local_relpath = ?2)
 
+-- STMT_UPDATE_NODE_FILEINFO_OPDEPTH
+UPDATE nodes SET translated_size = ?3, last_mod_time = ?4
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?5
+
 -- STMT_UPDATE_ACTUAL_TREE_CONFLICTS
 UPDATE actual_node SET tree_conflict_data = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2
@@ -905,7 +914,7 @@ SELECT wc_id, ?3 /*local_relpath*/, ?4 /
     ?7/*moved_here*/, kind, changed_revision, changed_date,
     changed_author, checksum, properties, translated_size,
     last_mod_time, symlink_target,
-    (SELECT dst.moved_to FROM nodes_current AS dst
+    (SELECT dst.moved_to FROM nodes AS dst
                          WHERE dst.wc_id = ?1
                          AND dst.local_relpath = ?3
                          AND dst.op_depth = ?4)
@@ -923,7 +932,7 @@ SELECT wc_id, ?3 /*local_relpath*/, ?4 /
     ?7 /*moved_here*/, kind, changed_revision, changed_date,
     changed_author, checksum, properties, translated_size,
     last_mod_time, symlink_target,
-    (SELECT dst.moved_to FROM nodes_current AS dst
+    (SELECT dst.moved_to FROM nodes AS dst
                          WHERE dst.wc_id = ?1
                          AND dst.local_relpath = ?3
                          AND dst.op_depth = ?4)