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

svn commit: r983947 - in /subversion/trunk/subversion/libsvn_wc: adm_ops.c lock.c lock.h

Author: rhuijben
Date: Tue Aug 10 12:02:32 2010
New Revision: 983947

URL: http://svn.apache.org/viewvc?rev=983947&view=rev
Log:
Remove the svn_wc__adm_missing() and svn_wc__adm_available() transitational
apis by properly checking for an obstructions status in the last two
remaining callers.

* subversion/libsvn_wc/adm_ops.c
  (revert_entry): Check for the exact obstruction type.
  (svn_wc__internal_remove_from_revision_control): Retrieve status and use that
    for obstruction decisions.

* subversion/libsvn_wc/lock.c
  (svn_wc__adm_available): Make static and rename to ...
  (adm_available): ... this.
  (do_open): Update caller.
  (open_anchor): Update caller.
  (svn_wc__adm_missing): Remove function.

* subversion/libsvn_wc/lock.h
  (svn_wc__adm_missing,
   svn_wc__adm_available): Remove functions.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    subversion/trunk/subversion/libsvn_wc/lock.c
    subversion/trunk/subversion/libsvn_wc/lock.h

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=983947&r1=983946&r2=983947&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Tue Aug 10 12:02:32 2010
@@ -1546,7 +1546,7 @@ revert_entry(svn_depth_t *depth,
           /* Before single-db we didn't have to perform a recursive delete
              here. With single-db we really must delete missing nodes */
           if (disk_kind == svn_node_none
-              || svn_wc__adm_missing(db, local_abspath, pool))
+              || status == svn_wc__db_status_obstructed_add)
             {
               /* Schedule add but missing, just remove the entry
                  or it's missing an adm area in which case
@@ -1948,6 +1948,7 @@ svn_wc__internal_remove_from_revision_co
 {
   svn_error_t *err;
   svn_boolean_t left_something = FALSE;
+  svn_wc__db_status_t status;
   svn_wc__db_kind_t kind;
 
   /* ### This whole function should be rewritten to run inside a transaction,
@@ -1966,7 +1967,11 @@ svn_wc__internal_remove_from_revision_co
   if (cancel_func)
     SVN_ERR(cancel_func(cancel_baton));
 
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE, scratch_pool));
+  SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL,
+                               db, local_abspath, scratch_pool, scratch_pool));
 
   if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)
     {
@@ -2058,7 +2063,9 @@ svn_wc__internal_remove_from_revision_co
 
     }  /* done with file case */
 #ifndef SVN_WC__SINGLE_DB
-  else if (svn_wc__adm_missing(db, local_abspath, scratch_pool))
+  else if (status == svn_wc__db_status_obstructed
+           || status == svn_wc__db_status_obstructed_add
+           || status == svn_wc__db_status_obstructed_delete)
     {
       /* The directory is missing  so don't try to recurse, in
          not existing administrative data, just delete the

Modified: subversion/trunk/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.c?rev=983947&r1=983946&r2=983947&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.c (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.c Tue Aug 10 12:02:32 2010
@@ -629,13 +629,27 @@ close_single(svn_wc_adm_access_t *adm_ac
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_wc__adm_available(svn_boolean_t *available,
-                      svn_wc__db_kind_t *kind,
-                      svn_boolean_t *obstructed,
-                      svn_wc__db_t *db,
-                      const char *local_abspath,
-                      apr_pool_t *scratch_pool)
+/* Retrieves the KIND of LOCAL_ABSPATH and whether its administrative data is
+   available in the working copy.
+
+   *AVAILABLE is set to TRUE when the node and its metadata are available,
+   otherwise to FALSE (due to obstruction, missing, absence, exclusion,
+   or a "not-present" child).
+
+   *OBSTRUCTED is set to TRUE when the node is not available because
+   it is obstructed/missing, otherwise to FALSE.
+
+   KIND and OBSTRUCTED can be NULL.
+
+   ### note: this function should go away when we move to a single
+   ### adminstrative area.  */
+static svn_error_t *
+adm_available(svn_boolean_t *available,
+              svn_wc__db_kind_t *kind,
+              svn_boolean_t *obstructed,
+              svn_wc__db_t *db,
+              const char *local_abspath,
+              apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
 
@@ -718,12 +732,12 @@ do_open(svn_wc_adm_access_t **adm_access
 
           node_abspath = svn_dirent_join(local_abspath, name, iterpool);
 
-          SVN_ERR(svn_wc__adm_available(&available,
-                                        &kind,
-                                        &obstructed,
-                                        db,
-                                        node_abspath,
-                                        scratch_pool));
+          SVN_ERR(adm_available(&available,
+                                &kind,
+                                &obstructed,
+                                db,
+                                node_abspath,
+                                scratch_pool));
 
           if (kind != svn_wc__db_kind_dir)
             continue;
@@ -1336,8 +1350,8 @@ open_anchor(svn_wc_adm_access_t **anchor
           svn_boolean_t available, obstructed;
           svn_wc__db_kind_t kind;
 
-          err = svn_wc__adm_available(&available, &kind, &obstructed,
-                                      db, local_abspath, pool);
+          err = adm_available(&available, &kind, &obstructed,
+                              db, local_abspath, pool);
 
           if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
             svn_error_clear(err);
@@ -1560,36 +1574,6 @@ svn_wc__adm_get_db(const svn_wc_adm_acce
   return adm_access->db;
 }
 
-
-svn_boolean_t
-svn_wc__adm_missing(svn_wc__db_t *db,
-                    const char *local_abspath,
-                    apr_pool_t *scratch_pool)
-{
-  const svn_wc_adm_access_t *look;
-  svn_boolean_t available, obstructed;
-  svn_wc__db_kind_t kind;
-
-  look = get_from_shared(local_abspath, db, scratch_pool);
-
-  if (look != NULL)
-    return IS_MISSING(look);
-
-  /* When we switch to a single database an access baton can't be
-     missing, but until then it can. But if there are no access batons we
-     would always return FALSE.
-     For this case we check if an access baton could be opened
-
-*/
-
-  /* This check must match the check in do_open() */
-  svn_error_clear(svn_wc__adm_available(&available, &kind, &obstructed,
-                                        db, local_abspath,
-                                        scratch_pool));
-
-  return (kind == svn_wc__db_kind_dir) && !available && obstructed;
-}
-
 #ifndef SVN_WC__SINGLE_DB
 static svn_error_t *
 acquire_locks_recursively(svn_wc_context_t *wc_ctx,

Modified: subversion/trunk/subversion/libsvn_wc/lock.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.h?rev=983947&r1=983946&r2=983947&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.h (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.h Tue Aug 10 12:02:32 2010
@@ -49,39 +49,6 @@ void svn_wc__adm_access_set_entries(svn_
    be NULL.  */
 apr_hash_t *svn_wc__adm_access_entries(svn_wc_adm_access_t *adm_access);
 
-
-/* Returns TRUE if LOCAL_ABSPATH is a working copy directory that is obstructed
-   or missing such that an access baton is not available for LOCAL_ABSPATH.
-   This means DB must also include the parent of LOCAL_ABSPATH.
-
-   This function falls back to using svn_wc__adm_available() if no access batons
-   for LOCAL_ABSPATH are stored in DB. */
-svn_boolean_t svn_wc__adm_missing(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  apr_pool_t *scratch_pool);
-
-/* Retrieves the KIND of LOCAL_ABSPATH and whether its administrative data is
-   available in the working copy.
-
-   *AVAILABLE is set to TRUE when the node and its metadata are available,
-   otherwise to FALSE (due to obstruction, missing, absence, exclusion,
-   or a "not-present" child).
-
-   *OBSTRUCTED is set to TRUE when the node is not available because
-   it is obstructed/missing, otherwise to FALSE.
-
-   KIND and OBSTRUCTED can be NULL.
-
-   ### note: this function should go away when we move to a single
-   ### adminstrative area.  */
-svn_error_t *
-svn_wc__adm_available(svn_boolean_t *available,
-                      svn_wc__db_kind_t *kind,
-                      svn_boolean_t *obstructed,
-                      svn_wc__db_t *db,
-                      const char *local_abspath,
-                      apr_pool_t *scratch_pool);
-
 /* Same as svn_wc__adm_retrieve_internal, but takes a DB and an absolute
    directory path.  */
 svn_wc_adm_access_t *