You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ne...@apache.org on 2010/05/03 01:42:48 UTC

svn commit: r940337 - /subversion/trunk/subversion/libsvn_wc/node.c

Author: neels
Date: Sun May  2 23:42:48 2010
New Revision: 940337

URL: http://svn.apache.org/viewvc?rev=940337&view=rev
Log:
Fix r940102 to also work when the root copy target of a mixed-rev copy is an
ancestor that is further up than the direct parent. Plus it looks much better
like this.

* subversion/libsvn_wc/node.c
  (svn_wc__node_get_copyfrom_info):
    Instead of using the ORIGINAL_* values of the parent directly, rather
    recurse to (scanningly) find the COPYFROM_URL of the parent folder.

Modified:
    subversion/trunk/subversion/libsvn_wc/node.c

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=940337&r1=940336&r2=940337&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Sun May  2 23:42:48 2010
@@ -414,6 +414,18 @@ svn_wc__node_get_copyfrom_info(const cha
     {
       /* If this was the root of the copy then the URL is immediately
          available... */
+      const char *my_copyfrom_url;
+
+      if (copyfrom_url || is_copy_target)
+        my_copyfrom_url = svn_path_url_add_component2(original_root_url,
+                                                      original_repos_relpath,
+                                                      result_pool);
+
+      if (copyfrom_url)
+        *copyfrom_url = my_copyfrom_url;
+
+      if (copyfrom_rev)
+        *copyfrom_rev = original_revision;
 
       if (is_copy_target)
         {
@@ -431,40 +443,28 @@ svn_wc__node_get_copyfrom_info(const cha
            * a separate copy target. */
           const char *parent_abspath;
           const char *base_name;
-          const char *parent_original_repos_relpath;
-          const char *parent_original_root_url;
+          const char *parent_copyfrom_url;
 
           svn_dirent_split(local_abspath, &parent_abspath, &base_name,
                            scratch_pool);
 
           /* This is a copied node, so we should never fall off the top of a
            * working copy here. */
-          SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL,
-                                       NULL, NULL, NULL, NULL, NULL, NULL,
-                                       NULL, NULL, NULL,
-                                       &parent_original_repos_relpath,
-                                       &parent_original_root_url, NULL, NULL,
-                                       NULL, NULL, NULL, NULL, NULL, db,
-                                       parent_abspath, scratch_pool,
-                                       scratch_pool));
+          SVN_ERR(svn_wc__node_get_copyfrom_info(&parent_copyfrom_url,
+                                                 NULL, NULL,
+                                                 wc_ctx, parent_abspath,
+                                                 scratch_pool, scratch_pool));
 
           /* So, count this as a separate copy target only if the URLs
            * don't match up, or if the parent isn't copied at all. */
-          if (parent_original_root_url == NULL
-              || parent_original_repos_relpath == NULL
-              || strcmp(original_root_url, parent_original_root_url) != 0
-              || strcmp(svn_relpath_join(parent_original_repos_relpath,
-                                         base_name, scratch_pool),
-                        original_repos_relpath) != 0)
+          if (parent_copyfrom_url == NULL
+              || strcmp(my_copyfrom_url,
+                        svn_path_url_add_component2(parent_copyfrom_url,
+                                                    base_name,
+                                                    scratch_pool)) != 0)
             *is_copy_target = TRUE;
         }
 
-      if (copyfrom_url)
-        *copyfrom_url = svn_path_url_add_component2(original_root_url,
-                                                    original_repos_relpath,
-                                                    result_pool);
-      if (copyfrom_rev)
-        *copyfrom_rev = original_revision;
     }
   else if ((status == svn_wc__db_status_added
             || status == svn_wc__db_status_obstructed_add)