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

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

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Fri, 05 Nov 2010 14:23:43 +0000

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.)
Received on 2010-11-05 15:24:25 CET

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