Author: stsp
Date: Fri Jul 29 13:12:39 2011
New Revision: 1152204

URL: http://svn.apache.org/viewvc?rev=1152204&view=rev
Log:
Add a new internal API function: svn_wc__node_get_deleted_ancestor().

This will be needed for handling moves during commit processing.

* subversion/include/private/svn_wc_private.h
  (svn_wc__node_get_deleted_ancestor): Declare.

* subversion/libsvn_wc/node.c
  (svn_wc__node_get_deleted_ancestor): Implement. This function returns
   the absolute path of the deletion op-root of a given deleted LOCAL_ABSPATH.

Modified:
    subversion/trunk/subversion/include/private/svn_wc_private.h
    subversion/trunk/subversion/libsvn_wc/node.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=1152204&r1=1152203&r2=1152204&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Fri Jul 29 
13:12:39 2011
@@ -466,6 +466,22 @@ svn_wc__node_is_status_deleted(svn_boole
                                apr_pool_t *scratch_pool);
 
 /**
+ * Set @a *deleted_ancestor_abspath to the root of the delete operation
+ * that deleted @a local_abspath. If @a local_abspath itself was deleted
+ * and has no deleted ancestor, @a *deleted_ancestor_abspath will equal
+ * @a local_abspath. If @a local_abspath was not deleted,
+ * set @a *deleted_ancestor_abspath to @c NULL.
+ * @a *deleted_ancestor_abspath is allocated in @a result_pool.
+ * Use @a scratch_pool for all temporary allocations.
+ */ 
+svn_error_t *
+svn_wc__node_get_deleted_ancestor(const char **deleted_ancestor_abspath,
+                                  svn_wc_context_t *wc_ctx,
+                                  const char *local_abspath,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool);
+
+/**
  * Set @a *is_server_excluded to whether @a local_abspath has been
  * excluded by the server, 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_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1152204&r1=1152203&r2=1152204&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Fri Jul 29 13:12:39 2011
@@ -748,6 +748,33 @@ svn_wc__node_is_status_deleted(svn_boole
 }
 
 svn_error_t *
+svn_wc__node_get_deleted_ancestor(const char **deleted_ancestor_abspath,
+                                  svn_wc_context_t *wc_ctx,
+                                  const char *local_abspath,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool)
+{
+  svn_wc__db_status_t status;
+
+  *deleted_ancestor_abspath = NULL;
+
+  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, NULL,
+                               NULL, NULL, NULL, NULL, NULL,
+                               wc_ctx->db, local_abspath,
+                               scratch_pool, scratch_pool));
+
+  if (status == svn_wc__db_status_deleted)
+    SVN_ERR(svn_wc__db_scan_deletion(deleted_ancestor_abspath, NULL, NULL,
+                                     wc_ctx->db, local_abspath,
+                                     result_pool, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_wc__node_is_status_server_excluded(svn_boolean_t *is_server_excluded,
                                        svn_wc_context_t *wc_ctx,
                                        const char *local_abspath,


Reply via email to