subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1227384 - in /subversion/trunk/subversion: include/private/ libsvn_client/ libsvn_wc/
Date Wed, 04 Jan 2012 23:23:24 GMT
Author: stsp
Date: Wed Jan  4 23:23:23 2012
New Revision: 1227384

URL: http://svn.apache.org/viewvc?rev=1227384&view=rev
Log:
Tweak a private libsvn_wc node API so that libsvn_client can use it to find
the root of a copied subtree in the working copy, given some copied node
within this subtree.

This new feature isn't used yet so there is no functional change.

* subversion/include/private/svn_wc_private.h
  (svn_wc__node_get_origin): Add COPY_ROOT_ABSPATH output parameter.

* subversion/libsvn_wc/wc.h
  (svn_wc__internal_get_origin): Add COPY_ROOT_ABSPATH output param here, too.

* subversion/libsvn_wc/node.c
  (svn_wc__internal_get_origin): Add COPY_ROOT_ABSPATH output parameter.
   This function was already scanning the value from the DB for local use.
  (svn_wc__node_get_origin): Pass through the new COPY_ROOT_ABSPATH parameter.

* subversion/libsvn_wc/info.c,
  subversion/libsvn_wc/externals.c,
  subversion/libsvn_client/merge.c,
  subversion/libsvn_client/ra.c,
  subversion/libsvn_client/commit_util.c,
  subversion/libsvn_client/mergeinfo.c,
  subversion/libsvn_client/export.c,
  subversion/libsvn_client/copy.c
  (build_info_for_node, is_external_rolled_out, get_full_mergeinfo,
   svn_client__repos_locations, harvest_committables,
   svn_client__get_wc_or_repos_mergeinfo_catalog, copy_versioned_files,
   calculate_target_mergeinfo, try_copy): Update callers of
    svn_wc__internal_get_origin() and svn_wc__node_get_origin(), passing
    NULL for the new output parameter.

Modified:
    subversion/trunk/subversion/include/private/svn_wc_private.h
    subversion/trunk/subversion/libsvn_client/commit_util.c
    subversion/trunk/subversion/libsvn_client/copy.c
    subversion/trunk/subversion/libsvn_client/export.c
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_client/mergeinfo.c
    subversion/trunk/subversion/libsvn_client/ra.c
    subversion/trunk/subversion/libsvn_wc/externals.c
    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/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Wed Jan  4 23:23:23 2012
@@ -479,6 +479,12 @@ svn_wc__node_get_url(const char **url,
  * If not NULL, sets @a revision, @a repos_relpath, @a repos_root_url and
  * @a repos_uuid to the original (if a copy) or their current values.
  *
+ * If @a copy_root_abspath is not NULL, and @a *is_copy indicates that the
+ * node was copied, set @a *copy_root_abspath to the local absolute path of
+ * the root of the copied subtree containing the node. If the copied node is
+ * a root by itself, @a *copy_root_abspath will match @a local_abspath (but
+ * won't necessarily point to the same string in memory).
+ *
  * If @a scan_deleted is TRUE, determine the origin of the deleted node. If
  * @a scan_deleted is FALSE, return NULL, SVN_INVALID_REVNUM or FALSE for
  * deleted nodes.
@@ -491,6 +497,7 @@ svn_wc__node_get_origin(svn_boolean_t *i
                         const char **repos_relpath,
                         const char **repos_root_url,
                         const char **repos_uuid,
+                        const char **copy_root_abspath,
                         svn_wc_context_t *wc_ctx,
                         const char *local_abspath,
                         svn_boolean_t scan_deleted,

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Wed Jan  4 23:23:23 2012
@@ -627,7 +627,7 @@ harvest_committables(svn_wc_context_t *w
 
           /* Determine from what parent we would be the deleted child */
           SVN_ERR(svn_wc__node_get_origin(NULL, &revision, &repos_relpath,
-                                          NULL, NULL, wc_ctx,
+                                          NULL, NULL, NULL, wc_ctx,
                                           svn_dirent_dirname(local_abspath,
                                                              scratch_pool),
                                           FALSE, scratch_pool, scratch_pool));
@@ -684,7 +684,7 @@ harvest_committables(svn_wc_context_t *w
 
           SVN_ERR(svn_wc__node_get_origin(NULL, &cf_rev,
                                       &cf_relpath, NULL,
-                                      NULL,
+                                      NULL, NULL,
                                       wc_ctx, local_abspath, FALSE,
                                       scratch_pool, scratch_pool));
 

Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Wed Jan  4 23:23:23 2012
@@ -98,7 +98,7 @@ calculate_target_mergeinfo(svn_ra_sessio
 
       SVN_ERR(svn_wc__node_get_origin(NULL, &src_revnum,
                                       &repos_relpath, &repos_root_url,
-                                      NULL,
+                                      NULL, NULL,
                                       ctx->wc_ctx, local_abspath, FALSE,
                                       pool, pool));
 
@@ -2127,7 +2127,7 @@ try_copy(const apr_array_header_t *sourc
                   SVN_ERR(svn_wc__node_get_origin(NULL, &copyfrom_rev,
                                                   &copyfrom_repos_relpath,
                                                   &copyfrom_repos_root_url,
-                                                  NULL,
+                                                  NULL, NULL,
                                                   ctx->wc_ctx,
                                                   pair->src_abspath_or_url,
                                                   TRUE, iterpool, iterpool));

Modified: subversion/trunk/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/export.c?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/export.c (original)
+++ subversion/trunk/subversion/libsvn_client/export.c Wed Jan  4 23:23:23 2012
@@ -402,7 +402,7 @@ copy_versioned_files(const char *from_ab
       const char *repos_relpath;
 
       SVN_ERR(svn_wc__node_get_origin(&is_added, NULL, &repos_relpath,
-                                      NULL, NULL,
+                                      NULL, NULL, NULL,
                                       ctx->wc_ctx, from_abspath, FALSE,
                                       pool, pool));
 

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed Jan  4 23:23:23 2012
@@ -3516,7 +3516,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
       /* Retrieve the origin (original_*) of the node, or just the
          url if the node was not copied. */
       SVN_ERR(svn_wc__node_get_origin(FALSE, &target_rev, &repos_relpath,
-                                      &repos_root, NULL,
+                                      &repos_root, NULL, NULL,
                                       ctx->wc_ctx, target_abspath, FALSE,
                                       scratch_pool, scratch_pool));
 

Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.c?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.c Wed Jan  4 23:23:23 2012
@@ -624,7 +624,7 @@ svn_client__get_wc_or_repos_mergeinfo_ca
      a URL and without that we cannot get accurate mergeinfo for
      TARGET_WCPATH. */
   SVN_ERR(svn_wc__node_get_origin(NULL, &target_rev, &repos_relpath,
-                                  &repos_root, NULL,
+                                  &repos_root, NULL, NULL,
                                   ctx->wc_ctx, local_abspath, FALSE,
                                   scratch_pool, scratch_pool));
 
@@ -1077,7 +1077,7 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
                                       scratch_pool));
 
       SVN_ERR(svn_wc__node_get_origin(NULL, &rev, &repos_relpath,
-                                      &repos_root_url, NULL,
+                                      &repos_root_url, NULL, NULL,
                                       ctx->wc_ctx, local_abspath, FALSE,
                                       scratch_pool, scratch_pool));
 

Modified: subversion/trunk/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/ra.c?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/ra.c (original)
+++ subversion/trunk/subversion/libsvn_client/ra.c Wed Jan  4 23:23:23 2012
@@ -717,7 +717,7 @@ svn_client__repos_locations(const char *
           svn_boolean_t is_copy;
 
           SVN_ERR(svn_wc__node_get_origin(&is_copy, &peg_revnum, &repos_relpath,
-                                          &repos_root_url, NULL,
+                                          &repos_root_url, NULL, NULL,
                                           ctx->wc_ctx, local_abspath_or_url,
                                           FALSE, subpool, subpool));
 

Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Wed Jan  4 23:23:23 2012
@@ -1138,7 +1138,7 @@ is_external_rolled_out(svn_boolean_t *is
   err = svn_wc__node_get_origin(NULL, NULL,
                                 &x_repos_relpath,
                                 &x_repos_root_url,
-                                NULL,
+                                NULL, NULL,
                                 wc_ctx, xinfo->local_abspath,
                                 FALSE, /* scan_deleted */
                                 scratch_pool, scratch_pool);

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Wed Jan  4 23:23:23 2012
@@ -182,7 +182,7 @@ build_info_for_node(svn_wc__info2_t **in
           SVN_ERR(svn_wc__internal_get_origin(NULL, &tmpinfo->rev,
                                               &repos_relpath,
                                               &tmpinfo->repos_root_URL,
-                                              &tmpinfo->repos_UUID,
+                                              &tmpinfo->repos_UUID, NULL,
                                               db, local_abspath, TRUE,
                                               result_pool, scratch_pool));
         }

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Wed Jan  4 23:23:23 2012
@@ -1349,6 +1349,7 @@ svn_wc__internal_get_origin(svn_boolean_
                             const char **repos_relpath,
                             const char **repos_root_url,
                             const char **repos_uuid,
+                            const char **copy_root_abspath,
                             svn_wc__db_t *db,
                             const char *local_abspath,
                             svn_boolean_t scan_deleted,
@@ -1399,7 +1400,8 @@ svn_wc__internal_get_origin(svn_boolean_
       if (repos_uuid)
         *repos_uuid = original_repos_uuid;
 
-      return SVN_NO_ERROR;
+      if (copy_root_abspath == NULL)
+        return SVN_NO_ERROR;
     }
 
   {
@@ -1428,13 +1430,19 @@ svn_wc__internal_get_origin(svn_boolean_
                                          result_pool, scratch_pool));
 
         if (status == svn_wc__db_status_added)
-          return SVN_NO_ERROR; /* Local addition */
+          {
+            if (is_copy)
+              *is_copy = FALSE;
+            return SVN_NO_ERROR; /* Local addition */
+          }
 
         *repos_relpath = svn_relpath_join(
                                 original_repos_relpath,
                                 svn_dirent_skip_ancestor(op_root_abspath,
                                                          local_abspath),
                                 result_pool);
+        if (copy_root_abspath)
+          *copy_root_abspath = op_root_abspath;
       }
     else /* Deleted, excluded, not-present, server-excluded, ... */
       {
@@ -1459,6 +1467,7 @@ svn_wc__node_get_origin(svn_boolean_t *i
                         const char **repos_relpath,
                         const char **repos_root_url,
                         const char **repos_uuid,
+                        const char **copy_root_abspath,
                         svn_wc_context_t *wc_ctx,
                         const char *local_abspath,
                         svn_boolean_t scan_deleted,
@@ -1467,6 +1476,7 @@ svn_wc__node_get_origin(svn_boolean_t *i
 {
   return svn_error_trace(svn_wc__internal_get_origin(is_copy, revision,
                            repos_relpath, repos_root_url, repos_uuid,
+                           copy_root_abspath,
                            wc_ctx->db, local_abspath, scan_deleted,
                            result_pool, scratch_pool));
 }

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1227384&r1=1227383&r2=1227384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Wed Jan  4 23:23:23 2012
@@ -620,6 +620,7 @@ svn_wc__internal_get_origin(svn_boolean_
                             const char **repos_relpath,
                             const char **repos_root_url,
                             const char **repos_uuid,
+                            const char **copy_root_abspath,
                             svn_wc__db_t *db,
                             const char *local_abspath,
                             svn_boolean_t scan_deleted,



Mime
View raw message