You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Lieven Govaerts <lg...@mobsol.be> on 2006/10/10 20:46:44 UTC

[PATCH] incomplete-directories: depth_zero_bring_in_dir test

Attached is an implementation of the depth_zero_bring_in_dir test for 
the incomplete-directories branch.

The test consists of two parts, one that is passing and one that is 
failing. It fails when I try to do an 'svn update --depth 2' on the 
folder A that is a depth 0, because the descendants of A are not added.

I'm not sure what's the problem here, is this part already implemented?

Note: According to requirements there should be a depth:inf parameter, 
but the help text of update refers to depth=2.

Lieven.

Re: [PATCH] incomplete-directories: depth_zero_bring_in_dir test

Posted by Lieven Govaerts <sv...@mobsol.be>.
Karl Fogel wrote:
> Lieven Govaerts <lg...@mobsol.be> writes:
>   
>> Attached is an implementation of the depth_zero_bring_in_dir test for
>> the incomplete-directories branch.
>>
>> The test consists of two parts, one that is passing and one that is
>> failing. It fails when I try to do an 'svn update --depth 2' on the
>> folder A that is a depth 0, because the descendants of A are not
>> added.
>>
>> I'm not sure what's the problem here, is this part already implemented?
>>
>> Note: According to requirements there should be a depth:inf parameter,
>> but the help text of update refers to depth=2.
>>     
>
> Thanks for writing this test!
>   
NP, test writing is fun! ;)
> Yes, some of the functionality is not expected to work right now; I'm
> basically implementing it along with the tests.  And this test was
> next on my list too.  Did you see r21869?  It's relevant to this test
> because it provides a helper function that does a lot of the setup for
> you...
>   
Attached is a new version of the patch, per our discussion on IRC. It's 
not that pretty but as far as I can see it's testing the expected behavior.

regards,

Lieven.

[[[
New regression test for svn update of a folder in a working copy checked 
out
at depth 0.

* subversion/tests/cmdline/depth_tests.py
  (depth_zero_bring_in_dir): implemented test according to
   the requirements (see notes/incomplete-directories.txt)
]]]

Re: [PATCH] incomplete-directories: depth_zero_bring_in_dir test

Posted by Karl Fogel <kf...@google.com>.
Lieven Govaerts <lg...@mobsol.be> writes:
> Attached is an implementation of the depth_zero_bring_in_dir test for
> the incomplete-directories branch.
>
> The test consists of two parts, one that is passing and one that is
> failing. It fails when I try to do an 'svn update --depth 2' on the
> folder A that is a depth 0, because the descendants of A are not
> added.
>
> I'm not sure what's the problem here, is this part already implemented?
>
> Note: According to requirements there should be a depth:inf parameter,
> but the help text of update refers to depth=2.

Thanks for writing this test!

Yes, some of the functionality is not expected to work right now; I'm
basically implementing it along with the tests.  And this test was
next on my list too.  Did you see r21869?  It's relevant to this test
because it provides a helper function that does a lot of the setup for
you...

Want to repost?  I'll hold off on this test until hear from you.

Thanks for daring to enter the world of incomplete directories...

-Karl

> Lieven.
> Index: subversion/tests/cmdline/depth_tests.py
> ===================================================================
> --- subversion/tests/cmdline/depth_tests.py	(revision 21872)
> +++ subversion/tests/cmdline/depth_tests.py	(working copy)
> @@ -231,8 +231,57 @@
>  def depth_zero_bring_in_dir(sbox):
>    "bring a dir into a depth-0 working copy"
>    # Run 'svn up A' to bring A permanently into the working copy.
> -  raise svntest.Failure("<test not yet written>")
> +  
> +  sbox.build()
> +  if os.path.exists(sbox.wc_dir):
> +    svntest.main.safe_rmtree(sbox.wc_dir)
>  
> +  wc2 = sbox.wc_dir + '-2'
> +  if os.path.exists(wc2):
> +    svntest.main.safe_rmtree(wc2)
> +  
> +  svntest.actions.run_and_verify_svn("Unexpected error during co --depth 0",
> +                                     SVNAnyOutput, [], "co",
> +                                     "--depth", "0",
> +                                     svntest.main.current_repo_url,
> +                                     wc2)
> +  
> +  # Update A in the depth-0 wc2, expecting to receive only the A folder.
> +  A_path = os.path.join(wc2, 'A')
> +
> +  expected_output = svntest.wc.State(wc2,
> +                                     { 'A' : Item(status='A ') })
> +  expected_disk = svntest.wc.State('', { })
> +  expected_disk.add(\
> +    {'A' : Item(contents=None) } )
> +
> +  expected_status = svntest.wc.State(wc2,
> +                                     { '' : svntest.wc.StateItem() })
> +  expected_status.tweak(contents=None, status='  ', wc_rev=1)
> +  expected_status.add(\
> +    {'A' : Item(status='  ', wc_rev=1) } )
> +
> +  svntest.actions.run_and_verify_update(wc2,
> +                                        expected_output,
> +                                        expected_disk,
> +                                        expected_status,
> +                                        None, None,
> +                                        None, None, None, None,
> +                                        A_path)
> +
> +  # is the next already expected to work??
> +  expected_disk = svntest.main.greek_state.copy()
> +  expected_disk.remove('iota')
> +  expected_status = svntest.actions.get_virginal_state(wc2, 1)
> +  expected_status.remove('iota')
> +  svntest.actions.run_and_verify_update(A_path,
> +                                        expected_output,
> +                                        expected_disk,
> +                                        expected_status,
> +                                        None, None,
> +                                        None, None, None, None,
> +                                        '--depth', '2', A_path)
> +
>  #----------------------------------------------------------------------
>  def depth_one_bring_in_file(sbox):
>    "bring a file into a depth-1 working copy"

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org