You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/06/27 20:35:29 UTC
svn commit: r1497487 - in /subversion/trunk/subversion:
libsvn_client/cleanup.c tests/cmdline/wc_tests.py
Author: stsp
Date: Thu Jun 27 18:35:29 2013
New Revision: 1497487
URL: http://svn.apache.org/r1497487
Log:
Fix a bug with 'svn cleanup --remove-unversioned' where items that do not
match a user-configured global ignores list are not removed, even though
they should be removed.
Found by: danielsh
* subversion/libsvn_client/cleanup.c
(do_cleanup): Unconditionally load the configured global ignores list,
not just if --remove-ignored was passed. And don't bother with loading
ignore patterns for the cleanup target here, since the status walk
will do that for us.
* subversion/tests/cmdline/wc_tests.py
(cleanup_unversioned_items): Extend this test to detect the bug fixed.
Modified:
subversion/trunk/subversion/libsvn_client/cleanup.c
subversion/trunk/subversion/tests/cmdline/wc_tests.py
Modified: subversion/trunk/subversion/libsvn_client/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/cleanup.c?rev=1497487&r1=1497486&r2=1497487&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/cleanup.c (original)
+++ subversion/trunk/subversion/libsvn_client/cleanup.c Thu Jun 27 18:35:29 2013
@@ -109,16 +109,16 @@ do_cleanup(const char *local_abspath,
if (remove_unversioned_items || remove_ignored_items || include_externals)
{
struct cleanup_status_walk_baton b;
- apr_array_header_t *ignores = NULL;
+ apr_array_header_t *ignores;
b.include_externals = include_externals;
b.remove_unversioned_items = remove_unversioned_items;
b.remove_ignored_items = remove_ignored_items;
b.include_externals = include_externals;
b.ctx = ctx;
- if (remove_ignored_items)
- SVN_ERR(svn_wc_get_ignores2(&ignores, ctx->wc_ctx, local_abspath,
- ctx->config, scratch_pool, scratch_pool));
+
+ SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config,
+ scratch_pool));
SVN_ERR(svn_wc_walk_status(ctx->wc_ctx, local_abspath,
svn_depth_infinity,
TRUE, /* get all */
Modified: subversion/trunk/subversion/tests/cmdline/wc_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/wc_tests.py?rev=1497487&r1=1497486&r2=1497487&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/wc_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/wc_tests.py Thu Jun 27 18:35:29 2013
@@ -238,6 +238,8 @@ def cleanup_unversioned_items(sbox):
os.mkdir(sbox.ospath('dir_foo'))
svntest.main.file_write(sbox.ospath('dir_foo/foo_child1'), contents)
os.mkdir(sbox.ospath('dir_foo/foo_child2'))
+ # a file that matches a default ignore pattern
+ svntest.main.file_write(sbox.ospath('foo.o'), contents)
# ignore some of the unversioned items
sbox.simple_propset('svn:ignore', '*_foo', '.')
@@ -254,6 +256,7 @@ def cleanup_unversioned_items(sbox):
expected_output += [
'I dir_foo\n',
'I file_foo\n',
+ 'I foo.o\n',
]
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
[], 'status', '--no-ignore')
@@ -268,15 +271,33 @@ def cleanup_unversioned_items(sbox):
' M .\n',
'I dir_foo\n',
'I file_foo\n',
+ 'I foo.o\n',
]
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
[], 'status', '--no-ignore')
+ # remove ignored items, with an empty global-ignores list
expected_output = [
'D dir_foo\n',
'D file_foo\n',
]
svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+ [], 'cleanup', '--remove-ignored',
+ '--config-option',
+ 'config:miscellany:global-ignores=')
+
+ # the file matching global-ignores should still be present
+ expected_output = [
+ ' M .\n',
+ 'I foo.o\n',
+ ]
+ svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+ [], 'status', '--no-ignore')
+
+ expected_output = [
+ 'D foo.o\n',
+ ]
+ svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
[], 'cleanup', '--remove-ignored')
expected_output = [
' M .\n',