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 2011/05/04 21:51:38 UTC

svn commit: r1099574 - in /subversion/trunk/subversion/libsvn_wc: info.c node.c wc.h

Author: hwright
Date: Wed May  4 19:51:37 2011
New Revision: 1099574

URL: http://svn.apache.org/viewvc?rev=1099574&view=rev
Log:
Introduce an internal version of a libsvn_wc node function, for use with info.

* subversion/libsvn_wc/wc.h
  (svn_wc__internal_get_committ_base_rev): New.

* subversion/libsvn_wc/info.c
  (build_info_for_entry): Use the library-internal function.
 
* subversion/libsvn_wc/node.c
  (get_base_rev): New, from svn_wc__node_get_base_rev().
  (svn_wc__node_get_base_rev): Use static, internal version.
  (svn_wc__internal_get_commit_base_rev): New.
  (svn_wc__node_get_commit_base_rev): Implement as a wrapper.

Modified:
    subversion/trunk/subversion/libsvn_wc/info.c
    subversion/trunk/subversion/libsvn_wc/node.c
    subversion/trunk/subversion/libsvn_wc/wc.h

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1099574&r1=1099573&r2=1099574&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Wed May  4 19:51:37 2011
@@ -105,8 +105,8 @@ build_info_for_entry(svn_info2_t **info,
     tmpinfo->last_changed_rev = SVN_INVALID_REVNUM;
 
   if (is_copy)
-    SVN_ERR(svn_wc__node_get_commit_base_rev(&tmpinfo->rev, wc_ctx,
-                                             local_abspath, scratch_pool));
+    SVN_ERR(svn_wc__internal_get_commit_base_rev(&tmpinfo->rev, wc_ctx->db,
+                                                 local_abspath, scratch_pool));
   else
     tmpinfo->rev = rev;
 

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1099574&r1=1099573&r2=1099574&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Wed May  4 19:51:37 2011
@@ -822,11 +822,11 @@ svn_wc__node_is_added(svn_boolean_t *is_
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_wc__node_get_base_rev(svn_revnum_t *base_revision,
-                          svn_wc_context_t *wc_ctx,
-                          const char *local_abspath,
-                          apr_pool_t *scratch_pool)
+static svn_error_t *
+get_base_rev(svn_revnum_t *base_revision,
+             svn_wc__db_t *db,
+             const char *local_abspath,
+             apr_pool_t *scratch_pool)
 {
   svn_boolean_t have_base;
   svn_error_t *err;
@@ -834,7 +834,7 @@ svn_wc__node_get_base_rev(svn_revnum_t *
   err = svn_wc__db_base_get_info(NULL, NULL, base_revision, NULL,
                                  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                  NULL, NULL, NULL, NULL, NULL,
-                                 wc_ctx->db, local_abspath,
+                                 db, local_abspath,
                                  scratch_pool, scratch_pool);
 
   if (!err || err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
@@ -847,13 +847,23 @@ svn_wc__node_get_base_rev(svn_revnum_t *
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, &have_base, NULL,
                                NULL, NULL, NULL, NULL, NULL,
-                               wc_ctx->db, local_abspath,
+                               db, local_abspath,
                                scratch_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
+svn_wc__node_get_base_rev(svn_revnum_t *base_revision,
+                          svn_wc_context_t *wc_ctx,
+                          const char *local_abspath,
+                          apr_pool_t *scratch_pool)
+{
+  return svn_error_return(get_base_rev(base_revision, wc_ctx->db,
+                                       local_abspath, scratch_pool));
+}
+
+svn_error_t *
 svn_wc__node_get_pre_ng_status_data(svn_revnum_t *revision,
                                    svn_revnum_t *changed_rev,
                                    apr_time_t *changed_date,
@@ -903,10 +913,10 @@ svn_wc__node_get_pre_ng_status_data(svn_
 
 
 svn_error_t *
-svn_wc__node_get_commit_base_rev(svn_revnum_t *commit_base_revision,
-                                 svn_wc_context_t *wc_ctx,
-                                 const char *local_abspath,
-                                 apr_pool_t *scratch_pool)
+svn_wc__internal_get_commit_base_rev(svn_revnum_t *commit_base_revision,
+                                     svn_wc__db_t *db,
+                                     const char *local_abspath,
+                                     apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
   svn_boolean_t have_base;
@@ -917,8 +927,7 @@ svn_wc__node_get_commit_base_rev(svn_rev
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL,
                                &have_base, NULL, NULL,
-                               wc_ctx->db, local_abspath, scratch_pool,
-                               scratch_pool));
+                               db, local_abspath, scratch_pool, scratch_pool));
 
   /* If this returned a valid revnum, there is no WORKING node. The node is
      cleanly checked out, no modifications, copies or replaces. */
@@ -932,15 +941,14 @@ svn_wc__node_get_commit_base_rev(svn_rev
          return SVN_INVALID_REVNUM. */
       SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL,
                                        NULL, NULL, commit_base_revision,
-                                       wc_ctx->db, local_abspath,
+                                       db, local_abspath,
                                        scratch_pool, scratch_pool));
 
       if (! SVN_IS_VALID_REVNUM(*commit_base_revision) && have_base)
         /* It is a replace that does not feature a copy/move-here.
            Return the revert-base revision. */
         return svn_error_return(
-          svn_wc__node_get_base_rev(commit_base_revision, wc_ctx,
-                                    local_abspath, scratch_pool));
+          get_base_rev(commit_base_revision, db, local_abspath, scratch_pool));
     }
   else if (status == svn_wc__db_status_deleted)
     {
@@ -950,7 +958,7 @@ svn_wc__node_get_commit_base_rev(svn_rev
 
       SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
                                        &work_del_abspath,
-                                       wc_ctx->db, local_abspath,
+                                       db, local_abspath,
                                        scratch_pool, scratch_pool));
       if (work_del_abspath != NULL)
         {
@@ -964,7 +972,7 @@ svn_wc__node_get_commit_base_rev(svn_rev
                                        NULL, NULL, NULL, NULL, NULL, NULL,
                                        NULL, NULL, NULL, NULL, NULL, NULL,
                                        NULL, NULL,
-                                       wc_ctx->db, parent_abspath,
+                                       db, parent_abspath,
                                        scratch_pool, scratch_pool));
 
           SVN_ERR_ASSERT(parent_status == svn_wc__db_status_added);
@@ -972,20 +980,30 @@ svn_wc__node_get_commit_base_rev(svn_rev
           SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL,
                                            NULL, NULL,
                                            commit_base_revision,
-                                           wc_ctx->db, parent_abspath,
+                                           db, parent_abspath,
                                            scratch_pool, scratch_pool));
         }
       else
         /* This is a normal delete. Get the base revision. */
         return svn_error_return(
-          svn_wc__node_get_base_rev(commit_base_revision, wc_ctx,
-                                    local_abspath, scratch_pool));
+          get_base_rev(commit_base_revision, db, local_abspath, scratch_pool));
     }
 
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
+svn_wc__node_get_commit_base_rev(svn_revnum_t *commit_base_revision,
+                                 svn_wc_context_t *wc_ctx,
+                                 const char *local_abspath,
+                                 apr_pool_t *scratch_pool)
+{
+  return svn_error_return(svn_wc__internal_get_commit_base_rev(
+                            commit_base_revision, wc_ctx->db, local_abspath,
+                            scratch_pool));
+}
+
+svn_error_t *
 svn_wc__node_get_lock_info(const char **lock_token,
                            const char **lock_owner,
                            const char **lock_comment,

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1099574&r1=1099573&r2=1099574&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Wed May  4 19:51:37 2011
@@ -656,6 +656,13 @@ svn_wc__internal_get_origin(svn_boolean_
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool);
 
+/* Internal version of svn_wc__node_get_commit_base_rev */
+svn_error_t *
+svn_wc__internal_get_commit_base_rev(svn_revnum_t *commit_base_revision,
+                                     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.