You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2015/05/20 06:00:59 UTC
svn commit: r1680451 - in /subversion/branches/1.9.x: ./ STATUS
subversion/libsvn_wc/externals.c subversion/tests/cmdline/externals_tests.py
Author: svn-role
Date: Wed May 20 04:00:59 2015
New Revision: 1680451
URL: http://svn.apache.org/r1680451
Log:
Merge the r1680242 group from trunk:
* r1680242, r1680264
Stop removing last-change-* on non-updates of file externals (issue 4580)
Justification:
Resolves regression with 1.7.x/1.8.x pre 1.8.13, caused by issue 4411
patch. This patch implements this fix in a better way and also fixes
an incorrectly recorded url in text conflicts caused by updating a
file external.
Votes:
+1: rhuijben, stsp, philip
Modified:
subversion/branches/1.9.x/ (props changed)
subversion/branches/1.9.x/STATUS
subversion/branches/1.9.x/subversion/libsvn_wc/externals.c
subversion/branches/1.9.x/subversion/tests/cmdline/externals_tests.py
Propchange: subversion/branches/1.9.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 20 04:00:59 2015
@@ -91,4 +91,4 @@
/subversion/branches/verify-at-commit:1462039-1462408
/subversion/branches/verify-keep-going:1439280-1546110
/subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663530,1663671,1663697,1663706,1663738,1663749,1663791,1663991,1664035,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664489-1664490,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664593-1664594,1664596,1664653,1664664,1664672,1664674,1664684,1664927,1664938-1664940,1664978,1664984,1664997,1665164,1665195,1665213,1665259,1665318,1665437-1665438,1665609,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666258,1666270,1666272,1666379,1666449,1666690,1666832,1666851,1666965,1667101,1667106-1667107,1667120,1667228,1667233-1667235,1667249-1667250,1667258,1667290,1667301,1667471,1667691-1667693,1667699-1667700,1667715,1667941,1667976,1668320,1668598-1668600,1668602-1668603,1668607-1668608,1668618,1669743,1669746,1669749,1669945,1670139,1670149,1670152,1670329,1670337,167
0347,1670353,1671164,1671388,1672295,1672311,1672372,1672404,1672511-1672512,1672578,1672728,1673044,1673062-1673063,1673065,1673153,1673170,1673172,1673197,1673202,1673204,1673228,1673282,1673445,1673691-1673692,1673746,1673785,1673803,1674015,1674032,1674170,1674301,1674305,1674308,1674339-1674340,1674406,1674415,1674455-1674456,1674475,1674487,1674522,1674580,1674627,1674891,1675771,1675774,1676526,1676535,1676538,1676555,1676564,1676570,1676665,1676667,1676769,1677003,1677191,1677267,1677440,1678147,1678149,1678494,1678571,1678734,1678742,1678745-1678746,1678839,1678846,1678894,1679166,1679169,1679228,1679230,1679287,1679909
+/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663530,1663671,1663697,1663706,1663738,1663749,1663791,1663991,1664035,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664489-1664490,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664593-1664594,1664596,1664653,1664664,1664672,1664674,1664684,1664927,1664938-1664940,1664978,1664984,1664997,1665164,1665195,1665213,1665259,1665318,1665437-1665438,1665609,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666258,1666270,1666272,1666379,1666449,1666690,1666832,1666851,1666965,1667101,1667106-1667107,1667120,1667228,1667233-1667235,1667249-1667250,1667258,1667290,1667301,1667471,1667691-1667693,1667699-1667700,1667715,1667941,1667976,1668320,1668598-1668600,1668602-1668603,1668607-1668608,1668618,1669743,1669746,1669749,1669945,1670139,1670149,1670152,1670329,1670337,167
0347,1670353,1671164,1671388,1672295,1672311,1672372,1672404,1672511-1672512,1672578,1672728,1673044,1673062-1673063,1673065,1673153,1673170,1673172,1673197,1673202,1673204,1673228,1673282,1673445,1673691-1673692,1673746,1673785,1673803,1674015,1674032,1674170,1674301,1674305,1674308,1674339-1674340,1674406,1674415,1674455-1674456,1674475,1674487,1674522,1674580,1674627,1674891,1675771,1675774,1676526,1676535,1676538,1676555,1676564,1676570,1676665,1676667,1676769,1677003,1677191,1677267,1677440,1678147,1678149,1678494,1678571,1678734,1678742,1678745-1678746,1678839,1678846,1678894,1679166,1679169,1679228,1679230,1679287,1679909,1680242,1680264
Modified: subversion/branches/1.9.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/STATUS?rev=1680451&r1=1680450&r2=1680451&view=diff
==============================================================================
--- subversion/branches/1.9.x/STATUS (original)
+++ subversion/branches/1.9.x/STATUS Wed May 20 04:00:59 2015
@@ -47,13 +47,3 @@ Veto-blocked changes:
Approved changes:
=================
-
- * r1680242, r1680264
- Stop removing last-change-* on non-updates of file externals (issue 4580)
- Justification:
- Resolves regression with 1.7.x/1.8.x pre 1.8.13, caused by issue 4411
- patch. This patch implements this fix in a better way and also fixes
- an incorrectly recorded url in text conflicts caused by updating a
- file external.
- Votes:
- +1: rhuijben, stsp, philip
Modified: subversion/branches/1.9.x/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_wc/externals.c?rev=1680451&r1=1680450&r2=1680451&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_wc/externals.c Wed May 20 04:00:59 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;
Modified: subversion/branches/1.9.x/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/tests/cmdline/externals_tests.py?rev=1680451&r1=1680450&r2=1680451&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/1.9.x/subversion/tests/cmdline/externals_tests.py Wed May 20 04:00:59 2015
@@ -4155,6 +4155,153 @@ def file_external_to_normal_file(sbox):
svntest.actions.run_and_verify_update(wc_dir, expected_output, None,
expected_status)
+@Issue(4580)
+def file_external_recorded_info(sbox):
+ "check file external recorded info"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # r2 - Create file external
+ svntest.actions.run_and_verify_svnmucc(None, [],
+ '-U', sbox.repo_url,
+ '-m', '',
+ 'propset', 'svn:externals',
+ '^/iota i', '')
+
+ expected_output = svntest.wc.State(wc_dir, {
+ '' : Item(status=' U'),
+ 'i' : Item(status='A '),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.add({
+ 'i' : Item(status=' ', wc_rev='2', switched='X')
+ })
+ svntest.actions.run_and_verify_update(wc_dir, expected_output, None,
+ expected_status, [], False,
+ '-r', 2, wc_dir)
+
+ expected_infos = [{
+ 'Path': re.escape(sbox.ospath('i')),
+ 'Relative URL': re.escape('^/iota'),
+ 'Revision': '2',
+ 'Last Changed Rev': '1',
+ 'Last Changed Author': 'jrandom'
+ }]
+ svntest.actions.run_and_verify_info(expected_infos, sbox.ospath('i'))
+
+ # r3 - No-op change
+ svntest.actions.run_and_verify_svnmucc(None, [],
+ '-U', sbox.repo_url,
+ '-m', '',
+ 'cp', '1', 'iota', 'iotb')
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'iotb' : Item(status='A '),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
+ expected_status.add({
+ 'i' : Item(status=' ', wc_rev='3', switched='X'),
+ 'iotb' : Item(status=' ', wc_rev='3')
+ })
+ svntest.actions.run_and_verify_update(wc_dir, expected_output, None,
+ expected_status, [], False,
+ '-r', 3, wc_dir)
+
+ expected_infos = [{
+ 'Path': re.escape(sbox.ospath('i')),
+ 'Relative URL': re.escape('^/iota'),
+ 'Revision': '3',
+ 'Last Changed Rev': '1',
+ 'Last Changed Author': 'jrandom'
+ }]
+ svntest.actions.run_and_verify_info(expected_infos, sbox.ospath('i'))
+
+ # r4 - Update url
+ svntest.actions.run_and_verify_svnmucc(None, [],
+ '-U', sbox.repo_url,
+ '-m', '',
+ 'propset', 'svn:externals',
+ '^/iotb i', '')
+
+
+ expected_output = svntest.wc.State(wc_dir, {
+ '' : Item(status=' U'),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 4)
+ expected_status.add({
+ 'i' : Item(status=' ', wc_rev='4', switched='X'),
+ 'iotb' : Item(status=' ', wc_rev='4')
+ })
+ svntest.actions.run_and_verify_update(wc_dir, expected_output, None,
+ expected_status, [], False,
+ '-r', 4, wc_dir)
+
+ expected_infos = [{
+ 'Path': re.escape(sbox.ospath('i')),
+ 'Relative URL': re.escape('^/iotb'),
+ 'Revision': '4',
+ 'Last Changed Rev': '3',
+ 'Last Changed Author': 'jrandom'
+ }]
+ svntest.actions.run_and_verify_info(expected_infos, sbox.ospath('i'))
+
+ # r5 - Replace file
+ svntest.actions.run_and_verify_svnmucc(None, [],
+ '-U', sbox.repo_url,
+ '-m', '',
+ 'rm', 'iotb',
+ 'cp', '3', 'A/mu', 'iotb')
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'i' : Item(status='U '),
+ 'iotb' : Item(status='A ', prev_status='D '),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 5)
+ expected_status.add({
+ 'i' : Item(status=' ', wc_rev='5', switched='X'),
+ 'iotb' : Item(status=' ', wc_rev='5')
+ })
+ svntest.actions.run_and_verify_update(wc_dir, expected_output, None,
+ expected_status, [], False,
+ '-r', 5, wc_dir)
+
+ expected_infos = [{
+ 'Path': re.escape(sbox.ospath('i')),
+ 'Relative URL': re.escape('^/iotb'),
+ 'Revision': '5',
+ 'Last Changed Rev': '5',
+ 'Last Changed Author': 'jrandom'
+ }]
+ svntest.actions.run_and_verify_info(expected_infos, sbox.ospath('i'))
+
+ # Back to r2. But with a conflict
+ sbox.simple_append('i', 'i')
+ expected_output = svntest.wc.State(wc_dir, {
+ '' : Item(status=' U'),
+ 'iotb' : Item(status='D '),
+ 'i' : Item(status='C '),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.add({
+ 'i' : Item(status='C ', wc_rev='5', switched='X'),
+ })
+ svntest.actions.run_and_verify_update(wc_dir, expected_output, None,
+ expected_status, [], False,
+ '-r', 2, wc_dir)
+
+ expected_infos = [{
+ 'Path': re.escape(sbox.ospath('i')),
+ 'Relative URL': re.escape('^/iota'),
+ 'Revision': '5',
+ 'Last Changed Rev': '1',
+ 'Last Changed Author': 'jrandom',
+ 'Conflict Details': re.escape('incoming file edit upon switch'
+ ' Source left: (file) ^/iotb@5'
+ ' Source right: (file) ^/iota@5')
+ }]
+ svntest.actions.run_and_verify_info(expected_infos, sbox.ospath('i'))
+
########################################################################
# Run the tests
@@ -4229,6 +4376,7 @@ test_list = [ None,
copy_pin_externals_whitepace_dir,
nested_notification,
file_external_to_normal_file,
+ file_external_recorded_info,
]
if __name__ == '__main__':