Author: pburba
Date: Tue Dec 8 18:37:38 2009
New Revision: 888508
URL: http://svn.apache.org/viewvc?rev=888508&view=rev
Log:
Fix issue #3461 'excluded subtrees are not detected by svnversion'.
* subversion/include/svn_wc.h
(svn_wc_walk_status): Add get_excluded argument.
* subversion/libsvn_client/status.c
(svn_client_status5): Update call to svn_wc_walk_status(), keeping earlier
behavior of ignoring excluded subtrees.
* subversion/libsvn_wc/revision_status.c
(analyze_status): Don't consider an excluded subtree as modified.
(svn_wc_revision_status2): Update call to svn_wc_walk_status(), requesting
excluded subtrees.
* subversion/libsvn_wc/status.c
(get_dir_status): Add get_excluded argument, pass it to handle_dir_entry().
Note, because of the circular reference between this function and
handle_dir_entry() there is forward declaration for get_dir_status().
(handle_dir_entry): Add get_excluded argument, pass it to get_dir_status().
(make_dir_baton,
handle_statii,
close_directory): Update calls to get_dir_status(), keeping earlier
behavior of ignoring excluded subtrees.
(close_edit): Update call to svn_wc_walk_status, keeping earlier
behavior of ignoring excluded subtrees.
(svn_wc_walk_status): Add get_excluded argument and pass it to
get_dir_status().
* subversion/tests/cmdline/svnversion_tests.py
(svnversion_with_excluded_subtrees): Remove XFail comment.
(test_list): Remove XFail from svnversion_with_excluded_subtrees.
Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/status.c
subversion/trunk/subversion/libsvn_wc/revision_status.c
subversion/trunk/subversion/libsvn_wc/status.c
subversion/trunk/subversion/tests/cmdline/svnversion_tests.py
Modified: subversion/trunk/subversion/include/svn_wc.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=888508&r1=888507&r2=888508&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Tue Dec 8 18:37:38 2009
@@ -3792,6 +3792,9 @@
* If @a no_ignore is set, statuses that would typically be ignored
* will instead be reported.
*
+ * If @a get_excluded is true, statuses for the roots of excluded subtrees
+ * are reported. Otherwise excluded subtrees are ignored.
+ *
* @a ignore_patterns is an array of file patterns matching
* unversioned files to ignore for the purposes of status reporting,
* or @c NULL if the default set of ignorable file patterns should be used.
@@ -3812,6 +3815,7 @@
svn_depth_t depth,
svn_boolean_t get_all,
svn_boolean_t no_ignore,
+ svn_boolean_t get_excluded,
const apr_array_header_t *ignore_patterns,
svn_wc_status_func4_t status_func,
void *status_baton,
Modified: subversion/trunk/subversion/libsvn_client/status.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/status.c?rev=888508&r1=888507&r2=888508&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/status.c (original)
+++ subversion/trunk/subversion/libsvn_client/status.c Tue Dec 8 18:37:38 2009
@@ -469,7 +469,7 @@
else
{
err = svn_wc_walk_status(ctx->wc_ctx, target_abspath,
- depth, get_all, no_ignore, ignores,
+ depth, get_all, no_ignore, FALSE, ignores,
tweak_status, &sb,
ignore_externals ? NULL
: svn_cl__store_externals,
Modified: subversion/trunk/subversion/libsvn_wc/revision_status.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/revision_status.c?rev=888508&r1=888507&r2=888508&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/revision_status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/revision_status.c Tue Dec 8 18:37:38
2009
@@ -67,10 +67,13 @@
sb->result->max_rev = item_rev;
}
- sb->result->switched |= status->switched;
- sb->result->modified |= (status->text_status != svn_wc_status_normal);
- sb->result->modified |= (status->prop_status != svn_wc_status_normal
- && status->prop_status != svn_wc_status_none);
+ if (status->entry->depth != svn_depth_exclude)
+ {
+ sb->result->switched |= status->switched;
+ sb->result->modified |= (status->text_status != svn_wc_status_normal);
+ sb->result->modified |= (status->prop_status != svn_wc_status_normal
+ && status->prop_status != svn_wc_status_none);
+ }
sb->result->sparse_checkout |= (status->entry->depth != svn_depth_infinity);
if (sb->local_abspath
@@ -118,6 +121,7 @@
svn_depth_infinity,
TRUE /* get_all */,
FALSE /* no_ignore */,
+ TRUE, /* get_excluded */
NULL /* ignore_patterns */,
analyze_status, &sb,
NULL, NULL,
Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=888508&r1=888507&r2=888508&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Tue Dec 8 18:37:38 2009
@@ -800,6 +800,7 @@
svn_boolean_t get_all,
svn_boolean_t no_ignore,
svn_boolean_t skip_this_dir,
+ svn_boolean_t get_excluded,
svn_wc_status_func4_t status_func,
void *status_baton,
svn_cancel_func_t cancel_func,
@@ -821,6 +822,7 @@
svn_depth_t depth,
svn_boolean_t get_all,
svn_boolean_t no_ignore,
+ svn_boolean_t get_excluded,
svn_wc_status_func4_t status_func,
void *status_baton,
svn_cancel_func_t cancel_func,
@@ -839,8 +841,8 @@
{
SVN_ERR(get_dir_status(wb, local_abspath, dir_entry, NULL, ignores,
depth, get_all, no_ignore, FALSE,
- status_func, status_baton, cancel_func,
- cancel_baton, pool));
+ get_excluded, status_func, status_baton,
+ cancel_func, cancel_baton, pool));
}
else
{
@@ -925,6 +927,9 @@
status will not be reported. However, upon recursing, all subdirs
*will* be reported, regardless of this parameter's value.
+ If GET_EXCLUDED is TRUE, then statuses for the roots of excluded
+ subtrees are reported, otherwise they are ignored.
+
Other arguments are the same as those passed to
svn_wc_get_status_editor5(). */
static svn_error_t *
@@ -937,6 +942,7 @@
svn_boolean_t get_all,
svn_boolean_t no_ignore,
svn_boolean_t skip_this_dir,
+ svn_boolean_t get_excluded,
svn_wc_status_func4_t status_func,
void *status_baton,
svn_cancel_func_t cancel_func,
@@ -1057,7 +1063,7 @@
SVN_ERR(svn_wc__db_node_hidden(&hidden, wb->db, node_abspath,
iterpool));
- if (!hidden)
+ if (!hidden || get_excluded)
{
err = svn_wc__get_entry(&entry, wb->db, node_abspath, FALSE,
dirent_p ? dirent_p->kind
@@ -1103,7 +1109,7 @@
? depth
: svn_depth_empty,
get_all,
- no_ignore,
+ no_ignore, get_excluded,
status_func, status_baton,
cancel_func, cancel_baton, iterpool));
continue;
@@ -1462,8 +1468,8 @@
status_in_parent->entry, NULL,
ignores, d->depth == svn_depth_files ?
svn_depth_files : svn_depth_immediates,
- TRUE, TRUE, TRUE, hash_stash, d->statii, NULL,
- NULL, pool));
+ TRUE, TRUE, TRUE, FALSE, hash_stash, d->statii,
+ NULL, NULL, pool));
/* If we found a depth here, it should govern. */
this_dir_status = apr_hash_get(d->statii, d->local_abspath,
@@ -1647,7 +1653,7 @@
local_abspath,
dir_entry, NULL,
ignores, depth, eb->get_all,
- eb->no_ignore, TRUE, status_func,
+ eb->no_ignore, TRUE, FALSE, status_func,
status_baton, eb->cancel_func,
eb->cancel_baton, subpool));
}
@@ -1903,6 +1909,7 @@
tgt_status->entry, NULL,
eb->ignores, eb->default_depth,
eb->get_all, eb->no_ignore, TRUE,
+ FALSE,
eb->status_func, eb->status_baton,
eb->cancel_func, eb->cancel_baton,
pool));
@@ -2084,6 +2091,7 @@
eb->default_depth,
eb->get_all,
eb->no_ignore,
+ FALSE,
eb->ignores,
eb->status_func,
eb->status_baton,
@@ -2204,6 +2212,7 @@
svn_depth_t depth,
svn_boolean_t get_all,
svn_boolean_t no_ignore,
+ svn_boolean_t get_excluded,
const apr_array_header_t *ignore_patterns,
svn_wc_status_func4_t status_func,
void *status_baton,
@@ -2248,6 +2257,7 @@
get_all,
TRUE,
TRUE,
+ get_excluded,
status_func,
status_baton,
cancel_func,
@@ -2265,6 +2275,7 @@
get_all,
no_ignore,
FALSE,
+ get_excluded,
status_func,
status_baton,
cancel_func,
@@ -2282,6 +2293,7 @@
get_all,
no_ignore,
TRUE,
+ get_excluded,
status_func,
status_baton,
cancel_func,
Modified: subversion/trunk/subversion/tests/cmdline/svnversion_tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnversion_tests.py?rev=888508&r1=888507&r2=888508&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnversion_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnversion_tests.py Tue Dec 8
18:37:38 2009
@@ -207,9 +207,6 @@
#----------------------------------------------------------------------
# Test for issue #3461 'excluded subtrees are not detected by svnversion'
-#
-# Marked as XFail until svnversion detects excluded subtrees,
-# i.e. issue #3461 is fixed.
def svnversion_with_excluded_subtrees(sbox):
"test 'svnversion' with excluded subtrees"
sbox.build()
@@ -248,7 +245,7 @@
test_list = [ None,
svnversion_test,
ignore_externals,
- XFail(svnversion_with_excluded_subtrees),
+ svnversion_with_excluded_subtrees,
]
if __name__ == '__main__':