Plugin Development Help

Alex Lewis alex.lewis001 at gmail.com
Tue Jul 24 16:52:32 UTC 2012


Hi,
  I hope you don't mind me posting here but if possible I'd like some help with 
a plugin for Bazaar I'm trying to develop. I'll warn you now this is the first 
time I've tried python and the first time I've tried to develop a Bazaar plugin 
so you might need to be a bit gentle :)

  The plugin I'm trying to develop is one to add the ability to set a "Task-ID" 
on the revision data. So I'm aiming to add a "--task-id=<value>" option to at 
least the commit and log commands. So on commit a task-id can be specified to 
indicate what task the committed changes are for. Log will be extended to log 
revisions for a given task-id, also applying the other standard logging options 
if specified. Eventually I guess I'll need to extend merge to ensure the task-id 
data is brought across and flattened appropriately in the target. Does this all 
sound reasonable?

  I've had a play and so far I've been able to add the --task-id option to the 
commit command in a couple of ways. The two ways I've tried is either to use the 
extend_command hook or to create a sub-class of cmd_commit in builtins. Is there 
an official way or best practice for doing this?

  The theory is to add the task-id data to the revision data on commit. From 
what I can tell the revprops array on Commit might be a good place to put the 
data? The problem is I don't seem to be able to get to the revprops array from 
my plugin code through any hooks and I've tried a number of other ways. Does 
adding the task-id to the revprops array sound like the right thing to do? If so 
how do I go about doing this or if not what should I do instead?

I have been using the Bazaar plugin development guide as much as possible but 
I've got to the point where I'm stuck.

Thank you for reading and for any help you may provide.

Cheers,
Alex




More information about the bazaar mailing list