subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1515362 [7/13] - in /subversion/branches/move-tracking-1: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ notes/tree-conflicts/ subversion/bindings/cxxhl/include/ subversion/bindings/cxxhl/include/svncxxhl/ subversio...
Date Mon, 19 Aug 2013 11:21:06 GMT
Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/dump.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/dump.c Mon Aug 19 11:21:01 2013
@@ -1332,6 +1332,71 @@ verify_close_directory(void *dir_baton,
   return close_directory(dir_baton, pool);
 }
 
+static void
+notify_verification_error(svn_revnum_t rev,
+                          svn_error_t *err,
+                          svn_repos_notify_func_t notify_func,
+                          void *notify_baton,
+                          apr_pool_t *pool)
+{
+  svn_repos_notify_t *notify_failure;
+
+  if (notify_func == NULL)
+    return;
+
+  notify_failure = svn_repos_notify_create(svn_repos_notify_failure, pool);
+  notify_failure->err = err;
+  notify_failure->revision = rev;
+  notify_func(notify_baton, notify_failure, pool);
+}
+
+/* Verify revision REV in file system FS. */
+static svn_error_t *
+verify_one_revision(svn_fs_t *fs,
+                    svn_revnum_t rev,
+                    svn_repos_notify_func_t notify_func,
+                    void *notify_baton,
+                    svn_revnum_t start_rev,
+                    svn_cancel_func_t cancel_func,
+                    void *cancel_baton,
+                    apr_pool_t *scratch_pool)
+{
+  const svn_delta_editor_t *dump_editor;
+  void *dump_edit_baton;
+  svn_fs_root_t *to_root;
+  apr_hash_t *props;
+  const svn_delta_editor_t *cancel_editor;
+  void *cancel_edit_baton;
+
+  /* Get cancellable dump editor, but with our close_directory handler.*/
+  SVN_ERR(get_dump_editor(&dump_editor, &dump_edit_baton,
+                          fs, rev, "",
+                          svn_stream_empty(scratch_pool),
+                          NULL, NULL,
+                          verify_close_directory,
+                          notify_func, notify_baton,
+                          start_rev,
+                          FALSE, TRUE, /* use_deltas, verify */
+                          scratch_pool));
+  SVN_ERR(svn_delta_get_cancellation_editor(cancel_func, cancel_baton,
+                                            dump_editor, dump_edit_baton,
+                                            &cancel_editor,
+                                            &cancel_edit_baton,
+                                            scratch_pool));
+  SVN_ERR(svn_fs_revision_root(&to_root, fs, rev, scratch_pool));
+  SVN_ERR(svn_repos_replay2(to_root, "", SVN_INVALID_REVNUM, FALSE,
+                            cancel_editor, cancel_edit_baton,
+                            NULL, NULL, scratch_pool));
+ 
+  /* While our editor close_edit implementation is a no-op, we still
+     do this for completeness. */
+  SVN_ERR(cancel_editor->close_edit(cancel_edit_baton, scratch_pool));
+ 
+  SVN_ERR(svn_fs_revision_proplist(&props, fs, rev, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* Baton type used for forwarding notifications from FS API to REPOS API. */
 struct verify_fs2_notify_func_baton_t
 {
@@ -1359,9 +1424,10 @@ verify_fs2_notify_func(svn_revnum_t revi
 }
 
 svn_error_t *
-svn_repos_verify_fs2(svn_repos_t *repos,
+svn_repos_verify_fs3(svn_repos_t *repos,
                      svn_revnum_t start_rev,
                      svn_revnum_t end_rev,
+                     svn_boolean_t keep_going,
                      svn_repos_notify_func_t notify_func,
                      void *notify_baton,
                      svn_cancel_func_t cancel_func,
@@ -1375,6 +1441,8 @@ svn_repos_verify_fs2(svn_repos_t *repos,
   svn_repos_notify_t *notify;
   svn_fs_progress_notify_func_t verify_notify = NULL;
   struct verify_fs2_notify_func_baton_t *verify_notify_baton = NULL;
+  svn_error_t *err;
+  svn_boolean_t found_corruption = FALSE;
 
   /* Determine the current youngest revision of the filesystem. */
   SVN_ERR(svn_fs_youngest_rev(&youngest, fs, pool));
@@ -1403,7 +1471,6 @@ svn_repos_verify_fs2(svn_repos_t *repos,
     {
       notify = svn_repos_notify_create(svn_repos_notify_verify_rev_end,
                                        pool);
-
       verify_notify = verify_fs2_notify_func;
       verify_notify_baton = apr_palloc(pool, sizeof(*verify_notify_baton));
       verify_notify_baton->notify_func = notify_func;
@@ -1413,49 +1480,50 @@ svn_repos_verify_fs2(svn_repos_t *repos,
     }
 
   /* Verify global metadata and backend-specific data first. */
-  SVN_ERR(svn_fs_verify(svn_fs_path(fs, pool), svn_fs_config(fs, pool),
-                        start_rev, end_rev,
-                        verify_notify, verify_notify_baton,
-                        cancel_func, cancel_baton, pool));
+  err = svn_fs_verify(svn_fs_path(fs, pool), svn_fs_config(fs, pool),
+                      start_rev, end_rev,
+                      verify_notify, verify_notify_baton,
+                      cancel_func, cancel_baton, pool);
 
-  for (rev = start_rev; rev <= end_rev; rev++)
+  if (err && !keep_going)
     {
-      const svn_delta_editor_t *dump_editor;
-      void *dump_edit_baton;
-      const svn_delta_editor_t *cancel_editor;
-      void *cancel_edit_baton;
-      svn_fs_root_t *to_root;
-      apr_hash_t *props;
+      found_corruption = TRUE;
+      notify_verification_error(SVN_INVALID_REVNUM, err, notify_func,
+                                notify_baton, iterpool);
+      svn_error_clear(err);
+      return svn_error_createf(SVN_ERR_REPOS_CORRUPTED, NULL,
+                               _("Repository '%s' failed to verify"),
+                               svn_dirent_local_style(svn_repos_path(repos,
+                                                                     pool),
+                                                      pool));
+    }
+  else
+    {
+      if (err)
+        found_corruption = TRUE;
+      svn_error_clear(err);
+    }
 
+  for (rev = start_rev; rev <= end_rev; rev++)
+    {
       svn_pool_clear(iterpool);
 
-      /* Get cancellable dump editor, but with our close_directory handler. */
-      SVN_ERR(get_dump_editor(&dump_editor, &dump_edit_baton,
-                              fs, rev, "",
-                              svn_stream_empty(iterpool),
-                              NULL, NULL,
-                              verify_close_directory,
-                              notify_func, notify_baton,
-                              start_rev,
-                              FALSE, TRUE, /* use_deltas, verify */
-                              iterpool));
-      SVN_ERR(svn_delta_get_cancellation_editor(cancel_func, cancel_baton,
-                                                dump_editor, dump_edit_baton,
-                                                &cancel_editor,
-                                                &cancel_edit_baton,
-                                                iterpool));
-
-      SVN_ERR(svn_fs_revision_root(&to_root, fs, rev, iterpool));
-      SVN_ERR(svn_fs_verify_root(to_root, iterpool));
-
-      SVN_ERR(svn_repos_replay2(to_root, "", SVN_INVALID_REVNUM, FALSE,
-                                cancel_editor, cancel_edit_baton,
-                                NULL, NULL, iterpool));
-      /* While our editor close_edit implementation is a no-op, we still
-         do this for completeness. */
-      SVN_ERR(cancel_editor->close_edit(cancel_edit_baton, iterpool));
+      /* Wrapper function to catch the possible errors. */
+      err = verify_one_revision(fs, rev, notify_func, notify_baton, start_rev,
+                                cancel_func, cancel_baton, iterpool);
 
-      SVN_ERR(svn_fs_revision_proplist(&props, fs, rev, iterpool));
+      if (err)
+        {
+          found_corruption = TRUE;
+          notify_verification_error(rev, err, notify_func, notify_baton,
+                                    iterpool);
+          svn_error_clear(err);
+
+          if (keep_going)
+            continue;
+          else
+            break;
+        }
 
       if (notify_func)
         {
@@ -1474,5 +1542,12 @@ svn_repos_verify_fs2(svn_repos_t *repos,
   /* Per-backend verification. */
   svn_pool_destroy(iterpool);
 
+  if (found_corruption)
+    return svn_error_createf(SVN_ERR_REPOS_CORRUPTED, NULL,
+                             _("Repository '%s' failed to verify"),
+                             svn_dirent_local_style(svn_repos_path(repos,
+                                                                   pool),
+                                                    pool));
+
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/fs-wrap.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/fs-wrap.c Mon Aug 19 11:21:01 2013
@@ -172,6 +172,10 @@ svn_repos__validate_prop(const char *nam
 {
   svn_prop_kind_t kind = svn_property_kind2(name);
 
+  /* Allow deleting any property, even a property we don't allow to set. */
+  if (value == NULL)
+    return SVN_NO_ERROR;
+
   /* Disallow setting non-regular properties. */
   if (kind != svn_prop_regular_kind)
     return svn_error_createf

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/replay.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/replay.c Mon Aug 19 11:21:01 2013
@@ -1457,8 +1457,8 @@ replay_node(svn_fs_root_t *root,
             }
 
           SVN_ERR(svn_editor_alter_file(editor, repos_relpath,
-                                        SVN_INVALID_REVNUM, props, checksum,
-                                        contents));
+                                        SVN_INVALID_REVNUM,
+                                        checksum, contents, props));
         }
 
       if (change->node_kind == svn_node_dir

Modified: subversion/branches/move-tracking-1/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_repos/repos.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_repos/repos.c Mon Aug 19 11:21:01 2013
@@ -1534,6 +1534,54 @@ svn_repos_open2(svn_repos_t **repos_p,
   return get_repos(repos_p, path, FALSE, FALSE, TRUE, fs_config, pool);
 }
 
+/* Baton used with fs_upgrade_notify, specifying the svn_repos layer
+ * notification parameters.
+ */
+struct fs_upgrade_notify_baton_t
+{
+  svn_repos_notify_func_t notify_func;
+  void *notify_baton;
+};
+
+/* Implements svn_fs_upgrade_notify_t as forwarding to a
+ * svn_repos_notify_func_t passed in a fs_upgrade_notify_baton_t* BATON.
+ */
+static svn_error_t *
+fs_upgrade_notify(void *baton,
+                  apr_uint64_t number,
+                  svn_fs_upgrade_notify_action_t action,
+                  apr_pool_t *pool)
+{
+  struct fs_upgrade_notify_baton_t *fs_baton = baton;
+
+  svn_repos_notify_t *notify = svn_repos_notify_create(
+                                svn_repos_notify_mutex_acquired, pool);
+  switch(action)
+    {
+      case svn_fs_upgrade_pack_revprops:
+        notify->shard = number;
+        notify->action = svn_repos_notify_pack_revprops;
+        break;
+
+      case svn_fs_upgrade_cleanup_revprops:
+        notify->shard = number;
+        notify->action = svn_repos_notify_cleanup_revprops;
+        break;
+
+      case svn_fs_upgrade_format_bumped:
+        notify->revision = number;
+        notify->action = svn_repos_notify_format_bumped;
+        break;
+
+      default:
+        /* unknown notification */
+        SVN_ERR_MALFUNCTION();
+    }
+
+  fs_baton->notify_func(fs_baton->notify_baton, notify, pool);
+
+  return SVN_NO_ERROR;
+}
 
 svn_error_t *
 svn_repos_upgrade2(const char *path,
@@ -1547,6 +1595,10 @@ svn_repos_upgrade2(const char *path,
   int format;
   apr_pool_t *subpool = svn_pool_create(pool);
 
+  struct fs_upgrade_notify_baton_t fs_notify_baton;
+  fs_notify_baton.notify_func = notify_func;
+  fs_notify_baton.notify_baton = notify_baton;
+
   /* Fetch a repository object; for the Berkeley DB backend, it is
      initialized with an EXCLUSIVE lock on the database.  This will at
      least prevent others from trying to read or write to it while we
@@ -1575,7 +1627,9 @@ svn_repos_upgrade2(const char *path,
   SVN_ERR(svn_io_write_version_file(format_path, format, subpool));
 
   /* Try to upgrade the filesystem. */
-  SVN_ERR(svn_fs_upgrade(repos->db_path, subpool));
+  SVN_ERR(svn_fs_upgrade2(repos->db_path,
+                          notify_func ? fs_upgrade_notify : NULL,
+                          &fs_notify_baton, NULL, NULL, subpool));
 
   /* Now overwrite our format file with the latest version. */
   SVN_ERR(svn_io_write_version_file(format_path, SVN_REPOS__FORMAT_NUMBER,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-membuffer.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-membuffer.c Mon Aug 19 11:21:01 2013
@@ -31,6 +31,7 @@
 #include "svn_private_config.h"
 #include "cache.h"
 #include "svn_string.h"
+#include "svn_sorts.h"  /* get the MIN macro */
 #include "private/svn_dep_compat.h"
 #include "private/svn_mutex.h"
 #include "private/svn_pseudo_md5.h"
@@ -888,8 +889,9 @@ get_group_index(svn_membuffer_t **cache,
    * Since key may not be well-distributed, pre-fold it to a smaller but
    * "denser" ranger.  The divisors are primes larger than the largest
    * counts. */
-  *cache = &segment0[(key[1] % 2809637ull) & (segment0->segment_count - 1)];
-  return (key[0] % 5030895599ull) % segment0->group_count;
+  *cache = &segment0[(key[1] % APR_UINT64_C(2809637))
+         & (segment0->segment_count - 1)];
+  return (key[0] % APR_UINT64_C(5030895599)) % segment0->group_count;
 }
 
 /* Reduce the hit count of ENTRY and update the accumulated hit info
@@ -2244,9 +2246,8 @@ combine_key(svn_membuffer_cache_t *cache
   /* scramble key DATA.  All of this must be reversible to prevent key
    * collisions.  So, we limit ourselves to xor and permutations. */
   data[1] = (data[1] << 27) | (data[1] >> 37);
-  data[0] = (data[0] << 43) | (data[0] >> 21);
   data[1] ^= data[0] & 0xffff;
-  data[0] ^= data[1] & 0xffffffffffff0000ull;
+  data[0] ^= data[1] & APR_UINT64_C(0xffffffffffff0000);
 
   /* combine with this cache's namespace */
   cache->combined_key[0] = data[0] ^ cache->prefix[0];
@@ -2424,12 +2425,16 @@ svn_membuffer_cache_is_cachable(void *ca
   return size <= cache->membuffer->max_entry_size;
 }
 
-/* Add statistics of SEGMENT to INFO.
+/* Add statistics of SEGMENT to INFO.  If INCLUDE_HISTOGRAM is TRUE,
+ * accumulate index bucket fill levels in INFO->HISTOGRAM.
  */
 static svn_error_t *
 svn_membuffer_get_segment_info(svn_membuffer_t *segment,
-                               svn_cache__info_t *info)
+                               svn_cache__info_t *info,
+                               svn_boolean_t include_histogram)
 {
+  apr_size_t i;
+
   info->data_size += segment->l1.size + segment->l2.size;
   info->used_size += segment->data_used;
   info->total_size += segment->l1.size + segment->l2.size +
@@ -2438,6 +2443,15 @@ svn_membuffer_get_segment_info(svn_membu
   info->used_entries += segment->used_entries;
   info->total_entries += segment->group_count * GROUP_SIZE;
 
+  if (include_histogram)
+    for (i = 0; i < segment->group_count; ++i)
+      {
+        apr_size_t use
+          = MIN(segment->directory[i].used,
+                sizeof(info->histogram) / sizeof(info->histogram[0]) - 1);
+        info->histogram[use]++;
+      }
+
   return SVN_NO_ERROR;
 }
 
@@ -2459,18 +2473,11 @@ svn_membuffer_cache_get_info(void *cache
 
   /* collect info from shared cache back-end */
 
-  info->data_size = 0;
-  info->used_size = 0;
-  info->total_size = 0;
-
-  info->used_entries = 0;
-  info->total_entries = 0;
-
   for (i = 0; i < cache->membuffer->segment_count; ++i)
     {
       svn_membuffer_t *segment = cache->membuffer + i;
       WITH_READ_LOCK(segment,
-                     svn_membuffer_get_segment_info(segment, info));
+                     svn_membuffer_get_segment_info(segment, info, FALSE));
     }
 
   return SVN_NO_ERROR;
@@ -2698,3 +2705,37 @@ svn_cache__create_membuffer_cache(svn_ca
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+svn_membuffer_get_global_segment_info(svn_membuffer_t *segment,
+                                      svn_cache__info_t *info)
+{
+  info->gets += segment->total_reads;
+  info->sets += segment->total_writes;
+  info->hits += segment->total_hits;
+
+  WITH_READ_LOCK(segment,
+                  svn_membuffer_get_segment_info(segment, info, TRUE));
+
+  return SVN_NO_ERROR;
+}
+
+svn_cache__info_t *
+svn_cache__membuffer_get_global_info(apr_pool_t *pool)
+{
+  apr_uint32_t i;
+
+  svn_membuffer_t *membuffer = svn_cache__get_global_membuffer_cache();
+  svn_cache__info_t *info = apr_pcalloc(pool, sizeof(*info));
+
+  /* cache front-end specific data */
+
+  info->id = "membuffer globals";
+
+  /* collect info from shared cache back-end */
+
+  for (i = 0; i < membuffer->segment_count; ++i)
+    svn_error_clear(svn_membuffer_get_global_segment_info(membuffer + i,
+                                                          info));
+
+  return info;
+}

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-memcache.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-memcache.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-memcache.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/cache-memcache.c Mon Aug 19 11:21:01 2013
@@ -366,12 +366,6 @@ memcache_get_info(void *cache_void,
 
   /* we don't have any memory allocation info */
 
-  info->used_size = 0;
-  info->total_size = 0;
-  info->data_size = 0;
-  info->used_entries = 0;
-  info->total_entries = 0;
-
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/cache.c Mon Aug 19 11:21:01 2013
@@ -192,6 +192,7 @@ svn_cache__get_info(svn_cache__t *cache,
 {
   /* write general statistics */
 
+  memset(info, 0, sizeof(*info));
   info->gets = cache->reads;
   info->hits = cache->hits;
   info->sets = cache->writes;
@@ -221,6 +222,7 @@ svn_cache__get_info(svn_cache__t *cache,
 
 svn_string_t *
 svn_cache__format_info(const svn_cache__info_t *info,
+                       svn_boolean_t access_only,
                        apr_pool_t *result_pool)
 {
   enum { _1MB = 1024 * 1024 };
@@ -235,9 +237,40 @@ svn_cache__format_info(const svn_cache__
   double data_entry_rate = (100.0 * (double)info->used_entries)
                  / (double)(info->total_entries ? info->total_entries : 1);
 
-  return svn_string_createf(result_pool,
+  const char *histogram = "";
+  if (!access_only)
+    {
+      svn_stringbuf_t *text = svn_stringbuf_create_empty(result_pool);
+
+      int i;
+      int count = sizeof(info->histogram) / sizeof(info->histogram[0]);
+      for (i = 0; i < count; ++i)
+        if (info->histogram[i] > 0 || text->len > 0)
+          text = svn_stringbuf_createf(result_pool,
+                                       i == count - 1
+                                         ? "%12" APR_UINT64_T_FMT
+                                           " buckets with >%d entries\n%s"
+                                         : "%12" APR_UINT64_T_FMT
+                                           " buckets with %d entries\n%s",
+                                        info->histogram[i], i, text->data);
+
+      histogram = text->data;
+    }
+
+  return access_only
+       ? svn_string_createf(result_pool,
+                            "%s\n"
+                            "gets    : %" APR_UINT64_T_FMT
+                            ", %" APR_UINT64_T_FMT " hits (%5.2f%%)\n"
+                            "sets    : %" APR_UINT64_T_FMT
+                            " (%5.2f%% of misses)\n",
+                            info->id,
+                            info->gets,
+                            info->hits, hit_rate,
+                            info->sets, write_rate)
+       : svn_string_createf(result_pool,
 
-                            "prefix  : %s\n"
+                            "%s\n"
                             "gets    : %" APR_UINT64_T_FMT
                             ", %" APR_UINT64_T_FMT " hits (%5.2f%%)\n"
                             "sets    : %" APR_UINT64_T_FMT
@@ -247,7 +280,7 @@ svn_cache__format_info(const svn_cache__
                             " of %" APR_UINT64_T_FMT " MB data cache"
                             " / %" APR_UINT64_T_FMT " MB total cache memory\n"
                             "          %" APR_UINT64_T_FMT " entries (%5.2f%%)"
-                            " of %" APR_UINT64_T_FMT " total\n",
+                            " of %" APR_UINT64_T_FMT " total\n%s",
 
                             info->id,
 
@@ -261,5 +294,6 @@ svn_cache__format_info(const svn_cache__
                             info->total_size / _1MB,
 
                             info->used_entries, data_entry_rate,
-                            info->total_entries);
+                            info->total_entries,
+                            histogram);
 }

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/config_file.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/config_file.c Mon Aug 19 11:21:01 2013
@@ -94,7 +94,7 @@ parser_getc(parse_context_t *ctx, int *c
         }
       else if (ctx->buffer_pos < ctx->buffer_size)
         {
-          *c = ctx->parser_buffer[ctx->buffer_pos];
+          *c = (unsigned char)ctx->parser_buffer[ctx->buffer_pos];
           ctx->buffer_pos++;
         }
       else
@@ -107,7 +107,7 @@ parser_getc(parse_context_t *ctx, int *c
 
           if (ctx->buffer_pos < ctx->buffer_size)
             {
-              *c = ctx->parser_buffer[ctx->buffer_pos];
+              *c = (unsigned char)ctx->parser_buffer[ctx->buffer_pos];
               ctx->buffer_pos++;
             }
           else
@@ -131,7 +131,7 @@ parser_getc_plain(parse_context_t *ctx, 
 {
   if (ctx->buffer_pos < ctx->buffer_size)
     {
-      *c = ctx->parser_buffer[ctx->buffer_pos];
+      *c = (unsigned char)ctx->parser_buffer[ctx->buffer_pos];
       ctx->buffer_pos++;
 
       return SVN_NO_ERROR;
@@ -189,6 +189,32 @@ skip_to_eoln(parse_context_t *ctx, int *
   return SVN_NO_ERROR;
 }
 
+/* Skip a UTF-8 Byte Order Mark if found. */
+static APR_INLINE svn_error_t *
+skip_bom(parse_context_t *ctx)
+{
+  int ch;
+
+  SVN_ERR(parser_getc(ctx, &ch));
+  if (ch == 0xEF)
+    {
+      const unsigned char *buf = (unsigned char *)ctx->parser_buffer;
+      /* This makes assumptions about the implementation of parser_getc and
+       * the use of skip_bom.  Specifically that parser_getc() will get all
+       * of the BOM characters into the parse_context_t buffer.  This can
+       * safely be assumed as long as we only try to use skip_bom() at the
+       * start of the stream and the buffer is longer than 3 characters. */
+      SVN_ERR_ASSERT(ctx->buffer_size > ctx->buffer_pos + 1);
+      if (buf[ctx->buffer_pos] == 0xBB && buf[ctx->buffer_pos + 1] == 0xBF)
+        ctx->buffer_pos += 2;
+      else
+        SVN_ERR(parser_ungetc(ctx, ch));
+    }
+  else
+    SVN_ERR(parser_ungetc(ctx, ch));
+
+  return SVN_NO_ERROR;
+}
 
 /* Parse a single option value */
 static svn_error_t *
@@ -454,6 +480,8 @@ svn_config__parse_stream(svn_config_t *c
   ctx->buffer_pos = 0;
   ctx->buffer_size = 0;
 
+  SVN_ERR(skip_bom(ctx));
+
   do
     {
       SVN_ERR(skip_whitespace(ctx, &ch, &count));
@@ -810,6 +838,9 @@ svn_config_ensure(const char *config_dir
         "###   http-max-connections       Maximum number of parallel server" NL
         "###                              connections to use for any given"  NL
         "###                              HTTP operation."                   NL
+        "###   busted-proxy               The proxy may have some protocol"  NL
+        "###                              issues that Subversion needs to"   NL
+        "###                              detect and work around."           NL
         "###   neon-debug-mask            Debug mask for Neon HTTP library"  NL
         "###   ssl-authority-files        List of files, each of a trusted CA"
                                                                              NL

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/dirent_uri.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/dirent_uri.c Mon Aug 19 11:21:01 2013
@@ -1688,8 +1688,9 @@ svn_dirent_is_canonical(const char *dire
 static svn_boolean_t
 relpath_is_canonical(const char *relpath)
 {
-  const char *ptr = relpath;
+  const char *dot_pos, *ptr = relpath;
   apr_size_t i, len;
+  unsigned pattern = 0;
 
   /* RELPATH is canonical if it has:
    *  - no '.' segments
@@ -1713,16 +1714,23 @@ relpath_is_canonical(const char *relpath
   if (ptr[len-1] == '/' || (ptr[len-1] == '.' && ptr[len-2] == '/'))
     return FALSE;
 
+  /* '.' are rare. So, search for them globally. There will often be no 
+   * more than one hit.  Also note that we already checked for invalid 
+   * starts and endings, i.e. we only need to check for "/./"
+   */
+  for (dot_pos = memchr(ptr, '.', len);
+       dot_pos;
+       dot_pos = strchr(dot_pos+1, '.'))
+    if (dot_pos > ptr && dot_pos[-1] == '/' && dot_pos[1] == '/')
+      return FALSE;
+
   /* Now validate the rest of the path. */
   for (i = 0; i < len - 1; ++i)
-    if (ptr[i] == '/' && ptr[i+1] <= '/') /* '.' and '/' have smaller UTF-8
-                                             codes than most other chars */
-      {
-        if (ptr[i+1] == '/')
-          return FALSE;  /*  //   */
-        if (ptr[i+1] == '.' && ptr[i+2] == '/')
-          return FALSE;  /*  /./  */
-      }
+    {
+      pattern = ((pattern & 0xff) << 8) + (unsigned char)ptr[i];
+      if (pattern == 0x101 * (unsigned char)('/'))
+        return FALSE;
+    }
 
   return TRUE;
 }

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/io.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/io.c Mon Aug 19 11:21:01 2013
@@ -2808,13 +2808,13 @@ svn_io_wait_for_cmd(apr_proc_t *cmd_proc
            && APR_PROC_CHECK_CORE_DUMP(exitwhy_val))
     return svn_error_createf
       (SVN_ERR_EXTERNAL_PROGRAM, NULL,
-       _("Process '%s' failed (exitwhy %d, signal %d, core dumped)"),
-       cmd, exitwhy_val, exitcode_val);
+       _("Process '%s' failed (signal %d, core dumped)"),
+       cmd, exitcode_val);
   else if (APR_PROC_CHECK_SIGNALED(exitwhy_val))
     return svn_error_createf
       (SVN_ERR_EXTERNAL_PROGRAM, NULL,
-       _("Process '%s' failed (exitwhy %d, signal %d)"),
-       cmd, exitwhy_val, exitcode_val);
+       _("Process '%s' failed (signal %d)"),
+       cmd, exitcode_val);
   else if (! APR_PROC_CHECK_EXIT(exitwhy_val))
     /* Don't really know what happened here. */
     return svn_error_createf
@@ -3614,6 +3614,9 @@ svn_io_read_length_line(apr_file_t *file
       apr_size_t bytes_read = 0;
       char *eol;
 
+      if (to_read == 0)
+        break;
+
       /* read data block (or just a part of it) */
       SVN_ERR(svn_io_file_read_full2(file, buf, to_read,
                                      &bytes_read, &eof, pool));

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/named_atomic.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/named_atomic.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/named_atomic.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/named_atomic.c Mon Aug 19 11:21:01 2013
@@ -251,6 +251,7 @@ struct svn_atomic_namespace__t
  */
 static svn_mutex__t *thread_mutex = NULL;
 
+#if APR_HAS_MMAP
 /* Initialization flag for the above used by svn_atomic__init_once.
  */
 static volatile svn_atomic_t mutex_initialized = FALSE;
@@ -266,6 +267,7 @@ init_thread_mutex(void *baton, apr_pool_
 
   return svn_mutex__init(&thread_mutex, USE_THREAD_MUTEX, global_pool);
 }
+#endif /* APR_HAS_MMAP */
 
 /* Utility that acquires our global mutex and converts error types.
  */
@@ -297,6 +299,7 @@ unlock(struct mutex_t *mutex, svn_error_
                                                     unlock_err));
 }
 
+#if APR_HAS_MMAP
 /* The last user to close a particular namespace should also remove the
  * lock file.  Failure to do so, however, does not affect further uses
  * of the same namespace.
@@ -318,6 +321,7 @@ delete_lock_file(void *arg)
 
   return status;
 }
+#endif /* APR_HAS_MMAP */
 
 /* Validate the ATOMIC parameter, i.e it's address.  Correct code will
  * never need this but if someone should accidentally to use a NULL or
@@ -351,7 +355,11 @@ return_atomic(svn_named_atomic__t **atom
 svn_boolean_t
 svn_named_atomic__is_supported(void)
 {
-#ifdef _WIN32
+#if !APR_HAS_MMAP
+  return FALSE;
+#elif !defined(_WIN32)
+  return TRUE;
+#else
   static svn_tristate_t result = svn_tristate_unknown;
 
   if (result == svn_tristate_unknown)
@@ -373,9 +381,7 @@ svn_named_atomic__is_supported(void)
     }
 
   return result == svn_tristate_true;
-#else
-  return TRUE;
-#endif
+#endif /* _WIN32 */
 }
 
 svn_boolean_t
@@ -389,6 +395,9 @@ svn_atomic_namespace__create(svn_atomic_
                              const char *name,
                              apr_pool_t *result_pool)
 {
+#if !APR_HAS_MMAP
+  return svn_error_create(APR_ENOTIMPL, NULL, NULL);
+#else
   apr_status_t apr_err;
   svn_error_t *err;
   apr_file_t *file;
@@ -489,6 +498,7 @@ svn_atomic_namespace__create(svn_atomic_
   /* Unlock to allow other processes may access the shared memory as well.
    */
   return unlock(&new_ns->mutex, err);
+#endif /* APR_HAS_MMAP */
 }
 
 svn_error_t *

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/pool.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/pool.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/pool.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/pool.c Mon Aug 19 11:21:01 2013
@@ -51,7 +51,7 @@ abort_on_pool_failure(int retcode)
 {
   /* Don't translate this string! It requires memory allocation to do so!
      And we don't have any of it... */
-  printf("Out of memory - terminating application.\n");
+  printf("libsvn: Out of memory - terminating application.\n");
   abort();
   return 0; /* not reached */
 }

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/sqlite.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/sqlite.c Mon Aug 19 11:21:01 2013
@@ -159,9 +159,9 @@ struct svn_sqlite__value_t
   int sqlite_err__temp = (x);                                    \
   if (sqlite_err__temp != SQLITE_OK)                             \
     return svn_error_createf(SQLITE_ERROR_CODE(sqlite_err__temp), \
-                             NULL, "sqlite: %s (S%d)",             \
-                             sqlite3_errmsg((db)->db3),           \
-                             sqlite_err__temp);                   \
+                             NULL, "sqlite[S%d]: %s",             \
+                             sqlite_err__temp,                    \
+                             sqlite3_errmsg((db)->db3));          \
 } while (0)
 
 #define SQLITE_ERR_MSG(x, msg) do                                \
@@ -169,8 +169,8 @@ struct svn_sqlite__value_t
   int sqlite_err__temp = (x);                                    \
   if (sqlite_err__temp != SQLITE_OK)                             \
     return svn_error_createf(SQLITE_ERROR_CODE(sqlite_err__temp), \
-                             NULL, "sqlite: %s (S%d)", (msg),     \
-                             sqlite_err__temp);                  \
+                             NULL, "sqlite[S%d]: %s",            \
+                             sqlite_err__temp, msg);             \
 } while (0)
 
 
@@ -192,9 +192,9 @@ exec_sql2(svn_sqlite__db_t *db, const ch
   if (sqlite_err != SQLITE_OK && sqlite_err != ignored_err)
     {
       svn_error_t *err = svn_error_createf(SQLITE_ERROR_CODE(sqlite_err), NULL,
-                                           _("sqlite: %s (S%d),"
+                                           _("sqlite[S%d]: %s,"
                                              " executing statement '%s'"),
-                                           err_msg, sqlite_err, sql);
+                                           sqlite_err, err_msg, sql);
       sqlite3_free(err_msg);
       return err;
     }
@@ -311,8 +311,8 @@ svn_sqlite__step(svn_boolean_t *got_row,
       svn_error_t *err1, *err2;
 
       err1 = svn_error_createf(SQLITE_ERROR_CODE(sqlite_result), NULL,
-                               "sqlite: %s (S%d)",
-                               sqlite3_errmsg(stmt->db->db3), sqlite_result);
+                               "sqlite[S%d]: %s",
+                               sqlite_result, sqlite3_errmsg(stmt->db->db3));
       err2 = svn_sqlite__reset(stmt);
       return svn_error_compose_create(err1, err2);
     }
@@ -763,7 +763,7 @@ init_sqlite(void *baton, apr_pool_t *poo
     int err = sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
     if (err != SQLITE_OK && err != SQLITE_MISUSE)
       return svn_error_createf(SQLITE_ERROR_CODE(err), NULL,
-                               _("Could not configure SQLite (S%d)"), err);
+                               _("Could not configure SQLite [S%d]"), err);
   }
   SQLITE_ERR_MSG(sqlite3_initialize(), _("Could not initialize SQLite"));
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/stream.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/stream.c Mon Aug 19 11:21:01 2013
@@ -56,6 +56,7 @@ struct svn_stream_t {
   svn_stream_mark_fn_t mark_fn;
   svn_stream_seek_fn_t seek_fn;
   svn_stream__is_buffered_fn_t is_buffered_fn;
+  apr_file_t *file; /* Maybe NULL */
 };
 
 
@@ -81,6 +82,7 @@ svn_stream_create(void *baton, apr_pool_
   stream->mark_fn = NULL;
   stream->seek_fn = NULL;
   stream->is_buffered_fn = NULL;
+  stream->file = NULL;
   return stream;
 }
 
@@ -913,6 +915,7 @@ svn_stream_from_aprfile2(apr_file_t *fil
   svn_stream_set_mark(stream, mark_handler_apr);
   svn_stream_set_seek(stream, seek_handler_apr);
   svn_stream__set_is_buffered(stream, is_buffered_handler_apr);
+  stream->file = file;
 
   if (! disown)
     svn_stream_set_close(stream, close_handler_apr);
@@ -920,6 +923,12 @@ svn_stream_from_aprfile2(apr_file_t *fil
   return stream;
 }
 
+apr_file_t *
+svn_stream__aprfile(svn_stream_t *stream)
+{
+  return stream->file;
+}
+
 
 /* Compressed stream support */
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/string.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/string.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/string.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/string.c Mon Aug 19 11:21:01 2013
@@ -1028,7 +1028,7 @@ svn__strtoff(apr_off_t *offset, const ch
 }
 
 unsigned long
-svn__strtoul(const char *buffer, char **end)
+svn__strtoul(const char* buffer, const char** end)
 {
   unsigned long result = 0;
 
@@ -1052,7 +1052,7 @@ svn__strtoul(const char *buffer, char **
       ++buffer;
     }
 
-  *end = (char *)buffer;
+  *end = buffer;
   return result;
 }
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/types.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/types.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/types.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/types.c Mon Aug 19 11:21:01 2013
@@ -39,7 +39,7 @@ svn_revnum_parse(svn_revnum_t *rev,
                  const char *str,
                  const char **endptr)
 {
-  char *end;
+  const char *end;
 
   svn_revnum_t result = (svn_revnum_t)svn__strtoul(str, &end);
 
@@ -67,7 +67,7 @@ svn_revnum_parse(svn_revnum_t *rev,
       if (*str > '2' || (apr_uint32_t)result > APR_INT32_MAX)
         return svn_error_createf
                   (SVN_ERR_REVNUM_PARSE_FAILURE, NULL,
-                  _("Revision number too large or not normalized '%s'"), str);
+                  _("Revision number too large '%s'"), str);
     }
   
   if (endptr)

Modified: subversion/branches/move-tracking-1/subversion/libsvn_subr/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_subr/utf8proc.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_subr/utf8proc.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_subr/utf8proc.c Mon Aug 19 11:21:01 2013
@@ -24,7 +24,7 @@
 
 
 #define UTF8PROC_INLINE
-#include "utf8proc/utf8proc.c.inline"
+#include "utf8proc/utf8proc.c"
 
 #include <apr_fnmatch.h>
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/adm_ops.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/adm_ops.c Mon Aug 19 11:21:01 2013
@@ -148,6 +148,7 @@ process_committed_leaf(svn_wc__db_t *db,
                                 db, local_abspath,
                                 FALSE /* keep_as_working */,
                                 FALSE /* queue_deletes */,
+                                TRUE  /* remove_locks */,
                                 (! via_recurse)
                                     ? new_revnum : SVN_INVALID_REVNUM,
                                 NULL, NULL,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/conflicts.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/conflicts.c Mon Aug 19 11:21:01 2013
@@ -1277,7 +1277,7 @@ generate_propconflict(svn_boolean_t *con
                       apr_pool_t *scratch_pool)
 {
   svn_wc_conflict_result_t *result = NULL;
-  svn_wc_conflict_description2_t *cdesc;
+  svn_wc_conflict_description3_t *cdesc;
   const char *dirpath = svn_dirent_dirname(local_abspath, scratch_pool);
   svn_node_kind_t kind;
   const svn_string_t *new_value = NULL;
@@ -1294,7 +1294,7 @@ generate_propconflict(svn_boolean_t *con
                              svn_dirent_local_style(local_abspath,
                                                     scratch_pool));
 
-  cdesc = svn_wc_conflict_description_create_prop2(
+  cdesc = svn_wc_conflict_description_create_prop3(
                 local_abspath,
                 (kind == svn_node_dir) ? svn_node_dir : svn_node_file,
                 propname, scratch_pool);
@@ -1332,7 +1332,6 @@ generate_propconflict(svn_boolean_t *con
          base_file stay NULL as-is.  Both agents are attempting to add a
          new property.  */
     }
-
   else if ((base_val && !incoming_old_val)
            || (!base_val && incoming_old_val))
     {
@@ -1354,7 +1353,6 @@ generate_propconflict(svn_boolean_t *con
                                   scratch_pool));
       cdesc->base_abspath = svn_dirent_join(dirpath, file_name, scratch_pool);
     }
-
   else  /* base and old are both non-NULL */
     {
       const svn_string_t *conflict_base_val;
@@ -1398,14 +1396,15 @@ generate_propconflict(svn_boolean_t *con
           svn_diff_file_options_t *options =
             svn_diff_file_options_create(scratch_pool);
 
-          SVN_ERR(svn_stream_open_unique(&mergestream, &cdesc->merged_file,
+          SVN_ERR(svn_stream_open_unique(&mergestream,
+                                         &cdesc->prop_reject_abspath,
                                          NULL, svn_io_file_del_on_pool_cleanup,
                                          scratch_pool, scratch_pool));
           SVN_ERR(svn_diff_mem_string_diff3(&diff, conflict_base_val,
                                             working_val,
                                             incoming_new_val, options, scratch_pool));
-          SVN_ERR(svn_diff_mem_string_output_merge2
-                  (mergestream, diff, conflict_base_val, working_val,
+          SVN_ERR(svn_diff_mem_string_output_merge2(mergestream, diff,
+                   conflict_base_val, working_val,
                    incoming_new_val, NULL, NULL, NULL, NULL,
                    svn_diff_conflict_display_modified_latest, scratch_pool));
           SVN_ERR(svn_stream_close(mergestream));
@@ -1427,10 +1426,8 @@ generate_propconflict(svn_boolean_t *con
     cdesc->reason = svn_wc_conflict_reason_edited;
 
   /* Invoke the interactive conflict callback. */
-  {
-    SVN_ERR(conflict_func(&result, cdesc, conflict_baton, scratch_pool,
-                          scratch_pool));
-  }
+  SVN_ERR(conflict_func(&result, svn_wc__cd3_to_cd2(cdesc, scratch_pool),
+                        conflict_baton, scratch_pool, scratch_pool));
   if (result == NULL)
     {
       *conflict_remains = TRUE;
@@ -1781,7 +1778,7 @@ resolve_text_conflict(svn_skel_t **work_
                       svn_boolean_t *was_resolved,
                       svn_wc__db_t *db,
                       const char *local_abspath,
-                      svn_wc_conflict_description2_t *cdesc,
+                      svn_wc_conflict_description3_t *cdesc,
                       const apr_array_header_t *merge_options,
                       svn_wc_conflict_resolver_func2_t conflict_func,
                       void *conflict_baton,
@@ -1797,8 +1794,8 @@ resolve_text_conflict(svn_skel_t **work_
   /* Give the conflict resolution callback a chance to clean
      up the conflicts before we mark the file 'conflicted' */
 
-  SVN_ERR(conflict_func(&result, cdesc, conflict_baton, scratch_pool,
-                        scratch_pool));
+  SVN_ERR(conflict_func(&result, svn_wc__cd3_to_cd2(cdesc, scratch_pool),
+                        conflict_baton, scratch_pool, scratch_pool));
   if (result == NULL)
     return svn_error_create(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
                             _("Conflict callback violated API:"
@@ -1851,7 +1848,7 @@ resolve_text_conflict(svn_skel_t **work_
  * Allocate results in RESULT_POOL.  SCRATCH_POOL is used for temporary
  * allocations. */
 static svn_error_t *
-read_text_conflict_desc(svn_wc_conflict_description2_t **desc,
+read_text_conflict_desc(svn_wc_conflict_description3_t **desc,
                         svn_wc__db_t *db,
                         const char *local_abspath,
                         const svn_skel_t *conflict_skel,
@@ -1863,7 +1860,7 @@ read_text_conflict_desc(svn_wc_conflict_
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
 {
-  *desc = svn_wc_conflict_description_create_text2(local_abspath, result_pool);
+  *desc = svn_wc_conflict_description_create_text3(local_abspath, result_pool);
   (*desc)->is_binary = is_binary;
   (*desc)->mime_type = mime_type;
   (*desc)->operation = operation;
@@ -1891,7 +1888,7 @@ read_text_conflict_desc(svn_wc_conflict_
  * Allocate results in RESULT_POOL.  SCRATCH_POOL is used for temporary
  * allocations. */
 static svn_error_t *
-read_tree_conflict_desc(svn_wc_conflict_description2_t **desc,
+read_tree_conflict_desc(svn_wc_conflict_description3_t **desc,
                         svn_wc__db_t *db,
                         const char *local_abspath,
                         const svn_skel_t *conflict_skel,
@@ -1916,7 +1913,7 @@ read_tree_conflict_desc(svn_wc_conflict_
   else
     tc_kind = svn_node_file; /* Avoid assertion */
 
-  *desc = svn_wc_conflict_description_create_tree2(local_abspath, tc_kind,
+  *desc = svn_wc_conflict_description_create_tree3(local_abspath, tc_kind,
                                                    operation,
                                                    left_version, right_version,
                                                    result_pool);
@@ -2042,7 +2039,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
     {
       svn_skel_t *work_items;
       svn_boolean_t was_resolved;
-      svn_wc_conflict_description2_t *desc;
+      svn_wc_conflict_description3_t *desc;
       apr_hash_t *props;
 
       SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
@@ -2079,7 +2076,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
   if (tree_conflicted)
     {
       svn_wc_conflict_result_t *result;
-      svn_wc_conflict_description2_t *desc;
+      svn_wc_conflict_description3_t *desc;
 
       SVN_ERR(read_tree_conflict_desc(&desc,
                                       db, local_abspath, conflict_skel,
@@ -2087,8 +2084,8 @@ svn_wc__conflict_invoke_resolver(svn_wc_
                                       scratch_pool, scratch_pool));
 
       /* Tell the resolver func about this conflict. */
-      SVN_ERR(resolver_func(&result, desc, resolver_baton, scratch_pool,
-                            scratch_pool));
+      SVN_ERR(resolver_func(&result, svn_wc__cd3_to_cd2(desc, scratch_pool),
+                            resolver_baton, scratch_pool, scratch_pool));
 
       /* Ignore the result. We cannot apply it here since this code runs
        * during an update or merge operation. Tree conflicts are always
@@ -2144,22 +2141,19 @@ read_prop_conflict_descs(apr_array_heade
   if ((! create_tempfiles) || apr_hash_count(conflicted_props) == 0)
     {
       /* Legacy prop conflict with only a .reject file. */
-      svn_wc_conflict_description2_t *desc;
+      svn_wc_conflict_description3_t *desc;
 
-      desc  = svn_wc_conflict_description_create_prop2(local_abspath,
+      desc  = svn_wc_conflict_description_create_prop3(local_abspath,
                                                        node_kind,
                                                        "", result_pool);
 
-      /* ### This should be changed. The prej file should be stored
-       * ### separately from the other files. We need to rev the
-       * ### conflict description struct for this. */
-      desc->their_abspath = apr_pstrdup(result_pool, prop_reject_file);
+      desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
 
       desc->operation = operation;
       desc->src_left_version = left_version;
       desc->src_right_version = right_version;
 
-      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description2_t*) = desc;
+      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description3_t *) = desc;
 
       return SVN_NO_ERROR;
     }
@@ -2173,14 +2167,14 @@ read_prop_conflict_descs(apr_array_heade
       svn_string_t *old_value;
       svn_string_t *my_value;
       svn_string_t *their_value;
-      svn_wc_conflict_description2_t *desc;
+      svn_wc_conflict_description3_t *desc;
 
       svn_pool_clear(iterpool);
 
-      desc  = svn_wc_conflict_description_create_prop2(local_abspath,
-                                                       node_kind,
-                                                       propname,
-                                                       result_pool);
+      desc = svn_wc_conflict_description_create_prop3(local_abspath,
+                                                      node_kind,
+                                                      propname,
+                                                      result_pool);
 
       desc->operation = operation;
       desc->src_left_version = left_version;
@@ -2208,10 +2202,7 @@ read_prop_conflict_descs(apr_array_heade
       else
         desc->reason = svn_wc_conflict_reason_edited;
 
-      /* ### This should be changed. The prej file should be stored
-       * ### separately from the other files. We need to rev the
-       * ### conflict description struct for this. */
-      desc->their_abspath = apr_pstrdup(result_pool, prop_reject_file);
+      desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
 
       /* ### This should be changed. The conflict description for
        * ### props should contain these values as svn_string_t,
@@ -2235,10 +2226,7 @@ read_prop_conflict_descs(apr_array_heade
           svn_stream_t *s;
           apr_size_t len;
 
-          /* ### Currently, their_abspath is used for the prop reject file.
-           * ### Put their value into merged instead...
-           * ### We need to rev the conflict description struct to fix this. */
-          SVN_ERR(svn_stream_open_unique(&s, &desc->merged_file, NULL,
+          SVN_ERR(svn_stream_open_unique(&s, &desc->their_abspath, NULL,
                                          svn_io_file_del_on_pool_cleanup,
                                          result_pool, iterpool));
           len = their_value->len;
@@ -2259,7 +2247,7 @@ read_prop_conflict_descs(apr_array_heade
           SVN_ERR(svn_stream_close(s));
         }
 
-      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description2_t*) = desc;
+      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description3_t *) = desc;
     }
   svn_pool_destroy(iterpool);
 
@@ -2291,7 +2279,7 @@ svn_wc__read_conflicts(const apr_array_h
     {
       /* Some callers expect not NULL */
       *conflicts = apr_array_make(result_pool, 0,
-                                  sizeof(svn_wc_conflict_description2_t*));;
+                                  sizeof(svn_wc_conflict_description3_t *));;
       return SVN_NO_ERROR;
     }
 
@@ -2301,7 +2289,7 @@ svn_wc__read_conflicts(const apr_array_h
                                      result_pool, scratch_pool));
 
   cflcts = apr_array_make(result_pool, 4,
-                          sizeof(svn_wc_conflict_description2_t*));
+                          sizeof(svn_wc_conflict_description3_t *));
 
   if (locations && locations->nelts > 0)
     left_version = APR_ARRAY_IDX(locations, 0, const svn_wc_conflict_version_t *);
@@ -2322,26 +2310,26 @@ svn_wc__read_conflicts(const apr_array_h
 
   if (text_conflicted)
     {
-      svn_wc_conflict_description2_t *desc;
+      svn_wc_conflict_description3_t *desc;
 
       SVN_ERR(read_text_conflict_desc(&desc,
                                       db, local_abspath, conflict_skel,
                                       FALSE /*is_binary*/, NULL /*mime_type*/,
                                       operation, left_version, right_version,
                                       result_pool, scratch_pool));
-      APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description2_t*) = desc;
+      APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description3_t *) = desc;
     }
 
   if (tree_conflicted)
     {
-      svn_wc_conflict_description2_t *desc;
+      svn_wc_conflict_description3_t *desc;
 
       SVN_ERR(read_tree_conflict_desc(&desc,
                                       db, local_abspath, conflict_skel,
                                       operation, left_version, right_version,
                                       result_pool, scratch_pool));
 
-      APR_ARRAY_PUSH(cflcts, const svn_wc_conflict_description2_t *) = desc;
+      APR_ARRAY_PUSH(cflcts, const svn_wc_conflict_description3_t *) = desc;
     }
 
   *conflicts = cflcts;
@@ -2929,12 +2917,12 @@ conflict_status_walker(void *baton,
 
   for (i = 0; i < conflicts->nelts; i++)
     {
-      const svn_wc_conflict_description2_t *cd;
+      const svn_wc_conflict_description3_t *cd;
       svn_boolean_t did_resolve;
       svn_wc_conflict_choice_t my_choice = cswb->conflict_choice;
       const char *merged_file = NULL;
 
-      cd = APR_ARRAY_IDX(conflicts, i, const svn_wc_conflict_description2_t *);
+      cd = APR_ARRAY_IDX(conflicts, i, const svn_wc_conflict_description3_t *);
 
       svn_pool_clear(iterpool);
 
@@ -2947,7 +2935,9 @@ conflict_status_walker(void *baton,
                                     _("No conflict-callback and no "
                                       "pre-defined conflict-choice provided"));
 
-          SVN_ERR(cswb->conflict_func(&result, cd, cswb->conflict_baton,
+          SVN_ERR(cswb->conflict_func(&result,
+                                      svn_wc__cd3_to_cd2(cd, scratch_pool),
+                                      cswb->conflict_baton,
                                       iterpool, iterpool));
 
           my_choice = result->choice;

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/crop.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/crop.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/crop.c Mon Aug 19 11:21:01 2013
@@ -110,6 +110,7 @@ crop_children(svn_wc__db_t *db,
             SVN_ERR(svn_wc__db_base_remove(db, child_abspath,
                                            FALSE /* keep_as_working */,
                                            FALSE /* queue_deletes */,
+                                           FALSE /* remove_locks */,
                                            SVN_INVALID_REVNUM,
                                            NULL, NULL, iterpool));
 

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/deprecated.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/deprecated.c Mon Aug 19 11:21:01 2013
@@ -2633,6 +2633,148 @@ svn_wc_props_modified_p(svn_boolean_t *m
 }
 
 
+svn_error_t *
+svn_wc__status2_from_3(svn_wc_status2_t **status,
+                       const svn_wc_status3_t *old_status,
+                       svn_wc_context_t *wc_ctx,
+                       const char *local_abspath,
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool)
+{
+  const svn_wc_entry_t *entry = NULL;
+
+  if (old_status == NULL)
+    {
+      *status = NULL;
+      return SVN_NO_ERROR;
+    }
+
+  *status = apr_pcalloc(result_pool, sizeof(**status));
+
+  if (old_status->versioned)
+    {
+      svn_error_t *err;
+      err= svn_wc__get_entry(&entry, wc_ctx->db, local_abspath, FALSE,
+                             svn_node_unknown, result_pool, scratch_pool);
+
+      if (err && err->apr_err == SVN_ERR_NODE_UNEXPECTED_KIND)
+        svn_error_clear(err);
+      else
+        SVN_ERR(err);
+    }
+
+  (*status)->entry = entry;
+  (*status)->copied = old_status->copied;
+  (*status)->repos_lock = svn_lock_dup(old_status->repos_lock, result_pool);
+
+  if (old_status->repos_relpath)
+    (*status)->url = svn_path_url_add_component2(old_status->repos_root_url,
+                                                 old_status->repos_relpath,
+                                                 result_pool);
+  (*status)->ood_last_cmt_rev = old_status->ood_changed_rev;
+  (*status)->ood_last_cmt_date = old_status->ood_changed_date;
+  (*status)->ood_kind = old_status->ood_kind;
+  (*status)->ood_last_cmt_author = old_status->ood_changed_author;
+
+  if (old_status->conflicted)
+    {
+      const svn_wc_conflict_description3_t *tree_conflict;
+      const svn_wc_conflict_description2_t *tree_conflict2;
+      SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, wc_ctx, local_abspath,
+                                        scratch_pool, scratch_pool));
+      tree_conflict2 = svn_wc__cd3_to_cd2(tree_conflict, scratch_pool);
+      (*status)->tree_conflict = svn_wc__cd2_to_cd(tree_conflict2, result_pool);
+    }
+
+  (*status)->switched = old_status->switched;
+
+  (*status)->text_status = old_status->node_status;
+  (*status)->prop_status = old_status->prop_status;
+
+  (*status)->repos_text_status = old_status->repos_node_status;
+  (*status)->repos_prop_status = old_status->repos_prop_status;
+
+  /* Some values might be inherited from properties */
+  if (old_status->node_status == svn_wc_status_modified
+      || old_status->node_status == svn_wc_status_conflicted)
+    (*status)->text_status = old_status->text_status;
+
+  /* (Currently a no-op, but just make sure it is ok) */
+  if (old_status->repos_node_status == svn_wc_status_modified
+      || old_status->repos_node_status == svn_wc_status_conflicted)
+    (*status)->repos_text_status = old_status->repos_text_status;
+
+  if (old_status->node_status == svn_wc_status_added)
+    (*status)->prop_status = svn_wc_status_none; /* No separate info */
+
+  /* Find pristine_text_status value */
+  switch (old_status->text_status)
+    {
+      case svn_wc_status_none:
+      case svn_wc_status_normal:
+      case svn_wc_status_modified:
+        (*status)->pristine_text_status = old_status->text_status;
+        break;
+      case svn_wc_status_conflicted:
+      default:
+        /* ### Fetch compare data, or fall back to the documented
+               not retrieved behavior? */
+        (*status)->pristine_text_status = svn_wc_status_none;
+        break;
+    }
+
+  /* Find pristine_prop_status value */
+  switch (old_status->prop_status)
+    {
+      case svn_wc_status_none:
+      case svn_wc_status_normal:
+      case svn_wc_status_modified:
+        if (old_status->node_status != svn_wc_status_added
+            && old_status->node_status != svn_wc_status_deleted
+            && old_status->node_status != svn_wc_status_replaced)
+          {
+            (*status)->pristine_prop_status = old_status->prop_status;
+          }
+        else
+          (*status)->pristine_prop_status = svn_wc_status_none;
+        break;
+      case svn_wc_status_conflicted:
+      default:
+        /* ### Fetch compare data, or fall back to the documented
+               not retrieved behavior? */
+        (*status)->pristine_prop_status = svn_wc_status_none;
+        break;
+    }
+
+  if (old_status->versioned
+      && old_status->conflicted
+      && old_status->node_status != svn_wc_status_obstructed
+      && (old_status->kind == svn_node_file
+          || old_status->node_status != svn_wc_status_missing))
+    {
+      svn_boolean_t text_conflict_p, prop_conflict_p;
+
+      /* The entry says there was a conflict, but the user might have
+         marked it as resolved by deleting the artifact files, so check
+         for that. */
+      SVN_ERR(svn_wc__internal_conflicted_p(&text_conflict_p,
+                                            &prop_conflict_p,
+                                            NULL,
+                                            wc_ctx->db, local_abspath,
+                                            scratch_pool));
+
+      if (text_conflict_p)
+        (*status)->text_status = svn_wc_status_conflicted;
+
+      if (prop_conflict_p)
+        (*status)->prop_status = svn_wc_status_conflicted;
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
+
 /*** From status.c ***/
 
 struct status4_wrapper_baton
@@ -4580,3 +4722,98 @@ svn_wc_read_kind(svn_node_kind_t *kind,
 
   return SVN_NO_ERROR;
 }
+
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description_create_text2(const char *local_abspath,
+                                         apr_pool_t *result_pool)
+{
+  svn_wc_conflict_description2_t *conflict;
+
+  SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
+
+  conflict = apr_pcalloc(result_pool, sizeof(*conflict));
+  conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
+  conflict->node_kind = svn_node_file;
+  conflict->kind = svn_wc_conflict_kind_text;
+  conflict->action = svn_wc_conflict_action_edit;
+  conflict->reason = svn_wc_conflict_reason_edited;
+  return conflict;
+}
+
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description_create_prop2(const char *local_abspath,
+                                         svn_node_kind_t node_kind,
+                                         const char *property_name,
+                                         apr_pool_t *result_pool)
+{
+  svn_wc_conflict_description2_t *conflict;
+
+  SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
+
+  conflict = apr_pcalloc(result_pool, sizeof(*conflict));
+  conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
+  conflict->node_kind = node_kind;
+  conflict->kind = svn_wc_conflict_kind_property;
+  conflict->property_name = apr_pstrdup(result_pool, property_name);
+  return conflict;
+}
+
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description_create_tree2(
+  const char *local_abspath,
+  svn_node_kind_t node_kind,
+  svn_wc_operation_t operation,
+  const svn_wc_conflict_version_t *src_left_version,
+  const svn_wc_conflict_version_t *src_right_version,
+  apr_pool_t *result_pool)
+{
+  svn_wc_conflict_description2_t *conflict;
+
+  SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
+
+  conflict = apr_pcalloc(result_pool, sizeof(*conflict));
+  conflict->local_abspath = apr_pstrdup(result_pool, local_abspath);
+  conflict->node_kind = node_kind;
+  conflict->kind = svn_wc_conflict_kind_tree;
+  conflict->operation = operation;
+  conflict->src_left_version = svn_wc_conflict_version_dup(src_left_version,
+                                                           result_pool);
+  conflict->src_right_version = svn_wc_conflict_version_dup(src_right_version,
+                                                            result_pool);
+  return conflict;
+}
+
+svn_wc_conflict_description2_t *
+svn_wc__conflict_description2_dup(const svn_wc_conflict_description2_t *conflict,
+                                  apr_pool_t *pool)
+{
+  svn_wc_conflict_description2_t *new_conflict;
+
+  new_conflict = apr_pcalloc(pool, sizeof(*new_conflict));
+
+  /* Shallow copy all members. */
+  *new_conflict = *conflict;
+
+  if (conflict->local_abspath)
+    new_conflict->local_abspath = apr_pstrdup(pool, conflict->local_abspath);
+  if (conflict->property_name)
+    new_conflict->property_name = apr_pstrdup(pool, conflict->property_name);
+  if (conflict->mime_type)
+    new_conflict->mime_type = apr_pstrdup(pool, conflict->mime_type);
+  if (conflict->base_abspath)
+    new_conflict->base_abspath = apr_pstrdup(pool, conflict->base_abspath);
+  if (conflict->their_abspath)
+    new_conflict->their_abspath = apr_pstrdup(pool, conflict->their_abspath);
+  if (conflict->my_abspath)
+    new_conflict->my_abspath = apr_pstrdup(pool, conflict->my_abspath);
+  if (conflict->merged_file)
+    new_conflict->merged_file = apr_pstrdup(pool, conflict->merged_file);
+  if (conflict->src_left_version)
+    new_conflict->src_left_version =
+      svn_wc_conflict_version_dup(conflict->src_left_version, pool);
+  if (conflict->src_right_version)
+    new_conflict->src_right_version =
+      svn_wc_conflict_version_dup(conflict->src_right_version, pool);
+
+  return new_conflict;
+}

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/entries.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/entries.c Mon Aug 19 11:21:01 2013
@@ -464,9 +464,9 @@ read_one_entry(const svn_wc_entry_t **ne
 
           for (j = 0; j < child_conflicts->nelts; j++)
             {
-              const svn_wc_conflict_description2_t *conflict =
+              const svn_wc_conflict_description3_t *conflict =
                 APR_ARRAY_IDX(child_conflicts, j,
-                              svn_wc_conflict_description2_t *);
+                              svn_wc_conflict_description3_t *);
 
               if (conflict->kind == svn_wc_conflict_kind_tree)
                 {
@@ -1892,15 +1892,15 @@ write_entry(struct write_baton **entry_n
                              scratch_pool);
       tree_conflicts = apr_hash_make(result_pool);
       skel = skel->children;
-      while(skel)
+      while (skel)
         {
-          svn_wc_conflict_description2_t *conflict;
+          svn_wc_conflict_description3_t *conflict;
           svn_skel_t *new_skel;
           const char *key;
 
           /* *CONFLICT is allocated so it is safe to use a non-const pointer */
           SVN_ERR(svn_wc__deserialize_conflict(
-                             (const svn_wc_conflict_description2_t**)&conflict,
+                             (const svn_wc_conflict_description3_t**)&conflict,
                                                skel,
                                                svn_dirent_join(root_abspath,
                                                                local_relpath,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/externals.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/externals.c Mon Aug 19 11:21:01 2013
@@ -1413,6 +1413,7 @@ svn_wc__external_remove(svn_wc_context_t
       SVN_ERR(svn_wc__db_base_remove(wc_ctx->db, local_abspath,
                                      FALSE /* keep_as_working */,
                                      TRUE /* queue_deletes */,
+                                     FALSE /* remove_locks */,
                                      SVN_INVALID_REVNUM,
                                      NULL, NULL, scratch_pool));
       SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/info.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/info.c Mon Aug 19 11:21:01 2013
@@ -310,10 +310,16 @@ build_info_for_node(svn_wc__info2_t **in
                                 local_abspath, result_pool, scratch_pool));
 
   if (conflicted)
-    SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, db,
-                                   local_abspath,
-                                   TRUE /* ### create tempfiles */,
-                                   result_pool, scratch_pool));
+    {
+      const apr_array_header_t *conflicts;
+
+      SVN_ERR(svn_wc__read_conflicts(&conflicts, db,
+                                     local_abspath,
+                                     TRUE /* ### create tempfiles */,
+                                     result_pool, scratch_pool));
+      wc_info->conflicts = svn_wc__cd3_array_to_cd2_array(conflicts,
+                                                          result_pool);
+    }
   else
     wc_info->conflicts = NULL;
 
@@ -373,7 +379,7 @@ struct found_entry_baton
   svn_boolean_t actual_only;
   svn_boolean_t first;
   /* The set of tree conflicts that have been found but not (yet) visited by
-   * the tree walker.  Map of abspath -> svn_wc_conflict_description2_t. */
+   * the tree walker.  Map of abspath -> empty string. */
   apr_hash_t *tree_conflicts;
   apr_pool_t *pool;
 };
@@ -534,8 +540,9 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
        hi = apr_hash_next(hi))
     {
       const char *this_abspath = svn__apr_hash_index_key(hi);
-      const svn_wc_conflict_description2_t *tree_conflict;
+      const svn_wc_conflict_description3_t *tree_conflict;
       svn_wc__info2_t *info;
+      const apr_array_header_t *conflicts;
 
       svn_pool_clear(iterpool);
 
@@ -557,21 +564,22 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
       info->repos_root_URL = repos_root_url;
       info->repos_UUID = repos_uuid;
 
-      SVN_ERR(svn_wc__read_conflicts(&info->wc_info->conflicts,
+      SVN_ERR(svn_wc__read_conflicts(&conflicts,
                                      wc_ctx->db, this_abspath,
                                      TRUE /* ### create tempfiles */,
                                      iterpool, iterpool));
-
-      if (! info->wc_info->conflicts || ! info->wc_info->conflicts->nelts)
+      if (! conflicts || ! conflicts->nelts)
         continue;
 
-      tree_conflict = APR_ARRAY_IDX(info->wc_info->conflicts, 0,
-                                    svn_wc_conflict_description2_t *);
+      tree_conflict = APR_ARRAY_IDX(conflicts, 0,
+                                    const svn_wc_conflict_description3_t *);
 
       if (!depth_includes(local_abspath, depth, tree_conflict->local_abspath,
                           tree_conflict->node_kind, iterpool))
         continue;
 
+      info->wc_info->conflicts = svn_wc__cd3_array_to_cd2_array(conflicts,
+                                                                iterpool);
       SVN_ERR(receiver(receiver_baton, this_abspath, info, iterpool));
     }
   svn_pool_destroy(iterpool);

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/tree_conflicts.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/tree_conflicts.c Mon Aug 19 11:21:01 2013
@@ -196,7 +196,7 @@ read_node_version_info(const svn_wc_conf
 
 
 svn_error_t *
-svn_wc__deserialize_conflict(const svn_wc_conflict_description2_t **conflict,
+svn_wc__deserialize_conflict(const svn_wc_conflict_description3_t **conflict,
                              const svn_skel_t *skel,
                              const char *dir_path,
                              apr_pool_t *result_pool,
@@ -211,7 +211,7 @@ svn_wc__deserialize_conflict(const svn_w
   const svn_wc_conflict_version_t *src_left_version;
   const svn_wc_conflict_version_t *src_right_version;
   int n;
-  svn_wc_conflict_description2_t *new_conflict;
+  svn_wc_conflict_description3_t *new_conflict;
 
   if (!is_valid_conflict_skel(skel))
     return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
@@ -266,7 +266,7 @@ svn_wc__deserialize_conflict(const svn_w
   SVN_ERR(read_node_version_info(&src_right_version, skel->next,
                                  result_pool, scratch_pool));
 
-  new_conflict = svn_wc_conflict_description_create_tree2(victim_abspath,
+  new_conflict = svn_wc_conflict_description_create_tree3(victim_abspath,
     node_kind, operation, src_left_version, src_right_version,
     result_pool);
   new_conflict->action = action;
@@ -329,7 +329,7 @@ prepend_version_info_skel(svn_skel_t *pa
 
 svn_error_t *
 svn_wc__serialize_conflict(svn_skel_t **skel,
-                           const svn_wc_conflict_description2_t *conflict,
+                           const svn_wc_conflict_description3_t *conflict,
                            apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool)
 {
@@ -401,7 +401,7 @@ svn_wc__del_tree_conflict(svn_wc_context
 
 svn_error_t *
 svn_wc__add_tree_conflict(svn_wc_context_t *wc_ctx,
-                          const svn_wc_conflict_description2_t *conflict,
+                          const svn_wc_conflict_description3_t *conflict,
                           apr_pool_t *scratch_pool)
 {
   svn_boolean_t existing_conflict;
@@ -443,7 +443,7 @@ svn_wc__add_tree_conflict(svn_wc_context
                                                   NULL,
                                                   scratch_pool, scratch_pool));
 
-  switch(conflict->operation)
+  switch (conflict->operation)
     {
       case svn_wc_operation_update:
       default:
@@ -473,7 +473,7 @@ svn_wc__add_tree_conflict(svn_wc_context
 
 
 svn_error_t *
-svn_wc__get_tree_conflict(const svn_wc_conflict_description2_t **tree_conflict,
+svn_wc__get_tree_conflict(const svn_wc_conflict_description3_t **tree_conflict,
                           svn_wc_context_t *wc_ctx,
                           const char *local_abspath,
                           apr_pool_t *result_pool,
@@ -495,14 +495,13 @@ svn_wc__get_tree_conflict(const svn_wc_c
 
   for (i = 0; i < conflicts->nelts; i++)
     {
-      const svn_wc_conflict_description2_t *desc;
+      const svn_wc_conflict_description3_t *desc;
 
-      desc = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description2_t *);
+      desc = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description3_t *);
 
       if (desc->kind == svn_wc_conflict_kind_tree)
         {
-          *tree_conflict = svn_wc__conflict_description2_dup(desc,
-                                                             result_pool);
+          *tree_conflict = svn_wc__conflict_description3_dup(desc, result_pool);
           return SVN_NO_ERROR;
         }
     }

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/tree_conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/tree_conflicts.h?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/tree_conflicts.h (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/tree_conflicts.h Mon Aug 19 11:21:01 2013
@@ -62,18 +62,18 @@ extern "C" {
 
 svn_error_t *
 svn_wc__serialize_conflict(svn_skel_t **skel,
-                           const svn_wc_conflict_description2_t *conflict,
+                           const svn_wc_conflict_description3_t *conflict,
                            apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool);
 
 
-/* Parse a newly allocated svn_wc_conflict_description2_t object from the
+/* Parse a newly allocated svn_wc_conflict_description3_t object from the
  * provided SKEL. Return the result in *CONFLICT, allocated in RESULT_POOL.
  * DIR_PATH is the path to the WC directory whose conflicts are being read.
  * Use SCRATCH_POOL for temporary allocations.
  */
 svn_error_t *
-svn_wc__deserialize_conflict(const svn_wc_conflict_description2_t **conflict,
+svn_wc__deserialize_conflict(const svn_wc_conflict_description3_t **conflict,
                              const svn_skel_t *skel,
                              const char *dir_path,
                              apr_pool_t *result_pool,

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/update_editor.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/update_editor.c Mon Aug 19 11:21:01 2013
@@ -924,6 +924,7 @@ mark_directory_edited(struct dir_baton *
       do_notification(db->edit_baton, db->local_abspath, svn_node_dir,
                       svn_wc_notify_tree_conflict, scratch_pool);
       db->already_notified = TRUE;
+
     }
 
   return SVN_NO_ERROR;
@@ -1813,6 +1814,7 @@ delete_entry(const char *path,
       SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
                                      FALSE /* keep_as_working */,
                                      FALSE /* queue_deletes */,
+                                     FALSE /* remove_locks */,
                                      SVN_INVALID_REVNUM /* not_present_rev */,
                                      NULL, NULL,
                                      scratch_pool));
@@ -1909,7 +1911,7 @@ delete_entry(const char *path,
     {
       /* Delete, and do not leave a not-present node.  */
       SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
-                                     keep_as_working, queue_deletes,
+                                     keep_as_working, queue_deletes, FALSE,
                                      SVN_INVALID_REVNUM /* not_present_rev */,
                                      tree_conflict, NULL,
                                      scratch_pool));
@@ -1918,7 +1920,7 @@ delete_entry(const char *path,
     {
       /* Delete, leaving a not-present node.  */
       SVN_ERR(svn_wc__db_base_remove(eb->db, local_abspath,
-                                     keep_as_working, queue_deletes,
+                                     keep_as_working, queue_deletes, FALSE,
                                      *eb->target_revision,
                                      tree_conflict, NULL,
                                      scratch_pool));
@@ -1937,8 +1939,19 @@ delete_entry(const char *path,
 
   /* Notify. */
   if (tree_conflict)
-    do_notification(eb, local_abspath, svn_node_unknown,
-                    svn_wc_notify_tree_conflict, scratch_pool);
+    {
+      if (eb->conflict_func)
+        SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, local_abspath,
+                                                 tree_conflict,
+                                                 NULL /* merge_options */,
+                                                 eb->conflict_func,
+                                                 eb->conflict_baton,
+                                                 eb->cancel_func,
+                                                 eb->cancel_baton,
+                                                 scratch_pool));
+      do_notification(eb, local_abspath, svn_node_unknown,
+                      svn_wc_notify_tree_conflict, scratch_pool);
+    }
   else
     {
       svn_wc_notify_action_t action = svn_wc_notify_update_delete;
@@ -2287,6 +2300,16 @@ add_directory(const char *path,
 
   if (tree_conflict != NULL)
     {
+      if (eb->conflict_func)
+        SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, db->local_abspath,
+                                                 tree_conflict,
+                                                 NULL /* merge_options */,
+                                                 eb->conflict_func,
+                                                 eb->conflict_baton,
+                                                 eb->cancel_func,
+                                                 eb->cancel_baton,
+                                                 pool));
+
       db->already_notified = TRUE;
       do_notification(eb, db->local_abspath, svn_node_dir,
                       svn_wc_notify_tree_conflict, pool);
@@ -2905,7 +2928,7 @@ close_directory(void *dir_baton,
                                              eb->conflict_func,
                                              eb->conflict_baton,
                                              eb->cancel_func,
-                                             eb->conflict_baton,
+                                             eb->cancel_baton,
                                              scratch_pool));
 
   /* Notify of any prop changes on this directory -- but do nothing if
@@ -3378,6 +3401,16 @@ add_file(const char *path,
                                           tree_conflict, NULL,
                                           scratch_pool));
 
+      if (eb->conflict_func)
+        SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db, fb->local_abspath,
+                                                 tree_conflict,
+                                                 NULL /* merge_options */,
+                                                 eb->conflict_func,
+                                                 eb->conflict_baton,
+                                                 eb->cancel_func,
+                                                 eb->cancel_baton,
+                                                 scratch_pool));
+
       fb->already_notified = TRUE;
       do_notification(eb, fb->local_abspath, svn_node_file,
                       svn_wc_notify_tree_conflict, scratch_pool);
@@ -4701,6 +4734,7 @@ close_edit(void *edit_baton,
               SVN_ERR(svn_wc__db_base_remove(eb->db, eb->target_abspath,
                                              FALSE /* keep_as_working */,
                                              FALSE /* queue_deletes */,
+                                             FALSE /* remove_locks */,
                                              SVN_INVALID_REVNUM,
                                              NULL, NULL, scratch_pool));
             }

Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/upgrade.c?rev=1515362&r1=1515361&r2=1515362&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/upgrade.c Mon Aug 19 11:21:01 2013
@@ -654,8 +654,8 @@ ensure_repos_info(svn_wc_entry_t *entry,
 
 /*
  * Read tree conflict descriptions from @a conflict_data.  Set @a *conflicts
- * to a hash of pointers to svn_wc_conflict_description2_t objects indexed by
- * svn_wc_conflict_description2_t.local_abspath, all newly allocated in @a
+ * to a hash of pointers to svn_wc_conflict_description3_t objects indexed by
+ * svn_wc_conflict_description3_t.local_abspath, all newly allocated in @a
  * pool.  @a dir_path is the path to the working copy directory whose conflicts
  * are being read.  The conflicts read are the tree conflicts on the immediate
  * child nodes of @a dir_path.  Do all allocations in @a pool.
@@ -692,7 +692,7 @@ read_tree_conflicts(apr_hash_t **conflic
   iterpool = svn_pool_create(pool);
   for (skel = skel->children; skel != NULL; skel = skel->next)
     {
-      const svn_wc_conflict_description2_t *conflict;
+      const svn_wc_conflict_description3_t *conflict;
 
       svn_pool_clear(iterpool);
       SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel, dir_path,
@@ -727,7 +727,7 @@ migrate_single_tree_conflict_data(svn_sq
        hi;
        hi = apr_hash_next(hi))
     {
-      const svn_wc_conflict_description2_t *conflict =
+      const svn_wc_conflict_description3_t *conflict =
           svn__apr_hash_index_val(hi);
       const char *conflict_relpath;
       const char *conflict_data;
@@ -1431,7 +1431,7 @@ svn_wc__upgrade_conflict_skel_from_raw(s
   if (tree_conflict_data)
     {
       svn_skel_t *tc_skel;
-      const svn_wc_conflict_description2_t *tc;
+      const svn_wc_conflict_description3_t *tc;
       const char *local_abspath;
 
       if (!conflict_data)
@@ -2196,13 +2196,15 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
   upgrade_working_copy_baton_t cb_baton;
   svn_error_t *err;
   int result_format;
+  svn_boolean_t bumped_format;
 
   /* Try upgrading a wc-ng-style working copy. */
   SVN_ERR(svn_wc__db_open(&db, NULL /* ### config */, TRUE, FALSE,
                           scratch_pool, scratch_pool));
 
 
-  err = svn_wc__db_bump_format(&result_format, local_abspath, db,
+  err = svn_wc__db_bump_format(&result_format, &bumped_format,
+                               db, local_abspath,
                                scratch_pool);
   if (err)
     {
@@ -2224,6 +2226,17 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx,
 
       SVN_ERR_ASSERT(result_format == SVN_WC__VERSION);
 
+      if (bumped_format && notify_func)
+        {
+          svn_wc_notify_t *notify;
+
+          notify = svn_wc_create_notify(local_abspath,
+                                        svn_wc_notify_upgraded_path,
+                                        scratch_pool);
+
+          notify_func(notify_baton, notify, scratch_pool);
+        }
+
       return SVN_NO_ERROR;
     }
 



Mime
View raw message