subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r936809 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_client/diff.c libsvn_wc/node.c
Date Thu, 22 Apr 2010 12:18:37 GMT
Author: cmpilato
Date: Thu Apr 22 12:18:36 2010
New Revision: 936809

URL: http://svn.apache.org/viewvc?rev=936809&view=rev
Log:
Irradicate the last remaining svn_wc_entry_t instance in the
libsvn_client diff logic.

* subversion/include/private/svn_wc_private.h,
* subversion/libsvn_wc/node.c
  (svn_wc__node_get_copyfrom_info): New.

* subversion/libsvn_client/diff.c
  (convert_to_url): Trade use of svn_wc_entry_t for some WC-NG node
    functions.

Modified:
    subversion/trunk/subversion/include/private/svn_wc_private.h
    subversion/trunk/subversion/libsvn_client/diff.c
    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=936809&r1=936808&r2=936809&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Thu Apr 22 12:18:36 2010
@@ -361,6 +361,21 @@ svn_wc__node_get_url(const char **url,
 
 
 /**
+ * Set @a *copyfrom_url to the corresponding copy-from URL, and @a
+ * copyfrom_rev to the corresponding copy-from revision, of @a
+ * local_abspath, using @a wc_ctx.  If @a local_abspath does not
+ * represent the root of a copied subtree, set @a *copyfrom_rev to
+ * NULL and @a copyfrom_rev to @c SVN_INVALID_REVNUM.
+ */
+svn_error_t *
+svn_wc__node_get_copyfrom_info(const char **copyfrom_url,
+                               svn_revnum_t *copyfrom_rev,
+                               svn_wc_context_t *wc_ctx,
+                               const char *local_abspath,
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool);
+
+/**
  * Recursively call @a callbacks->found_node for all nodes underneath
  * @a local_abspath.
  */

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=936809&r1=936808&r2=936809&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Thu Apr 22 12:18:36 2010
@@ -880,22 +880,21 @@ convert_to_url(const char **url,
                apr_pool_t *result_pool,
                apr_pool_t *scratch_pool)
 {
-  const svn_wc_entry_t *entry;
-
   if (svn_path_is_url(abspath_or_url))
     {
       *url = apr_pstrdup(result_pool, abspath_or_url);
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(svn_wc__get_entry_versioned(&entry, wc_ctx, abspath_or_url,
-                                      svn_node_unknown, FALSE, FALSE,
-                                      scratch_pool, scratch_pool));
-
-  if (entry->url)
-    *url = apr_pstrdup(result_pool, entry->url);
-  else
-    *url = apr_pstrdup(result_pool, entry->copyfrom_url);
+  SVN_ERR(svn_wc__node_get_url(url, wc_ctx, abspath_or_url,
+                               result_pool, scratch_pool));
+  if (! *url)
+    {
+      svn_revnum_t copyfrom_rev;
+      SVN_ERR(svn_wc__node_get_copyfrom_info(url, &copyfrom_rev,
+                                             wc_ctx, abspath_or_url,
+                                             result_pool, scratch_pool));
+    }
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=936809&r1=936808&r2=936809&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Thu Apr 22 12:18:36 2010
@@ -338,6 +338,39 @@ svn_wc__node_get_url(const char **url,
                             result_pool, scratch_pool));
 }
 
+svn_error_t *
+svn_wc__node_get_copyfrom_info(const char **copyfrom_url,
+                               svn_revnum_t *copyfrom_rev,
+                               svn_wc_context_t *wc_ctx,
+                               const char *local_abspath,
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool)
+{
+  svn_wc__db_t *db = wc_ctx->db;
+  const char *original_root_url;
+  const char *original_repos_relpath;
+  svn_revnum_t original_revision;
+
+  *copyfrom_url = NULL;
+  *copyfrom_rev = SVN_INVALID_REVNUM;
+
+  SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, &original_repos_relpath,
+                               &original_root_url, NULL, &original_revision,
+                               NULL, NULL, NULL, NULL, NULL, db,
+                               local_abspath, scratch_pool, scratch_pool));
+  if (original_root_url && original_repos_relpath)
+    {
+      *copyfrom_url = svn_path_url_add_component2(original_root_url,
+                                                  original_repos_relpath,
+                                                  result_pool);
+      *copyfrom_rev = original_revision;
+    }
+
+  return SVN_NO_ERROR;
+}
+
 
 /* A recursive node-walker, helper for svn_wc__node_walk_children(). */
 static svn_error_t *



Mime
View raw message