calling other bzr commands from with a plugin

Aaron Bentley aaron.bentley at utoronto.ca
Mon Nov 21 03:28:48 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jamie Wilkinson wrote:
| What's the correct procedure for calling other Commands from within a
| plugin?

Calling other commands is almost never the right thing, because commands
are usually intended to be user-facing, and what you want is usually
precision, object reuse, etc.  So it's usually better to call whatever
the command itself calls.

I suppose you can call the command's run method, if you really insist.

| Specifically, I want to call Aaron's 'patch' command from bzrtools, but
| without shelling out to os.system.

I'd suggest invoking bzrlib.plugins.bzrtools.patch.patch().  It might
make sense to test whether bzrtools exists, first.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDgT7w0F+nu1YWqI0RAiqMAJwKNK9STAAFe+Bo6Z6HoA6q6bpFegCbBTK5
728IwRiVVtq7YD4KbdkWejA=
=5Y2R
-----END PGP SIGNATURE-----




More information about the bazaar mailing list