[prev in list] [next in list] [prev in thread] [next in thread] 

List:       subversion-cvs
Subject:    svn commit: r37506 - trunk/subversion/libsvn_wc
From:       Greg Stein <gstein () gmail ! com>
Date:       2009-04-29 21:57:29
Message-ID: 200904292157.n3TLvT7W005250 () svn2 ! sjc ! collab ! net
[Download RAW message or body]

Author: gstein
Date: Wed Apr 29 14:57:29 2009
New Revision: 37506

Log:
Clear out some obsolete code, now that wc-ng is enabled.

* subversion/libsvn_wc/wc_db.c:
  (gather_children): stop delegating for old working copy formats
  (svn_wc__db_read_info): stop delegating

* subversion/libsvn_wc/entries.h:
* subversion/libsvn_wc/old-and-busted.c:
  (svn_wc__read_info_old, svn_wc__gather_children_old): remove

Modified:
   trunk/subversion/libsvn_wc/entries.h
   trunk/subversion/libsvn_wc/old-and-busted.c
   trunk/subversion/libsvn_wc/wc_db.c

Modified: trunk/subversion/libsvn_wc/entries.h
URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/entries.h?pathrev=37506&r1=37505&r2=37506
 ==============================================================================
--- trunk/subversion/libsvn_wc/entries.h	Wed Apr 29 13:51:04 2009	(r37505)
+++ trunk/subversion/libsvn_wc/entries.h	Wed Apr 29 14:57:29 2009	(r37506)
@@ -314,48 +314,6 @@ svn_wc__read_entries_old(apr_hash_t **en
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 
-/* Fulfill a svn_wc__db_read_info() invocation by reading an old-style
-   entry structure. Limited fields are available.  */
-svn_error_t *
-svn_wc__read_info_old(svn_wc__db_status_t *status,
-                      svn_wc__db_kind_t *kind,
-                      svn_revnum_t *revision,
-                      const char **repos_relpath,
-                      const char **repos_root_url,
-                      const char **repos_uuid,
-                      svn_revnum_t *changed_rev,
-                      apr_time_t *changed_date,
-                      const char **changed_author,
-                      apr_time_t *last_mod_time,
-                      svn_depth_t *depth,
-                      svn_checksum_t **checksum,
-                      svn_filesize_t *translated_size,
-                      const char **target,
-                      const char **changelist,
-                      const char **original_repos_relpath,
-                      const char **original_root_url,
-                      const char **original_uuid,
-                      svn_revnum_t *original_revision,
-                      svn_boolean_t *text_mod,
-                      svn_boolean_t *props_mod,
-                      svn_boolean_t *base_shadowed,
-                      svn_wc__db_lock_t **lock,
-                      svn_wc__db_t *db,
-                      const char *wcroot_abspath,
-                      const char *local_relpath,
-                      apr_pool_t *result_pool,
-                      apr_pool_t *scratch_pool);
-
-
-svn_error_t *
-svn_wc__gather_children_old(const apr_array_header_t **children,
-                            svn_boolean_t base_only,
-                            svn_wc__db_t *db,
-                            const char *wcroot_abspath,
-                            const char *local_relpath,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool);
-
 
 /* Parse a file external specification in the NULL terminated STR and
    place the path in PATH_RESULT, the peg revision in PEG_REV_RESULT

Modified: trunk/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/old-and-busted.c?pathrev=37506&r1=37505&r2=37506
 ==============================================================================
--- trunk/subversion/libsvn_wc/old-and-busted.c	Wed Apr 29 13:51:04 2009	(r37505)
+++ trunk/subversion/libsvn_wc/old-and-busted.c	Wed Apr 29 14:57:29 2009	(r37506)
@@ -944,292 +944,3 @@ svn_wc__read_entries_old(apr_hash_t **en
   /* Fill in any implied fields. */
   return resolve_to_defaults(*entries, result_pool);
 }
-
-
-
-
-static svn_error_t *
-get_entries(apr_hash_t **entries,
-            svn_wc__db_t *db,
-            const char *wcroot_abspath,
-            apr_pool_t *scratch_pool)
-{
-  svn_wc_adm_access_t *adm_access;
-
-  /* Is there an existing access baton for this path?  */
-  adm_access = svn_wc__adm_retrieve_internal2(db, wcroot_abspath,
-                                              scratch_pool);
-  if (adm_access == NULL)
-    {
-      /* No access baton. Read the entries into SCRATCH_POOL, and we'll
-         just drop them on the floor.  */
-      SVN_ERR(svn_wc__read_entries_old(entries, wcroot_abspath,
-                                       scratch_pool, scratch_pool));
-    }
-  else
-    {
-      /* Already cached?  */
-      *entries = svn_wc__adm_access_entries(adm_access);
-      if (*entries == NULL)
-        {
-          apr_pool_t *access_pool = svn_wc_adm_access_pool(adm_access);
-
-          /* Read and cache the entries.  */
-          SVN_ERR(svn_wc__read_entries_old(entries, wcroot_abspath,
-                                           access_pool, scratch_pool));
-          svn_wc__adm_access_set_entries(adm_access, *entries);
-        }
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__read_info_old(svn_wc__db_status_t *status,
-                      svn_wc__db_kind_t *kind,
-                      svn_revnum_t *revision,
-                      const char **repos_relpath,
-                      const char **repos_root_url,
-                      const char **repos_uuid,
-                      svn_revnum_t *changed_rev,
-                      apr_time_t *changed_date,
-                      const char **changed_author,
-                      apr_time_t *last_mod_time,
-                      svn_depth_t *depth,
-                      svn_checksum_t **checksum,
-                      svn_filesize_t *translated_size,
-                      const char **target,
-                      const char **changelist,
-                      const char **original_repos_relpath,
-                      const char **original_root_url,
-                      const char **original_uuid,
-                      svn_revnum_t *original_revision,
-                      svn_boolean_t *text_mod,
-                      svn_boolean_t *props_mod,
-                      svn_boolean_t *base_shadowed,
-                      svn_wc__db_lock_t **lock,
-                      svn_wc__db_t *db,
-                      const char *wcroot_abspath,
-                      const char *local_relpath,
-                      apr_pool_t *result_pool,
-                      apr_pool_t *scratch_pool)
-{
-  apr_hash_t *entries;
-  const svn_wc_entry_t *entry;
-
-  /* Oops. Can't fetch that kind of value with this old working copy.  */
-  if (revision || repos_relpath || repos_root_url
-      || repos_uuid
-      || last_mod_time || translated_size || target || changelist
-      || original_repos_relpath || original_root_url || original_uuid
-      || original_revision || text_mod || props_mod || base_shadowed
-      )
-    return svn_error_createf(SVN_ERR_WC_UPGRADE_REQUIRED, NULL,
-                             _("Unable to return data because the working "
-                               "copy at '%s' needs to be upgraded."),
-                             svn_path_local_style(wcroot_abspath,
-                                                  scratch_pool));
-
-  /* Grab the entries file from an access baton if we can, or just read
-     the sucker in (and later forget it).  */
-  SVN_ERR(get_entries(&entries, db, wcroot_abspath, scratch_pool));
-
-  entry = apr_hash_get(entries, local_relpath, APR_HASH_KEY_STRING);
-  if (entry == NULL)
-    return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
-                             _("Entry '%s' in '%s' is not under version "
-                               "control"),
-                             svn_path_local_style(local_relpath, scratch_pool),
-                             svn_path_local_style(wcroot_abspath,
-                                                  scratch_pool));
-  if (status)
-    {
-      svn_boolean_t obstructed;
-
-      /* Some status values are not returned by this function:
-
-         MOVED_AWAY and MOVED_HERE are not returned since that information
-         is not stored in a wc-1 working copy.
-
-         COPIED is a status returned by scan_addition after reviewing the
-         hierarchy looking for copyfrom information.
-
-         INCOMPLETE cannot be modeled by wc-1. Directories can be marked
-         as "incomplete" as a reference to their children, but it is unknown
-         *which* children should be marked INCOMPLETE.
-
-         EXCLUDED is not (yet) used within wc library.
-
-         BASE_DELETED is a wc_db internal representation that gets mapped
-         into a standard DELETED or MOVED_AWAY status.  */
-
-      /* We're looking at the entry in the parent if this is a directory
-         and its name is not "".  */
-      obstructed = entry->kind == svn_node_dir && *entry->name != '\0';
-
-      if (entry->absent)
-        {
-          /* You can't add/delete/replace over an abent node.  */
-          SVN_ERR_ASSERT(entry->schedule == svn_wc_schedule_normal);
-
-          /* Better be an absent file, or an obstructed subdir (because the
-             subdir should not be on the disk).  */
-          SVN_ERR_ASSERT(entry->kind == svn_node_file || obstructed);
-
-          *status = svn_wc__db_status_absent;
-        }
-      else if (entry->schedule == svn_wc_schedule_add
-               || entry->schedule == svn_wc_schedule_replace
-               || entry->copied)
-        {
-          *status = obstructed ? svn_wc__db_status_obstructed_add
-                               : svn_wc__db_status_added;
-        }
-      else if (entry->schedule == svn_wc_schedule_delete)
-        {
-          *status = obstructed ? svn_wc__db_status_obstructed_delete
-                               : svn_wc__db_status_deleted;
-        }
-      else
-        {
-          SVN_ERR_ASSERT(entry->schedule == svn_wc_schedule_normal);
-          if (entry->copied)
-            {
-              /* This must be a child of a copied subtree. It better not be
-                 obstructed.  */
-              SVN_ERR_ASSERT(!obstructed);
-              *status = svn_wc__db_status_added;
-            }
-          else if (entry->deleted)
-            {
-              *status = svn_wc__db_status_not_present;
-            }
-          else
-            {
-              *status = obstructed ? svn_wc__db_status_obstructed
-                                   : svn_wc__db_status_normal;
-            }
-        }
-    }
-  if (kind)
-    {
-      if (entry->kind == svn_node_file)
-        {
-          *kind = svn_wc__db_kind_file;
-        }
-      else
-        {
-          SVN_ERR_ASSERT(entry->kind == svn_node_dir);
-          *kind = svn_wc__db_kind_dir;
-        }
-      /* ### no kind_symlink, or kind_unknown  */
-    }
-
-  /* ### revision  */
-  /* ### repos_relpath, repos_root_url, repos_uuid  */
-
-  if (changed_rev)
-    *changed_rev = entry->cmt_rev;
-  if (changed_date)
-    *changed_date = entry->cmt_date;
-  if (changed_author)
-    *changed_author = apr_pstrdup(result_pool, entry->cmt_author);
-
-  /* ### last_mod_time  */
-
-  if (depth)
-    {
-      if (entry->kind == svn_node_dir)
-        *depth = entry->depth;
-      else
-        *depth = svn_depth_unknown;
-    }
-  if (checksum)
-    {
-      if (entry->checksum)
-        SVN_ERR(svn_checksum_parse_hex(checksum, svn_checksum_md5,
-                                       entry->checksum, result_pool));
-      else
-        *checksum = NULL;
-    }
-
-  /* ### translated_size  */
-  /* ### target  */
-  /* ### changelist  */
-  /* ### original_repos_relpath, original_root_url, original_uuid,
-     ### original_revision  */
-  /* ### text_mod, props_mod  */
-  /* ### base_shadowed  */
-
-  if (lock)
-    {
-      if (entry->lock_token)
-        {
-          *lock = apr_palloc(result_pool, sizeof(**lock));
-          (*lock)->token = apr_pstrdup(result_pool, entry->lock_token);
-          (*lock)->owner = apr_pstrdup(result_pool, entry->lock_owner);
-          (*lock)->comment = apr_pstrdup(result_pool, entry->lock_comment);
-          (*lock)->date = entry->lock_creation_date;
-        }
-      else
-        {
-          *lock = NULL;
-        }
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_wc__gather_children_old(const apr_array_header_t **children,
-                            svn_boolean_t base_only,
-                            svn_wc__db_t *db,
-                            const char *wcroot_abspath,
-                            const char *local_relpath,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool)
-{
-  apr_hash_t *entries;
-  apr_array_header_t *child_names;
-  apr_hash_index_t *hi;
-
-  /* ### we don't have the filtering done for BASE_ONLY yet.  */
-  if (base_only)
-    return svn_error_createf(SVN_ERR_WC_UPGRADE_REQUIRED, NULL,
-                             _("Unable to return data because the working "
-                               "copy at '%s' needs to be upgraded."),
-                             svn_path_local_style(wcroot_abspath,
-                                                  scratch_pool));
-
-  /* Grab the entries file from an access baton if we can, or just read
-     the sucker in (and later forget it).  */
-  SVN_ERR(get_entries(&entries, db, wcroot_abspath, scratch_pool));
-
-  /* The returned array will contain the same count as ENTRIES, less one
-     for the omitted "this-dir".  */
-  child_names = apr_array_make(result_pool,
-                               apr_hash_count(entries) - 1,
-                               sizeof(const char *));
-
-  for (hi = apr_hash_first(scratch_pool, entries); hi; hi = apr_hash_next(hi))
-    {
-      const void *key;
-      const char *name;
-
-      apr_hash_this(hi, &key, NULL, NULL);
-      name = key;
-
-      /* Don't insert "this-dir".  */
-      if (*name == '\0')
-        continue;
-
-      APR_ARRAY_PUSH(child_names, const char *) = apr_pstrdup(result_pool,
-                                                              name);
-    }
-
-  *children = child_names;
-
-  return SVN_NO_ERROR;
-}

Modified: trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/wc_db.c?pathrev=37506&r1=37505&r2=37506
 ==============================================================================
--- trunk/subversion/libsvn_wc/wc_db.c	Wed Apr 29 13:51:04 2009	(r37505)
+++ trunk/subversion/libsvn_wc/wc_db.c	Wed Apr 29 14:57:29 2009	(r37506)
@@ -1366,11 +1366,8 @@ gather_children(const apr_array_header_t
                               svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
 
-  /* If this is an old working copy, then delegate to grab this info.  */
-  if (pdh->wcroot->format < SVN_WC__VERSION)
-    return svn_wc__gather_children_old(children, base_only,
-                                       db, pdh->wcroot->abspath, local_relpath,
-                                       result_pool, scratch_pool);
+  /* We should not have been called, if the wc has an improper version.  */
+  SVN_ERR_ASSERT(pdh->wcroot->format == SVN_WC__VERSION);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
                                     base_only
@@ -2484,18 +2481,8 @@ svn_wc__db_read_info(svn_wc__db_status_t
                               svn_sqlite__mode_readonly,
                               scratch_pool, scratch_pool));
 
-  /* If this is an old working copy, then delegate to grab this info.  */
-  if (pdh->wcroot->format < SVN_WC__VERSION)
-    return svn_wc__read_info_old(status, kind, revision,
-                                 repos_relpath, repos_root_url, repos_uuid,
-                                 changed_rev, changed_date, changed_author,
-                                 last_mod_time, depth, checksum,
-                                 translated_size, target, changelist,
-                                 original_repos_relpath, original_root_url,
-                                 original_uuid, original_revision,
-                                 text_mod, props_mod, base_shadowed, lock,
-                                 db, pdh->wcroot->abspath, local_relpath,
-                                 result_pool, scratch_pool);
+  /* We should not have been called, if the wc has an improper version.  */
+  SVN_ERR_ASSERT(pdh->wcroot->format == SVN_WC__VERSION);
 
   SVN_ERR(svn_sqlite__get_statement(&stmt_base, pdh->wcroot->sdb,
                                     lock ? STMT_SELECT_BASE_NODE_WITH_LOCK

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1986209


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic