You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2014/09/17 13:35:06 UTC
svn commit: r1625522 - in /subversion/trunk/subversion:
libsvn_wc/externals.c tests/cmdline/externals_tests.py
Author: rhuijben
Date: Wed Sep 17 11:35:06 2014
New Revision: 1625522
URL: http://svn.apache.org/r1625522
Log:
When a file externals contents and properties aren't updated during a switch,
but its url is... update the recorded information.
This resolves issues #4411 and #4519.
* subversion/libsvn_wc/externals.c
(close_edit): Bump external registration if this didn't occur in close_file.
* subversion/tests/cmdline/externals_tests.py
(switch_parent_relative_file_external,
switch_relative_externals): Remove XFail markers.
Modified:
subversion/trunk/subversion/libsvn_wc/externals.c
subversion/trunk/subversion/tests/cmdline/externals_tests.py
Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1625522&r1=1625521&r2=1625522&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Wed Sep 17 11:35:06 2014
@@ -943,29 +943,62 @@ close_edit(void *edit_baton,
{
struct edit_baton *eb = edit_baton;
- if (!eb->file_closed
- || eb->iprops)
+ 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.
- if (eb->iprops)
- {
- wcroot_iprops = apr_hash_make(pool);
- svn_hash_sets(wcroot_iprops, eb->local_abspath, eb->iprops);
- }
-
- /* The node wasn't updated, so we just have to bump its revision */
- SVN_ERR(svn_wc__db_op_bump_revisions_post_update(eb->db,
- eb->local_abspath,
- svn_depth_infinity,
- NULL, NULL, NULL,
- *eb->target_revision,
- apr_hash_make(pool),
- wcroot_iprops,
- TRUE /* empty update */,
- eb->notify_func,
- eb->notify_baton,
- pool));
+ Just bump the information as that is just as expensive as
+ 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 (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));
}
return SVN_NO_ERROR;
Modified: subversion/trunk/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/externals_tests.py?rev=1625522&r1=1625521&r2=1625522&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/externals_tests.py Wed Sep 17 11:35:06 2014
@@ -3228,7 +3228,6 @@ def update_dir_external_shallow(sbox):
sbox.ospath('A/B/E'))
@Issue(4411)
-@XFail()
def switch_parent_relative_file_external(sbox):
"switch parent-relative file external"
@@ -3445,7 +3444,6 @@ def update_deletes_file_external(sbox):
@Issue(4519)
-@XFail()
def switch_relative_externals(sbox):
"switch relative externals"