[rfc] cleaning up run_bzr and similar things in the test suite
Martin Pool
mbp at sourcefrog.net
Tue Jun 26 08:09:30 BST 2007
Marius, and other people reviewing his work, reminded me that the ways
by which the test suite exercises the bzr command line are currently a
bit messy. I am now cleaning them up and wanted to just give some
advance warning and let people object if they will.
One question is how arguments should be passed:
1- run_bzr("add a b")
2- run_bzr(["add", "a", "b"])
3- run_bzr("add", "a", "b")
1 has the advantage that it's much easier to read and write but the
problem that it needs to be split. 2 is more reliable and avoids
quoting problems if you need to pass arguments containing
metacharacters, or which might do so, or if you need to mix in
variables, and is closer to the real interface of commands.py. 3
seems like an inferior compromise between the two.
Having looked at several of these I really prefer #1 in cases where
it's safe to use, and I would be happy to see it in new code. I'm
going to get rid of #3 when I see it. Robert asks that it be at least
fairly explicit when and where the splitting is done.
But the main problem is just a multiplication of similar interfaces.
--
Martin
More information about the bazaar
mailing list