Controlling bazaar from python

Robert Collins robertc at robertcollins.net
Thu Aug 9 00:01:25 BST 2007


On Wed, 2007-08-08 at 18:57 +0100, Jeremy Wilkins wrote:
> Hi,
> 
> I've had a look through builtins.py and the blackbox tests and have
> set off trying to get status information. I've tried the following
> simple program
> 
> #!/usr/bin/env python
> 
> from bzrlib import builtins
> 
> sta = builtins.cmd_status()
> sta.run(False, '/tmp/bzrtest/')

I recommend using the code in cmd_status as a template for what you
want, rather than calling it directly.

Calling builtins.* command objects gives you no better an API than
running bzr from the command line.

Conversely, doing

from bzrlib import workingtree
tree = workingtree.WorkingTree.open('.')
tree.changes_from(tree.basis())

and other similar things will give you structured data to work with.

Cheers,
Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070809/bd1109b3/attachment.pgp 


More information about the bazaar mailing list