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

Re: [PATCH] fix svn cat to skip unversioned items V4.

From: Vivek <vivek_at_collab.net>
Date: 2005-06-17 07:36:53 CEST

> One thing I did not take care of was this, though:
>
> I think there's a minor conceptual problem with this test. This issue
> is really about what happens when someone invokes 'svn cat' on
> multiple targets, in which the cattable targets *follow* uncattable
> ones. For example:
>
> $ svn cat versioned_file_1 unversioned_file_1 versioned_file_2
> [contents of versioned_file_1]
> [error for unversioned_file_1]
> [contents of versioned_file_2 never seen, due to above error]
> $
>
> After your bugfix, of course, it should be:
>
> $ svn cat versioned_file_1 unversioned_file_1 versioned_file_2
> [contents of versioned_file_1]
> [error for unversioned_file_1]
> [contents of versioned_file_2]
> $
>
> So ideally, you should test this scenario. However, your final test
> group doesn't do that. It does something similar, but not the same:
>
> G_path = os.path.join(dir_path, 'G')
> rho_path = os.path.join(G_path, 'rho')
>
> expected_out = ["This is the file 'rho'."]
> expected_err1 = ["svn: warning: '" + G_path + "'"
> + " refers to a directory\n"]
> svntest.actions.run_and_verify_svn(None, expected_out, expected_err1,
> 'cat', rho_path, G_path)
>
> expected_err2 = ["svn: warning: '" + new_file_path + "'"
> + " is not under version control or doesn't exist\n"]
> svntest.actions.run_and_verify_svn(None, expected_out, expected_err2,
> 'cat', rho_path, new_file_path)
>
> svntest.actions.run_and_verify_svn(None, expected_out,
> expected_err1 + expected_err2,
> 'cat', rho_path, G_path, new_file_path)
>
> In each case, the only cattable path ('rho_path') *precedes* the
> uncattable paths, so of course rho_path will be catted whether or not
> there were skipped targets.
>
> In the final test, you do make sure you get warnings for both G_path
> and new_file_path, so at least we know that svn tried to do something
> after encountering the first unversioned path. That's a good thing to
> test. But why not also test the main use case: that a cat can
> *succeed* on one target *after* failing on another?
>
> After this is committed, could you patch the test to do that too?
Yes, this shall be addressed.
Since issue #2030 is being extended to all svn commands, I am thinking
of using a single test to cover all the commands. The use cases will the
same for svn cat. The proposed test will loop over all relevant svn
commands, calling a function with the command as a parameter.
>
> Thanks,
> -Karl
Thanks,
Vivek

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 17 07:37:00 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.