subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1568883 [5/6] - in /subversion/branches/fsfs-ucsnorm: ./ build/generator/ contrib/client-side/ contrib/client-side/emacs/ contrib/hook-scripts/ contrib/server-side/ notes/ notes/meetings/ notes/wc-ng/ subversion/bindings/ctypes-python/csvn...
Date Mon, 17 Feb 2014 05:53:26 GMT
Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/cache-membuffer.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/cache-membuffer.c Mon Feb 17 05:53:23 2014
@@ -97,7 +97,7 @@
  * about 50% of the content survives every 50% of the cache being re-written
  * with new entries. For details on the fine-tuning involved, see the
  * comments in ensure_data_insertable_l2().
- * 
+ *
  * Due to the randomized mapping of keys to entry groups, some groups may
  * overflow.  In that case, there are spare groups that can be chained to
  * an already used group to extend it.
@@ -508,7 +508,7 @@ struct svn_membuffer_t
    */
   unsigned char *data;
 
-  /* Total number of data buffer bytes in use. This is for statistics only.
+  /* Total number of data buffer bytes in use.
    */
   apr_uint64_t data_used;
 
@@ -550,17 +550,23 @@ struct svn_membuffer_t
 
 
   /* Total number of calls to membuffer_cache_get.
-   * Purely statistical information that may be used for profiling.
+   * Purely statistical information that may be used for profiling only.
+   * Updates are not synchronized and values may be nonsensicle on some
+   * platforms.
    */
   apr_uint64_t total_reads;
 
   /* Total number of calls to membuffer_cache_set.
-   * Purely statistical information that may be used for profiling.
+   * Purely statistical information that may be used for profiling only.
+   * Updates are not synchronized and values may be nonsensicle on some
+   * platforms.
    */
   apr_uint64_t total_writes;
 
   /* Total number of hits since the cache's creation.
-   * Purely statistical information that may be used for profiling.
+   * Purely statistical information that may be used for profiling only.
+   * Updates are not synchronized and values may be nonsensicle on some
+   * platforms.
    */
   apr_uint64_t total_hits;
 
@@ -577,6 +583,12 @@ struct svn_membuffer_t
    */
   svn_boolean_t allow_blocking_writes;
 #endif
+
+  /* All counters that have consistency requirements on thems (currently,
+   * that's only the hit counters) must use this mutex to serialize their
+   * updates.
+   */
+  svn_mutex__t *counter_mutex;
 };
 
 /* Align integer VALUE to the next ITEM_ALIGNMENT boundary.
@@ -1437,10 +1449,10 @@ ensure_data_insertable_l2(svn_membuffer_
                * or is smaller than the one to insert - both relative to
                * their respective priority.
                */
-              keep = to_fit_in->hit_count * to_fit_in->priority
-                   < entry->hit_count * entry->priority
-                  || to_fit_in->size * to_fit_in->priority
-                   < entry->size * entry->priority;
+              keep = (apr_uint64_t)to_fit_in->hit_count * to_fit_in->priority
+                   < (apr_uint64_t)entry->hit_count * entry->priority
+                  || (apr_uint64_t)to_fit_in->size * to_fit_in->priority
+                   < (apr_uint64_t)entry->size * entry->priority;
             }
           else if (cache->hit_count > cache->used_entries)
             {
@@ -1774,6 +1786,8 @@ svn_cache__membuffer_cache_create(svn_me
        */
       c[seg].allow_blocking_writes = allow_blocking_writes;
 #endif
+
+      SVN_ERR(svn_mutex__init(&c[seg].counter_mutex, thread_safe, pool));
     }
 
   /* done here
@@ -1881,7 +1895,11 @@ membuffer_cache_set_internal(svn_membuff
    * the old spot, just re-use that space. */
   if (entry && ALIGN_VALUE(entry->size) >= size && buffer)
     {
-      cache->data_used += size - entry->size;
+      /* Careful! We need to cast SIZE to the full width of CACHE->DATA_USED
+       * lest we run into trouble with 32 bit underflow *not* treated as a
+       * negative value.
+       */
+      cache->data_used += (apr_uint64_t)size - entry->size;
       entry->size = size;
       entry->priority = priority;
 
@@ -1994,6 +2012,25 @@ membuffer_cache_set(svn_membuffer_t *cac
   return SVN_NO_ERROR;
 }
 
+/* Count a hit in ENTRY within CACHE.
+ */
+static svn_error_t *
+increment_hit_counters(svn_membuffer_t *cache, entry_t *entry)
+{
+  /* To minimize the memory footprint of the cache index, we limit local
+   * hit counters to 32 bits.  These may overflow and we must make sure that
+   * the global sums are still the sum of all local counters. */
+  if (++entry->hit_count == 0)
+    cache->hit_count -= APR_UINT32_MAX;
+  else
+    cache->hit_count++;
+
+  /* That one is for stats only. */
+  cache->total_hits++;
+
+  return SVN_NO_ERROR;
+}
+
 /* Look for the cache entry in group GROUP_INDEX of CACHE, identified
  * by the hash value TO_FIND. If no item has been stored for KEY,
  * *BUFFER will be NULL. Otherwise, return a copy of the serialized
@@ -2050,10 +2087,8 @@ membuffer_cache_get_internal(svn_membuff
 
   /* update hit statistics
    */
-  entry->hit_count++;
-  cache->hit_count++;
-  cache->total_hits++;
-
+  SVN_MUTEX__WITH_LOCK(cache->counter_mutex,
+                       increment_hit_counters(cache, entry));
   *item_size = entry->size;
 
   return SVN_NO_ERROR;
@@ -2112,14 +2147,13 @@ membuffer_cache_has_key_internal(svn_mem
   entry_t *entry = find_entry(cache, group_index, to_find, FALSE);
   if (entry)
     {
-      /* This is often happen in "block read" where most data is already
+      /* This often be called by "block read" when most data is already
          in L2 and only a few previously evicted items are added to L1
          again.  While items in L1 are well protected for a while, L2
          items may get evicted soon.  Thus, mark all them as "hit" to give
-         them a higher chance for survival. */
-      entry->hit_count++;
-      cache->hit_count++;
-      cache->total_hits++;
+         them a higher chance of survival. */
+      SVN_MUTEX__WITH_LOCK(cache->counter_mutex,
+                           increment_hit_counters(cache, entry));
 
       *found = TRUE;
     }
@@ -2190,9 +2224,8 @@ membuffer_cache_get_partial_internal(svn
     {
       *found = TRUE;
 
-      entry->hit_count++;
-      cache->hit_count++;
-      cache->total_hits++;
+      SVN_MUTEX__WITH_LOCK(cache->counter_mutex,
+                           increment_hit_counters(cache, entry));
 
 #ifdef SVN_DEBUG_CACHE_MEMBUFFER
 
@@ -2282,8 +2315,8 @@ membuffer_cache_set_partial_internal(svn
       char *orig_data = data;
       apr_size_t size = entry->size;
 
-      entry->hit_count++;
-      cache->hit_count++;
+      SVN_MUTEX__WITH_LOCK(cache->counter_mutex,
+                           increment_hit_counters(cache, entry));
       cache->total_writes++;
 
 #ifdef SVN_DEBUG_CACHE_MEMBUFFER

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/file.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/file.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/file.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/file.c Mon Feb 17 05:53:23 2014
@@ -403,7 +403,7 @@ close_file(svn_file_t *file)
   return SVN_NO_ERROR;
 }
 
-apr_size_t
+int
 svn_file__get_max_shared_handles(void)
 {
   return get_handle_pool()->capacity;
@@ -411,7 +411,7 @@ svn_file__get_max_shared_handles(void)
 
 static svn_error_t *
 set_max_shared_handles_internal(shared_handle_pool_t *handle_pool,
-                                apr_size_t new_max)
+                                int new_max)
 {
   handle_pool->capacity = new_max;
   while (   (handle_pool->capacity > handle_pool->open_count)
@@ -425,7 +425,7 @@ set_max_shared_handles_internal(shared_h
 }
 
 svn_error_t *
-svn_file__set_max_shared_handles(apr_size_t new_max)
+svn_file__set_max_shared_handles(int new_max)
 {
   shared_handle_pool_t *handle_pool = get_handle_pool();
   SVN_MUTEX__WITH_LOCK(handle_pool->mutex,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/fnv1a.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/fnv1a.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/fnv1a.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/fnv1a.c Mon Feb 17 05:53:23 2014
@@ -37,7 +37,7 @@
  * http://www.isthe.com/chongo/tech/comp/fnv/ 
  */
 #define FNV1_PRIME_32 0x01000193
-#define FNV1_BASE_32 2166136261
+#define FNV1_BASE_32 2166136261U
 
 /* FNV-1a core implementation returning a 32 bit checksum over the first
  * LEN bytes in INPUT.  HASH is the checksum over preceding data (if any).

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/io.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/io.c Mon Feb 17 05:53:23 2014
@@ -1502,7 +1502,7 @@ get_default_file_perms(apr_fileperms_t *
       /* Get the perms for a newly created file to find out what bits
         should be set.
 
-        Explictly delete the file because we want this file to be as
+        Explicitly delete the file because we want this file to be as
         short-lived as possible since its presence means other
         processes may have to try multiple names.
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/spillbuf.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/spillbuf.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/spillbuf.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/spillbuf.c Mon Feb 17 05:53:23 2014
@@ -697,7 +697,8 @@ svn_stream__from_spillbuf(svn_spillbuf_t
 
   stream = svn_stream_create(sb, result_pool);
 
-  svn_stream_set_read(stream, read_handler_spillbuf);
+  svn_stream_set_read2(stream, NULL /* only full read support */,
+                       read_handler_spillbuf);
   svn_stream_set_write(stream, write_handler_spillbuf);
 
   return stream;

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sqlite.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sqlite.c Mon Feb 17 05:53:23 2014
@@ -1080,6 +1080,18 @@ svn_sqlite__open(svn_sqlite__db_t **db, 
 
   SVN_ERR(internal_open(&(*db)->db3, path, mode, scratch_pool));
 
+#if SQLITE_VERSION_NUMBER >= 3008000 && SQLITE_VERSION_NUMBER < 3009000
+  /* disable SQLITE_ENABLE_STAT3/4 from 3.8.1 - 3.8.3 (but not 3.8.3.1+)
+   * to prevent using it when it's buggy.
+   * See: https://www.sqlite.org/src/info/4c86b126f2 */
+  if (sqlite3_libversion_number() > 3008000 &&
+      sqlite3_libversion_number() < 3008004 &&
+      strcmp(sqlite3_sourceid(),"2014-02-11")<0)
+    {
+      sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, (*db)->db3, 0x800);
+    }
+#endif
+
 #ifdef SVN_UNICODE_NORMALIZATION_FIXES
   /* Create extension buffers with space for 200 UCS-4 characters. */
   svn_membuf__create(&(*db)->sqlext_buf1, 800, result_pool);
@@ -1119,14 +1131,14 @@ svn_sqlite__open(svn_sqlite__db_t **db, 
   sqlite3_profile((*db)->db3, sqlite_profiler, (*db)->db3);
 #endif
 
-  /* ### simplify this. remnants of some old SQLite compat code.  */
-  {
-    int ignored_err = SQLITE_OK;
-
-    SVN_ERR(exec_sql2(*db, "PRAGMA case_sensitive_like=1;", ignored_err));
-  }
-
   SVN_ERR(exec_sql(*db,
+              /* The default behavior of the LIKE operator is to ignore case
+                 for ASCII characters. Hence, by default 'a' LIKE 'A' is true.
+                 The case_sensitive_like pragma installs a new application-
+                 defined LIKE function that is either case sensitive or
+                 insensitive depending on the value of the case_sensitive_like
+                 pragma. */
+              "PRAGMA case_sensitive_like=1;"
               /* Disable synchronization to disable the explicit disk flushes
                  that make Sqlite up to 50 times slower; especially on small
                  transactions.
@@ -1143,7 +1155,13 @@ svn_sqlite__open(svn_sqlite__db_t **db, 
               /* Enable recursive triggers so that a user trigger will fire
                  in the deletion phase of an INSERT OR REPLACE statement.
                  Requires SQLite >= 3.6.18  */
-              "PRAGMA recursive_triggers=ON;"));
+              "PRAGMA recursive_triggers=ON;"
+              /* Enforce current Sqlite default behavior. Some distributions
+                 might change the Sqlite defaults without realizing how this
+                 affects application(read: Subversion) performance/behavior. */
+              "PRAGMA foreign_keys=OFF;"      /* SQLITE_DEFAULT_FOREIGN_KEYS*/
+              "PRAGMA locking_mode = NORMAL;" /* SQLITE_DEFAULT_LOCKING_MODE */
+              ));
 
 #if defined(SVN_DEBUG)
   /* When running in debug mode, enable the checking of foreign key
@@ -1152,6 +1170,14 @@ svn_sqlite__open(svn_sqlite__db_t **db, 
   SVN_ERR(exec_sql(*db, "PRAGMA foreign_keys=ON;"));
 #endif
 
+#ifdef SVN_SQLITE_REVERSE_UNORDERED_SELECTS
+  /* When enabled, this PRAGMA causes SELECT statements without an ORDER BY
+     clause to emit their results in the reverse order of what they normally
+     would.  This can help detecting invalid assumptions about the result
+     order.*/
+  SVN_ERR(exec_sql(*db, "PRAGMA reverse_unordered_selects=ON;"));
+#endif
+
   /* Store temporary tables in RAM instead of in temporary files, but don't
      fail on this if this option is disabled in the sqlite compilation by
      setting SQLITE_TEMP_STORE to 0 (always to disk) */

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/stream.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/stream.c Mon Feb 17 05:53:23 2014
@@ -214,7 +214,9 @@ svn_stream_skip(svn_stream_t *stream, ap
 svn_error_t *
 svn_stream_write(svn_stream_t *stream, const char *data, apr_size_t *len)
 {
-  SVN_ERR_ASSERT(stream->write_fn != NULL);
+  if (stream->write_fn == NULL)
+    return svn_error_create(SVN_ERR_STREAM_NOT_SUPPORTED, NULL, NULL);
+
   return svn_error_trace(stream->write_fn(stream->baton, data, len));
 }
 
@@ -1305,7 +1307,8 @@ svn_stream_compressed(svn_stream_t *stre
   baton->read_flush = Z_SYNC_FLUSH;
 
   zstream = svn_stream_create(baton, pool);
-  svn_stream_set_read(zstream, read_handler_gz);
+  svn_stream_set_read2(zstream, NULL /* only full read support */,
+                       read_handler_gz);
   svn_stream_set_write(zstream, write_handler_gz);
   svn_stream_set_close(zstream, close_handler_gz);
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/string.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/string.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/string.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/string.c Mon Feb 17 05:53:23 2014
@@ -150,7 +150,7 @@ string_compare(const char *str1,
   if (len1 != len2)
     return FALSE;
 
-  /* now the strings must have identical lenghths */
+  /* now the strings must have identical lengths */
 
   if ((memcmp(str1, str2, len1)) == 0)
     return TRUE;

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/subst.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/subst.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/subst.c Mon Feb 17 05:53:23 2014
@@ -1541,7 +1541,8 @@ stream_translated(svn_stream_t *stream,
   baton->buf = apr_palloc(result_pool, SVN__TRANSLATION_BUF_SIZE);
 
   /* Setup the stream methods */
-  svn_stream_set_read(s, translated_stream_read);
+  svn_stream_set_read2(s, NULL /* only full read support */,
+                       translated_stream_read);
   svn_stream_set_write(s, translated_stream_write);
   svn_stream_set_close(s, translated_stream_close);
   svn_stream_set_mark(s, translated_stream_mark);
@@ -1940,7 +1941,8 @@ svn_subst_stream_from_specialfile(svn_st
   baton->write_stream = svn_stream_from_stringbuf(baton->write_content, pool);
 
   *stream = svn_stream_create(baton, pool);
-  svn_stream_set_read(*stream, read_handler_special);
+  svn_stream_set_read2(*stream, NULL /* only full read support */,
+                       read_handler_special);
   svn_stream_set_write(*stream, write_handler_special);
   svn_stream_set_close(*stream, close_handler_special);
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sysinfo.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sysinfo.c Mon Feb 17 05:53:23 2014
@@ -550,22 +550,46 @@ linux_release_name(apr_pool_t *pool)
 typedef DWORD (WINAPI *FNGETNATIVESYSTEMINFO)(LPSYSTEM_INFO);
 typedef BOOL (WINAPI *FNENUMPROCESSMODULES) (HANDLE, HMODULE*, DWORD, LPDWORD);
 
-/* Get system and version info, and try to tell the difference
-   between the native system type and the runtime environment of the
-   current process. Populate results in SYSINFO, LOCAL_SYSINFO
-   (optional) and OSINFO. */
+svn_boolean_t
+svn_sysinfo___fill_windows_version(OSVERSIONINFOEXW *version_info)
+{
+  memset(version_info, 0, sizeof(*version_info));
+
+  version_info->dwOSVersionInfoSize = sizeof(*version_info);
+
+  /* Kill warnings with the Windows 8 and later platform SDK */
+#if _MSC_VER > 1600 && NTDDI_VERSION >= _0x06020000
+  /* Windows 8 deprecated the API to retrieve the Windows version to avoid
+     backwards compatibility problems... It might return a constant version
+     in future Windows versions... But let's kill the warning.
+
+     We can implementation this using a different function later. */
+#pragma warning(push)
+#pragma warning(disable: 4996)
+#endif
+
+  /* Prototype supports OSVERSIONINFO */
+  return GetVersionExW((LPVOID)version_info);
+#if _MSC_VER > 1600 && NTDDI_VERSION >= _0x06020000
+#pragma warning(pop)
+#pragma warning(disable: 4996)
+#endif
+}
+
+/* Get system info, and try to tell the difference between the native
+   system type and the runtime environment of the current process.
+   Populate results in SYSINFO and LOCAL_SYSINFO (optional). */
 static BOOL
 system_info(SYSTEM_INFO *sysinfo,
-            SYSTEM_INFO *local_sysinfo,
-            OSVERSIONINFOEXW *osinfo)
+            SYSTEM_INFO *local_sysinfo)
 {
   FNGETNATIVESYSTEMINFO GetNativeSystemInfo_ = (FNGETNATIVESYSTEMINFO)
     GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetNativeSystemInfo");
 
-  ZeroMemory(sysinfo, sizeof *sysinfo);
+  memset(sysinfo, 0, sizeof *sysinfo);
   if (local_sysinfo)
     {
-      ZeroMemory(local_sysinfo, sizeof *local_sysinfo);
+      memset(local_sysinfo, 0, sizeof *local_sysinfo);
       GetSystemInfo(local_sysinfo);
       if (GetNativeSystemInfo_)
         GetNativeSystemInfo_(sysinfo);
@@ -575,11 +599,6 @@ system_info(SYSTEM_INFO *sysinfo,
   else
     GetSystemInfo(sysinfo);
 
-  ZeroMemory(osinfo, sizeof *osinfo);
-  osinfo->dwOSVersionInfoSize = sizeof *osinfo;
-  if (!GetVersionExW((LPVOID)osinfo))
-    return FALSE;
-
   return TRUE;
 }
 
@@ -612,7 +631,8 @@ win32_canonical_host(apr_pool_t *pool)
   SYSTEM_INFO local_sysinfo;
   OSVERSIONINFOEXW osinfo;
 
-  if (system_info(&sysinfo, &local_sysinfo, &osinfo))
+  if (system_info(&sysinfo, &local_sysinfo)
+      && svn_sysinfo___fill_windows_version(&osinfo))
     {
       const char *arch = processor_name(&local_sysinfo);
       const char *machine = processor_name(&sysinfo);
@@ -676,7 +696,8 @@ win32_release_name(apr_pool_t *pool)
   OSVERSIONINFOEXW osinfo;
   HKEY hkcv;
 
-  if (!system_info(&sysinfo, NULL, &osinfo))
+  if (!system_info(&sysinfo, NULL)
+      || !svn_sysinfo___fill_windows_version(&osinfo))
     return NULL;
 
   if (!RegOpenKeyExW(HKEY_LOCAL_MACHINE,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sysinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sysinfo.h?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sysinfo.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/sysinfo.h Mon Feb 17 05:53:23 2014
@@ -62,6 +62,17 @@ const apr_array_header_t *svn_sysinfo__l
  */
 const apr_array_header_t *svn_sysinfo__loaded_libs(apr_pool_t *pool);
 
+#ifdef WIN32
+/* Obtain the Windows version information as OSVERSIONINFOEXW structure.
+ *
+ * !!! Unlike other apis the caller is expected to pre-allocate the buffer
+ * !!! to allow using this api from the crash handler.
+ */
+svn_boolean_t
+svn_sysinfo___fill_windows_version(OSVERSIONINFOEXW *version_info);
+#endif
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/utf8proc.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/utf8proc.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/utf8proc.c Mon Feb 17 05:53:23 2014
@@ -196,7 +196,7 @@ svn_utf__normalize(const char **result,
  * Assume BUFFER is already filled to *LENGTH and return the new size there.
  * This function does *not* nul-terminate the stringbuf!
  *
- * A returned error indicates that the codepoint is invalud.
+ * A returned error indicates that the codepoint is invalid.
  */
 static svn_error_t *
 encode_ucs4(svn_membuf_t *buffer, apr_int32_t ucs4chr, apr_size_t *length)
@@ -217,10 +217,10 @@ encode_ucs4(svn_membuf_t *buffer, apr_in
 
 /* Decode an UCS-4 string to UTF-8, placing the result into BUFFER.
  * While utf8proc does have a similar function, it does more checking
- * and processing than we want here. Return the lenght of the result
+ * and processing than we want here. Return the length of the result
  * (excluding the NUL terminator) in *result_length.
  *
- * A returned error indicates that the codepoint is invalud.
+ * A returned error indicates that the codepoint is invalid.
  */
 static svn_error_t *
 encode_ucs4_string(svn_membuf_t *buffer,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/win32_crashrpt.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/win32_crashrpt.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_subr/win32_crashrpt.c Mon Feb 17 05:53:23 2014
@@ -37,6 +37,8 @@ typedef int win32_crashrpt__dummy;
 
 #include "svn_version.h"
 
+#include "sysinfo.h"
+
 #include "win32_crashrpt.h"
 #include "win32_crashrpt_dll.h"
 
@@ -188,7 +190,7 @@ static void
 write_process_info(EXCEPTION_RECORD *exception, CONTEXT *context,
                    FILE *log_file)
 {
-  OSVERSIONINFO oi;
+  OSVERSIONINFOEXW oi;
   const char *cmd_line;
   char workingdir[8192];
 
@@ -207,13 +209,11 @@ write_process_info(EXCEPTION_RECORD *exc
                 SVN_VERSION, __DATE__, __TIME__);
 
   /* write information about the OS */
-  oi.dwOSVersionInfoSize = sizeof(oi);
-  GetVersionEx(&oi);
-
-  fprintf(log_file,
-                "Platform: Windows OS version %d.%d build %d %s\n\n",
-                oi.dwMajorVersion, oi.dwMinorVersion, oi.dwBuildNumber,
-                oi.szCSDVersion);
+  if (svn_sysinfo___fill_windows_version(&oi))
+    fprintf(log_file,
+                  "Platform: Windows OS version %d.%d build %d %S\n\n",
+                  oi.dwMajorVersion, oi.dwMinorVersion, oi.dwBuildNumber,
+                  oi.szCSDVersion);
 
   /* write the exception code */
   fprintf(log_file,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/adm_crawler.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/adm_crawler.c Mon Feb 17 05:53:23 2014
@@ -144,7 +144,7 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
   return SVN_NO_ERROR;
 }
 
-/* Try to restore LOCAL_ABSPATH of node type KIND and if successfull,
+/* Try to restore LOCAL_ABSPATH of node type KIND and if successful,
    notify that the node is restored.  Use DB for accessing the working copy.
    If USE_COMMIT_TIMES is set, then set working file's timestamp to
    last-commit-time.
@@ -909,7 +909,8 @@ copying_stream(svn_stream_t *source,
   baton->target = target;
 
   stream = svn_stream_create(baton, pool);
-  svn_stream_set_read(stream, read_handler_copy);
+  svn_stream_set_read2(stream, NULL /* only full read support */,
+                       read_handler_copy);
   svn_stream_set_close(stream, close_handler_copy);
 
   return stream;

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/deprecated.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/deprecated.c Mon Feb 17 05:53:23 2014
@@ -1037,6 +1037,29 @@ svn_wc_add(const char *path,
                      compat_call_notify_func, &nb, pool);
 }
 
+/*** From revert.c ***/
+svn_error_t *
+svn_wc_revert4(svn_wc_context_t *wc_ctx,
+               const char *local_abspath,
+               svn_depth_t depth,
+               svn_boolean_t use_commit_times,
+               const apr_array_header_t *changelist_filter,
+               svn_cancel_func_t cancel_func,
+               void *cancel_baton,
+               svn_wc_notify_func2_t notify_func,
+               void *notify_baton,
+               apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(svn_wc_revert5(wc_ctx, local_abspath,
+                                        depth,
+                                        use_commit_times,
+                                        changelist_filter,
+                                        FALSE /* clear_changelists*/,
+                                        cancel_func, cancel_baton,
+                                        notify_func, notify_baton,
+                                        scratch_pool));
+}
+
 svn_error_t *
 svn_wc_revert3(const char *path,
                svn_wc_adm_access_t *parent_access,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/diff_local.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/diff_local.c Mon Feb 17 05:53:23 2014
@@ -121,7 +121,7 @@ ensure_state(struct diff_baton *eb,
       if (! relpath)
         return SVN_NO_ERROR;
 
-      /* Don't recurse on the anchor, as that might loop infinately because
+      /* Don't recurse on the anchor, as that might loop infinitely because
             svn_dirent_dirname("/",...)   -> "/"
             svn_dirent_dirname("C:/",...) -> "C:/" (Windows) */
       if (*relpath)

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/revert.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/revert.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/revert.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/revert.c Mon Feb 17 05:53:23 2014
@@ -635,17 +635,18 @@ revert_restore(svn_wc__db_t *db,
   return SVN_NO_ERROR;
 }
 
-
-svn_error_t *
-svn_wc__revert_internal(svn_wc__db_t *db,
-                        const char *local_abspath,
-                        svn_depth_t depth,
-                        svn_boolean_t use_commit_times,
-                        svn_cancel_func_t cancel_func,
-                        void *cancel_baton,
-                        svn_wc_notify_func2_t notify_func,
-                        void *notify_baton,
-                        apr_pool_t *scratch_pool)
+/* Revert tree LOCAL_ABSPATH to depth DEPTH and notify for all reverts. */
+static svn_error_t *
+revert(svn_wc__db_t *db,
+       const char *local_abspath,
+       svn_depth_t depth,
+       svn_boolean_t use_commit_times,
+       svn_boolean_t clear_changelists,
+       svn_cancel_func_t cancel_func,
+       void *cancel_baton,
+       svn_wc_notify_func2_t notify_func,
+       void *notify_baton,
+       apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
 
@@ -667,7 +668,7 @@ svn_wc__revert_internal(svn_wc__db_t *db
     SVN_ERR(svn_wc__write_check(db, dir_abspath, scratch_pool));
   }
 
-  err = svn_wc__db_op_revert(db, local_abspath, depth,
+  err = svn_wc__db_op_revert(db, local_abspath, depth, clear_changelists,
                              scratch_pool, scratch_pool);
 
   if (!err)
@@ -694,6 +695,7 @@ revert_changelist(svn_wc__db_t *db,
                   svn_depth_t depth,
                   svn_boolean_t use_commit_times,
                   apr_hash_t *changelist_hash,
+                  svn_boolean_t clear_changelists,
                   svn_cancel_func_t cancel_func,
                   void *cancel_baton,
                   svn_wc_notify_func2_t notify_func,
@@ -710,11 +712,11 @@ revert_changelist(svn_wc__db_t *db,
   /* Revert this node (depth=empty) if it matches one of the changelists.  */
   if (svn_wc__internal_changelist_match(db, local_abspath, changelist_hash,
                                         scratch_pool))
-    SVN_ERR(svn_wc__revert_internal(db, local_abspath,
-                                    svn_depth_empty, use_commit_times,
-                                    cancel_func, cancel_baton,
-                                    notify_func, notify_baton,
-                                    scratch_pool));
+    SVN_ERR(revert(db, local_abspath,
+                   svn_depth_empty, use_commit_times, clear_changelists,
+                   cancel_func, cancel_baton,
+                   notify_func, notify_baton,
+                   scratch_pool));
 
   if (depth == svn_depth_empty)
     return SVN_NO_ERROR;
@@ -746,6 +748,7 @@ revert_changelist(svn_wc__db_t *db,
 
       SVN_ERR(revert_changelist(db, child_abspath, depth,
                                 use_commit_times, changelist_hash,
+                                clear_changelists,
                                 cancel_func, cancel_baton,
                                 notify_func, notify_baton,
                                 iterpool));
@@ -770,6 +773,7 @@ revert_partial(svn_wc__db_t *db,
                const char *local_abspath,
                svn_depth_t depth,
                svn_boolean_t use_commit_times,
+               svn_boolean_t clear_changelists,
                svn_cancel_func_t cancel_func,
                void *cancel_baton,
                svn_wc_notify_func2_t notify_func,
@@ -789,9 +793,10 @@ revert_partial(svn_wc__db_t *db,
 
   /* Revert the root node itself (depth=empty), then move on to the
      children.  */
-  SVN_ERR(svn_wc__revert_internal(db, local_abspath, svn_depth_empty,
-                                  use_commit_times, cancel_func, cancel_baton,
-                                  notify_func, notify_baton, iterpool));
+  SVN_ERR(revert(db, local_abspath, svn_depth_empty,
+                 use_commit_times, clear_changelists,
+                 cancel_func, cancel_baton,
+                 notify_func, notify_baton, iterpool));
 
   SVN_ERR(svn_wc__db_read_children_of_working_node(&children, db,
                                                    local_abspath,
@@ -822,11 +827,11 @@ revert_partial(svn_wc__db_t *db,
         }
 
       /* Revert just this node (depth=empty).  */
-      SVN_ERR(svn_wc__revert_internal(db, child_abspath,
-                                      svn_depth_empty, use_commit_times,
-                                      cancel_func, cancel_baton,
-                                      notify_func, notify_baton,
-                                      iterpool));
+      SVN_ERR(revert(db, child_abspath,
+                     svn_depth_empty, use_commit_times, clear_changelists,
+                     cancel_func, cancel_baton,
+                     notify_func, notify_baton,
+                     iterpool));
     }
 
   svn_pool_destroy(iterpool);
@@ -836,11 +841,12 @@ revert_partial(svn_wc__db_t *db,
 
 
 svn_error_t *
-svn_wc_revert4(svn_wc_context_t *wc_ctx,
+svn_wc_revert5(svn_wc_context_t *wc_ctx,
                const char *local_abspath,
                svn_depth_t depth,
                svn_boolean_t use_commit_times,
                const apr_array_header_t *changelist_filter,
+               svn_boolean_t clear_changelists,
                svn_cancel_func_t cancel_func,
                void *cancel_baton,
                svn_wc_notify_func2_t notify_func,
@@ -856,17 +862,18 @@ svn_wc_revert4(svn_wc_context_t *wc_ctx,
       return svn_error_trace(revert_changelist(wc_ctx->db, local_abspath,
                                                depth, use_commit_times,
                                                changelist_hash,
+                                               clear_changelists,
                                                cancel_func, cancel_baton,
                                                notify_func, notify_baton,
                                                scratch_pool));
     }
 
   if (depth == svn_depth_empty || depth == svn_depth_infinity)
-    return svn_error_trace(svn_wc__revert_internal(wc_ctx->db, local_abspath,
-                                                   depth, use_commit_times,
-                                                   cancel_func, cancel_baton,
-                                                   notify_func, notify_baton,
-                                                   scratch_pool));
+    return svn_error_trace(revert(wc_ctx->db, local_abspath,
+                                  depth, use_commit_times, clear_changelists,
+                                  cancel_func, cancel_baton,
+                                  notify_func, notify_baton,
+                                  scratch_pool));
 
   /* The user may expect svn_depth_files/svn_depth_immediates to work
      on copied dirs with one level of children.  It doesn't, the user
@@ -877,6 +884,7 @@ svn_wc_revert4(svn_wc_context_t *wc_ctx,
   if (depth == svn_depth_files || depth == svn_depth_immediates)
     return svn_error_trace(revert_partial(wc_ctx->db, local_abspath,
                                           depth, use_commit_times,
+                                          clear_changelists,
                                           cancel_func, cancel_baton,
                                           notify_func, notify_baton,
                                           scratch_pool));

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/translate.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/translate.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/translate.c Mon Feb 17 05:53:23 2014
@@ -49,20 +49,6 @@
 #include "private/svn_wc_private.h"
 
 
-/* */
-static svn_error_t *
-read_handler_unsupported(void *baton, char *buffer, apr_size_t *len)
-{
-  SVN_ERR_MALFUNCTION();
-}
-
-/* */
-static svn_error_t *
-write_handler_unsupported(void *baton, const char *buffer, apr_size_t *len)
-{
-  SVN_ERR_MALFUNCTION();
-}
-
 svn_error_t *
 svn_wc__internal_translated_stream(svn_stream_t **stream,
                                    svn_wc__db_t *db,
@@ -132,16 +118,18 @@ svn_wc__internal_translated_stream(svn_s
                                                 FALSE /* expand */,
                                                 result_pool);
 
-          /* Enforce our contract. TO_NF streams are readonly */
-          svn_stream_set_write(*stream, write_handler_unsupported);
+          /* streams enforce our contract that TO_NF streams are read-only
+           * by returning SVN_ERR_STREAM_NOT_SUPPORTED when trying to
+           * write to them. */
         }
       else
         {
           *stream = svn_subst_stream_translated(*stream, eol, TRUE,
                                                 keywords, TRUE, result_pool);
 
-          /* Enforce our contract. FROM_NF streams are write-only */
-          svn_stream_set_read(*stream, read_handler_unsupported);
+          /* streams enforce our contract that FROM_NF streams are write-only
+           * by returning SVN_ERR_STREAM_NOT_SUPPORTED when trying to
+           * read them. */
         }
     }
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc-metadata.sql?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc-metadata.sql Mon Feb 17 05:53:23 2014
@@ -577,7 +577,7 @@ CREATE UNIQUE INDEX I_EXTERNALS_DEFINED 
    indexes to make better decisions in the query planner.
 
    For every interesting index this contains a number of rows where the
-   statistics ar calculated for and then for every column in the index the
+   statistics are calculated for and then for every column in the index the
    average number of rows with the same value in all columns left of this
    column including the column itself.
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc-queries.sql?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc-queries.sql Mon Feb 17 05:53:23 2014
@@ -252,9 +252,14 @@ WHERE wc_id = ?1 
 -- STMT_SELECT_LOCAL_RELPATH_OP_DEPTH
 SELECT local_relpath, kind
 FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
+UNION ALL
+SELECT local_relpath, kind
+FROM nodes
 WHERE wc_id = ?1
-  AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = ?3
+ORDER BY local_relpath
 
 -- STMT_SELECT_CHILDREN_OP_DEPTH
 SELECT local_relpath, kind
@@ -951,19 +956,25 @@ SELECT wc_id, local_relpath, op_depth, p
    AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
    AND op_depth = ?3
 
-/* If this query is updated, STMT_INSERT_DELETE_LIST should too. */
+/* If this query is updated, STMT_INSERT_DELETE_LIST should too.
+   Use UNION ALL instead of a simple 'OR' to avoid creating a temp table */
 -- STMT_INSERT_DELETE_FROM_NODE_RECURSIVE
 INSERT INTO nodes (
     wc_id, local_relpath, op_depth, parent_relpath, presence, kind)
 SELECT wc_id, local_relpath, ?4 /*op_depth*/, parent_relpath, MAP_BASE_DELETED,
        kind
 FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
+UNION ALL
+SELECT wc_id, local_relpath, ?4 /*op_depth*/, parent_relpath, MAP_BASE_DELETED,
+       kind
+FROM nodes
 WHERE wc_id = ?1
-  AND (local_relpath = ?2
-       OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = ?3
   AND presence NOT IN (MAP_BASE_DELETED, MAP_NOT_PRESENT, MAP_EXCLUDED, MAP_SERVER_EXCLUDED)
   AND file_external IS NULL
+ORDER BY local_relpath
 
 -- STMT_INSERT_WORKING_NODE_FROM_BASE_COPY
 INSERT INTO nodes (
@@ -1397,16 +1408,18 @@ CREATE TEMPORARY TABLE delete_list (
    A subquery is used instead of nodes_current to avoid a table scan */
 -- STMT_INSERT_DELETE_LIST
 INSERT INTO delete_list(local_relpath)
+SELECT ?2
+UNION ALL
 SELECT local_relpath FROM nodes AS n
 WHERE wc_id = ?1
-  AND (local_relpath = ?2
-       OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth >= ?3
   AND op_depth = (SELECT MAX(s.op_depth) FROM nodes AS s
                   WHERE s.wc_id = ?1
                     AND s.local_relpath = n.local_relpath)
   AND presence NOT IN (MAP_BASE_DELETED, MAP_NOT_PRESENT, MAP_EXCLUDED, MAP_SERVER_EXCLUDED)
   AND file_external IS NULL
+ORDER by local_relpath
 
 -- STMT_SELECT_DELETE_LIST
 SELECT local_relpath FROM delete_list
@@ -1542,9 +1555,7 @@ SELECT local_relpath, moved_to, op_depth
 WHERE wc_id = ?1
   AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND moved_to IS NOT NULL
-  AND op_depth >= (SELECT MAX(op_depth) FROM nodes o
-                    WHERE o.wc_id = ?1
-                      AND o.local_relpath = ?2)
+  AND op_depth >= ?3
 
 -- STMT_SELECT_MOVED_FROM_FOR_DELETE
 SELECT local_relpath, op_depth,
@@ -1568,10 +1579,15 @@ UPDATE nodes SET moved_to = NULL
 
 -- STMT_SELECT_MOVED_PAIR3
 SELECT local_relpath, moved_to, op_depth, kind FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3
+  AND moved_to IS NOT NULL
+UNION ALL
+SELECT local_relpath, moved_to, op_depth, kind FROM nodes
 WHERE wc_id = ?1
-  AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth > ?3
   AND moved_to IS NOT NULL
+ORDER BY local_relpath, op_depth
 
 -- STMT_SELECT_MOVED_OUTSIDE
 SELECT local_relpath, moved_to, op_depth FROM nodes

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc.h?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc.h Mon Feb 17 05:53:23 2014
@@ -782,19 +782,6 @@ svn_wc__externals_find_target_dups(apr_a
                                    apr_pool_t *pool,
                                    apr_pool_t *scratch_pool);
 
-/* Revert tree LOCAL_ABSPATH to depth DEPTH and notify for all
-   reverts. */
-svn_error_t *
-svn_wc__revert_internal(svn_wc__db_t *db,
-                        const char *local_abspath,
-                        svn_depth_t depth,
-                        svn_boolean_t use_commit_times,
-                        svn_cancel_func_t cancel_func,
-                        void *cancel_baton,
-                        svn_wc_notify_func2_t notify_func,
-                        void *notify_baton,
-                        apr_pool_t *scratch_pool);
-
 svn_error_t *
 svn_wc__node_has_local_mods(svn_boolean_t *modified,
                             svn_boolean_t *all_edits_are_deletes,

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db.c Mon Feb 17 05:53:23 2014
@@ -6443,6 +6443,13 @@ clear_moved_to(svn_wc__db_wcroot_t *wcro
   return SVN_NO_ERROR;
 }
 
+/* Baton for op_revert_txn and op_revert_recursive_txn */
+struct revert_baton_t
+{
+  svn_wc__db_t *db;
+  svn_boolean_t clear_changelists;
+};
+
 /* One of the two alternative bodies of svn_wc__db_op_revert().
  *
  * Implements svn_wc__db_txn_callback_t. */
@@ -6452,7 +6459,8 @@ op_revert_txn(void *baton,
               const char *local_relpath,
               apr_pool_t *scratch_pool)
 {
-  svn_wc__db_t *db = baton;
+  struct revert_baton_t *rvb = baton;
+  svn_wc__db_t *db = rvb->db;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
   int op_depth;
@@ -6597,17 +6605,27 @@ op_revert_txn(void *baton,
         SVN_ERR(clear_moved_to(wcroot, local_relpath, scratch_pool));
     }
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                  STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
-  if (!affected_rows)
+  if (rvb->clear_changelists)
     {
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                    STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST));
+                                        STMT_DELETE_ACTUAL_NODE));
       SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
       SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
     }
+  else
+    {
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                  STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+      SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+      if (!affected_rows)
+        {
+          SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                  STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST));
+          SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+          SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+        }
+    }
 
   return SVN_NO_ERROR;
 }
@@ -6622,6 +6640,7 @@ op_revert_recursive_txn(void *baton,
                         const char *local_relpath,
                         apr_pool_t *scratch_pool)
 {
+  struct revert_baton_t *rvb = baton;
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
   int op_depth;
@@ -6703,17 +6722,28 @@ op_revert_recursive_txn(void *baton,
                             local_relpath, select_op_depth));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
-  SVN_ERR(svn_sqlite__get_statement(
-                    &stmt, wcroot->sdb,
-                    STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__step_done(stmt));
-
-  SVN_ERR(svn_sqlite__get_statement(
-                    &stmt, wcroot->sdb,
-                    STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
-  SVN_ERR(svn_sqlite__step_done(stmt));
+  if (rvb->clear_changelists)
+    {
+      SVN_ERR(svn_sqlite__get_statement(
+                        &stmt, wcroot->sdb,
+                        STMT_DELETE_ACTUAL_NODE_RECURSIVE));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+      SVN_ERR(svn_sqlite__step_done(stmt));
+    }
+  else
+    {
+      SVN_ERR(svn_sqlite__get_statement(
+                        &stmt, wcroot->sdb,
+                        STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+      SVN_ERR(svn_sqlite__step_done(stmt));
+      
+      SVN_ERR(svn_sqlite__get_statement(
+                        &stmt, wcroot->sdb,
+                        STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+      SVN_ERR(svn_sqlite__step_done(stmt));
+    }
 
   /* ### This removes the locks, but what about the access batons? */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -6760,22 +6790,27 @@ svn_error_t *
 svn_wc__db_op_revert(svn_wc__db_t *db,
                      const char *local_abspath,
                      svn_depth_t depth,
+                     svn_boolean_t clear_changelists,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
+  struct revert_baton_t rvb;
   struct with_triggers_baton_t wtb = { STMT_CREATE_REVERT_LIST,
                                        STMT_DROP_REVERT_LIST_TRIGGERS,
                                        NULL, NULL};
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
+  rvb.db = db;
+  rvb.clear_changelists = clear_changelists;
+  wtb.cb_baton = &rvb;
+
   switch (depth)
     {
     case svn_depth_empty:
       wtb.cb_func = op_revert_txn;
-      wtb.cb_baton = db;
       break;
     case svn_depth_infinity:
       wtb.cb_func = op_revert_recursive_txn;
@@ -7669,19 +7704,70 @@ delete_node(void *baton,
   svn_boolean_t have_row, op_root;
   svn_boolean_t add_work = FALSE;
   svn_sqlite__stmt_t *stmt;
-  int select_depth; /* Depth of what is to be deleted */
-  svn_boolean_t refetch_depth = FALSE;
+  int working_op_depth; /* Depth of what is to be deleted */
+  int keep_op_depth = 0; /* Depth of what is below what is deleted */
   svn_node_kind_t kind;
   apr_array_header_t *moved_nodes = NULL;
-  int delete_depth = relpath_depth(local_relpath);
+  int delete_op_depth = relpath_depth(local_relpath);
 
-  SVN_ERR(read_info(&status,
-                    &kind, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                    &op_root, NULL, NULL,
-                    NULL, NULL, NULL,
-                    wcroot, local_relpath,
-                    scratch_pool, scratch_pool));
+  assert(*local_relpath); /* Can't delete wcroot */
+
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_SELECT_NODE_INFO));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+  if (!have_row)
+    {
+      return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND,
+                               svn_sqlite__reset(stmt),
+                               _("The node '%s' was not found."),
+                               path_for_error_message(wcroot,
+                                                      local_relpath,
+                                                      scratch_pool));
+    }
+
+  working_op_depth = svn_sqlite__column_int(stmt, 0);
+  status = svn_sqlite__column_token(stmt, 3, presence_map);
+  kind = svn_sqlite__column_token(stmt, 4, kind_map);
+
+  if (working_op_depth < delete_op_depth)
+    {
+      op_root = FALSE;
+      add_work = TRUE;
+      keep_op_depth = working_op_depth;
+    }
+  else
+    {
+      op_root = TRUE;
+
+      SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+      if (have_row)
+        {
+          svn_wc__db_status_t below_status;
+          int below_op_depth;
+
+          below_op_depth = svn_sqlite__column_int(stmt, 0);
+          below_status = svn_sqlite__column_token(stmt, 3, presence_map);
+
+          if (below_status != svn_wc__db_status_not_present
+              && below_status != svn_wc__db_status_base_deleted)
+            {
+              add_work = TRUE;
+              keep_op_depth = below_op_depth;
+            }
+          else
+            keep_op_depth = 0;
+        }
+      else
+        keep_op_depth = -1;
+    }
+
+  SVN_ERR(svn_sqlite__reset(stmt));
+
+  if (working_op_depth != 0) /* WORKING */
+    SVN_ERR(convert_to_working_status(&status, status));
 
   if (status == svn_wc__db_status_deleted
       || status == svn_wc__db_status_not_present)
@@ -7772,7 +7858,7 @@ delete_node(void *baton,
            * possibly because of a nested move operation. */
           moved_node = apr_palloc(scratch_pool, sizeof(struct moved_node_t));
           moved_node->local_relpath = local_relpath;
-          moved_node->op_depth = delete_depth;
+          moved_node->op_depth = delete_op_depth;
           moved_node->moved_to_relpath = b->moved_to_relpath;
           moved_node->moved_from_depth = -1;
 
@@ -7799,7 +7885,8 @@ delete_node(void *baton,
 
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_SELECT_MOVED_FOR_DELETE));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+      SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, local_relpath,
+                                delete_op_depth));
 
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
       iterpool = svn_pool_create(scratch_pool);
@@ -7821,7 +7908,7 @@ delete_node(void *baton,
               /* Plain delete. Fixup move information of descendants that were
                  moved here, or that were moved out */
 
-              if (moved_here_depth >= delete_depth)
+              if (moved_here_depth >= delete_op_depth)
                 {
                   /* The move we recorded here must be moved to the location
                      this node had before it was moved here.
@@ -7835,22 +7922,24 @@ delete_node(void *baton,
                 }
               else
                 {
-                  /* Update the op-depth of an moved node below this tree */
+                  /* Update the op-depth of an moved away node that was
+                     registered as moved by the records that we are about
+                     to delete */
                   fixup = TRUE;
-                  child_op_depth = delete_depth;
+                  child_op_depth = delete_op_depth;
                 }
             }
           else if (b->moved_to_relpath)
             {
               /* The node is moved to a new location */
 
-              if (delete_depth == child_op_depth)
+              if (delete_op_depth == child_op_depth)
                 {
                   /* Update the op-depth of a tree shadowed by this tree */
                   fixup = TRUE;
-                  child_op_depth = delete_depth;
+                  /*child_op_depth = delete_depth;*/
                 }
-              else if (child_op_depth >= delete_depth
+              else if (child_op_depth >= delete_op_depth
                        && !svn_relpath_skip_ancestor(local_relpath,
                                                      mv_to_relpath))
                 {
@@ -7866,10 +7955,10 @@ delete_node(void *baton,
                                                        child_relpath,
                                                        scratch_pool);
 
-                      if (child_op_depth > delete_depth
+                      if (child_op_depth > delete_op_depth
                            && svn_relpath_skip_ancestor(local_relpath,
                                                         child_relpath))
-                        child_op_depth = delete_depth;
+                        child_op_depth = delete_op_depth;
                       else
                         child_op_depth = relpath_depth(child_relpath);
 
@@ -7939,34 +8028,6 @@ delete_node(void *baton,
         }
     }
 
-  if (op_root)
-    {
-      svn_boolean_t below_base;
-      svn_boolean_t below_work;
-      svn_wc__db_status_t below_status;
-
-      /* Use STMT_SELECT_NODE_INFO directly instead of read_info plus
-         info_below_working */
-      SVN_ERR(info_below_working(&below_base, &below_work, &below_status,
-                                 wcroot, local_relpath, -1, scratch_pool));
-      if ((below_base || below_work)
-          && below_status != svn_wc__db_status_not_present
-          && below_status != svn_wc__db_status_deleted)
-        {
-          add_work = TRUE;
-          refetch_depth = TRUE;
-        }
-
-      select_depth = relpath_depth(local_relpath);
-    }
-  else
-    {
-      add_work = TRUE;
-      if (status != svn_wc__db_status_normal)
-        SVN_ERR(op_depth_of(&select_depth, wcroot, local_relpath));
-      else
-        select_depth = 0; /* Deleting BASE node */
-    }
 
   /* ### Put actual-only nodes into the list? */
   if (b->notify)
@@ -7974,19 +8035,16 @@ delete_node(void *baton,
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_INSERT_DELETE_LIST));
       SVN_ERR(svn_sqlite__bindf(stmt, "isd",
-                                wcroot->wc_id, local_relpath, select_depth));
+                                wcroot->wc_id, local_relpath, working_op_depth));
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE));
   SVN_ERR(svn_sqlite__bindf(stmt, "isd",
-                            wcroot->wc_id, local_relpath, delete_depth));
+                            wcroot->wc_id, local_relpath, delete_op_depth));
   SVN_ERR(svn_sqlite__step_done(stmt));
 
-  if (refetch_depth)
-    SVN_ERR(op_depth_of(&select_depth, wcroot, local_relpath));
-
   /* Delete ACTUAL_NODE rows, but leave those that have changelist
      and a NODES row. */
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -8016,7 +8074,7 @@ delete_node(void *baton,
                                  STMT_INSERT_DELETE_FROM_NODE_RECURSIVE));
       SVN_ERR(svn_sqlite__bindf(stmt, "isdd",
                                 wcroot->wc_id, local_relpath,
-                                select_depth, delete_depth));
+                                keep_op_depth, delete_op_depth));
       SVN_ERR(svn_sqlite__step_done(stmt));
     }
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db.h?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db.h Mon Feb 17 05:53:23 2014
@@ -1615,6 +1615,9 @@ svn_wc__db_op_mark_resolved(svn_wc__db_t
  *
  * At present only depth=empty and depth=infinity are supported.
  *
+ * If @a clear_changelists is FALSE then changelist information is kept,
+ * otherwise it is cleared.
+ *
  * This function populates the revert list that can be queried to
  * determine what was reverted.
  */
@@ -1622,6 +1625,7 @@ svn_error_t *
 svn_wc__db_op_revert(svn_wc__db_t *db,
                      const char *local_abspath,
                      svn_depth_t depth,
+                     svn_boolean_t clear_changelists,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool);
 

Modified: subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db_update_move.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/libsvn_wc/wc_db_update_move.c Mon Feb 17 05:53:23 2014
@@ -46,7 +46,7 @@
  * layer. The destination may have additional higher op-depths
  * representing adds, deletes, moves within the move destination. [2]
  *
- * After the intial move an update has modified the NODES in the move
+ * After the initial move an update has modified the NODES in the move
  * source and may have introduced a tree-conflict since the source and
  * destination trees are no longer equivalent.  The source is a
  * different revision and may have text, property and tree changes

Modified: subversion/branches/fsfs-ucsnorm/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/svn/status-cmd.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/svn/status-cmd.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/svn/status-cmd.c Mon Feb 17 05:53:23 2014
@@ -187,7 +187,7 @@ print_status(void *baton,
    * ### _read_info() returns. The svn_wc_status_func4_t callback is
    * ### suppposed to handle the gathering of additional information from the
    * ### WORKING nodes on its own. Until we've agreed on how the CLI should
-   * ### handle the revision information, we use this appproach to stay compat
+   * ### handle the revision information, we use this approach to stay compat
    * ### with our testsuite. */
   if (status->versioned
       && !SVN_IS_VALID_REVNUM(status->revision)

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/README
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/README?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/README (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/README Mon Feb 17 05:53:23 2014
@@ -363,7 +363,7 @@ the bottom of the file. To avoid renumbe
 should add new tests to the end of the list.
 
 
-Testing Compatability With Previous Release
+Testing Compatibility With Previous Release
 ===========================================
 
 You can run the Python test suite against older installed versions of

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/autoprop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/autoprop_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/autoprop_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/autoprop_tests.py Mon Feb 17 05:53:23 2014
@@ -102,7 +102,7 @@ def autoprops_test(sbox, cmd, cfgenable,
 
   # some directories
   wc_dir = sbox.wc_dir
-  tmp_dir = os.path.abspath(svntest.main.temp_dir)
+  tmp_dir = os.path.abspath(sbox.add_wc_path('autoprops'))
   config_dir = os.path.join(tmp_dir, 'autoprops_config_' + sbox.name)
   repos_url = sbox.repo_url
 
@@ -415,7 +415,7 @@ def inheritable_autoprops_test(sbox, cmd
 
   # some directories
   wc_dir = sbox.wc_dir
-  tmp_dir = os.path.abspath(svntest.main.temp_dir)
+  tmp_dir = os.path.abspath(sbox.add_wc_path('iautoprops'))
   config_dir = os.path.join(tmp_dir, 'autoprops_config_' + sbox.name)
   repos_url = sbox.repo_url
 
@@ -646,7 +646,7 @@ def svn_prop_inheritable_autoprops_add_v
   #
   # Then revert the previous additions and add again, only the
   # svn:auto-props should be applied.
-  tmp_dir = os.path.abspath(svntest.main.temp_dir)
+  tmp_dir = os.path.abspath(sbox.add_wc_path('temp'))
   config_dir = os.path.join(tmp_dir,
                             'autoprops_config_disabled_' + sbox.name)
   create_inherited_autoprops_config(config_dir, False)

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/basic_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/basic_tests.py Mon Feb 17 05:53:23 2014
@@ -204,17 +204,33 @@ def basic_update(sbox):
                                         expected_status)
 
   # Unversioned paths, those that are not immediate children of a versioned
-  # path, are skipped and do not raise an error
+  # path, are skipped and do raise an error if they are the only targets
   xx_path = sbox.ospath('xx/xx')
-  exit_code, out, err = svntest.actions.run_and_verify_svn(
+  expected_err = "svn: E155007: "
+  svntest.actions.run_and_verify_svn(
     "update xx/xx",
-    ["Skipped '"+xx_path+"'\n",
-    ] + svntest.main.summary_of_conflicts(skipped_paths=1),
-    [], 'update', xx_path)
-  exit_code, out, err = svntest.actions.run_and_verify_svn(
-    "update xx/xx", [], [],
+    ["Skipped '"+xx_path+"'\n", ],
+    expected_err,
+    'update', xx_path)
+  svntest.actions.run_and_verify_svn(
+    "update xx/xx", [], expected_err,
     'update', '--quiet', xx_path)
 
+  # Unversioned paths, that are not the only targets of the command are
+  # skipped without an error
+  svntest.actions.run_and_verify_svn(
+    "update A/mu xx/xx",
+    ["Updating '"+mu_path+"':\n",
+     "At revision 2.\n",
+     "Skipped '"+xx_path+"'\n",
+     "Summary of updates:\n",
+     "  Updated '"+mu_path+"' to r2.\n"
+    ] + svntest.main.summary_of_conflicts(skipped_paths=1),
+    [], 'update', mu_path, xx_path)
+  svntest.actions.run_and_verify_svn(
+    "update A/mu xx/xx",
+    [], [], 'update', '--quiet', mu_path, xx_path)
+
 #----------------------------------------------------------------------
 def basic_mkdir_url(sbox):
   "basic mkdir URL"

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/checkout_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/checkout_tests.py Mon Feb 17 05:53:23 2014
@@ -27,6 +27,7 @@
 
 # General modules
 import sys, re, os, time, subprocess
+import datetime
 
 # Our testing module
 import svntest
@@ -660,16 +661,28 @@ def checkout_peg_rev_date(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
+  ## Get svn:date.
   exit_code, output, errput = svntest.main.run_svn(None, 'propget', 'svn:date',
                                                    '--revprop', '-r1',
                                                    '--strict',
                                                    sbox.repo_url)
   if exit_code or errput != [] or len(output) != 1:
     raise svntest.Failure("svn:date propget failed")
-  r1_time = output[0]
+  r1_string = output[0]
 
-  # sleep till the next second.
-  time.sleep(1.1)
+  ## Increment the svn:date date by one microsecond.
+  # TODO: pass tzinfo=UTC to datetime.datetime()
+  date_pattern = re.compile(r'(\d+)-(\d+)-(\d+)T(\d\d):(\d\d):(\d\d)\.(\d+)Z$')
+  r1_time = datetime.datetime(*map(int, date_pattern.match(r1_string).groups()))
+  peg_time = r1_time + datetime.timedelta(microseconds=1)
+  assert r1_time != peg_time
+  # peg_string is, by all likelihood, younger than r1's svn:date and older than
+  # r2's svn:date.  It is also not equal to either of them, so we test the
+  # binary search of svn:date values.
+  peg_string = '%04d-%02d-%02dT%02d:%02d:%02d.%06dZ' % \
+               tuple(getattr(peg_time, x)
+                     for x in ["year", "month", "day", "hour", "minute",
+                               "second", "microsecond"])
 
   # create a new revision
   mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -678,7 +691,7 @@ def checkout_peg_rev_date(sbox):
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'ci', '-m', 'changed file mu', wc_dir)
 
-  # now checkout the repo@current_time in another folder, this should create our
+  # now checkout the repo@peg_string in another folder, this should create our
   # initial wc without the change in mu.
   checkout_target = sbox.add_wc_path('checkout')
   os.mkdir(checkout_target)
@@ -691,7 +704,24 @@ def checkout_peg_rev_date(sbox):
 
   # use an old date to checkout, that way we're sure we get the first revision
   svntest.actions.run_and_verify_checkout(sbox.repo_url +
-                                          '@{' + r1_time + '}',
+                                          '@{' + peg_string + '}',
+                                          checkout_target,
+                                          expected_output,
+                                          expected_wc)
+
+  # now try another checkout with repo@r1_string 
+  checkout_target = sbox.add_wc_path('checkout2')
+  os.mkdir(checkout_target)
+
+  expected_output = svntest.main.greek_state.copy()
+  expected_output.wc_dir = checkout_target
+  expected_output.tweak(status='A ', contents=None)
+
+  expected_wc = svntest.main.greek_state.copy()
+
+  # use an old date to checkout, that way we're sure we get the first revision
+  svntest.actions.run_and_verify_checkout(sbox.repo_url +
+                                          '@{' + r1_string + '}',
                                           checkout_target,
                                           expected_output,
                                           expected_wc)

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/depth_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/depth_tests.py Mon Feb 17 05:53:23 2014
@@ -504,26 +504,10 @@ def depth_immediates_bring_in_file(sbox)
                                         A_mu_path)
 
   # Run 'svn up A/D/gamma' to test the edge case 'Skipped'.
-  expected_output = svntest.wc.State(wc_imm, {
-    'A/D/gamma'   : Item(verb='Skipped'),
-    })
-  expected_disk = svntest.main.greek_state.copy()
-  expected_disk.remove('A/C', 'A/B/lambda', 'A/B/E', 'A/B/E/alpha',
-                       'A/B/E/beta', 'A/B/F', 'A/B', 'A/D/gamma', 'A/D/G',
-                       'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau', 'A/D/H/chi',
-                       'A/D/H/psi', 'A/D/H/omega', 'A/D/H', 'A/D')
-  expected_status = svntest.actions.get_virginal_state(wc_imm, 1)
-  expected_status.remove('A/C', 'A/B/lambda', 'A/B/E', 'A/B/E/alpha',
-                       'A/B/E/beta', 'A/B/F', 'A/B', 'A/D/gamma', 'A/D/G',
-                       'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau', 'A/D/H/chi',
-                       'A/D/H/psi', 'A/D/H/omega', 'A/D/H', 'A/D')
-  svntest.actions.run_and_verify_update(wc_imm,
-                                        expected_output,
-                                        expected_disk,
-                                        expected_status,
-                                        None, None, None,
-                                        None, None, None,
-                                        gamma_path)
+  svntest.actions.run_and_verify_svn("update A/D/gamma",
+                       ["Skipped '"+gamma_path+"'\n", ],
+                       "svn: E155007: ", 'update', gamma_path)
+  svntest.actions.run_and_verify_status(wc_imm, expected_status)
 
 #----------------------------------------------------------------------
 def depth_immediates_fill_in_dir(sbox):

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/diff_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/diff_tests.py Mon Feb 17 05:53:23 2014
@@ -4760,7 +4760,7 @@ def diff_repo_wc_file_props(sbox):
   if svntest.main.is_os_windows():
     # test suite normalizes crlf output into just lf on Windows.
     # so we have to assume it worked because there is an add and
-    # remove line with the same content.  Fortunately, it does't
+    # remove line with the same content.  Fortunately, it doesn't
     # do this on *nix so we can be pretty sure that it works right.
     # TODO: Provide a way to handle this better
     crlf = '\n'

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_automatic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_automatic_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_automatic_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_automatic_tests.py Mon Feb 17 05:53:23 2014
@@ -334,7 +334,6 @@ def three_way_merge_no_op(base_node, sou
 def cherry_pick(sbox, rev, source, target):
   """Cherry-pick merge revision REV from branch SOURCE to branch TARGET
   (both WC-relative paths), and commit."""
-  sbox.simple_update(target)
   svn_merge(rev, source, target)
   sbox.simple_commit()
 
@@ -691,6 +690,7 @@ def cherry1_fwd(sbox):
   #     2  34  5  67  8  9  0  1
 
   init_mod_merge_mod(sbox, mod_6=True, mod_7=False)
+  sbox.simple_update()
   modify_branch(sbox, 'A', 8)
   cherry_pick(sbox, 8, 'A', 'B')
   modify_branch(sbox, 'A', 10)

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/merge_tests.py Mon Feb 17 05:53:23 2014
@@ -5845,7 +5845,7 @@ def empty_mergeinfo(sbox):
   #   B) Empty mergeinfo elides to empty mergeinfo.
   #
   #   C) If a merge sets empty mergeinfo on its target and that target has
-  #      no ancestor in either the WC or the repository with explict
+  #      no ancestor in either the WC or the repository with explicit
   #      mergeinfo, then the target's mergeinfo is removed (a.k.a. elides
   #      to nothing).
   sbox.build()
@@ -15602,7 +15602,7 @@ def dav_skelta_mode_causes_spurious_conf
   A_branch_path = sbox.ospath('A-branch')
   C_branch_path = sbox.ospath('A-branch/C')
 
-  # r2 - Set some intial properties:
+  # r2 - Set some initial properties:
   #
   #  'dir-prop'='value1' on A/C.
   #  'svn:eol-style'='native' on A/mu.

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnadmin_tests.py Mon Feb 17 05:53:23 2014
@@ -1219,7 +1219,7 @@ def dont_drop_valid_mergeinfo_during_inc
   #                      |            |                            |     |
   # trunk---r2---r3-----r5---r6-------r8---r9--------------->      |     |
   #   r1             |        |     |       |                      |     |
-  # intial           |        |     |       |______                |     |
+  # initial          |        |     |       |______                |     |
   # import         copy       |   copy             |            merge   merge
   #                  |        |     |            merge           (r5)   (r8)
   #                  |        |     |            (r9)              |     |

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnauthz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnauthz_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnauthz_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnauthz_tests.py Mon Feb 17 05:53:23 2014
@@ -874,7 +874,7 @@ def svnauthz_accessof_txn_test(sbox):
   verify_logfile(logfilepath, expected_data)
 
 def svnauthz_compat_mode_file_test(sbox):
-  "test 'svnauthz-validate' compatability mode file"
+  "test 'svnauthz-validate' compatibility mode file"
 
 
   # Create an authz file
@@ -906,7 +906,7 @@ def svnauthz_compat_mode_file_test(sbox)
 
 @SkipUnless(svntest.main.is_ra_type_file)
 def svnauthz_compat_mode_repo_test(sbox):
-  "test 'svnauthz-validate' compatability mode url"
+  "test 'svnauthz-validate' compatibility mode url"
 
   sbox.build()
   wc_dir = sbox.wc_dir

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svndumpfilter_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svndumpfilter_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svndumpfilter_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svndumpfilter_tests.py Mon Feb 17 05:53:23 2014
@@ -283,7 +283,7 @@ def filter_mergeinfo_revs_outside_of_dum
   #                      |            |                            |     |
   # trunk---r2---r3-----r5---r6-------r8---r9--------------->      |     |
   #   r1             |        |     |       |                      |     |
-  # intial           |        |     |       |______                |     |
+  # initial          |        |     |       |______                |     |
   # import         copy       |   copy             |            merge   merge
   #                  |        |     |            merge           (r5)   (r8)
   #                  |        |     |            (r9)              |     |
@@ -511,7 +511,7 @@ def dropped_but_not_renumbered_empty_rev
   #                      |            |                            |     |
   # trunk---r2---r3-----r5---r6-------r8---r9--------------->      |     |
   #   r1             |        |     |       |                      |     |
-  # intial           |        |     |       |______                |     |
+  # initial          |        |     |       |______                |     |
   # import         copy       |   copy             |            merge   merge
   #                  |        |     |            merge           (r5)   (r8)
   #                  |        |     |            (r9)              |     |

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnrdump_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svnrdump_tests.py Mon Feb 17 05:53:23 2014
@@ -488,7 +488,7 @@ def dont_drop_valid_mergeinfo_during_inc
   #                      |            |                            |     |
   # trunk---r2---r3-----r5---r6-------r8---r9--------------->      |     |
   #   r1             |        |     |       |                      |     |
-  # intial           |        |     |       |______                |     |
+  # initial          |        |     |       |______                |     |
   # import         copy       |   copy             |            merge   merge
   #                  |        |     |            merge           (r5)   (r8)
   #                  |        |     |            (r9)              |     |

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/factory.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/factory.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/factory.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/svntest/factory.py Mon Feb 17 05:53:23 2014
@@ -97,7 +97,7 @@
 #
 # YOU ARE CORDIALLY INVITED to add/tweak/change to your needs.
 # If you want to know what's going on, look at the switch()
-# funtion of TestFactory below.
+# function of TestFactory below.
 #
 #
 # DETAILS

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/update_tests.py?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/cmdline/update_tests.py Mon Feb 17 05:53:23 2014
@@ -6763,21 +6763,20 @@ def update_child_below_add(sbox):
   wc_dir = sbox.wc_dir
 
   sbox.simple_update('A/B', 0)
+  e_path = sbox.ospath('A/B/E')
 
-  # Update skips A/B/E because A/B has a not-present BASE node.
-  expected_output = svntest.wc.State(wc_dir, {
-      'A/B/E' : Item(verb='Skipped'),
-  })
+  # Update skips and errors on A/B/E because A/B has a not-present BASE node.
+  expected_output = ["Skipped '"+e_path+"'\n"]
+  expected_err = "svn: E155007: "
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
                          'A/B/F', 'A/B/lambda')
-  svntest.actions.run_and_verify_update(wc_dir,
-                                        expected_output,
-                                        None,
-                                        expected_status,
-                                        None, None, None,
-                                        None, None, None,
-                                        sbox.ospath('A/B/E'))
+  svntest.actions.run_and_verify_svn("update A/B/E",
+                                     expected_output,
+                                     expected_err,
+                                     'update', e_path)
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
 
   # Add working nodes over A/B
   sbox.simple_mkdir('A/B')
@@ -6789,6 +6788,9 @@ def update_child_below_add(sbox):
       'A/B/E'       : Item(status='A ', wc_rev='-'),
       'A/B/E/alpha' : Item(status='A ', wc_rev='-'),
   })
+  expected_output = svntest.wc.State(wc_dir, {
+      'A/B/E' : Item(verb='Skipped'),
+  })
   # Update should still skip A/B/E
   svntest.actions.run_and_verify_update(wc_dir,
                                         expected_output,

Modified: subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_subr/sqlite-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_subr/sqlite-test.c?rev=1568883&r1=1568882&r2=1568883&view=diff
==============================================================================
--- subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_subr/sqlite-test.c (original)
+++ subversion/branches/fsfs-ucsnorm/subversion/tests/libsvn_subr/sqlite-test.c Mon Feb 17 05:53:23 2014
@@ -71,13 +71,14 @@ test_sqlite_reset(apr_pool_t *pool)
 
   static const char *const statements[] = {
     "CREATE TABLE reset ("
-    "    one TEXT NOT NULL,"
+    "    one TEXT NOT NULL PRIMARY KEY,"
     "    two TEXT"
     ");"
     "INSERT INTO reset(one, two) VALUES ('foo', 'bar');"
     "INSERT INTO reset(one, two) VALUES ('zig', 'zag')",
 
-    "SELECT one FROM reset WHERE two IS NOT NULL AND error_second(one)",
+    "SELECT one FROM reset WHERE two IS NOT NULL AND error_second(one) "
+    "ORDER BY one",
 
     NULL
   };



Mime
View raw message