Proposal: separate script interface
Martin Pool
mbp at sourcefrog.net
Tue Jun 14 09:03:22 BST 2005
Hi,
I think the scripting interface of choice will be bzrlib; calling
through Python is faster, richer and safer than the shell interface.
Richer and safer because, for example, you don't need to worry about
quoting/unquoting data, and you get proper exceptions. However, not
everybody will do it that way.
There can certainly be cases where the behaviour that's good for a
computer is not the ideal behaviour for a human. For example, asking
for interactive input can be friendly for a person but frustrating for
someone to write a script. Also, as you say, some options should not
normally be used by people.
It's easier to learn how to script something if you just automate the
actions you would normally do by hand; indeed the name "script"
implies that. So I don't think there should be a totally separate
interface, but rather just a difference in emphasis. If the scripting
interface were completely separate I think some people would just
script the regular interface.
Possibly there should be some commands or options that are marked as
experts-only; this is what the 'hidden' flag is meant to do but I'm
not sure it's totally right. I wouldn't mind having "bzr commit
--revision-id" if there were some indication that you shouldn't
normally set it.
There's also precedent for a --batch option.
--
Martin
More information about the bazaar
mailing list