You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/09/09 11:16:51 UTC
svn commit: r995357 - in /subversion/trunk/subversion: libsvn_wc/upgrade.c
tests/cmdline/upgrade_tests.py
Author: philip
Date: Thu Sep 9 09:16:45 2010
New Revision: 995357
URL: http://svn.apache.org/viewvc?rev=995357&view=rev
Log:
Fix upgrade_tests.py 12.
* subversion/libsvn_wc/upgrade.c
(svn_wc__wipe_postupgrade): Handle an unversioned directory obstructing
a versioned directory.
(upgrade_working_copy): Handle an unversioned directory obstructing a
versioned directory, destroy iterpool when skipping, remove unneeded
comments.
* subversion/tests/cmdline/upgrade_tests.py
(missing_dirs2): Verify status.
(test_list): Remove XFail mark.
Modified:
subversion/trunk/subversion/libsvn_wc/upgrade.c
subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
Modified: subversion/trunk/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upgrade.c?rev=995357&r1=995356&r2=995357&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_wc/upgrade.c Thu Sep 9 09:16:45 2010
@@ -505,12 +505,24 @@ svn_wc__wipe_postupgrade(const char *dir
{
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
apr_array_header_t *subdirs;
+ svn_error_t *err;
int i;
if (cancel_func)
SVN_ERR((*cancel_func)(cancel_baton));
- SVN_ERR(get_versioned_subdirs(&subdirs, dir_abspath, scratch_pool, iterpool));
+ err = get_versioned_subdirs(&subdirs, dir_abspath, scratch_pool, iterpool);
+ if (err)
+ {
+ if (APR_STATUS_IS_ENOENT(err->apr_err))
+ {
+ /* An unversioned dir is obstructing a versioned dir */
+ svn_error_clear(err);
+ err = NULL;
+ }
+ svn_pool_destroy(iterpool);
+ return err;
+ }
for (i = 0; i < subdirs->nelts; ++i)
{
const char *child_abspath = APR_ARRAY_IDX(subdirs, i, const char *);
@@ -1517,9 +1529,9 @@ upgrade_working_copy(svn_wc__db_t *db,
int old_format;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
apr_array_header_t *subdirs;
+ svn_error_t *err;
int i;
- /* Check cancellation; note that this catches recursive calls too. */
if (cancel_func)
SVN_ERR(cancel_func(cancel_baton));
@@ -1533,13 +1545,28 @@ upgrade_working_copy(svn_wc__db_t *db,
svn_wc_create_notify(dir_abspath, svn_wc_notify_skip,
iterpool),
iterpool);
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
- /* At present upgrade_to_wcng removes the entries file so get the
- children before calling it. */
- SVN_ERR(get_versioned_subdirs(&subdirs, dir_abspath,
- scratch_pool, iterpool));
+ err = get_versioned_subdirs(&subdirs, dir_abspath, scratch_pool, iterpool);
+ if (err)
+ {
+ if (APR_STATUS_IS_ENOENT(err->apr_err))
+ {
+ /* An unversioned dir is obstructing a versioned dir */
+ svn_error_clear(err);
+ err = NULL;
+ if (notify_func)
+ notify_func(notify_baton,
+ svn_wc_create_notify(dir_abspath, svn_wc_notify_skip,
+ iterpool),
+ iterpool);
+ }
+ svn_pool_destroy(iterpool);
+ return err;
+ }
+
SVN_ERR(upgrade_to_wcng(db, dir_abspath, old_format,
repos_info_func, repos_info_baton,
Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=995357&r1=995356&r2=995357&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Thu Sep 9 09:16:45 2010
@@ -594,6 +594,26 @@ def missing_dirs2(sbox):
os.mkdir(sbox.ospath('A/B_new/F'))
svntest.actions.run_and_verify_svn(None, None, [],
'upgrade', sbox.wc_dir)
+ expected_status = svntest.wc.State(sbox.wc_dir,
+ {
+ '' : Item(status=' ', wc_rev='1'),
+ 'A' : Item(status=' ', wc_rev='1'),
+ 'A/mu' : Item(status=' ', wc_rev='1'),
+ 'A/C' : Item(status=' ', wc_rev='1'),
+ 'A/D' : Item(status='~ ', wc_rev='?'),
+ 'A/B' : Item(status=' ', wc_rev='1'),
+ 'A/B/F' : Item(status=' ', wc_rev='1'),
+ 'A/B/E' : Item(status='! ', wc_rev='?'),
+ 'A/B/lambda' : Item(status=' ', wc_rev='1'),
+ 'iota' : Item(status=' ', wc_rev='1'),
+ 'A/B_new' : Item(status='A ', wc_rev='-', copied='+'),
+ 'A/B_new/E' : Item(status='! ', wc_rev='?'),
+ 'A/B_new/F' : Item(status='~ ', wc_rev='?'),
+ 'A/B_new/lambda' : Item(status=' ', wc_rev='-', copied='+'),
+ })
+ if svntest.main.wc_is_singledb(sbox.wc_dir):
+ expected_status.tweak('A/D', 'A/B_new/F', status='! ')
+ run_and_verify_status_no_server(sbox.wc_dir, expected_status)
def delete_and_keep_local(sbox):
"check status delete and delete --keep-local"
@@ -643,7 +663,7 @@ test_list = [ None,
x3_1_4_6,
x3_1_6_12,
missing_dirs,
- XFail(missing_dirs2),
+ missing_dirs2,
XFail(delete_and_keep_local),
]