You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Charles Acknin <ch...@gmail.com> on 2007/09/21 16:10:09 UTC

[PATCH] tool to generate an svn sandbox

I had vaguely talked about making this script public a little while ago
on IRC.  So here it is hopefully clean enough, attached.  Basically,
what it does
is it generates a handy greek-tree sandbox with a repos and an
associated checked-out WC for people (I guess svn developers mostly) to
be able to perform all sorts of tests like e.g. reproduction recipes.

I created this script as an answer to the following simple need I often bump
into: where am I going to test this?

(Note this has nothing to do with the python test-suite.)

There are two modes available so that it's possible to use either
ra_local or ra_svn (which spawns an svnserve process and holds control
on it).  The usage output is quite explicit, it works like so:

[[[
$ gen-svn-sandbox.py
Usage: gen-svn-sandbox.py [OPTIONS] PATH-TO-SANDBOX

Options:
  --help (-h)  : This very help message
  -s           : Use ra_svn instead of ra_local
  -p PORT      : Listen port when using ra_svn (implies -s and
                 defaults to 3690)

Generates a Subversion sandbox for general purpose tests.
PATH-TO-SANDBOX is the directory in which the sandbox is to be
created.  The directory itself is created when missing.  The
sandbox reflects the following file hierarchy:
 /
  repos/ : fresh repository with pristine greek-tree imported
  wc/    : contains repos/ checkout at r1

By default, ra_local is used as the WC's RA layer.  When -s is
specified, the protocol is set to ra_svn instead.  This will
spawn an svnserve process on the loopback interface in daemon
mode with the root pointing to PATH-TO-SANDBOX/repos/.  The
listen port can be specified with the -p PORT option.
$ ls /tmp/sandbox
ls: cannot access /tmp/sandbox: No such file or directory
$ gen-svn-sandbox.py /tmp/sandbox
Generating sandbox at /tmp/sandbox ...
$ ls -p /tmp/sandbox
repos/  wc/
$ cd /tmp/sandbox/wc
$ wcfind
.
./A
./A/B
./A/B/E
./A/B/E/beta
./A/B/E/alpha
./A/B/F
./A/B/lambda
[...]
$ svn info
Path: .
URL: file:///tmp/sandbox/repos
Repository Root: file:///tmp/sandbox/repos
Repository UUID: b4230c85-943a-0410-8c62-f985b75e0d39
Revision: 1
Node Kind: directory
Schedule: normal
Last Changed Author: charles
Last Changed Rev: 1
Last Changed Date: 2007-09-20 19:31:09 +0200 (Thu, 20 Sep 2007)
]]]

And here you are with a fresh WC ready to work out whatever you have in
mind.

If it turns out people also feel like using it and think it's useful,
would tools/dev/gen-svn-sandbox.py be a nice place to host it?

Cheers,
Charles

Re: [PATCH] tool to generate an svn sandbox

Posted by Karl Fogel <kf...@red-bean.com>.
"Charles Acknin" <ch...@gmail.com> writes:
> I had vaguely talked about making this script public a little while ago
> on IRC.  So here it is hopefully clean enough, attached.  Basically,
> what it does
> is it generates a handy greek-tree sandbox with a repos and an
> associated checked-out WC for people (I guess svn developers mostly) to
> be able to perform all sorts of tests like e.g. reproduction recipes.
>
> I created this script as an answer to the following simple need I often bump
> into: where am I going to test this?

Thanks!  I have something similar, for those in Emacs:

Search for "kf-doit" in http://svn.red-bean.com/repos/kfogel/trunk/.emacs.

Basically, I just run "M-x kf-doit" in Emacs, inside a newly-created
directory, and I get an initialized script with editing point
positioned right where I'd start customizing it.  The shortness of the
name is a clue to how often I use it -- like, 10x a day :-).

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