rhuij...@apache.org wrote on Fri, Apr 08, 2011 at 15:06:45 -0000:
> Author: rhuijben
> Date: Fri Apr  8 15:06:44 2011
> New Revision: 1090288
> 
> URL: http://svn.apache.org/viewvc?rev=1090288&view=rev
> Log:
> Fix a test for wc-ng, by removing the assumption that you can chdir to any
> directory in a working copy, including deleted ones.
> 
> Fixing of this test also required r1090281.
> 
> * subversion/tests/cmdline/svntest/actions.py
>   (deep_trees_skipping_on_update): Don't chdir, just check the path in the
>     result.
> 
> * subversion/tests/cmdline/update_tests.py
>   (tree_conflicts_on_update_2_3): Remove XFail marker and disable invalid
>     set until somebody understands why there are too many items there.
> 
> Modified:
>     subversion/trunk/subversion/tests/cmdline/svntest/actions.py
>     subversion/trunk/subversion/tests/cmdline/update_tests.py
> 
> Modified: subversion/trunk/subversion/tests/cmdline/svntest/actions.py
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/actions.py?rev=1090288&r1=1090287&r2=1090288&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/cmdline/svntest/actions.py (original)
> +++ subversion/trunk/subversion/tests/cmdline/svntest/actions.py Fri Apr  8 
> 15:06:44 2011
> @@ -2560,10 +2560,9 @@ def deep_trees_skipping_on_update(sbox, 
>    # This time, cd to the subdir before updating it.
>    was_cwd = os.getcwd()
>    for path, skipped in chdir_skip_paths:
> -    #print("CHDIR TO: %s" % j(base, path))
> -    os.chdir(j(base, path))
> -    run_and_verify_update('',
> -                          wc.State('', {skipped : Item(verb='Skipped')}),
> +    p = j(base, path)
> +    run_and_verify_update(p,
> +                          wc.State(p, {skipped : Item(verb='Skipped')}),
>                            None, None)
>    os.chdir(was_cwd)
>  
> 
> Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1090288&r1=1090287&r2=1090288&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
> +++ subversion/trunk/subversion/tests/cmdline/update_tests.py Fri Apr  8 
> 15:06:44 2011
> @@ -4573,7 +4573,6 @@ def tree_conflicts_on_update_2_2(sbox):
>  #
>  # Marked as XFail until issue #3329 is resolved.
>  @Issue(3329)
> -@XFail()
>  def tree_conflicts_on_update_2_3(sbox):
>    "tree conflicts 2.3: skip on 2nd update"
>  
> @@ -4622,7 +4621,9 @@ def tree_conflicts_on_update_2_3(sbox):
>      ('D', 'D1'),
>      ('F', 'alpha'),
>      ('DDD', 'D1'),
> -    ('', 'D/D1', 'F/alpha', 'DD/D1', 'DF/D1', 'DDD/D1', 'DDF/D1'),
> +
> +    # BH: The next line gives an unpack error. Please fix.
> +    #('', 'D/D1', 'F/alpha', 'DD/D1', 'DF/D1', 'DDD/D1', 'DDF/D1'),
>      ]

I assume it gives an unpack error because it won't unpack the 7-tuple
into a 2-tuple in 'for foo, bar in the_7_tuple'.

I've tried to fix it as follows,

[[[
Index: subversion/tests/cmdline/update_tests.py
===================================================================
--- subversion/tests/cmdline/update_tests.py    (revision 1095774)
+++ subversion/tests/cmdline/update_tests.py    (working copy)
@@ -4624,7 +4624,7 @@ def tree_conflicts_on_update_2_3(sbox):
     ('DDD', 'D1'),
 
     # BH: The next line gives an unpack error. Please fix.
-    #('', 'D/D1', 'F/alpha', 'DD/D1', 'DF/D1', 'DDD/D1', 'DDF/D1'),
+    ('', ('D/D1', 'F/alpha', 'DD/D1', 'DF/D1', 'DDD/D1', 'DDF/D1')),
     ]
   # Note: We don't step *into* a directory that's deleted in the repository.
   # E.g. ('DDD/D1/D2', '') would correctly issue a "path does not
Index: subversion/tests/cmdline/svntest/actions.py
===================================================================
--- subversion/tests/cmdline/svntest/actions.py (revision 1095774)
+++ subversion/tests/cmdline/svntest/actions.py (working copy)
@@ -2564,15 +2564,22 @@ def deep_trees_skipping_on_update(sbox, test_case,
 
   run_and_verify_unquiet_status(base, x_status)
 
+  def set_of_skipped_paths(skipped):
+    if isinstance(skipped, type('')):
+      return (skipped,) # single-element tuple
+    else:
+      return skipped # is probably a tuple
+
   # Try to update each in-conflict subtree. Expect a 'Skipped' output for
   # each, and the WC status to be unchanged.
   # This time, cd to the subdir before updating it.
   was_cwd = os.getcwd()
   for path, skipped in chdir_skip_paths:
     p = j(base, path)
-    run_and_verify_update(p,
-                          wc.State(p, {skipped : Item(verb='Skipped')}),
-                          None, None)
+    for skipped_path in set_of_skipped_paths(skipped):
+      run_and_verify_update(p,
+                            wc.State(p, {skipped_path : Item(verb='Skipped')}),
+                            None, None)
   os.chdir(was_cwd)
 
   run_and_verify_unquiet_status(base, x_status)
Index: 
]]]

but then it fails with:

[[[
% ../runpytest update tree_conflicts_on_update_2_3
Couldn't find node 'DDD' in expected output tree
 * Node name:   DDD
    Path:       
svn-test-work/working_copies/update_tests-47/local_leaf_edit_incoming_tree_del_skipping/DDD
    Contents:   N/A (node is a directory)
    Properties: {}
    Attributes: {}
    Children:   1
Unequal at node local_leaf_edit_incoming_tree_del_skipping
Unequal at node update_tests-47
Unequal at node working_copies
Unequal at node svn-test-work
ACTUAL OUTPUT TREE:
svntest.wc.State(wc_dir, {})CWD: 
/home/daniel/src/svn/t1/subversion/tests/cmdline
EXCEPTION: SVNTreeUnequal
]]]

Does that help?  I have not yet looked further into it (because I don't
know the surrounding code or the context of the change).

Daniel
(and... by the way, the helper is wrong.  It should be a helper that
allows to write 'for path, set_of_skipped_paths in foo' rather than what
the above path implements.)

Reply via email to