> Author: rhuijben
> Date: Thu Sep 24 08:38:55 2009
> New Revision: 879627
>
> Add XFail test on how we handle 'svn cp' on directories containing
> a switched subdirectory.
>
> * subversion/tests/cmdline/switch_tests.py
> (copy_with_switched_subdir): New test.
> (test_list): Add test as XFail
>
> --- subversion/trunk/subversion/tests/cmdline/switch_tests.py 2009/09/24
> 06:00:01 879626
> +++ subversion/trunk/subversion/tests/cmdline/switch_tests.py 2009/09/24
> 08:38:55 879627
> @@ -2592,6 +2592,82 @@ def relocate_with_switched_children(sbox
> expected_info = { 'URL' : pattern }
> svntest.actions.run_and_verify_info([expected_info], path)
>
> +def copy_with_switched_subdir(sbox):
> + "copy directory with switched subdir"
> + sbox.build()
> + wc_dir = sbox.wc_dir
> + D = os.path.join(wc_dir, 'A/D')
> + G = os.path.join(D, 'G')
> +
> + E_url = sbox.repo_url + '/A/B/E'
> + R = os.path.join(wc_dir, 'R')
> +
> + state = svntest.actions.get_virginal_state(wc_dir, 1)
> +
> + # Verify before switching
> + svntest.actions.run_and_verify_status(wc_dir, state)
> +
> + # Switch D
> + svntest.actions.run_and_verify_svn(None, None, [], 'switch', E_url, G)
> +
> + state.tweak('A/D/G', switched='S')
> + state.remove('A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau');
> + state.add({
> + 'A/D/G/alpha' : Item(status=' ', wc_rev=1),
> + 'A/D/G/beta' : Item(status=' ', wc_rev=1),
> + })
> + svntest.actions.run_and_verify_status(wc_dir, state)
> +
> + # And now copy A and everything below it to R
> + svntest.actions.run_and_verify_svn(None, None, [], 'cp', D, R)
> +
> + state.add({
> + 'R' : Item(status='A ', copied='+', wc_rev='-'),
> + 'R/gamma' : Item(status=' ', copied='+', wc_rev='-'),
> + 'R/G/alpha' : Item(status=' ', copied='+', wc_rev='-'),
> + 'R/G/beta' : Item(status=' ', copied='+', wc_rev='-'),
> + 'R/H' : Item(status=' ', copied='+', wc_rev='-'),
> + 'R/H/chi' : Item(status=' ', copied='+', wc_rev='-'),
> + 'R/H/omega' : Item(status=' ', copied='+', wc_rev='-'),
> + 'R/H/psi' : Item(status=' ', copied='+', wc_rev='-'),
> +
> + # This should be:
> + # 'R/G' : Item(status='A ', copied='+', wc_rev='-'),
> + # But is:
> + 'R/G' : Item(status=' ', copied='+', wc_rev='-'),
Hi Bert,
If 'R/G' "should be" status='A ', then why did you write the test to
expect the incorrect state?
Because R/G *is* showing as added:
C:\SVN\src-trunk>run.python.test.DEBUG.bat switch 38
C:\SVN\src-trunk>set TESTNAME=switch
C:\SVN\src-trunk>set CONFIG=Debug
C:\SVN\src-trunk>if not exist Debug\subversion\tests\cmdline mkdir
Debug\subversion\tests\cmdline
C:\SVN\src-trunk>pushd Debug\subversion\tests\cmdline
C:\SVN\src-trunk\Debug\subversion\tests\cmdline>python
C:\SVN\src-trunk\\subversion\tests\cmdline\switch_tests.py 38
=============================================================
Expected 'G' and actual 'G' in status tree are different!
=============================================================
EXPECTED NODE TO BE:
=============================================================
* Node name: G
Path: svn-test-work\working_copies\switch_tests-38\R\G
Contents: N/A (node is a directory)
Properties: {}
Attributes: {'status': ' ', 'copied': '+', 'wc_rev': '-'}
Children: 2
=============================================================
ACTUAL NODE FOUND:
=============================================================
* Node name: G
Path: svn-test-work\working_copies\switch_tests-38\R\G
Contents: N/A (node is a directory)
Properties: {}
Attributes: {'status': 'A ', 'copied': '+', 'wc_rev': '-'}
Children: 2
Unequal at node G
Unequal at node R
Unequal at node switch_tests-38
Unequal at node working_copies
Unequal at node svn-test-work
EXPECTED STATUS OUTPUT TREE:
ROOT
+-- svn-test-work
+-- working_copies
+-- switch_tests-38
|-- A
| |-- B
| | |-- E
| | | |-- alpha
| | | +-- beta
| | |-- F
| | +-- lambda
| |-- C
| |-- D
| | |-- G
| | | |-- alpha
| | | +-- beta
| | |-- H
| | | |-- chi
| | | |-- omega
| | | +-- psi
| | +-- gamma
| +-- mu
|-- R
| |-- G
| | |-- alpha
| | +-- beta
| |-- H
| | |-- chi
| | |-- omega
| | +-- psi
| +-- gamma
+-- iota
ACTUAL STATUS OUTPUT TREE:
ROOT
+-- svn-test-work
+-- working_copies
+-- switch_tests-38
|-- A
| |-- B
| | |-- E
| | | |-- alpha
| | | +-- beta
| | |-- F
| | +-- lambda
| |-- C
| |-- D
| | |-- G
| | | |-- alpha
| | | +-- beta
| | |-- H
| | | |-- chi
| | | |-- omega
| | | +-- psi
| | +-- gamma
| +-- mu
|-- R
| |-- G
| | |-- alpha
| | +-- beta
| |-- H
| | |-- chi
| | |-- omega
| | +-- psi
| +-- gamma
+-- iota
ACTUAL STATUS TREE:
svntest.wc.State(wc_dir, {
'R' : Item(status='A ', copied='+', wc_rev='-'),
'R/gamma' : Item(status=' ', copied='+', wc_rev='-'),
'R/H' : Item(status=' ', copied='+', wc_rev='-'),
'R/H/omega' : Item(status=' ', copied='+', wc_rev='-'),
'R/H/chi' : Item(status=' ', copied='+', wc_rev='-'),
'R/H/psi' : Item(status=' ', copied='+', wc_rev='-'),
'R/G' : Item(status='A ', copied='+', wc_rev='-'),
'R/G/alpha' : Item(status=' ', copied='+', wc_rev='-'),
'R/G/beta' : Item(status=' ', copied='+', wc_rev='-'),
'A' : Item(status=' ', wc_rev='1'),
'A/B' : Item(status=' ', wc_rev='1'),
'A/B/E' : Item(status=' ', wc_rev='1'),
'A/B/E/alpha' : Item(status=' ', wc_rev='1'),
'A/B/E/beta' : Item(status=' ', wc_rev='1'),
'A/B/F' : Item(status=' ', wc_rev='1'),
'A/B/lambda' : Item(status=' ', wc_rev='1'),
'A/D' : Item(status=' ', wc_rev='1'),
'A/D/G' : Item(status=' ', wc_rev='1', switched='S'),
'A/D/G/alpha' : Item(status=' ', wc_rev='1'),
'A/D/G/beta' : Item(status=' ', wc_rev='1'),
'A/D/H' : Item(status=' ', wc_rev='1'),
'A/D/H/psi' : Item(status=' ', wc_rev='1'),
'A/D/H/omega' : Item(status=' ', wc_rev='1'),
'A/D/H/chi' : Item(status=' ', wc_rev='1'),
'A/D/gamma' : Item(status=' ', wc_rev='1'),
'A/C' : Item(status=' ', wc_rev='1'),
'A/mu' : Item(status=' ', wc_rev='1'),
'iota' : Item(status=' ', wc_rev='1'),
})EXCEPTION: SVNTreeUnequal
Traceback (most recent call last):
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\main.py",
line 1222, in run
rc = self.pred.run(sandbox)
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\testcase.py",
line 114, in run
return self._delegate.run(sandbox)
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\testcase.py",
line 176, in run
return self.func(sandbox)
File "C:\SVN\src-trunk\\subversion\tests\cmdline\switch_tests.py",
line 3079, in copy_with_switched_subdir
svntest.actions.run_and_verify_status(wc_dir, state)
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\actions.py",
line 1408, in run_and_verify_status
singleton_handler_b, b_baton)
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\tree.py",
line 662, in compare_trees
singleton_handler_b, b_baton)
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\tree.py",
line 662, in compare_trees
singleton_handler_b, b_baton)
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\tree.py",
line 662, in compare_trees
singleton_handler_b, b_baton)
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\tree.py",
line 662, in compare_trees
singleton_handler_b, b_baton)
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\tree.py",
line 662, in compare_trees
singleton_handler_b, b_baton)
File "C:\SVN\src-trunk\subversion\tests\cmdline\svntest\tree.py",
line 648, in compare_trees
raise SVNTreeUnequal
SVNTreeUnequal
XFAIL: switch_tests.py 38: copy directory with switched subdir
Paul
Received on 2011-02-10 22:53:27 CET