You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@wandisco.com> on 2010/11/05 11:59:29 UTC

Test suite - simpler simple_rm, simple_add, etc.

In a bid to continue simplifying how we write the repetetive bulky parts
of regression tests, I'm changing the sbox.simple_rm() etc. functions to
take path args that are relpaths relative to sbox.wc_dir, instead of
OS-style full paths relative to CWD.

The callers will change from

  mu_path = sbox.ospath('A/mu')
  sbox.simple_rm(mu_path)

to

  sbox.simple_rm('A/mu')

This is just a heads-up, and an opportunity for comments.  (I'm not
expecting objections so I'll probably commit it before everyone has a
chance to read this.)

- Julian


Re: Test suite - simpler simple_rm, simple_add, etc.

Posted by Julian Foad <ju...@wandisco.com>.
On Fri, 2010-11-05 at 11:59 +0000, Julian Foad wrote:
> In a bid to continue simplifying how we write the repetetive bulky parts
> of regression tests, I'm changing the sbox.simple_rm() etc. functions to
> take path args that are relpaths relative to sbox.wc_dir, instead of
> OS-style full paths relative to CWD.
> 
> The callers will change from
> 
>   mu_path = sbox.ospath('A/mu')
>   sbox.simple_rm(mu_path)
> 
> to
> 
>   sbox.simple_rm('A/mu')

I noticed one potential down-side: it won't be possible to use these
functions for a WC other than the sandbox's default WC.  We don't
currently use these simple_* functions on an alternate WC so we can
postpone solving this.

I think the best solution for that, when we require it, will be to
provide these methods on a Python "WC" class as well as, or instead of,
on the Sandbox class.  Then we would write "wc2.simple_commit()".

An alternative would be to provide the desired WC path as a keyword
argument, except that most of these functions take variable numbers of
arguments and keyword args can't be supplied after variable args until
Python 2.6.  (This has to work with Python 2.4.)  An alternative would
be to pass the target path args in an array, and then other optional or
keyword args could follow.

- Julian


> This is just a heads-up, and an opportunity for comments.  (I'm not
> expecting objections so I'll probably commit it before everyone has a
> chance to read this.)