[PATCH] python plugins in BZRPATH using Command structure

John A Meinel john at arbash-meinel.com
Wed May 11 03:36:29 BST 2005

The attached path adds support for searching the BZRPATH env variable,
and finding .py, .pyc, .pyo files therein. It will load them, and it
expects them to have classes of the form "cmd_" the same as in commands.py
If it finds them, then it adds that command the same as the ones in
globals(). One little tidbit is that it is possible to override a
builtin function with a customized one. And due to the grace of python,
you can actually call the original one in the middle.

This also includes an update to "testbzr". It does 2 things one, any
function in that file named "test_" is automatically run with an
unmunged name (similar to how cmd_* is done).

If you look in the test code, you can see an example of how to override
a builtin function and still call the original.

It does what Aaron Bentley desired, which is to recurse 1 level of
directory, so that you can put revctl'd plugins into your path.

I didn't overwrite the ExternalCommand portion, so if you have a shell
function, it will be executed by that route.


PS> Not having revert is *really* causing me problems, I keep catching
small things that should be changed while I work on other things. But I
assume bzr has to define a changeset format first, so that you can undo,
and then redo. Is there an official arch branch for bzr? I know I saw
abentley submitting some of his patches from an arch location.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr_plugins.patch
Type: text/x-patch
Size: 6319 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050510/0b30f6f2/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050510/0b30f6f2/attachment.pgp 

More information about the bazaar mailing list