You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/10/14 13:25:26 UTC
svn commit: r1022466 - in /subversion/trunk/subversion/tests/cmdline:
svntest/tree.py switch_tests.py
Author: julianfoad
Date: Thu Oct 14 11:25:26 2010
New Revision: 1022466
URL: http://svn.apache.org/viewvc?rev=1022466&view=rev
Log:
Fix detection of tree conflicts in the test suite. Originally, if a test
expected a tree conflict, that would be checked, and if a test explicitly said
"treeconflict=None" then the absence of a tree conflict would be checked;
however, if the test didn't specify, then the presence or absence of a tree
conflict would NOT be checked. Revert this behaviour, so that conflict
presence or absence is always checked, just like all other attributes.
* subversion/tests/cmdline/svntest/tree.py
(compare_atts): Delete this function that ignored the tree-conflict status
when not explicitly specified.
(compare_file_nodes, compare_trees): Use a simple "a != b" form to compare
attributes, instead of compare_atts().
* subversion/tests/cmdline/switch_tests.py
(tree_conflicts_on_switch_2_2): Explicitly state that a tree conflict is
expected.
Modified:
subversion/trunk/subversion/tests/cmdline/svntest/tree.py
subversion/trunk/subversion/tests/cmdline/switch_tests.py
Modified: subversion/trunk/subversion/tests/cmdline/svntest/tree.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/tree.py?rev=1022466&r1=1022465&r2=1022466&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/tree.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/tree.py Thu Oct 14 11:25:26 2010
@@ -413,23 +413,6 @@ def add_elements_as_path(top_node, eleme
prev_node = new_node
-def compare_atts(a, b):
- """Compare two dictionaries of attributes, A (actual) and B (expected).
- If the attribute 'treeconflict' in B is missing or is 'None', ignore it.
- Return 0 if the same, 1 otherwise."""
- a = a.copy()
- b = b.copy()
- # Remove any attributes to ignore.
- for att in ['treeconflict']:
- if (att not in b) or (b[att] is None):
- if att in a:
- del a[att]
- if att in b:
- del b[att]
- if a != b:
- return 1
- return 0
-
# Helper for compare_trees
def compare_file_nodes(a, b):
"""Compare two nodes, A (actual) and B (expected). Compare their names,
@@ -441,7 +424,9 @@ def compare_file_nodes(a, b):
return 1
if a.props != b.props:
return 1
- return compare_atts(a.atts, b.atts)
+ if a.atts != b.atts:
+ return 1
+ return 0
# Internal utility used by most build_tree_from_foo() routines.
@@ -658,7 +643,7 @@ def compare_trees(label,
# They're both directories.
else:
# First, compare the directories' two hashes.
- if (a.props != b.props) or compare_atts(a.atts, b.atts):
+ if (a.props != b.props) or (a.atts != b.atts):
display_nodes(a, b)
raise SVNTreeUnequal
Modified: subversion/trunk/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/switch_tests.py?rev=1022466&r1=1022465&r2=1022466&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/switch_tests.py Thu Oct 14 11:25:26 2010
@@ -2778,7 +2778,7 @@ def tree_conflicts_on_switch_2_2(sbox):
'DF/D1',
'DDD/D1',
'DDF/D1',
- status='! ', wc_rev=None)
+ status='! ', treeconflict='C', wc_rev=None)
# Remove from expected status and disk everything below the deleted paths.
expected_status.remove('DD/D1/D2',
'DF/D1/beta',