You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <da...@elego.de> on 2013/06/26 14:18:52 UTC

nested_moves tests (r1496885) Re: Ev2 as a move-aware editor

I've gone ahead and added Python tests for the below scenarios: Philip's
scenario in move_tests.py and mine in svnmucc_tests.py.

I have an odd problem with Philip's scenario (move_tests.py
nested_replaces): if I set expected_status['A/B'] to an Item(status='A '),
I get an error stating the actual tree has a 'R ' node; and when
I change the expectation to 'R ', I get an error stating the actual tree
has 'A '.

The patch and the two error outputs are attached.  (I note that one of
them says "in status tree" and one "in entries tree".)

That patch isn't ready for commit; I am only at the point of
constructing a State object that will make the test pass, but I haven't
yet compared that State object to the actual moves the test does to
determine whether the 'svn status' output is buggy or correct.

I'm not really familiar with expected_status objects, so perhaps someone can
have a look at constructing the State object here?

Daniel


Daniel Shahaf wrote on Tue, Jun 25, 2013 at 21:53:07 +0000:
> On Tue, Jun 25, 2013 at 12:42:55PM +0100, Philip Martin wrote:
> >    R /A (from /X/Y/Z:1)
> >    A /A/B (from /A/B:1)
> >    R /A/B/C (from /X:1)
> >    D /A/B/C/Y
> >    R /X (from /A/B/C:1)
> >    A /X/Y (from /X/Y:1)
> >    R /X/Y/Z (from /A:1)
> >    D /X/Y/Z/B
> > 
> 
> What if we had three trees?
> 
> % svnmucc -mm -U $URL \
> rm A rm M rm X \
> cp HEAD X/Y/Z A cp HEAD A/B/C M cp HEAD M/N/O X \
> cp HEAD A/B A/B cp HEAD M/N M/N cp HEAD X/Y X/Y \
> rm A/B/C rm M/N/O rm X/Y/Z \
> cp HEAD X A/B/C cp HEAD A M/N/O cp HEAD M X/Y/Z \
> ;
> r2 committed by danielsh at 2013-06-25T21:51:29.046012Z
> % svn log qv -r2 $URL
> ------------------------------------------------------------------------
> r2 | danielsh | 2013-06-25 21:51:29 +0000 (Tue, 25 Jun 2013)
> Changed paths:
>    R /A (from /X/Y/Z:1)
>    A /A/B (from /A/B:1)
>    R /A/B/C (from /X:1)
>    R /M (from /A/B/C:1)
>    A /M/N (from /M/N:1)
>    R /M/N/O (from /A:1)
>    R /X (from /M/N/O:1)
>    A /X/Y (from /X/Y:1)
>    R /X/Y/Z (from /M:1)
> ------------------------------------------------------------------------
> 
> How would such a thing be represented?
> 
> > How would Ev2 describe that?  Perhaps

Re: nested_moves tests (r1496885) Re: Ev2 as a move-aware editor

Posted by Daniel Shahaf <da...@elego.de>.
Daniel Shahaf wrote on Wed, Jun 26, 2013 at 15:18:52 +0300:
> That patch isn't ready for commit; I am only at the point of
> constructing a State object that will make the test pass, but I haven't
> yet compared that State object to the actual moves the test does to
> determine whether the 'svn status' output is buggy or correct.
> 
> I'm not really familiar with expected_status objects, so perhaps someone can
> have a look at constructing the State object here?

Bert spotted the error in the original patch: needed to specify entry_status=.

Can someone review the result?  In particular, I'm not sure that the
'A/B' and 'A/B/C/Y/Z' StateItem's are correct.

Thanks

Daniel

Index: subversion/tests/cmdline/move_tests.py
===================================================================
--- subversion/tests/cmdline/move_tests.py	(revision 1496890)
+++ subversion/tests/cmdline/move_tests.py	(working copy)
@@ -1247,7 +1247,7 @@ def nested_replaces(sbox):
                        '-m', 'r1: create tree',
                        repo_url + '/A/B/C', repo_url + '/X/Y/Z')
   svntest.main.run_svn(None, 'checkout', '-q', repo_url, wc_dir)
-  expected_status = svntest.wc.State(wc_dir, {
+  r1_status = svntest.wc.State(wc_dir, {
     ''            : Item(status='  ', wc_rev='1'),
     'A'           : Item(status='  ', wc_rev='1'),
     'A/B'         : Item(status='  ', wc_rev='1'),
@@ -1256,7 +1256,7 @@ def nested_replaces(sbox):
     'X/Y'         : Item(status='  ', wc_rev='1'),
     'X/Y/Z'       : Item(status='  ', wc_rev='1'),
     })
-  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+  svntest.actions.run_and_verify_status(wc_dir, r1_status)
 
   ## r2: juggling
   moves = [
@@ -1271,7 +1271,20 @@ def nested_replaces(sbox):
   ]
   for src, dst in moves:
     svntest.main.run_svn(None, 'mv', ospath(src), ospath(dst))
-  # svntest.actions.run_and_verify_status(wc_dir, expected_status)
+  r2_status = svntest.wc.State(wc_dir, {
+    ''          : Item(status='  ', wc_rev='1'),
+    'A'         : Item(status='R ', copied='+', moved_from='X/Y/Z', moved_to='X/Y/Z', wc_rev='-'),
+    'A/B'       : Item(status='A ', copied='+', moved_from='X/Y/Z/B', wc_rev='-', entry_status='R '),
+    'A/B/C'     : Item(status='R ', copied='+', moved_from='X', moved_to='X', wc_rev='-'),
+    'A/B/C/Y'   : Item(status='D ', copied='+', wc_rev='-', moved_to='X/Y'),
+    'A/B/C/Y/Z' : Item(status='D ', copied='+', wc_rev='-'),
+    'X'         : Item(status='R ', copied='+', moved_from='A/B/C', moved_to='A/B/C', wc_rev='-'),
+    'X/Y'       : Item(status='A ', copied='+', moved_from='A/B/C/Y', wc_rev='-', entry_status='R '),
+    'X/Y/Z'     : Item(status='R ', copied='+', moved_from='A', moved_to='A', wc_rev='-'),
+    'X/Y/Z/B'   : Item(status='D ', copied='+', wc_rev='-', moved_to='A/B'),
+    'X/Y/Z/B/C' : Item(status='D ', copied='+', wc_rev='-'),
+  })
+  svntest.actions.run_and_verify_status(wc_dir, r2_status)
 
   svntest.main.run_svn(None, 'commit', '-m', 'r2: juggle the tree', wc_dir)
   expected_output = svntest.verify.UnorderedRegexListOutput(map(re.escape, [
@@ -1291,7 +1304,7 @@ def nested_replaces(sbox):
 
   ## Test updating to r1.
   svntest.main.run_svn(None, 'update', '-r1', wc_dir)
-  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+  svntest.actions.run_and_verify_status(wc_dir, r1_status)
 
 #######################################################################
 # Run the tests