You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/08/10 22:56:05 UTC

svn commit: r984206 [24/35] - in /subversion/branches/ignore-mergeinfo: ./ build/ build/generator/ build/generator/templates/ build/hudson/ build/hudson/jobs/subversion-1.6.x-solaris/ build/hudson/jobs/subversion-1.6.x-ubuntu/ build/hudson/jobs/subvers...

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/upgrade.c?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/upgrade.c Tue Aug 10 20:55:56 2010
@@ -52,12 +52,32 @@
 /* Old property locations. */
 #define PROPS_SUBDIR "props"
 #define PROP_BASE_SUBDIR "prop-base"
+#define PROP_BASE_FOR_DIR "dir-prop-base"
+#define PROP_REVERT_FOR_DIR "dir-prop-revert"
+#define PROP_WORKING_FOR_DIR "dir-props"
+
+/* Old textbase location. */
+#define TEXT_BASE_SUBDIR "text-base"
 
 #define TEMP_DIR "tmp"
 
 /* Old data files that we no longer need/use.  */
 #define ADM_README "README.txt"
 #define ADM_EMPTY_FILE "empty-file"
+#define ADM_LOG "log"
+#define ADM_LOCK "lock"
+
+/* New pristine location */
+#define PRISTINE_STORAGE_RELPATH "pristine"
+
+
+/* Forward declare until we decide to shift/reorder functions.  */
+static svn_error_t *
+migrate_node_props(const char *wcroot_abspath,
+                   const char *name,
+                   svn_sqlite__db_t *sdb,
+                   int original_format,
+                   apr_pool_t *scratch_pool);
 
 
 /* Read the properties from the file at PROPFILE_ABSPATH, returning them
@@ -327,7 +347,7 @@ build_lockfile_path(const char *local_di
   return svn_dirent_join_many(result_pool,
                               local_dir_abspath,
                               ".svn", /* ### switch to dynamic?  */
-                              "lock",
+                              ADM_LOCK,
                               NULL);
 }
 
@@ -356,10 +376,32 @@ create_physical_lock(const char *abspath
 }
 
 
-/* */
+/* Wipe out all the obsolete files/dirs from the administrative area.  */
 static void
-wipe_wcprops(const char *wcroot_abspath, apr_pool_t *scratch_pool)
+wipe_obsolete_files(const char *wcroot_abspath, apr_pool_t *scratch_pool)
 {
+  /* Zap unused files.  */
+  svn_error_clear(svn_io_remove_file2(
+                    svn_wc__adm_child(wcroot_abspath,
+                                      SVN_WC__ADM_FORMAT,
+                                      scratch_pool),
+                    TRUE, scratch_pool));
+  svn_error_clear(svn_io_remove_file2(
+                    svn_wc__adm_child(wcroot_abspath,
+                                      SVN_WC__ADM_ENTRIES,
+                                      scratch_pool),
+                    TRUE, scratch_pool));
+  svn_error_clear(svn_io_remove_file2(
+                    svn_wc__adm_child(wcroot_abspath,
+                                      ADM_EMPTY_FILE,
+                                      scratch_pool),
+                    TRUE, scratch_pool));
+  svn_error_clear(svn_io_remove_file2(
+                    svn_wc__adm_child(wcroot_abspath,
+                                      ADM_README,
+                                      scratch_pool),
+                    TRUE, scratch_pool));
+
   /* For formats <= SVN_WC__WCPROPS_MANY_FILES_VERSION, we toss the wcprops
      for the directory itself, and then all the wcprops for the files.  */
   svn_error_clear(svn_io_remove_file2(
@@ -379,54 +421,81 @@ wipe_wcprops(const char *wcroot_abspath,
                                       WCPROPS_ALL_DATA,
                                       scratch_pool),
                     TRUE, scratch_pool));
+
+#if 0  /* ### NOT READY TO WIPE THESE FILES!!  */
+  /* Remove the old properties files... whole directories at a time.  */
+  svn_error_clear(svn_io_remove_dir2(
+                    svn_wc__adm_child(wcroot_abspath,
+                                      PROPS_SUBDIR,
+                                      scratch_pool),
+                    FALSE, NULL, NULL, scratch_pool));
+  svn_error_clear(svn_io_remove_dir2(
+                    svn_wc__adm_child(wcroot_abspath,
+                                      PROP_BASE_SUBDIR,
+                                      scratch_pool),
+                    FALSE, NULL, NULL, scratch_pool));
+#endif
+
+#if 0  /* Conditional upon upgrading to format 18 */
+  /* Remove the old text-base directory. */
+  svn_error_clear(svn_io_remove_dir2(
+                    svn_wc__adm_child(wcroot_abspath,
+                                      TEXT_BASE_SUBDIR,
+                                      scratch_pool),
+                    FALSE, NULL, NULL, scratch_pool));
+#endif
+
+  /* Remove the old-style lock file LAST.  */
+  svn_error_clear(svn_io_remove_file2(
+                    build_lockfile_path(wcroot_abspath, scratch_pool),
+                    TRUE, scratch_pool));
 }
 
-/* Checks ENTRY to see if it misses critical information. Attempts to
-   retrieve this information from REPOS_INFO_FUNC, passing REPOS_INFO_BATON.
-   Returns a user understandable error using LOCAL_ABSPATH if vital
-   information would not be available after this function returns */
-static svn_error_t *
-fetch_missing_entry_data(svn_wc_entry_t *entry,
-                         const char *local_abspath,
-                         svn_wc_upgrade_get_repos_info_t repos_info_func,
-                         void *repos_info_baton,
-                         apr_pool_t *scratch_pool,
-                         apr_pool_t *result_pool)
-{
-  const char *repos_root;
-  const char *repos_uuid;
-  if (entry->repos && entry->uuid)
-    return SVN_NO_ERROR; /* We are done here */
 
-  if (!entry->repos && !repos_info_func)
+/* Ensure that ENTRY has its REPOS and UUID fields set. These will be
+   used to establish the REPOSITORY row in the new database, and then
+   used within the upgraded entries as they are written into the database.
+
+   If one or both are not available, then it attempts to retrieve this
+   information from REPOS_INFO_FUNC, passing REPOS_INFO_BATON.
+   Returns a user understandable error using LOCAL_ABSPATH if the
+   information cannot be obtained.  */
+static svn_error_t *
+ensure_repos_info(svn_wc_entry_t *entry,
+                  const char *local_abspath,
+                  svn_wc_upgrade_get_repos_info_t repos_info_func,
+                  void *repos_info_baton,
+                  apr_pool_t *result_pool,
+                  apr_pool_t *scratch_pool)
+{
+  /* Easy exit.  */
+  if (entry->repos != NULL && entry->uuid != NULL)
+    return SVN_NO_ERROR;
+
+  if (entry->repos == NULL && repos_info_func == NULL)
     return svn_error_createf(
         SVN_ERR_WC_UNSUPPORTED_FORMAT, NULL,
         _("Working copy '%s' can't be upgraded because the repository root is "
           "not available and can't be retrieved"),
         svn_dirent_local_style(local_abspath, scratch_pool));
 
-  if (!entry->uuid && !repos_info_func)
+  if (entry->uuid == NULL && repos_info_func == NULL)
     return svn_error_createf(
         SVN_ERR_WC_UNSUPPORTED_FORMAT, NULL,
         _("Working copy '%s' can't be upgraded because the repository uuid is "
           "not available and can't be retrieved"),
         svn_dirent_local_style(local_abspath, scratch_pool));
 
-   if (!entry->url)
+   if (entry->url == NULL)
      return svn_error_createf(
         SVN_ERR_WC_UNSUPPORTED_FORMAT, NULL,
         _("Working copy '%s' can't be upgraded because it doesn't have a url"),
         svn_dirent_local_style(local_abspath, scratch_pool));
 
-   SVN_ERR(repos_info_func(&repos_root, &repos_uuid, repos_info_baton,
-                          entry->url, scratch_pool, result_pool));
-
-   if (!entry->repos)
-     entry->repos = repos_root;
-   if (!entry->uuid)
-     entry->uuid = repos_uuid;
-
-   return SVN_NO_ERROR;
+   return svn_error_return((*repos_info_func)(&entry->repos, &entry->uuid,
+                                              repos_info_baton,
+                                              entry->url,
+                                              result_pool, scratch_pool));
 }
 
 
@@ -442,7 +511,7 @@ upgrade_to_wcng(svn_wc__db_t *db,
                 void *repos_info_baton,
                 apr_pool_t *scratch_pool)
 {
-  const char *logfile_path = svn_wc__adm_child(dir_abspath, SVN_WC__ADM_LOG,
+  const char *logfile_path = svn_wc__adm_child(dir_abspath, ADM_LOG,
                                                scratch_pool);
   svn_node_kind_t logfile_on_disk;
   apr_hash_t *entries;
@@ -450,11 +519,13 @@ upgrade_to_wcng(svn_wc__db_t *db,
   svn_sqlite__db_t *sdb;
   apr_int64_t repos_id;
   apr_int64_t wc_id;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  apr_hash_index_t *hi;
 
   /* Don't try to mess with the WC if there are old log files left. */
 
   /* Is the (first) log file present?  */
-  SVN_ERR(svn_io_check_path(logfile_path, &logfile_on_disk, scratch_pool));
+  SVN_ERR(svn_io_check_path(logfile_path, &logfile_on_disk, iterpool));
   if (logfile_on_disk == svn_node_file)
     return svn_error_create(SVN_ERR_WC_UNSUPPORTED_FORMAT, NULL,
                             _("Cannot upgrade with existing logs; please "
@@ -463,7 +534,7 @@ upgrade_to_wcng(svn_wc__db_t *db,
   /* Lock this working copy directory, or steal an existing lock. Do this
      BEFORE we read the entries. We don't want another process to modify the
      entries after we've read them into memory.  */
-  SVN_ERR(create_physical_lock(dir_abspath, scratch_pool));
+  SVN_ERR(create_physical_lock(dir_abspath, iterpool));
 
   /* What's going on here?
    *
@@ -484,18 +555,17 @@ upgrade_to_wcng(svn_wc__db_t *db,
 
   /***** ENTRIES *****/
   SVN_ERR(svn_wc__read_entries_old(&entries, dir_abspath,
-                                   scratch_pool, scratch_pool));
+                                   scratch_pool, iterpool));
 
   this_dir = apr_hash_get(entries, SVN_WC_ENTRY_THIS_DIR, APR_HASH_KEY_STRING);
-
-  SVN_ERR(fetch_missing_entry_data(this_dir, dir_abspath,
-                                   repos_info_func, repos_info_baton,
-                                   scratch_pool, apr_hash_pool_get(entries)));
+  SVN_ERR(ensure_repos_info(this_dir, dir_abspath,
+                            repos_info_func, repos_info_baton,
+                            scratch_pool, iterpool));
 
   /* Create an empty sqlite database for this directory. */
   SVN_ERR(svn_wc__db_upgrade_begin(&sdb, &repos_id, &wc_id, dir_abspath,
                                    this_dir->repos, this_dir->uuid,
-                                   scratch_pool, scratch_pool));
+                                   scratch_pool, iterpool));
 
   /* Migrate the entries over to the new database.
      ### We need to think about atomicity here.
@@ -503,26 +573,11 @@ upgrade_to_wcng(svn_wc__db_t *db,
      entries_write_new() writes in current format rather than f12. Thus, this
      function bumps a working copy all the way to current.  */
   SVN_ERR(svn_wc__db_temp_reset_format(SVN_WC__VERSION, db, dir_abspath,
-                                       scratch_pool));
-  SVN_ERR(svn_wc__db_wclock_set(db, dir_abspath, 0, scratch_pool));
+                                       iterpool));
+  SVN_ERR(svn_wc__db_wclock_set(db, dir_abspath, 0, iterpool));
   SVN_ERR(svn_wc__write_upgraded_entries(db, sdb, repos_id, wc_id,
                                          dir_abspath, entries,
-                                         scratch_pool));
-
-  SVN_ERR(svn_io_remove_file2(svn_wc__adm_child(dir_abspath,
-                                                SVN_WC__ADM_FORMAT,
-                                                scratch_pool),
-                              TRUE,
-                              scratch_pool));
-  SVN_ERR(svn_io_remove_file2(svn_wc__adm_child(dir_abspath,
-                                                SVN_WC__ADM_ENTRIES,
-                                                scratch_pool),
-                              FALSE,
-                              scratch_pool));
-
-  /* ### Note that lots of this content is cribbed from the old format updater.
-     ### The following code will change as the wc-ng format changes and more
-     ### stuff gets migrated to the sqlite format. */
+                                         iterpool));
 
   /***** WC PROPS *****/
 
@@ -533,43 +588,49 @@ upgrade_to_wcng(svn_wc__db_t *db,
 
       if (old_format <= SVN_WC__WCPROPS_MANY_FILES_VERSION)
         SVN_ERR(read_many_wcprops(&all_wcprops, dir_abspath,
-                                  scratch_pool, scratch_pool));
+                                  iterpool, iterpool));
       else
         SVN_ERR(read_wcprops(&all_wcprops, dir_abspath,
-                             scratch_pool, scratch_pool));
+                             iterpool, iterpool));
 
-      SVN_ERR(svn_wc__db_upgrade_apply_dav_cache(sdb, all_wcprops,
-                                                 scratch_pool));
+      SVN_ERR(svn_wc__db_upgrade_apply_dav_cache(sdb, all_wcprops, iterpool));
     }
 
-  /* Zap any wcprops files.  */
-  wipe_wcprops(dir_abspath, scratch_pool);
+  /* Upgrade all the properties (including "this dir").
 
-  /* We don't want README.txt or empty-file after format 7.  */
-  if (old_format <= 7)
+     Note: this must come AFTER the entries have been migrated into the
+     database. The upgrade process needs to examine the WORKING state.  */
+  for (hi = apr_hash_first(scratch_pool, entries);
+       hi != NULL;
+       hi = apr_hash_next(hi))
     {
-      svn_error_clear(svn_io_remove_file2(
-          svn_wc__adm_child(dir_abspath, ADM_EMPTY_FILE, scratch_pool),
-          TRUE, scratch_pool));
-      svn_error_clear(svn_io_remove_file2(
-          svn_wc__adm_child(dir_abspath, ADM_README, scratch_pool),
-          TRUE, scratch_pool));
+      const char *name = svn__apr_hash_index_key(hi);
+
+      svn_pool_clear(iterpool);
+
+#if 0
+      /* ### need to skip subdir stub entries.  */
+      /* ### not ready for this yet.  */
+      SVN_ERR(migrate_node_props(dir_abspath, name, sdb, old_format,
+                                 iterpool));
+#endif
     }
 
-  SVN_ERR(svn_wc__db_upgrade_finish(dir_abspath, sdb, scratch_pool));
+  SVN_ERR(svn_wc__db_upgrade_finish(dir_abspath, sdb, iterpool));
 
   /* All subdir access batons (and locks!) will be closed. Of course, they
      should have been closed/unlocked just after their own upgrade process
      has run.  */
   /* ### well, actually.... we don't recursively delete subdir locks here,
      ### we rely upon their own upgrade processes to do it. */
-  SVN_ERR(svn_wc__db_wclock_remove(db, dir_abspath, scratch_pool));
-  SVN_ERR(svn_io_remove_file2(build_lockfile_path(dir_abspath, scratch_pool),
-                              FALSE,
-                              scratch_pool));
+  SVN_ERR(svn_wc__db_wclock_remove(db, dir_abspath, iterpool));
+
+  /* Zap all the obsolete files. This removes the old-style lock file.  */
+  wipe_obsolete_files(dir_abspath, iterpool);
 
   /* ### need to (eventually) delete the .svn subdir.  */
 
+  svn_pool_destroy(iterpool);
   return SVN_NO_ERROR;
 }
 
@@ -893,12 +954,82 @@ bump_to_16(void *baton, svn_sqlite__db_t
 }
 
 
-#if 0 /* ### no props migration yet */
+/* Migrate the properties for one node (LOCAL_ABSPATH).  */
+static svn_error_t *
+migrate_node_props(const char *wcroot_abspath,
+                   const char *name,
+                   svn_sqlite__db_t *sdb,
+                   int original_format,
+                   apr_pool_t *scratch_pool)
+{
+  const char *base_abspath;  /* old name. nowadays: "pristine"  */
+  const char *revert_abspath;  /* old name. nowadays: "BASE"  */
+  const char *working_abspath;  /* old name. nowadays: "ACTUAL"  */
+  apr_hash_t *base_props;
+  apr_hash_t *revert_props;
+  apr_hash_t *working_props;
+
+  if (*name == '\0')
+    {
+      base_abspath = svn_wc__adm_child(wcroot_abspath, PROP_BASE_FOR_DIR,
+                                       scratch_pool);
+      revert_abspath = svn_wc__adm_child(wcroot_abspath, PROP_REVERT_FOR_DIR,
+                                         scratch_pool);
+      working_abspath = svn_wc__adm_child(wcroot_abspath, PROP_WORKING_FOR_DIR,
+                                          scratch_pool);
+    }
+  else
+    {
+      const char *basedir_abspath;
+      const char *propsdir_abspath;
+
+      propsdir_abspath = svn_wc__adm_child(wcroot_abspath, PROPS_SUBDIR,
+                                           scratch_pool);
+      basedir_abspath = svn_wc__adm_child(wcroot_abspath, PROP_BASE_SUBDIR,
+                                          scratch_pool);
+
+      base_abspath = svn_dirent_join(basedir_abspath,
+                                     apr_pstrcat(scratch_pool,
+                                                 name,
+                                                 SVN_WC__BASE_EXT,
+                                                 NULL),
+                                     scratch_pool);
+
+      revert_abspath = svn_dirent_join(basedir_abspath,
+                                       apr_pstrcat(scratch_pool,
+                                                   name,
+                                                   SVN_WC__REVERT_EXT,
+                                                   NULL),
+                                       scratch_pool);
+
+      working_abspath = svn_dirent_join(propsdir_abspath,
+                                        apr_pstrcat(scratch_pool,
+                                                    name,
+                                                    SVN_WC__WORK_EXT,
+                                                    NULL),
+                                        scratch_pool);
+    }
+
+  SVN_ERR(read_propfile(&base_props, base_abspath,
+                        scratch_pool, scratch_pool));
+  SVN_ERR(read_propfile(&revert_props, revert_abspath,
+                        scratch_pool, scratch_pool));
+  SVN_ERR(read_propfile(&working_props, working_abspath,
+                        scratch_pool, scratch_pool));
+
+  return svn_error_return(svn_wc__db_upgrade_apply_props(
+                            sdb, name,
+                            base_props, revert_props, working_props,
+                            original_format,
+                            scratch_pool));
+}
+
 
 /* */
 static svn_error_t *
 migrate_props(const char *wcroot_abspath,
               svn_sqlite__db_t *sdb,
+              int original_format,
               apr_pool_t *scratch_pool)
 {
   /* General logic here: iterate over all the immediate children of the root
@@ -922,9 +1053,7 @@ migrate_props(const char *wcroot_abspath
      no local changes to the properties.
   */
   const apr_array_header_t *children;
-  apr_pool_t *iterpool;
-  const char *props_dirpath;
-  const char *props_base_dirpath;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_wc__db_t *db;
   int i;
 
@@ -935,98 +1064,25 @@ migrate_props(const char *wcroot_abspath
   SVN_ERR(svn_wc__db_open(&db, svn_wc__db_openmode_default, NULL, FALSE, TRUE,
                           scratch_pool, scratch_pool));
 
+  /* Migrate the props for "this dir".  */
+  SVN_ERR(migrate_node_props(wcroot_abspath, "", sdb, original_format,
+                             scratch_pool));
+
   /* Go find all the children of the wcroot. */
   SVN_ERR(svn_wc__db_read_children(&children, db, wcroot_abspath,
                                    scratch_pool, scratch_pool));
 
-  /* Set up some data structures */
-  iterpool = svn_pool_create(scratch_pool);
-  props_dirpath = svn_wc__adm_child(wcroot_abspath, PROPS_SUBDIR, scratch_pool);
-  props_base_dirpath = svn_wc__adm_child(wcroot_abspath, PROP_BASE_SUBDIR,
-                                         scratch_pool);
-
   /* Iterate over the children, as described above */
   for (i = 0; i < children->nelts; i++)
     {
-      const char *child_relpath = APR_ARRAY_IDX(children, i, const char *);
-      const char *child_abspath;
-      const char *prop_base_path, *prop_working_path, *prop_revert_path;
-      svn_boolean_t pristine_is_working;
-      svn_boolean_t replaced;
-      apr_hash_t *working_props;
-      apr_hash_t *base_props;
+      const char *name = APR_ARRAY_IDX(children, i, const char *);
 
       svn_pool_clear(iterpool);
 
-      /* Several useful paths. */
-      child_abspath = svn_dirent_join(wcroot_abspath, child_relpath, iterpool);
-      prop_base_path = svn_dirent_join(props_base_dirpath,
-                                       apr_pstrcat(iterpool,
-                                                   child_relpath,
-                                                   SVN_WC__BASE_EXT,
-                                                   NULL),
-                                       iterpool);
-      prop_working_path = svn_dirent_join(props_dirpath,
-                                          apr_pstrcat(iterpool,
-                                                      child_relpath,
-                                                      SVN_WC__WORK_EXT,
-                                                      NULL),
-                                          iterpool);
-      prop_revert_path = svn_dirent_join(props_base_dirpath,
-                                         apr_pstrcat(iterpool,
-                                                     child_relpath,
-                                                     SVN_WC__REVERT_EXT,
-                                                     NULL),
-                                         iterpool);
-
-      SVN_ERR(read_propfile(&base_props, prop_base_path, iterpool, iterpool));
-      SVN_ERR_ASSERT(base_props != NULL);
-
-      SVN_ERR(read_propfile(&revert_props, prop_revert_path,
-                            iterpool, iterpool));
-      if (revert_props != NULL)
-        {
-          SVN_ERR(svn_wc__db_temp_base_set_props(db, child_abspath,
-                                                 revert_props, iterpool));
-          SVN_ERR(svn_wc__db_temp_working_set_props(db, child_abspath,
-                                                    base_props, iterpool));
-        }
-      else
-        {
-          /* Try writing to the WORKING tree first.  */
-          err = svn_wc__db_temp_working_set_props(db, local_abspath,
-                                                  base_props,
-                                                  scratch_pool);
-          if (err)
-            {
-              if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
-                return svn_error_return(err);
-              svn_error_clear(err);
-
-              /* The WORKING node is not present. Try writing to the
-                 BASE node now.  */
-              SVN_ERR(svn_wc__db_temp_base_set_props(db, local_abspath,
-                                                     base_props,
-                                                     scratch_pool));
-            }
-        }
-
-      /* If the properties file does not exist, then that simply means
-         there were no changes made. Avoid setting new props in that case.  */
-      SVN_ERR(read_propfile(&working_props, prop_working_path,
-                            iterpool, iterpool));
-      if (working_props != NULL)
-        {
-          SVN_ERR(svn_wc__db_op_set_props(db, child_abspath, working_props,
-                                          iterpool));
-        }
+      SVN_ERR(migrate_node_props(wcroot_abspath, name, sdb, original_format,
+                                 iterpool));
     }
 
-  /* Now delete the old directories. */
-  SVN_ERR(svn_io_remove_dir2(props_dirpath, TRUE, NULL, NULL, iterpool));
-  SVN_ERR(svn_io_remove_dir2(props_base_dirpath, TRUE, NULL, NULL,
-                             iterpool));
-
 #if 0
   /* ### we are not (yet) taking out a write lock  */
   SVN_ERR(svn_wc__adm_cleanup_tmp_area(db, wcroot_abspath, iterpool));
@@ -1040,21 +1096,113 @@ migrate_props(const char *wcroot_abspath
 
 
 /* */
+struct bump_to_17_baton
+{
+  const char *wcroot_abspath;
+  int original_format;
+};
+
+
 static svn_error_t *
 bump_to_17(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
 {
-  const char *wcroot_abspath = baton;
+  struct bump_to_17_baton *b17 = baton;
 
+#if 0
+  /* ### no schema changes (yet)... */
   SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_17));
+#endif
+
+  SVN_ERR(migrate_props(b17->wcroot_abspath, sdb, b17->original_format,
+                        scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+migrate_text_bases(const char *wcroot_abspath,
+                   svn_sqlite__db_t *sdb,
+                   apr_pool_t *scratch_pool)
+{
+  apr_hash_t *dirents;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  apr_hash_index_t *hi;
+  const char *text_base_dir = svn_wc__adm_child(wcroot_abspath,
+                                                TEXT_BASE_SUBDIR,
+                                                scratch_pool);
+
+  SVN_ERR(svn_io_get_dir_filenames(&dirents, text_base_dir, scratch_pool));
+  for (hi = apr_hash_first(scratch_pool, dirents); hi;
+            hi = apr_hash_next(hi))
+    {
+      const char *text_base_basename = svn__apr_hash_index_key(hi);
+      const char *pristine_path;
+      const char *text_base_path;
+      svn_checksum_t *md5_checksum;
+      svn_checksum_t *sha1_checksum;
+      svn_sqlite__stmt_t *stmt;
+      apr_finfo_t finfo;
+
+      svn_pool_clear(iterpool);
+      text_base_path = svn_dirent_join(text_base_dir, text_base_basename,
+                                       iterpool);
 
-  /* ### or something like this... */
-  SVN_ERR(migrate_props(wcroot_abspath, sdb, scratch_pool));
+      /* ### This code could be a bit smarter: we could chain checksum
+             streams instead of reading the file twice; we could check to
+             see if a pristine row exists before attempting to insert one;
+             we could check and see if a pristine file exists before
+             attempting to copy a new one over it.
+             
+             However, I think simplicity is the big win here, especially since
+             this is code that runs exactly once on a user's machine: when
+             doing the upgrade.  If you disagree, feel free to add the
+             complexity. :)  */
+
+      /* Gather the two checksums. */
+      SVN_ERR(svn_io_file_checksum2(&md5_checksum, text_base_path,
+                                    svn_checksum_md5, iterpool));
+      SVN_ERR(svn_io_file_checksum2(&sha1_checksum, text_base_path,
+                                    svn_checksum_sha1, iterpool));
+
+      SVN_ERR(svn_io_stat(&finfo, text_base_path, APR_FINFO_SIZE, iterpool));
+
+      /* Insert a row into the pristine table. */
+      SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_PRISTINE));
+      SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, iterpool));
+      SVN_ERR(svn_sqlite__bind_checksum(stmt, 2, md5_checksum, iterpool));
+      SVN_ERR(svn_sqlite__bind_int64(stmt, 3, finfo.size));
+      SVN_ERR(svn_sqlite__insert(NULL, stmt));
+
+      /* Compute the path of the pristine.
+         Note: in format 18, pristines are not yet sharded, so don't include
+         that in the path computation. */
+      pristine_path = svn_dirent_join_many(iterpool,
+                                           wcroot_abspath,
+                                           svn_wc_get_adm_dir(iterpool),
+                                           PRISTINE_STORAGE_RELPATH,
+                                           NULL);
+
+      /* Finally, copy the file over. */
+      SVN_ERR(svn_io_copy_file(text_base_path, pristine_path, TRUE,
+                               iterpool));
+    }
+
+  svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
 }
 
-#endif /* ### no props migration yet */
 
+static svn_error_t *
+bump_to_18(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
+{
+  const char *wcroot_abspath = baton;
+
+  SVN_ERR(migrate_text_bases(wcroot_abspath, sdb, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
 
 
 #if 0 /* ### no tree conflict migration yet */
@@ -1101,7 +1249,6 @@ svn_wc__upgrade_sdb(int *result_format,
         SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_13,
                                              (void *)wcroot_abspath,
                                              scratch_pool));
-
         /* If the transaction succeeded, then we don't need the wcprops
            files. We stopped writing them partway through format 12, but
            we may be upgrading from an "early 12" and need to toss those
@@ -1109,62 +1256,90 @@ svn_wc__upgrade_sdb(int *result_format,
            possible that current/real data is sitting within the database.
            This is why STMT_UPGRADE_TO_13 just clears the 'dav_cache'
            column -- we cannot definitely state that the column values
-           are Proper.  */
-        /* ### what happens if this throws an error? meaning: next time thru
-           ### the upgrade cycle, we start at format 13? there could be
-           ### stray files. maybe just always wipe these during any
-           ### format upgrade.  */
-        wipe_wcprops(wcroot_abspath, scratch_pool);
-        ++start_format;
+           are Proper.
+
+           They're removed by wipe_obsolete_files(), below.  */
+
+        *result_format = 13;
+        /* FALLTHROUGH  */
 
       case 13:
         /* Build WCLOCKS and migrate any physical lock.  */
         SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_14,
                                              (void *)wcroot_abspath,
                                              scratch_pool));
-
         /* If the transaction succeeded, then any lock has been migrated,
-           and we can toss the physical file.  */
-        svn_error_clear(svn_io_remove_file2(
-                          build_lockfile_path(wcroot_abspath, scratch_pool),
-                          TRUE,
-                          scratch_pool));
-        ++start_format;
+           and we can toss the physical file (below).  */
+
+        *result_format = 14;
+        /* FALLTHROUGH  */
 
       case 14:
         /* Revamp the recording of 'excluded' nodes.  */
         SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_15,
                                              (void *)wcroot_abspath,
                                              scratch_pool));
-        ++start_format;
+        *result_format = 15;
+        /* FALLTHROUGH  */
 
       case 15:
         /* Perform some minor changes to the schema.  */
         SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_16,
                                              (void *)wcroot_abspath,
                                              scratch_pool));
-        ++start_format;
+        *result_format = 16;
+        /* FALLTHROUGH  */
 
-#if 0
+#if (SVN_WC__VERSION > 16)
       case 16:
-        /* Move the properties into the database.  */
-        SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_17,
-                                             (void *)wcroot_abspath,
-                                             scratch_pool));
-        ++start_format;
+        {
+          struct bump_to_17_baton b17;
+
+          b17.wcroot_abspath = wcroot_abspath;
+          b17.original_format = start_format;
+
+          /* Move the properties into the database.  */
+          SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_17, &b17,
+                                               scratch_pool));
+        }
+
+        *result_format = 17;
+        /* FALLTHROUGH  */
+#endif
+
+#if 0
+      case 17:
+        {
+          const char *pristine_dir;
+
+          /* Create the '.svn/pristine' directory.  */
+          pristine_dir = svn_wc__adm_child(wcroot_abspath,
+                                           SVN_WC__ADM_PRISTINE,
+                                           scratch_pool);
+          SVN_ERR(svn_io_dir_make(pristine_dir, APR_OS_DEFAULT, scratch_pool));
+
+          /* Move text bases into the pristine directory, and update the db */
+          SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_18, wcroot_abspath,
+                                               scratch_pool));
+        }
+
+        *result_format = 18;
+        /* FALLTHROUGH  */
+#endif
 
-      case 99:
+      /* ### future bumps go here.  */
+#if 0
+      case 98:
         /* Revamp the recording of tree conflicts.  */
         SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_XXX,
                                              (void *)wcroot_abspath,
                                              scratch_pool));
-        ++start_format;
+        *result_format = 99;
 #endif
-
-      /* ### future bumps go here.  */
     }
 
-  *result_format = start_format;
+  /* Zap anything that might be remaining or escaped our notice.  */
+  wipe_obsolete_files(wcroot_abspath, scratch_pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/util.c?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/util.c Tue Aug 10 20:55:56 2010
@@ -543,3 +543,54 @@ svn_wc__cd_to_cd2(const svn_wc_conflict_
 
   return new_conflict;
 }
+
+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;
+  const svn_wc_conflict_description2_t *tree_conflict;
+  svn_wc_conflict_description_t *old_tree_conflict;
+
+  if (old_status == NULL)
+    {
+      *status = NULL;
+      return SVN_NO_ERROR;
+    }
+
+  *status = apr_pcalloc(result_pool, sizeof(**status));
+
+  SVN_ERR(svn_wc__get_entry(&entry, wc_ctx->db, local_abspath, TRUE,
+                            svn_node_unknown, FALSE, result_pool,
+                            scratch_pool));
+
+  SVN_ERR(svn_wc__db_op_read_tree_conflict(&tree_conflict, wc_ctx->db,
+                                           local_abspath, scratch_pool,
+                                           scratch_pool));
+  old_tree_conflict = svn_wc__cd2_to_cd(tree_conflict, result_pool);
+
+  (*status)->entry = entry;
+  (*status)->text_status = old_status->text_status;
+  (*status)->prop_status = old_status->prop_status;
+  (*status)->locked = old_status->locked;
+  (*status)->copied = old_status->copied;
+  (*status)->switched = old_status->switched;
+  (*status)->repos_text_status = old_status->repos_text_status;
+  (*status)->repos_prop_status = old_status->repos_prop_status;
+  (*status)->repos_lock = svn_lock_dup(old_status->repos_lock, result_pool);
+  (*status)->url = apr_pstrdup(result_pool, old_status->url);
+  (*status)->ood_last_cmt_rev = old_status->ood_last_cmt_rev;
+  (*status)->ood_last_cmt_date = old_status->ood_last_cmt_date;
+  (*status)->ood_kind = old_status->ood_kind;
+  (*status)->ood_last_cmt_author = old_status->ood_last_cmt_author;
+  (*status)->tree_conflict = old_tree_conflict;
+  (*status)->file_external = old_status->file_external;
+  (*status)->pristine_text_status = old_status->pristine_text_status;
+  (*status)->pristine_prop_status = old_status->pristine_prop_status;
+
+  return SVN_NO_ERROR;
+}

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc-metadata.sql?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc-metadata.sql Tue Aug 10 20:55:56 2010
@@ -584,8 +584,8 @@ PRAGMA user_version = 16;
 
 /* ------------------------------------------------------------------------- */
 
-/* Format 17 introduces new handling for conflict information.  */
--- format: 17
+/* Format YYY introduces new handling for conflict information.  */
+-- format: YYY
 
 
 /* ------------------------------------------------------------------------- */

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc-queries.sql?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc-queries.sql Tue Aug 10 20:55:56 2010
@@ -82,6 +82,11 @@ insert or ignore into base_node (
   wc_id, local_relpath, parent_relpath, presence, kind, revnum)
 values (?1, ?2, ?3, 'incomplete', 'unknown', ?5);
 
+-- STMT_INSERT_WORKING_NODE_INCOMPLETE
+INSERT OR IGNORE INTO BASE_NODE (
+  wc_id, local_relpath, parent_relpath, presence, kind)
+VALUES (?1, ?2, ?3, 'incomplete', 'unknown');
+
 -- STMT_SELECT_BASE_NODE_CHILDREN
 select local_relpath from base_node
 where wc_id = ?1 and parent_relpath = ?2;
@@ -106,8 +111,8 @@ select properties from base_node
 where wc_id = ?1 and local_relpath = ?2;
 
 -- STMT_SELECT_WORKING_PROPS
-select properties from working_node
-where wc_id = ?1 and local_relpath = ?2;
+SELECT properties, presence FROM WORKING_NODE
+WHERE wc_id = ?1 AND local_relpath = ?2;
 
 -- STMT_SELECT_ACTUAL_PROPS
 select properties from actual_node
@@ -232,12 +237,20 @@ delete from actual_node
 where wc_id = ?1 and local_relpath = ?2;
 
 -- STMT_UPDATE_BASE_DEPTH
-update base_node set depth = ?3
-where wc_id = ?1 and local_relpath = ?2;
+UPDATE BASE_NODE SET depth = ?3
+WHERE wc_id = ?1 AND local_relpath = ?2;
 
 -- STMT_UPDATE_WORKING_DEPTH
-update working_node set depth = ?3
-where wc_id = ?1 and local_relpath = ?2;
+UPDATE WORKING_NODE SET depth = ?3
+WHERE wc_id = ?1 AND local_relpath = ?2;
+
+-- STMT_UPDATE_BASE_EXCLUDED
+UPDATE BASE_NODE SET presence = 'excluded', depth = 'infinity'
+WHERE wc_id = ?1 AND local_relpath = ?2;
+
+-- STMT_UPDATE_WORKING_EXCLUDED
+UPDATE WORKING_NODE SET presence = 'excluded', depth = 'infinity'
+WHERE wc_id = ?1 AND local_relpath = ?2;
 
 -- STMT_UPDATE_BASE_PRESENCE
 update base_node set presence= ?3
@@ -271,6 +284,33 @@ DELETE FROM WORK_QUEUE WHERE id = ?1;
 INSERT OR IGNORE INTO PRISTINE (checksum, md5_checksum, size, refcount)
 VALUES (?1, ?2, ?3, 1);
 
+-- STMT_SELECT_PRISTINE_MD5_CHECKSUM
+SELECT md5_checksum
+FROM pristine
+WHERE checksum = ?1
+
+-- STMT_SELECT_PRISTINE_SHA1_CHECKSUM
+SELECT checksum
+FROM pristine
+WHERE md5_checksum = ?1
+
+-- STMT_SELECT_ANY_PRISTINE_REFERENCE
+SELECT 1 FROM base_node
+  WHERE checksum = ?1 OR checksum = ?2
+UNION ALL
+SELECT 1 FROM working_node
+  WHERE checksum = ?1 OR checksum = ?2
+UNION ALL
+SELECT 1 FROM actual_node
+  WHERE older_checksum = ?1 OR older_checksum = ?2
+    OR  left_checksum  = ?1 OR left_checksum  = ?2
+    OR  right_checksum = ?1 OR right_checksum = ?2
+LIMIT 1
+
+-- STMT_DELETE_PRISTINE
+DELETE FROM PRISTINE
+WHERE checksum = ?1
+
 -- STMT_SELECT_ACTUAL_CONFLICT_VICTIMS
 SELECT local_relpath
 FROM actual_node
@@ -372,6 +412,39 @@ SELECT 0 FROM BASE_NODE WHERE wc_id = ?1
 UNION
 SELECT 1 FROM WORKING_NODE WHERE wc_id = ?1 AND local_relpath = ?2;
 
+-- STMT_INSERT_WORKING_NODE_COPY_FROM_BASE
+INSERT OR REPLACE INTO WORKING_NODE (
+    wc_id, local_relpath, parent_relpath, presence, kind, checksum,
+    translated_size, changed_rev, changed_date, changed_author, depth,
+    symlink_target, last_mod_time, properties, copyfrom_repos_id,
+    copyfrom_repos_path, copyfrom_revnum )
+SELECT wc_id, ?3 AS local_relpath, ?4 AS parent_relpath, ?5 AS presence, kind,
+    checksum, translated_size, changed_rev, changed_date, changed_author, depth,
+    symlink_target, last_mod_time, properties, ?6 AS copyfrom_repos_id,
+    ?7 AS copyfrom_repos_path, ?8 AS copyfrom_revnum FROM BASE_NODE
+WHERE wc_id = ?1 AND local_relpath = ?2;
+
+-- STMT_INSERT_WORKING_NODE_COPY_FROM_WORKING
+INSERT OR REPLACE INTO WORKING_NODE (
+    wc_id, local_relpath, parent_relpath, presence, kind, checksum,
+    translated_size, changed_rev, changed_date, changed_author, depth,
+    symlink_target, last_mod_time, properties, copyfrom_repos_id,
+    copyfrom_repos_path, copyfrom_revnum )
+SELECT wc_id, ?3 AS local_relpath, ?4 AS parent_relpath, ?5 AS presence, kind,
+    checksum, translated_size, changed_rev, changed_date, changed_author, depth,
+    symlink_target, last_mod_time, properties, ?6 AS copyfrom_repos_id,
+    ?7 AS copyfrom_repos_path, ?8 AS copyfrom_revnum FROM WORKING_NODE
+WHERE wc_id = ?1 AND local_relpath = ?2;
+
+-- STMT_INSERT_ACTUAL_NODE_FROM_ACTUAL_NODE
+INSERT OR REPLACE INTO ACTUAL_NODE (
+     wc_id, local_relpath, parent_relpath, properties,
+     conflict_old, conflict_new, conflict_working,
+     prop_reject, changelist, text_mod, tree_conflict_data )
+SELECT wc_id, ?3 AS local_relpath, ?4 AS parent_relpath, properties,
+     conflict_old, conflict_new, conflict_working,
+     prop_reject, changelist, text_mod, tree_conflict_data FROM ACTUAL_NODE
+WHERE wc_id = ?1 AND local_relpath = ?2;
 
 /* ------------------------------------------------------------------------- */
 
@@ -392,9 +465,9 @@ insert or replace into working_node (
   copyfrom_repos_id,
   copyfrom_repos_path, copyfrom_revnum, moved_here, moved_to, checksum,
   translated_size, changed_rev, changed_date, changed_author, depth,
-  last_mod_time, properties, keep_local)
+  last_mod_time, properties, keep_local, symlink_target)
 values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
-  ?15, ?16, ?17, ?18, ?19);
+  ?15, ?16, ?17, ?18, ?19, ?20);
 
 -- STMT_INSERT_ACTUAL_NODE
 insert or replace into actual_node (
@@ -424,13 +497,10 @@ where wc_id = ?1 and local_relpath = ?2;
 update base_node set file_external = ?3
 where wc_id = ?1 and local_relpath = ?2;
 
--- STMT_UPDATE_BASE_LAST_CHANGE
-update base_node set changed_rev = ?3, changed_date = ?4, changed_author = ?5
+-- STMT_UPDATE_WORKING_CHECKSUM
+update working_node set checksum = ?3
 where wc_id = ?1 and local_relpath = ?2;
 
--- STMT_UPDATE_WORKING_LAST_CHANGE
-update working_node set changed_rev = ?3, changed_date = ?4, changed_author = ?5
-where wc_id = ?1 and local_relpath = ?2;
 
 /* ------------------------------------------------------------------------- */
 

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc.h?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/wc.h Tue Aug 10 20:55:56 2010
@@ -31,8 +31,10 @@
 #include "svn_types.h"
 #include "svn_error.h"
 #include "svn_wc.h"
+
 #include "private/svn_sqlite.h"
 #include "private/svn_wc_private.h"
+#include "private/svn_skel.h"
 
 #include "wc_db.h"
 
@@ -40,8 +42,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-
-#define SVN_WC__TMP_EXT       ".tmp"
+
 #define SVN_WC__PROP_REJ_EXT  ".prej"
 #define SVN_WC__BASE_EXT      ".svn-base" /* for text and prop bases */
 #define SVN_WC__WORK_EXT      ".svn-work" /* for working propfiles */
@@ -60,7 +61,7 @@ extern "C" {
  * For example, ".svn/props/foo" became ".svn/props/foo.svn-work".
  *
  * The change from 2 to 3 was the introduction of the entry attribute
- * SVN_WC__ENTRY_ATTR_ABSENT.
+ * old-and-busted.c::ENTRIES_ATTR_ABSENT.
  *
  * The change from 3 to 4 was the renaming of the magic "svn:this_dir"
  * entry name to "".
@@ -114,6 +115,9 @@ extern "C" {
  * any existing locks to a level of 0. The 'md5_checksum' column was
  * added to PRISTINE for future use.
  *
+ * The change from 16 to 17 added a '.svn/pristine' dir and ...
+ * ### IN PROGRESS
+ *
  * == 1.7.x shipped with format ???
  *
  * Please document any further format changes here.
@@ -122,6 +126,9 @@ extern "C" {
 #define SVN_WC__VERSION 16
 
 
+/* Formats <= this have no concept of "revert text-base/props".  */
+#define SVN_WC__NO_REVERT_FILES 4
+
 /* A version <= this doesn't have property caching in the entries file. */
 #define SVN_WC__NO_PROPCACHING_VERSION 5
 
@@ -149,6 +156,9 @@ extern "C" {
    this format or later will only have wcprops in BASE_NODE.dav_cache.  */
 #define SVN_WC__USES_DAV_CACHE 13
 
+/* A version < this does not store properties in wc.db.  */
+#define SVN_WC__PROPS_IN_DB 17
+
 
 
 /*** Context handling ***/
@@ -212,13 +222,17 @@ svn_wc__get_committed_queue_pool(const s
  * If @a no_unlock is set, don't release any user locks on @a
  * local_abspath; otherwise release them as part of this processing.
  *
- * If @keep_changelist is set, don't remove any changeset assignments
+ * If @a keep_changelist is set, don't remove any changeset assignments
  * from @a local_abspath; otherwise, clear it of such assignments.
  *
- * If @a local_abspath is a file and @a checksum is non-NULL, use @a checksum
- * as the checksum for the new text base. Otherwise, calculate the checksum
- * if needed.
+ * If @a local_abspath is a file and @a md5_checksum is non-NULL, use
+ * @a md5_checksum as the checksum for the new text base. Otherwise,
+ * calculate the checksum if needed.
  *   ### [JAF]  No, it doesn't calculate the checksum, it stores null in wc.db.
+ *
+ * If @a sha1_checksum is non-NULL, use it instead of @a md5_checksum to
+ * identify the node's pristine text.
+ * ### NOT YET IMPLEMENTED.
  */
 svn_error_t *
 svn_wc__process_committed_internal(svn_wc__db_t *db,
@@ -230,7 +244,8 @@ svn_wc__process_committed_internal(svn_w
                                    apr_hash_t *new_dav_cache,
                                    svn_boolean_t no_unlock,
                                    svn_boolean_t keep_changelist,
-                                   const svn_checksum_t *checksum,
+                                   const svn_checksum_t *md5_checksum,
+                                   const svn_checksum_t *sha1_checksum,
                                    const svn_wc_committed_queue_t *queue,
                                    apr_pool_t *scratch_pool);
 
@@ -260,35 +275,11 @@ struct svn_wc_traversal_info_t
 };
 
 
-
-/*** Timestamps. ***/
-
-/* A special timestamp value which means "use the timestamp from the
-   working copy".  This is sometimes used in a log entry like:
-
-   <modify-entry name="foo.c" revision="5" timestamp="working"/>
- */
-#define SVN_WC__TIMESTAMP_WC   "working"
-
-
-
-/*** Filesizes. ***/
-
-/* A special filesize value which means "use the filesize from the
-   working copy".  This is sometimes used in a log entry like:
-
-   <modify-entry name="foo.c" revision="5" working-size="working"/>
- */
-#define SVN_WC__WORKING_SIZE_WC   "working"
-
-
-
 /*** Names and file/dir operations in the administrative area. ***/
 
 /** The files within the administrative subdir. **/
 #define SVN_WC__ADM_FORMAT              "format"
 #define SVN_WC__ADM_ENTRIES             "entries"
-#define SVN_WC__ADM_LOCK                "lock"
 #define SVN_WC__ADM_TMP                 "tmp"
 #define SVN_WC__ADM_TEXT_BASE           "text-base"
 #define SVN_WC__ADM_PROPS               "props"
@@ -296,19 +287,14 @@ struct svn_wc_traversal_info_t
 #define SVN_WC__ADM_DIR_PROPS           "dir-props"
 #define SVN_WC__ADM_DIR_PROP_BASE       "dir-prop-base"
 #define SVN_WC__ADM_DIR_PROP_REVERT     "dir-prop-revert"
-#define SVN_WC__ADM_LOG                 "log"
-#define SVN_WC__ADM_KILLME              "KILLME"
 #define SVN_WC__ADM_PRISTINE            "pristine"
+#define SVN_WC__ADM_NONEXISTENT_PATH    "nonexistent-path"
 
 /* The basename of the ".prej" file, if a directory ever has property
    conflicts.  This .prej file will appear *within* the conflicted
    directory.  */
 #define SVN_WC__THIS_DIR_PREJ           "dir_conflicts"
 
-/* Possible contents of the killme file.  If present, signals that the
-   administrative area only should be deleted. */
-#define SVN_WC__KILL_ADM_ONLY           "adm-only"
-
 
 /* A few declarations for stuff in util.c.
  * If this section gets big, move it all out into a new util.h file. */
@@ -361,9 +347,12 @@ void svn_wc__compat_call_notify_func(voi
  * the text base is much longer than the working file, every byte of
  * the text base will still be examined.)
  *
- * If COMPARE_TEXTBASES is true, the comparison will be between a
- * detranslated version of *LOCAL_ABSPATH and the text base, otherwise, a
- * translated version of the text base and *LOCAL_ABSPATH will be compared.
+ * If COMPARE_TEXTBASES is true, translate LOCAL_ABSPATH's EOL
+ * style and keywords to repository-normal form according to its properties,
+ * and compare the result with the text base.  If COMPARE_TEXTBASES is
+ * false, translate the text base's EOL style and keywords to working-copy
+ * form according to LOCAL_ABSPATH's properties, and compare the
+ * result with LOCAL_ABSPATH.
  *
  * If LOCAL_ABSPATH does not exist, consider it unmodified.  If it exists
  * but is not under revision control (not even scheduled for
@@ -380,8 +369,8 @@ svn_wc__internal_text_modified_p(svn_boo
 
 
 /* Merge the difference between LEFT_ABSPATH and RIGHT_ABSPATH into
-   TARGET_ABSPATH, accumulating instructions to update the working
-   copy into LOG_ACCUM.
+   TARGET_ABSPATH, return the appropriate work queue operations in
+   *WORK_ITEMS.
 
    Note that, in the case of updating, the update can have sent new
    properties, which could affect the way the wc target is
@@ -419,9 +408,12 @@ svn_wc__internal_text_modified_p(svn_boo
 
    For a complete description, see svn_wc_merge3() for which this is
    the (loggy) implementation.
+
+   *WORK_ITEMS will be allocated in RESULT_POOL. All temporary allocations
+   will be performed in SCRATCH_POOL.
 */
 svn_error_t *
-svn_wc__internal_merge(svn_stringbuf_t **log_accum,
+svn_wc__internal_merge(svn_skel_t **work_items,
                        enum svn_wc_merge_outcome_t *merge_outcome,
                        svn_wc__db_t *db,
                        const char *left_abspath,
@@ -441,7 +433,8 @@ svn_wc__internal_merge(svn_stringbuf_t *
                        void *conflict_baton,
                        svn_cancel_func_t cancel_func,
                        void *cancel_baton,
-                       apr_pool_t *pool);
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool);
 
 /* A default error handler for svn_wc_walk_entries3().  Returns ERR in
    all cases. */
@@ -471,7 +464,7 @@ svn_wc__ambient_depth_filter_editor(cons
                                     void **edit_baton,
                                     const svn_delta_editor_t *wrapped_editor,
                                     void *wrapped_edit_baton,
-                                    const char *anchor,
+                                    const char *anchor_abspath,
                                     const char *target,
                                     svn_wc__db_t *db,
                                     apr_pool_t *pool);
@@ -489,7 +482,15 @@ svn_wc__internal_conflicted_p(svn_boolea
 
 
 /* Similar to svn_wc__versioned_file_modcheck(), but with a wc_db parameter
- * instead of a wc_context. */
+ * instead of a wc_context.
+ *
+ * If COMPARE_TEXTBASES is true, translate VERSIONED_FILE_ABSPATH's EOL
+ * style and keywords to repository-normal form according to its properties,
+ * and compare the result with BASE_FILE_ABSPATH.  If COMPARE_TEXTBASES is
+ * false, translate BASE_FILE_ABSPATH's EOL style and keywords to working-copy
+ * form according to VERSIONED_FILE_ABSPATH's properties, and compare the
+ * result with VERSIONED_FILE_ABSPATH.
+ */
 svn_error_t *
 svn_wc__internal_versioned_file_modcheck(svn_boolean_t *modified_p,
                                          svn_wc__db_t *db,
@@ -501,7 +502,8 @@ svn_wc__internal_versioned_file_modcheck
 /* Internal version of svn_wc_transmit_text_deltas3(). */
 svn_error_t *
 svn_wc__internal_transmit_text_deltas(const char **tempfile,
-                                      unsigned char digest[],
+                                      const svn_checksum_t **new_text_base_md5_checksum,
+                                      const svn_checksum_t **new_text_base_sha1_checksum,
                                       svn_wc__db_t *db,
                                       const char *local_abspath,
                                       svn_boolean_t fulltext,
@@ -518,7 +520,7 @@ svn_wc__internal_transmit_prop_deltas(sv
                                      void *baton,
                                      apr_pool_t *scratch_pool);
 
-/* Internal version of svn_wc_get_ancestry2(). */
+/* Internal version of svn_wc_get_ancestry(). */
 svn_error_t *
 svn_wc__internal_get_ancestry(const char **url,
                               svn_revnum_t *rev,
@@ -571,22 +573,6 @@ svn_wc__internal_remove_from_revision_co
                                               apr_pool_t *scratch_pool);
 
 
-/* Library-internal version of svn_wc__resolved_conflict5(). */
-svn_error_t *
-svn_wc__internal_resolved_conflict(svn_wc__db_t *db,
-                                   const char *local_abspath,
-                                   svn_depth_t depth,
-                                   svn_boolean_t resolve_text,
-                                   const char *resolve_prop,
-                                   svn_boolean_t resolve_tree,
-                                   svn_wc_conflict_choice_t conflict_choice,
-                                   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__internal_is_replaced(svn_boolean_t *replaced,
                              svn_wc__db_t *db,
@@ -602,6 +588,13 @@ svn_wc__internal_node_get_url(const char
                               apr_pool_t *scratch_pool);
 
 
+svn_error_t *
+svn_wc__internal_is_file_external(svn_boolean_t *file_external,
+                                  svn_wc__db_t *db,
+                                  const char *local_abspath,
+                                  apr_pool_t *scratch_pool);
+
+
 /* Upgrade the wc sqlite database given in SDB for the wc located at
    WCROOT_ABSPATH. It's current/starting format is given by START_FORMAT.
    After the upgrade is complete (to as far as the automatic upgrade will
@@ -615,17 +608,17 @@ svn_wc__upgrade_sdb(int *result_format,
                     apr_pool_t *scratch_pool);
 
 
-/* Checks whether a node is a working copy root or switched.
+/* Check whether a node is a working copy root or switched.
  *
- * If LOCAL_ABSPATH is the root of a working copy set WC_ROOT to TRUE,
+ * If LOCAL_ABSPATH is the root of a working copy, set *WC_ROOT to TRUE,
  * otherwise to FALSE.
  *
+ * If KIND is not null, set *KIND to the node type of LOCAL_ABSPATH.
+ *
  * If LOCAL_ABSPATH is switched against its parent in the same working copy
- * set *SWITCHED to TRUE, otherwise to FALSE. SWITCHED can be set to NULL
+ * set *SWITCHED to TRUE, otherwise to FALSE.  SWITCHED can be NULL
  * if the result is not important.
  *
- * If KIND is not null *KIND is set to the node type of LOCAL_ABSPATH
- *
  * Use SCRATCH_POOL for temporary allocations.
  */
 svn_error_t *
@@ -636,21 +629,6 @@ svn_wc__check_wc_root(svn_boolean_t *wc_
                       const char *local_abspath,
                       apr_pool_t *scratch_pool);
 
-/* Gets the relative path REL_PATH as used by the access batons in WC_CTX,
- * by looking at open access batons of LOCAL_ABSPATH and its parents.
- * Perform temporary allocations in SCRATCH_POOL and return the result in
- * RESULT_POOL.
- *
- * Sets REL_PATH to a copy of LOCAL_ABSPATH when no access batons for this
- * node or any of its parents are found
- */
-svn_error_t *
-svn_wc__temp_get_relpath(const char **rel_path,
-                         svn_wc__db_t *db,
-                         const char *local_abspath,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */