[PATCH] python plugins in BZRPATH using Command structure

mbp at sourcefrog.net mbp at sourcefrog.net
Wed May 11 03:55:47 BST 2005


On 10 May 2005, John A Meinel <john at arbash-meinel.com> wrote:
> The attached path adds support for searching the BZRPATH env variable,
> and finding .py, .pyc, .pyo files therein. 

My first reaction is that this is a bit too magical, but I suppose
it's OK.

> 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.

Why not just list them directly on your path?
 
> I didn't overwrite the ExternalCommand portion, so if you have a shell
> function, it will be executed by that route.
> 
> John
> =:->
> 
> 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.

For the moment I've just been using this recipe, which is a lame
version of tla undo/redo:

  bzr diff foo > deferred.diff
  patch -R <deferred.diff
  bzr commit
  patch < deferred.diff

I agree a revert command that sets aside the modifications would
be very nice.

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050511/2a8353de/attachment.pgp 


More information about the bazaar mailing list