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

[PATCH] tool to generate an svn sandbox

From: Charles Acknin <charlesacknin_at_gmail.com>
Date: 2007-09-21 18:10:09 CEST

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

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

Received on Fri Sep 21 18:10:24 2007

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.