subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1680242 - /subversion/trunk/subversion/libsvn_wc/externals.c
Date Tue, 19 May 2015 10:47:16 GMT
Author: rhuijben
Date: Tue May 19 10:47:15 2015
New Revision: 1680242

URL: http://svn.apache.org/r1680242
Log:
Following up on r1625522, revert the change to adding a replacement
file external and pass the proper new revision and url to the bump function
instead. Fix a few more url calculations to fix recording in conflict.

* subversion/libsvn_wc/externals.c
  (edit_baton): Store old and new repos_relpath instead of url.
  (open_file): Read old repos_relpath.
  (close_file): Record old repos_relpath in the conflict.
    Update caller.
  (close_edit): Bump the revision as pre r1625522, but pass the
    new repository info.
  (svn_wc__get_file_external_editor): Update baton init.

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

Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1680242&r1=1680241&r2=1680242&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Tue May 19 10:47:15 2015
@@ -462,9 +462,10 @@ struct edit_baton
   const apr_array_header_t *ext_patterns;
   const char *diff3cmd;
 
-  const char *url;
   const char *repos_root_url;
   const char *repos_uuid;
+  const char *old_repos_relpath;
+  const char *new_repos_relpath;
 
   const char *record_ancestor_abspath;
   const char *recorded_repos_relpath;
@@ -572,7 +573,8 @@ open_file(const char *path,
 
   *file_baton = eb;
   SVN_ERR(svn_wc__db_base_get_info(NULL, &kind, &eb->original_revision,
-                                   NULL, NULL, NULL, &eb->changed_rev,
+                                   &eb->old_repos_relpath, NULL, NULL,
+                                   &eb->changed_rev,
                                    &eb->changed_date, &eb->changed_author,
                                    NULL, &eb->original_checksum, NULL, NULL,
                                    &eb->had_props, NULL, NULL,
@@ -733,8 +735,6 @@ close_file(void *file_baton,
     const svn_checksum_t *original_checksum = NULL;
 
     svn_boolean_t added = !SVN_IS_VALID_REVNUM(eb->original_revision);
-    const char *repos_relpath = svn_uri_skip_ancestor(eb->repos_root_url,
-                                                      eb->url, pool);
 
     if (! added)
       {
@@ -908,14 +908,14 @@ close_file(void *file_baton,
                             svn_wc_conflict_version_create2(
                                     eb->repos_root_url,
                                     eb->repos_uuid,
-                                    repos_relpath,
+                                    eb->old_repos_relpath,
                                     eb->original_revision,
                                     svn_node_file,
                                     pool),
                             svn_wc_conflict_version_create2(
                                     eb->repos_root_url,
                                     eb->repos_uuid,
-                                    repos_relpath,
+                                    eb->new_repos_relpath,
                                     *eb->target_revision,
                                     svn_node_file,
                                     pool),
@@ -933,7 +933,7 @@ close_file(void *file_baton,
                         eb->db,
                         eb->local_abspath,
                         eb->wri_abspath,
-                        repos_relpath,
+                        eb->new_repos_relpath,
                         eb->repos_root_url,
                         eb->repos_uuid,
                         *eb->target_revision,
@@ -1002,6 +1002,7 @@ close_edit(void *edit_baton,
 
   if (!eb->file_closed)
     {
+      apr_hash_t *wcroot_iprops = NULL;
       /* The file wasn't updated, but its url or revision might have...
          e.g. switch between branches for relative externals.
 
@@ -1009,53 +1010,26 @@ close_edit(void *edit_baton,
          investigating when we should and shouldn't update it...
          and avoid hard to debug edge cases */
 
-      svn_node_kind_t kind;
-      const char *old_repos_relpath;
-      svn_revnum_t changed_rev;
-      apr_time_t changed_date;
-      const char *changed_author;
-      const svn_checksum_t *checksum;
-      apr_hash_t *pristine_props;
-      const char *repos_relpath = svn_uri_skip_ancestor(eb->repos_root_url,
-                                                        eb->url, pool);
-
-      SVN_ERR(svn_wc__db_base_get_info(NULL, &kind, NULL, &old_repos_relpath,
-                                       NULL, NULL, &changed_rev, &changed_date,
-                                       &changed_author, NULL, &checksum, NULL,
-                                       NULL, NULL, &pristine_props, NULL,
-                                       eb->db, eb->local_abspath,
-                                       pool, pool));
+      if (eb->iprops)
+        {
+          wcroot_iprops = apr_hash_make(pool);
+          svn_hash_sets(wcroot_iprops, eb->local_abspath, eb->iprops);
+        }
 
-      if (kind != svn_node_file)
-        return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
-                                   _("Node '%s' is no existing file external"),
-                                   svn_dirent_local_style(eb->local_abspath,
-                                                          pool));
-
-      SVN_ERR(svn_wc__db_external_add_file(
-                    eb->db,
-                    eb->local_abspath,
-                    eb->wri_abspath,
-                    repos_relpath,
-                    eb->repos_root_url,
-                    eb->repos_uuid,
-                    *eb->target_revision,
-                    pristine_props,
-                    eb->iprops,
-                    eb->changed_rev,
-                    eb->changed_date,
-                    eb->changed_author,
-                    checksum,
-                    NULL /* clear dav props */,
-                    eb->record_ancestor_abspath,
-                    eb->recorded_repos_relpath,
-                    eb->recorded_peg_revision,
-                    eb->recorded_revision,
-                    FALSE, NULL,
-                    TRUE /* keep_recorded_info */,
-                    NULL /* conflict_skel */,
-                    NULL /* work_items */,
-                    pool));
+      SVN_ERR(svn_wc__db_op_bump_revisions_post_update(eb->db,
+                                                       eb->local_abspath,
+                                                       svn_depth_infinity,
+                                                       eb->new_repos_relpath,
+                                                       eb->repos_root_url,
+                                                       eb->repos_uuid,
+                                                       *eb->target_revision,
+                                                       apr_hash_make(pool)
+                                                       /* exclude_relpaths */,
+                                                       wcroot_iprops,
+                                                       TRUE /* empty update */,
+                                                       eb->notify_func,
+                                                       eb->notify_baton,
+                                                       pool));
     }
 
   return SVN_NO_ERROR;
@@ -1101,9 +1075,12 @@ svn_wc__get_file_external_editor(const s
   eb->name = svn_dirent_basename(eb->local_abspath, NULL);
   eb->target_revision = target_revision;
 
-  eb->url = apr_pstrdup(edit_pool, url);
   eb->repos_root_url = apr_pstrdup(edit_pool, repos_root_url);
   eb->repos_uuid = apr_pstrdup(edit_pool, repos_uuid);
+  eb->new_repos_relpath = svn_uri_skip_ancestor(eb->repos_root_url, url, edit_pool);
+  eb->old_repos_relpath = eb->new_repos_relpath;
+
+  eb->original_revision = SVN_INVALID_REVNUM;
 
   eb->iprops = iprops;
 



Mime
View raw message