Author: cmpilato
Date: Fri Apr 23 18:17:37 2010
New Revision: 937452
URL: http://svn.apache.org/viewvc?rev=937452&view=rev
Log:
More svn_wc_entry_t purging from libsvn_client.
* subversion/include/private/svn_wc_private.h
(svn_wc__node_is_replaced): New.
* subversion/libsvn_wc/questions.c
(svn_wc__internal_is_replaced): Moved to node.c.
* subversion/libsvn_wc/node.c
(svn_wc__internal_is_replaced): Moved from questions.c.
(svn_wc__node_is_replaced): New wrapper around
svn_wc__internal_is_replaced().
* subversion/libsvn_client/status.c
(svn_client_status5): Use WC-NG node functions rather than
svn_wc_entry_t stuffs to determine how to handle status targets
missing from HEAD.
Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_client/status.c
subversion/trunk/subversion/libsvn_wc/node.c
subversion/trunk/subversion/libsvn_wc/questions.c
Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=937452&r1=937451&r2=937452&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Fri Apr 23
18:17:37 2010
@@ -457,6 +457,20 @@ svn_wc__node_is_added(svn_boolean_t *is_
apr_pool_t *scratch_pool);
/**
+ * Set @a *is_replaced to whether @a local_abspath is replaced, using
+ * @a wc_ctx. If @a local_abspath is not in the working copy, return
+ * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary
+ * allocations.
+ *
+ * NOTE: This corresponds directly to svn_wc_schedule_replace.
+ */
+svn_error_t *
+svn_wc__node_is_replaced(svn_boolean_t *is_replaced,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool);
+
+/**
* Get the base revision of @a local_abspath using @a wc_ctx. If
* @a local_abspath is not in the working copy, return
* @c SVN_ERR_WC_PATH_NOT_FOUND.
Modified: subversion/trunk/subversion/libsvn_client/status.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/status.c?rev=937452&r1=937451&r2=937452&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/status.c (original)
+++ subversion/trunk/subversion/libsvn_client/status.c Fri Apr 23 18:17:37 2010
@@ -391,17 +391,26 @@ svn_client_status5(svn_revnum_t *result_
&kind, pool));
if (kind == svn_node_none)
{
- const svn_wc_entry_t *entry;
- SVN_ERR(svn_wc__get_entry_versioned(&entry, ctx->wc_ctx,
- dir_abspath, svn_node_dir,
- FALSE, FALSE,
- pool, pool));
-
- /* Our status target does not exist in HEAD of the
- repository. If we're just adding this thing, that's
- fine. But if it was previously versioned, then it must
- have been deleted from the repository. */
- if (entry->schedule != svn_wc_schedule_add)
+ svn_boolean_t added;
+
+ /* Our status target does not exist in HEAD. If we've got
+ it localled added, that's okay. But if it was previously
+ versioned, then it must have since been deleted from the
+ repository. (Note that "locally replaced" doesn't count
+ as "added" in this case.) */
+ SVN_ERR(svn_wc__node_is_added(&added, ctx->wc_ctx,
+ dir_abspath, pool));
+ if (added)
+ {
+ svn_boolean_t replaced;
+
+ SVN_ERR(svn_wc__node_is_replaced(&added, ctx->wc_ctx,
+ dir_abspath, pool));
+ if (replaced)
+ added = FALSE;
+ }
+
+ if (! added)
sb.deleted_in_repos = TRUE;
/* And now close the edit. */
Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=937452&r1=937451&r2=937452&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Fri Apr 23 18:17:37 2010
@@ -667,6 +667,56 @@ svn_wc__node_is_added(svn_boolean_t *is_
return SVN_NO_ERROR;
}
+
+/* Equivalent to the old notion of "entry->schedule == schedule_replace" */
+svn_error_t *
+svn_wc__internal_is_replaced(svn_boolean_t *replaced,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_status_t status;
+ svn_boolean_t base_shadowed;
+ svn_wc__db_status_t base_status;
+
+ SVN_ERR(svn_wc__db_read_info(
+ &status, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, &base_shadowed,
+ NULL, NULL,
+ db, local_abspath,
+ scratch_pool, scratch_pool));
+ if (base_shadowed)
+ SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ *replaced = ((status == svn_wc__db_status_added
+ || status == svn_wc__db_status_obstructed_add)
+ && base_shadowed
+ && base_status != svn_wc__db_status_not_present);
+
+ return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
+svn_wc__node_is_replaced(svn_boolean_t *replaced,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
+{
+ SVN_ERR(svn_wc__internal_is_replaced(replaced, wc_ctx->db,
+ local_abspath, scratch_pool));
+}
+
+
svn_error_t *
svn_wc__node_get_base_rev(svn_revnum_t *base_revision,
svn_wc_context_t *wc_ctx,
Modified: subversion/trunk/subversion/libsvn_wc/questions.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/questions.c?rev=937452&r1=937451&r2=937452&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/questions.c (original)
+++ subversion/trunk/subversion/libsvn_wc/questions.c Fri Apr 23 18:17:37 2010
@@ -567,41 +567,3 @@ svn_wc__marked_as_binary(svn_boolean_t *
return SVN_NO_ERROR;
}
-
-
-/* Equivalent to the old notion of "entry->schedule == schedule_replace" */
-svn_error_t *
-svn_wc__internal_is_replaced(svn_boolean_t *replaced,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *scratch_pool)
-{
- svn_wc__db_status_t status;
- svn_boolean_t base_shadowed;
- svn_wc__db_status_t base_status;
-
- SVN_ERR(svn_wc__db_read_info(
- &status, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- NULL, NULL, &base_shadowed,
- NULL, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool));
- if (base_shadowed)
- SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool));
-
- *replaced = ((status == svn_wc__db_status_added
- || status == svn_wc__db_status_obstructed_add)
- && base_shadowed
- && base_status != svn_wc__db_status_not_present);
-
- return SVN_NO_ERROR;
-}