[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] incomplete-directories: depth_zero_bring_in_dir test

From: Lieven Govaerts <svnlgo_at_mobsol.be>
Date: 2006-10-10 23:58:56 CEST

Karl Fogel wrote:
> Lieven Govaerts <lgo@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)
]]]

Index: subversion/tests/cmdline/depth_tests.py
===================================================================
--- subversion/tests/cmdline/depth_tests.py (revision 21874)
+++ subversion/tests/cmdline/depth_tests.py (working copy)
@@ -231,8 +231,67 @@
 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>")
 
+ wc0, ign_a, ign_b = set_up_depthy_working_copies(sbox, zero=True)
+
+ # Update A in the depth-0 wc2, expecting to receive only the A folder.
+ A_path = os.path.join(wc0, 'A')
+
+ expected_output = svntest.wc.State(wc0,
+ { 'A' : Item(status='A ') })
+ expected_disk = svntest.wc.State('', { })
+ expected_disk.add(\
+ {'A' : Item(contents=None) } )
+
+ expected_status = svntest.wc.State(wc0,
+ { '' : 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(wc0,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None,
+ None, None, None, None,
+ A_path)
+
+ # we expect A to be added at depth infinity, so a normal 'svn up A'
+ # should be sufficient to add all descendants.
+ expected_output = svntest.wc.State(wc0, {
+ 'A' : Item(status='A '),
+ 'A/mu' : Item(status='A '),
+ 'A/B' : Item(status='A '),
+ 'A/B/lambda' : Item(status='A '),
+ 'A/B/E' : Item(status='A '),
+ 'A/B/E/alpha' : Item(status='A '),
+ 'A/B/E/beta' : Item(status='A '),
+ 'A/B/F' : Item(status='A '),
+ 'A/C' : Item(status='A '),
+ 'A/D' : Item(status='A '),
+ 'A/D/gamma' : Item(status='A '),
+ 'A/D/G' : Item(status='A '),
+ 'A/D/G/pi' : Item(status='A '),
+ 'A/D/G/rho' : Item(status='A '),
+ 'A/D/G/tau' : Item(status='A '),
+ 'A/D/H' : Item(status='A '),
+ 'A/D/H/chi' : Item(status='A '),
+ 'A/D/H/psi' : Item(status='A '),
+ 'A/D/H/omega' : Item(status='A ')
+ })
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.remove('iota')
+ expected_status = svntest.actions.get_virginal_state(wc0, 1)
+ expected_status.remove('iota')
+ svntest.actions.run_and_verify_update(wc0,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None,
+ None, None, None, None,
+ 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
Received on Tue Oct 10 23:59:14 2006

This is an archived mail posted to the Subversion Dev mailing list.